Version Notes
* Bug fixes
Download this release
Release Info
| Developer | Duc Ngo |
| Extension | Jmango360_Japi |
| Version | 3.4.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.4.0 to 3.4.1
- app/code/community/Jmango360/Japi/Helper/Data.php +8 -6
- app/code/community/Jmango360/Japi/Helper/Review/Bazaarvoice.php +73 -21
- app/code/community/Jmango360/Japi/Model/Rest/Catalog/Category/Assignedproducts.php +3 -1
- app/code/community/Jmango360/Japi/Model/Rest/Checkout/Methods.php +1 -1
- app/code/community/Jmango360/Japi/Model/Rest/Mage.php +2 -2
- app/code/community/Jmango360/Japi/controllers/CheckoutController.php +19 -0
- app/code/community/Jmango360/Japi/controllers/CustomerController.php +0 -4
- app/code/community/Jmango360/Japi/etc/config.xml +4 -1
- app/code/community/Jmango360/Japi/etc/system.xml +48 -2
- app/design/frontend/base/default/template/japi/customer/form/register.phtml +2 -2
- package.xml +4 -4
app/code/community/Jmango360/Japi/Helper/Data.php
CHANGED
|
@@ -927,6 +927,8 @@ class Jmango360_Japi_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 927 |
foreach ($image->attributes as $attribute) {
|
| 928 |
if ($attribute->name == 'title') {
|
| 929 |
$current['label'] = $attribute->value;
|
|
|
|
|
|
|
| 930 |
}
|
| 931 |
}
|
| 932 |
}
|
|
@@ -1197,13 +1199,13 @@ class Jmango360_Japi_Helper_Data extends Mage_Core_Helper_Abstract
|
|
| 1197 |
return $model->toOptionArray();
|
| 1198 |
}
|
| 1199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1200 |
public function isBazaarvoiceEnabled()
|
| 1201 |
{
|
| 1202 |
-
return (
|
| 1203 |
-
Mage::helper('core')->isModuleEnabled('Comaxx_BvConversations')
|
| 1204 |
-
&& Mage::getStoreConfigFlag('bazaarvoice/general/enable_bv')
|
| 1205 |
-
&& Mage::getStoreConfigFlag('bazaarvoice/rr/enable_rr')
|
| 1206 |
-
)
|
| 1207 |
-
|| (Mage::helper('core')->isModuleEnabled('Bazaarvoice_Connector'));
|
| 1208 |
}
|
| 1209 |
}
|
| 927 |
foreach ($image->attributes as $attribute) {
|
| 928 |
if ($attribute->name == 'title') {
|
| 929 |
$current['label'] = $attribute->value;
|
| 930 |
+
} elseif ($attribute->name == 'alt') {
|
| 931 |
+
$current['label'] = $attribute->value;
|
| 932 |
}
|
| 933 |
}
|
| 934 |
}
|
| 1199 |
return $model->toOptionArray();
|
| 1200 |
}
|
| 1201 |
|
| 1202 |
+
/**
|
| 1203 |
+
* Check Bazaarvoice Conversations enabled
|
| 1204 |
+
*
|
| 1205 |
+
* @return bool
|
| 1206 |
+
*/
|
| 1207 |
public function isBazaarvoiceEnabled()
|
| 1208 |
{
|
| 1209 |
+
return Mage::getStoreConfigFlag('japi/jmango_rest_bazaarvoice_settings/enable');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1210 |
}
|
| 1211 |
}
|
app/code/community/Jmango360/Japi/Helper/Review/Bazaarvoice.php
CHANGED
|
@@ -31,6 +31,13 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 31 |
);
|
| 32 |
protected $LOGGED_IN_EXCLUDE_FIELDS = array();
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
/**
|
| 35 |
* Get product Id for Bazaarvoice
|
| 36 |
*
|
|
@@ -114,9 +121,11 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 114 |
'apiVersion' => self::API_VERSION,
|
| 115 |
'resource.q0' => 'statistics',
|
| 116 |
'stats.q0' => 'reviews',
|
| 117 |
-
'filter.q0' =>
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
| 120 |
));
|
| 121 |
|
| 122 |
$result = $this->send('GET', $url);
|
|
@@ -180,13 +189,15 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 180 |
$url = $this->_getApiUrl('data/reviews.json', array(
|
| 181 |
'apiVersion' => '5.4',
|
| 182 |
'passkey' => $apiKey,
|
| 183 |
-
'Filter' =>
|
|
|
|
|
|
|
|
|
|
| 184 |
'Sort' => $this->_getReviewsSort(),
|
| 185 |
'Offset' => $this->_getReviewsOffset(),
|
| 186 |
'Limit' => $this->_getReviewsLimit(),
|
| 187 |
'Include' => 'Products',
|
| 188 |
-
'Stats' => 'Reviews'
|
| 189 |
-
'Locale' => Mage::app()->getLocale()->getLocaleCode()
|
| 190 |
));
|
| 191 |
|
| 192 |
$result = $this->send('GET', $url);
|
|
@@ -392,24 +403,16 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 392 |
|
| 393 |
$productId = $this->getBvProductId($product);
|
| 394 |
|
| 395 |
-
|
| 396 |
-
$session = Mage::getSingleton('customer/session');
|
| 397 |
-
if ($session->isLoggedIn()) {
|
| 398 |
-
$submitData['UserId'] = $session->getCustomer()->getId();
|
| 399 |
-
$submitData['UserEmail'] = $session->getCustomer()->getEmail();
|
| 400 |
-
} else {
|
| 401 |
-
$submitData['UserId'] = uniqid();
|
| 402 |
-
$submitData['UserEmail'] = @$data['useremail'];
|
| 403 |
-
}
|
| 404 |
-
|
| 405 |
-
$submitData = array_merge(array(
|
| 406 |
'UserNickname' => @$data['usernickname'],
|
|
|
|
|
|
|
| 407 |
'Title' => @$data['title'],
|
| 408 |
'ReviewText' => @$data['reviewtext'],
|
| 409 |
'Rating' => @$data['ratings']['rating'],
|
| 410 |
'IsRecommended' => $this->_getBooleanValue(@$data['isrecommended']),
|
| 411 |
'AgreedToTermsAndConditions' => $this->_getBooleanValue(@$data['agreedtotermsandconditions'])
|
| 412 |
-
)
|
| 413 |
|
| 414 |
if (!empty($data['ratings'])) {
|
| 415 |
$reviewForm = $this->getForm($product);
|
|
@@ -484,6 +487,28 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 484 |
return array('success' => Mage::helper('review')->__('Your review has been accepted for moderation.'));
|
| 485 |
}
|
| 486 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 487 |
/**
|
| 488 |
* Convert boolean value to string
|
| 489 |
*
|
|
@@ -544,7 +569,7 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 544 |
$reviewStatistics = $result['Includes']['Products'][$productId]['ReviewStatistics']['SecondaryRatingsAverages'];
|
| 545 |
foreach ($reviewStatistics as $reviewStatistic) {
|
| 546 |
$data[] = array(
|
| 547 |
-
'title' =>
|
| 548 |
'code' => @$reviewStatistic['Id'],
|
| 549 |
'type' => 'overview',
|
| 550 |
'percent' => round(100 * @$reviewStatistic['AverageRating'] / (empty($reviewStatistic['ValueRange']) ? 5 : $reviewStatistic['ValueRange']))
|
|
@@ -581,7 +606,7 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 581 |
foreach ($result['SecondaryRatings'] as $rating) {
|
| 582 |
$data['review'][] = array(
|
| 583 |
'code' => 'ratings',
|
| 584 |
-
'title' =>
|
| 585 |
'type' => 'radio',
|
| 586 |
'required' => false,
|
| 587 |
'id' => ++$index . "",
|
|
@@ -704,6 +729,28 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 704 |
return $data;
|
| 705 |
}
|
| 706 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 707 |
protected function _getDatetimeValue($value)
|
| 708 |
{
|
| 709 |
$storeTimestamp = Mage::getModel('core/date')->timestamp($value);
|
|
@@ -740,7 +787,12 @@ class Jmango360_Japi_Helper_Review_Bazaarvoice extends Mage_Core_Helper_Abstract
|
|
| 740 |
$env = $this->_getEnv();
|
| 741 |
$baseUrl = $env == 'staging' ? self::URL_STAGING : self::URL_PRODUCTION;
|
| 742 |
if (!empty($params)) {
|
| 743 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 744 |
} else {
|
| 745 |
return sprintf('%s%s', $baseUrl, $uri);
|
| 746 |
}
|
| 31 |
);
|
| 32 |
protected $LOGGED_IN_EXCLUDE_FIELDS = array();
|
| 33 |
|
| 34 |
+
/**
|
| 35 |
+
* Store ratings label mapping
|
| 36 |
+
*
|
| 37 |
+
* @var array
|
| 38 |
+
*/
|
| 39 |
+
protected $_labels = array();
|
| 40 |
+
|
| 41 |
/**
|
| 42 |
* Get product Id for Bazaarvoice
|
| 43 |
*
|
| 121 |
'apiVersion' => self::API_VERSION,
|
| 122 |
'resource.q0' => 'statistics',
|
| 123 |
'stats.q0' => 'reviews',
|
| 124 |
+
'filter.q0' => array(
|
| 125 |
+
sprintf('contentlocale:eq:%s', $locale),
|
| 126 |
+
sprintf('productid:eq:%s', join(',', array_keys($productIds)))
|
| 127 |
+
),
|
| 128 |
+
'filter_reviews.q0' => sprintf('contentlocale:eq:%s', $locale)
|
| 129 |
));
|
| 130 |
|
| 131 |
$result = $this->send('GET', $url);
|
| 189 |
$url = $this->_getApiUrl('data/reviews.json', array(
|
| 190 |
'apiVersion' => '5.4',
|
| 191 |
'passkey' => $apiKey,
|
| 192 |
+
'Filter' => array(
|
| 193 |
+
sprintf('ProductId:%s', $productId),
|
| 194 |
+
sprintf('ContentLocale:eq:%s', Mage::app()->getLocale()->getLocaleCode())
|
| 195 |
+
),
|
| 196 |
'Sort' => $this->_getReviewsSort(),
|
| 197 |
'Offset' => $this->_getReviewsOffset(),
|
| 198 |
'Limit' => $this->_getReviewsLimit(),
|
| 199 |
'Include' => 'Products',
|
| 200 |
+
'Stats' => 'Reviews'
|
|
|
|
| 201 |
));
|
| 202 |
|
| 203 |
$result = $this->send('GET', $url);
|
| 403 |
|
| 404 |
$productId = $this->getBvProductId($product);
|
| 405 |
|
| 406 |
+
$submitData = array(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 407 |
'UserNickname' => @$data['usernickname'],
|
| 408 |
+
'UserEmail' => @$data['useremail'],
|
| 409 |
+
'user' => $this->_getUAS(),
|
| 410 |
'Title' => @$data['title'],
|
| 411 |
'ReviewText' => @$data['reviewtext'],
|
| 412 |
'Rating' => @$data['ratings']['rating'],
|
| 413 |
'IsRecommended' => $this->_getBooleanValue(@$data['isrecommended']),
|
| 414 |
'AgreedToTermsAndConditions' => $this->_getBooleanValue(@$data['agreedtotermsandconditions'])
|
| 415 |
+
);
|
| 416 |
|
| 417 |
if (!empty($data['ratings'])) {
|
| 418 |
$reviewForm = $this->getForm($product);
|
| 487 |
return array('success' => Mage::helper('review')->__('Your review has been accepted for moderation.'));
|
| 488 |
}
|
| 489 |
|
| 490 |
+
/**
|
| 491 |
+
* Generate UAS string
|
| 492 |
+
*
|
| 493 |
+
* @return string
|
| 494 |
+
*/
|
| 495 |
+
protected function _getUAS()
|
| 496 |
+
{
|
| 497 |
+
$sharedKey = Mage::getStoreConfig('japi/jmango_rest_bazaarvoice_settings/shared_key');
|
| 498 |
+
if ($sharedKey) {
|
| 499 |
+
/* @var $dateModel Mage_Core_Model_Date */
|
| 500 |
+
$dateModel = Mage::getModel('core/date');
|
| 501 |
+
/* @var $session Mage_Customer_Model_Session */
|
| 502 |
+
$session = Mage::getSingleton('customer/session');
|
| 503 |
+
$userId = $session->isLoggedIn() ? $session->getCustomer()->getId() : uniqid();
|
| 504 |
+
$userStr = sprintf('date=%s&userid=%s', $dateModel->date('Y-m-d'), $userId);
|
| 505 |
+
$encUserStr = hash_hmac('sha256', $sharedKey, $userStr) . bin2hex($userStr);
|
| 506 |
+
return $encUserStr;
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
return '';
|
| 510 |
+
}
|
| 511 |
+
|
| 512 |
/**
|
| 513 |
* Convert boolean value to string
|
| 514 |
*
|
| 569 |
$reviewStatistics = $result['Includes']['Products'][$productId]['ReviewStatistics']['SecondaryRatingsAverages'];
|
| 570 |
foreach ($reviewStatistics as $reviewStatistic) {
|
| 571 |
$data[] = array(
|
| 572 |
+
'title' => !empty($reviewStatistic['Label']) ? $reviewStatistic['Label'] : $this->_getRatingLabel(@$reviewStatistic['Id']),
|
| 573 |
'code' => @$reviewStatistic['Id'],
|
| 574 |
'type' => 'overview',
|
| 575 |
'percent' => round(100 * @$reviewStatistic['AverageRating'] / (empty($reviewStatistic['ValueRange']) ? 5 : $reviewStatistic['ValueRange']))
|
| 606 |
foreach ($result['SecondaryRatings'] as $rating) {
|
| 607 |
$data['review'][] = array(
|
| 608 |
'code' => 'ratings',
|
| 609 |
+
'title' => !empty($rating['Label']) ? $rating['Label'] : $this->_getRatingLabel(@$rating['Id']),
|
| 610 |
'type' => 'radio',
|
| 611 |
'required' => false,
|
| 612 |
'id' => ++$index . "",
|
| 729 |
return $data;
|
| 730 |
}
|
| 731 |
|
| 732 |
+
/**
|
| 733 |
+
* Get rating label from configuration
|
| 734 |
+
*
|
| 735 |
+
* @param $value
|
| 736 |
+
* @return string
|
| 737 |
+
*/
|
| 738 |
+
protected function _getRatingLabel($value)
|
| 739 |
+
{
|
| 740 |
+
if (empty($this->_labels)) {
|
| 741 |
+
$labelsMap = explode("\n", Mage::getStoreConfig('japi/jmango_rest_bazaarvoice_settings/rating_label'));
|
| 742 |
+
foreach ($labelsMap as $labelMap) {
|
| 743 |
+
list($labelId, $labelText) = explode('|', $labelMap);
|
| 744 |
+
if ($labelId && $labelText) {
|
| 745 |
+
$this->_labels[$labelId] = $labelText;
|
| 746 |
+
}
|
| 747 |
+
}
|
| 748 |
+
}
|
| 749 |
+
if (array_key_exists($value, $this->_labels)) {
|
| 750 |
+
return $this->_labels[$value];
|
| 751 |
+
}
|
| 752 |
+
}
|
| 753 |
+
|
| 754 |
protected function _getDatetimeValue($value)
|
| 755 |
{
|
| 756 |
$storeTimestamp = Mage::getModel('core/date')->timestamp($value);
|
| 787 |
$env = $this->_getEnv();
|
| 788 |
$baseUrl = $env == 'staging' ? self::URL_STAGING : self::URL_PRODUCTION;
|
| 789 |
if (!empty($params)) {
|
| 790 |
+
/**
|
| 791 |
+
* Workaround to support duplicate param name on query string
|
| 792 |
+
*/
|
| 793 |
+
$query = http_build_query($params, null, '&');
|
| 794 |
+
$query = preg_replace('/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', $query);
|
| 795 |
+
return sprintf('%s%s?%s', $baseUrl, $uri, $query);
|
| 796 |
} else {
|
| 797 |
return sprintf('%s%s', $baseUrl, $uri);
|
| 798 |
}
|
app/code/community/Jmango360/Japi/Model/Rest/Catalog/Category/Assignedproducts.php
CHANGED
|
@@ -147,7 +147,9 @@ class Jmango360_Japi_Model_Rest_Catalog_Category_Assignedproducts extends Mage_C
|
|
| 147 |
);
|
| 148 |
}
|
| 149 |
} elseif ($filter instanceof Mage_Catalog_Block_Layer_Filter_Price) {
|
| 150 |
-
if (
|
|
|
|
|
|
|
| 151 |
if ($filter->hasDisplayType()
|
| 152 |
&& in_array($filter->getDisplayType(), array(
|
| 153 |
Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_DEFAULT,
|
| 147 |
);
|
| 148 |
}
|
| 149 |
} elseif ($filter instanceof Mage_Catalog_Block_Layer_Filter_Price) {
|
| 150 |
+
if (Mage::helper('core')->isModuleEnabled('Amasty_Shopby')
|
| 151 |
+
&& class_exists('Amasty_Shopby_Model_Catalog_Layer_Filter_Price')
|
| 152 |
+
) {
|
| 153 |
if ($filter->hasDisplayType()
|
| 154 |
&& in_array($filter->getDisplayType(), array(
|
| 155 |
Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_DEFAULT,
|
app/code/community/Jmango360/Japi/Model/Rest/Checkout/Methods.php
CHANGED
|
@@ -457,7 +457,7 @@ class Jmango360_Japi_Model_Rest_Checkout_Methods extends Jmango360_Japi_Model_Re
|
|
| 457 |
$this->_assignPaymentMethod($method);
|
| 458 |
$code = $method->getCode();
|
| 459 |
$options[$code] = $method->toArray();
|
| 460 |
-
$options[$code]['title'] = $this->_stripHtml($
|
| 461 |
if (is_object($method->getInfoInstance())) {
|
| 462 |
$options[$code]['payment'] = $method->getInfoInstance()->toArray();
|
| 463 |
}
|
| 457 |
$this->_assignPaymentMethod($method);
|
| 458 |
$code = $method->getCode();
|
| 459 |
$options[$code] = $method->toArray();
|
| 460 |
+
$options[$code]['title'] = $this->_stripHtml($method->getTitle());
|
| 461 |
if (is_object($method->getInfoInstance())) {
|
| 462 |
$options[$code]['payment'] = $method->getInfoInstance()->toArray();
|
| 463 |
}
|
app/code/community/Jmango360/Japi/Model/Rest/Mage.php
CHANGED
|
@@ -679,7 +679,7 @@ class Jmango360_Japi_Model_Rest_Mage extends Mage_Core_Model_Abstract
|
|
| 679 |
}
|
| 680 |
|
| 681 |
$attributes[] = array(
|
| 682 |
-
'label' => $nameWidget->getStoreLabel('firstname'),
|
| 683 |
'key' => 'firstname',
|
| 684 |
'enable' => true,
|
| 685 |
'required' => true,
|
|
@@ -697,7 +697,7 @@ class Jmango360_Japi_Model_Rest_Mage extends Mage_Core_Model_Abstract
|
|
| 697 |
}
|
| 698 |
|
| 699 |
$attributes[] = array(
|
| 700 |
-
'label' => $nameWidget->getStoreLabel('lastname'),
|
| 701 |
'key' => 'lastname',
|
| 702 |
'enable' => true,
|
| 703 |
'required' => true,
|
| 679 |
}
|
| 680 |
|
| 681 |
$attributes[] = array(
|
| 682 |
+
'label' => $nameWidget->getStoreLabel('firstname') ? $nameWidget->getStoreLabel('firstname') : Mage::helper('customer')->__('First Name'),
|
| 683 |
'key' => 'firstname',
|
| 684 |
'enable' => true,
|
| 685 |
'required' => true,
|
| 697 |
}
|
| 698 |
|
| 699 |
$attributes[] = array(
|
| 700 |
+
'label' => $nameWidget->getStoreLabel('lastname') ? $nameWidget->getStoreLabel('lastname') : Mage::helper('customer')->__('Last Name'),
|
| 701 |
'key' => 'lastname',
|
| 702 |
'enable' => true,
|
| 703 |
'required' => true,
|
app/code/community/Jmango360/Japi/controllers/CheckoutController.php
CHANGED
|
@@ -449,6 +449,25 @@ class Jmango360_Japi_CheckoutController extends Mage_Checkout_OnepageController
|
|
| 449 |
</reference>";
|
| 450 |
}
|
| 451 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 452 |
try {
|
| 453 |
$this->getLayout()->getUpdate()->addUpdate($xml);
|
| 454 |
$this->generateLayoutXml()->generateLayoutBlocks();
|
| 449 |
</reference>";
|
| 450 |
}
|
| 451 |
|
| 452 |
+
if ($helper->isModuleEnabled('TIG_MyParcel2014')) {
|
| 453 |
+
$xml .= "
|
| 454 |
+
<reference name=\"head\">
|
| 455 |
+
<action method=\"addItem\">
|
| 456 |
+
<type>skin_js</type>
|
| 457 |
+
<file>js/TIG/MyParcel2014/jquery-myparcel.min.js</file>
|
| 458 |
+
</action>
|
| 459 |
+
<action method=\"addItem\">
|
| 460 |
+
<type>skin_js</type>
|
| 461 |
+
<file>js/TIG/MyParcel2014/checkout.js</file>
|
| 462 |
+
</action>
|
| 463 |
+
</reference>
|
| 464 |
+
<reference name=\"checkout.onepage.shipping_method.available\">
|
| 465 |
+
<action method=\"setTemplate\">
|
| 466 |
+
<template>TIG/MyParcel2014/checkout/onepage/shipping_method/available.phtml</template>
|
| 467 |
+
</action>
|
| 468 |
+
</reference>";
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
try {
|
| 472 |
$this->getLayout()->getUpdate()->addUpdate($xml);
|
| 473 |
$this->generateLayoutXml()->generateLayoutBlocks();
|
app/code/community/Jmango360/Japi/controllers/CustomerController.php
CHANGED
|
@@ -21,10 +21,6 @@ class Jmango360_Japi_CustomerController extends Mage_Customer_AccountController
|
|
| 21 |
$this->getResponse()->setHeader('JM-Session-Id', $session->getSessionId());
|
| 22 |
}
|
| 23 |
$this->_initLayoutMessages(array('core/session', 'customer/session'));
|
| 24 |
-
if (Mage::getStoreConfigFlag('japi/jmango_rest_customer_settings/enable_address')) {
|
| 25 |
-
$form = $this->getLayout()->getBlock('customer_form_register');
|
| 26 |
-
if ($form) $form->setShowAddressFields(true);
|
| 27 |
-
}
|
| 28 |
$this->renderLayout();
|
| 29 |
}
|
| 30 |
|
| 21 |
$this->getResponse()->setHeader('JM-Session-Id', $session->getSessionId());
|
| 22 |
}
|
| 23 |
$this->_initLayoutMessages(array('core/session', 'customer/session'));
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
$this->renderLayout();
|
| 25 |
}
|
| 26 |
|
app/code/community/Jmango360/Japi/etc/config.xml
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
<config>
|
| 8 |
<modules>
|
| 9 |
<Jmango360_Japi>
|
| 10 |
-
<version>3.4.
|
| 11 |
</Jmango360_Japi>
|
| 12 |
</modules>
|
| 13 |
|
|
@@ -412,10 +412,13 @@
|
|
| 412 |
<android_touch_icon></android_touch_icon>
|
| 413 |
</jmango_smart_app_banner>
|
| 414 |
<jmango_rest_bazaarvoice_settings>
|
|
|
|
| 415 |
<env>staging</env>
|
| 416 |
<api_key_stg></api_key_stg>
|
| 417 |
<api_key_prod></api_key_prod>
|
|
|
|
| 418 |
<tc></tc>
|
|
|
|
| 419 |
</jmango_rest_bazaarvoice_settings>
|
| 420 |
<jmango_rest_developer_settings>
|
| 421 |
<enable>0</enable>
|
| 7 |
<config>
|
| 8 |
<modules>
|
| 9 |
<Jmango360_Japi>
|
| 10 |
+
<version>3.4.1</version>
|
| 11 |
</Jmango360_Japi>
|
| 12 |
</modules>
|
| 13 |
|
| 412 |
<android_touch_icon></android_touch_icon>
|
| 413 |
</jmango_smart_app_banner>
|
| 414 |
<jmango_rest_bazaarvoice_settings>
|
| 415 |
+
<enable></enable>
|
| 416 |
<env>staging</env>
|
| 417 |
<api_key_stg></api_key_stg>
|
| 418 |
<api_key_prod></api_key_prod>
|
| 419 |
+
<shared_key></shared_key>
|
| 420 |
<tc></tc>
|
| 421 |
+
<rating_label></rating_label>
|
| 422 |
</jmango_rest_bazaarvoice_settings>
|
| 423 |
<jmango_rest_developer_settings>
|
| 424 |
<enable>0</enable>
|
app/code/community/Jmango360/Japi/etc/system.xml
CHANGED
|
@@ -461,7 +461,7 @@
|
|
| 461 |
<show_in_store>1</show_in_store>
|
| 462 |
<comment>Select to view which customers are from JMango360</comment>
|
| 463 |
</display_customer_from>
|
| 464 |
-
|
| 465 |
<label>Enable additional fields on sign up form</label>
|
| 466 |
<frontend_type>select</frontend_type>
|
| 467 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
|
@@ -471,7 +471,7 @@
|
|
| 471 |
<show_in_store>1</show_in_store>
|
| 472 |
<comment>Enable additional fields on sign up form</comment>
|
| 473 |
</enable_address>
|
| 474 |
-
|
| 475 |
<label>Street Address #2 Label</label>
|
| 476 |
<frontend_type>text</frontend_type>
|
| 477 |
<sort_order>40</sort_order>
|
|
@@ -738,6 +738,16 @@
|
|
| 738 |
<show_in_store>1</show_in_store>
|
| 739 |
<sort_order>95</sort_order>
|
| 740 |
<fields>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 741 |
<env translate="label comment" module="japi">
|
| 742 |
<label>Environment</label>
|
| 743 |
<frontend_type>select</frontend_type>
|
|
@@ -747,6 +757,9 @@
|
|
| 747 |
<show_in_website>1</show_in_website>
|
| 748 |
<show_in_store>1</show_in_store>
|
| 749 |
<comment>Select environment</comment>
|
|
|
|
|
|
|
|
|
|
| 750 |
</env>
|
| 751 |
<api_key_stg translate="label comment" module="japi">
|
| 752 |
<label>Bazaarvoice API Key (STG)</label>
|
|
@@ -756,6 +769,9 @@
|
|
| 756 |
<show_in_website>1</show_in_website>
|
| 757 |
<show_in_store>1</show_in_store>
|
| 758 |
<comment>Bazaarvoice Conversations API key (staging)</comment>
|
|
|
|
|
|
|
|
|
|
| 759 |
</api_key_stg>
|
| 760 |
<api_key_prod translate="label comment" module="japi">
|
| 761 |
<label>Bazaarvoice API Key (PROD)</label>
|
|
@@ -765,7 +781,22 @@
|
|
| 765 |
<show_in_website>1</show_in_website>
|
| 766 |
<show_in_store>1</show_in_store>
|
| 767 |
<comment>Bazaarvoice Conversations API key (production)</comment>
|
|
|
|
|
|
|
|
|
|
| 768 |
</api_key_prod>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 769 |
<tc translate="label comment" module="japi">
|
| 770 |
<label><![CDATA[Terms & Conditions]]></label>
|
| 771 |
<frontend_type>textarea</frontend_type>
|
|
@@ -774,7 +805,22 @@
|
|
| 774 |
<show_in_website>1</show_in_website>
|
| 775 |
<show_in_store>1</show_in_store>
|
| 776 |
<comment>Customize the terms and conditions that your users will see for all submissions</comment>
|
|
|
|
|
|
|
|
|
|
| 777 |
</tc>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 778 |
</fields>
|
| 779 |
</jmango_rest_bazaarvoice_settings>
|
| 780 |
<jmango_rest_developer_settings translate="label" module="japi">
|
| 461 |
<show_in_store>1</show_in_store>
|
| 462 |
<comment>Select to view which customers are from JMango360</comment>
|
| 463 |
</display_customer_from>
|
| 464 |
+
<!--enable_address translate="label comment" module="japi">
|
| 465 |
<label>Enable additional fields on sign up form</label>
|
| 466 |
<frontend_type>select</frontend_type>
|
| 467 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 471 |
<show_in_store>1</show_in_store>
|
| 472 |
<comment>Enable additional fields on sign up form</comment>
|
| 473 |
</enable_address>
|
| 474 |
+
<street2_label translate="label comment" module="japi">
|
| 475 |
<label>Street Address #2 Label</label>
|
| 476 |
<frontend_type>text</frontend_type>
|
| 477 |
<sort_order>40</sort_order>
|
| 738 |
<show_in_store>1</show_in_store>
|
| 739 |
<sort_order>95</sort_order>
|
| 740 |
<fields>
|
| 741 |
+
<enable translate="label comment" module="japi">
|
| 742 |
+
<label>Enable Bazaarvoice</label>
|
| 743 |
+
<frontend_type>select</frontend_type>
|
| 744 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 745 |
+
<sort_order>0</sort_order>
|
| 746 |
+
<show_in_default>1</show_in_default>
|
| 747 |
+
<show_in_website>1</show_in_website>
|
| 748 |
+
<show_in_store>1</show_in_store>
|
| 749 |
+
<comment>Using Bazaarvoice Conversations platform</comment>
|
| 750 |
+
</enable>
|
| 751 |
<env translate="label comment" module="japi">
|
| 752 |
<label>Environment</label>
|
| 753 |
<frontend_type>select</frontend_type>
|
| 757 |
<show_in_website>1</show_in_website>
|
| 758 |
<show_in_store>1</show_in_store>
|
| 759 |
<comment>Select environment</comment>
|
| 760 |
+
<depends>
|
| 761 |
+
<enable>1</enable>
|
| 762 |
+
</depends>
|
| 763 |
</env>
|
| 764 |
<api_key_stg translate="label comment" module="japi">
|
| 765 |
<label>Bazaarvoice API Key (STG)</label>
|
| 769 |
<show_in_website>1</show_in_website>
|
| 770 |
<show_in_store>1</show_in_store>
|
| 771 |
<comment>Bazaarvoice Conversations API key (staging)</comment>
|
| 772 |
+
<depends>
|
| 773 |
+
<enable>1</enable>
|
| 774 |
+
</depends>
|
| 775 |
</api_key_stg>
|
| 776 |
<api_key_prod translate="label comment" module="japi">
|
| 777 |
<label>Bazaarvoice API Key (PROD)</label>
|
| 781 |
<show_in_website>1</show_in_website>
|
| 782 |
<show_in_store>1</show_in_store>
|
| 783 |
<comment>Bazaarvoice Conversations API key (production)</comment>
|
| 784 |
+
<depends>
|
| 785 |
+
<enable>1</enable>
|
| 786 |
+
</depends>
|
| 787 |
</api_key_prod>
|
| 788 |
+
<shared_key translate="label comment" module="japi">
|
| 789 |
+
<label>Shared Encoding Key</label>
|
| 790 |
+
<frontend_type>text</frontend_type>
|
| 791 |
+
<sort_order>31</sort_order>
|
| 792 |
+
<show_in_default>1</show_in_default>
|
| 793 |
+
<show_in_website>1</show_in_website>
|
| 794 |
+
<show_in_store>1</show_in_store>
|
| 795 |
+
<comment>The shared, secret encoding key that is used to encrypt user information</comment>
|
| 796 |
+
<depends>
|
| 797 |
+
<enable>1</enable>
|
| 798 |
+
</depends>
|
| 799 |
+
</shared_key>
|
| 800 |
<tc translate="label comment" module="japi">
|
| 801 |
<label><![CDATA[Terms & Conditions]]></label>
|
| 802 |
<frontend_type>textarea</frontend_type>
|
| 805 |
<show_in_website>1</show_in_website>
|
| 806 |
<show_in_store>1</show_in_store>
|
| 807 |
<comment>Customize the terms and conditions that your users will see for all submissions</comment>
|
| 808 |
+
<depends>
|
| 809 |
+
<enable>1</enable>
|
| 810 |
+
</depends>
|
| 811 |
</tc>
|
| 812 |
+
<rating_label translate="label comment" module="japi">
|
| 813 |
+
<label><![CDATA[Rating Lables]]></label>
|
| 814 |
+
<frontend_type>textarea</frontend_type>
|
| 815 |
+
<sort_order>50</sort_order>
|
| 816 |
+
<show_in_default>1</show_in_default>
|
| 817 |
+
<show_in_website>1</show_in_website>
|
| 818 |
+
<show_in_store>1</show_in_store>
|
| 819 |
+
<comment>Example: EaseOfUse|Kwaliteit van product</comment>
|
| 820 |
+
<depends>
|
| 821 |
+
<enable>1</enable>
|
| 822 |
+
</depends>
|
| 823 |
+
</rating_label>
|
| 824 |
</fields>
|
| 825 |
</jmango_rest_bazaarvoice_settings>
|
| 826 |
<jmango_rest_developer_settings translate="label" module="japi">
|
app/design/frontend/base/default/template/japi/customer/form/register.phtml
CHANGED
|
@@ -94,7 +94,7 @@
|
|
| 94 |
<?php echo $this->getLayout()->createBlock('japi/form')->setFields(Mage::helper('japi')->getSignupFormFields())->toHtml() ?>
|
| 95 |
</ul>
|
| 96 |
</div>
|
| 97 |
-
<?php if (
|
| 98 |
<div class="fieldset">
|
| 99 |
<input type="hidden" name="create_address" value="1"/>
|
| 100 |
<h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
|
|
@@ -192,7 +192,7 @@
|
|
| 192 |
title="<?php echo Mage::helper('core')->quoteEscape($this->__('State/Province')) ?>"
|
| 193 |
class="validate-select" style="display:none;">
|
| 194 |
<option
|
| 195 |
-
|
| 196 |
</select>
|
| 197 |
<script type="text/javascript">
|
| 198 |
//<