Skip to content

Commit

Permalink
Merge pull request #24 from vgelani/2.2-develop-PR-port-15540
Browse files Browse the repository at this point in the history
[Backport] fix for Wrong price amount on product page magento#11717
  • Loading branch information
gelanivishal authored Jun 7, 2018
2 parents 4405582 + 8a4d966 commit ca0e89c
Show file tree
Hide file tree
Showing 127 changed files with 1,728 additions and 494 deletions.
6 changes: 6 additions & 0 deletions app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)
$this->_view->loadLayout(['default', 'adminhtml_denied'], true, true, false);
$this->_view->renderLayout();
$this->_request->setDispatched(true);

return $this->_response;
}

Expand All @@ -226,6 +227,11 @@ public function dispatch(\Magento\Framework\App\RequestInterface $request)

$this->_processLocaleSettings();

// Need to preload isFirstPageAfterLogin (see https://github.com/magento/magento2/issues/15510)
if ($this->_auth->isLoggedIn()) {
$this->_auth->getAuthStorage()->isFirstPageAfterLogin();
}

return parent::dispatch($request);
}

Expand Down
8 changes: 7 additions & 1 deletion app/code/Magento/Backend/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,16 @@
<type name="Magento\Backend\Model\Menu\Builder">
<plugin name="SetupMenuBuilder" type="Magento\Backend\Model\Setup\MenuBuilder" />
</type>
<type name="Magento\Config\Model\Config\Structure\ConcealInProductionConfigList">
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction">
<arguments>
<argument name="configs" xsi:type="array">
<item name="dev" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::HIDDEN</item>
</argument>
</arguments>
</type>
<type name="Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProductionWithoutScdOnDemand">
<arguments>
<argument name="configs" xsi:type="array">
<item name="general/locale/code" xsi:type="const">Magento\Config\Model\Config\Structure\ElementVisibilityInterface::DISABLED</item>
</argument>
</arguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/checkbox.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/checkbox.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/multi.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/multi.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/radio.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/radio.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti
/**
* @var string
*/
protected $_template = 'product/composite/fieldset/options/type/select.phtml';
protected $_template = 'Magento_Bundle::product/composite/fieldset/options/type/select.phtml';

/**
* @param string $elementId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Bundle extends \Magento\Backend\Block\Widget implements \Magento\Backend\B
/**
* @var string
*/
protected $_template = 'product/edit/bundle.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle.phtml';

/**
* Core registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Option extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option.phtml';

/**
* Core registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Search extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option/search.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option/search.phtml';

/**
* @return void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Selection extends \Magento\Backend\Block\Widget
/**
* @var string
*/
protected $_template = 'product/edit/bundle/option/selection.phtml';
protected $_template = 'Magento_Bundle::product/edit/bundle/option/selection.phtml';

/**
* Catalog data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Checkbox extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Op
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/checkbox.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/checkbox.phtml';
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Multi extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/multi.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/multi.phtml';

/**
* @inheritdoc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Radio extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Optio
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/radio.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/radio.phtml';
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class Select extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Opti
/**
* @var string
*/
protected $_template = 'catalog/product/view/type/bundle/option/select.phtml';
protected $_template = 'Magento_Bundle::catalog/product/view/type/bundle/option/select.phtml';
}
6 changes: 1 addition & 5 deletions app/code/Magento/Captcha/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ Forms,Forms
"Number of Symbols","Number of Symbols"
"Please specify 8 symbols at the most. Range allowed (e.g. 3-5)","Please specify 8 symbols at the most. Range allowed (e.g. 3-5)"
"Symbols Used in CAPTCHA","Symbols Used in CAPTCHA"
"
Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.
","
Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.
"
"Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer.","Please use only letters (a-z or A-Z) or numbers (0-9) in this field. No spaces or other characters are allowed.<br />Similar looking characters (e.g. ""i"", ""l"", ""1"") decrease chance of correct recognition by customer."
"Case Sensitive","Case Sensitive"
"Enable CAPTCHA on Storefront","Enable CAPTCHA on Storefront"
"CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen.","CAPTCHA for ""Create user"" and ""Forgot password"" forms is always enabled if chosen."
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function getChildrenIds($parentId, $required = true)
}

/**
* Retrieve parent ids array by requered child
* Retrieve parent ids array by required child
*
* @param int|array $childId
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
?>
<?php $_total = $block->getItems()->getSize() ?>
<?php if ($_total): ?>
<a href="#" class="action print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
<a href="#" class="action print hidden-print" title="<?= /* @escapeNotVerified */ __('Print This Page') ?>">
<span><?= /* @escapeNotVerified */ __('Print This Page') ?></span>
</a>
<div class="table-wrapper comparison">
Expand All @@ -29,7 +29,7 @@
<?php if ($_i++ == 0): ?>
<th scope="row" class="cell label remove"><span><?= /* @escapeNotVerified */ __('Remove Product') ?></span></th>
<?php endif; ?>
<td class="cell remove product">
<td class="cell remove product hidden-print">
<?php $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');?>
<a href="#" data-post='<?= /* @escapeNotVerified */ $compareHelper->getPostDataRemove($_item) ?>'
class="action delete" title="<?= /* @escapeNotVerified */ __('Remove Product') ?>">
Expand Down Expand Up @@ -59,7 +59,7 @@
</strong>
<?= $block->getReviewsSummaryHtml($_item, 'short') ?>
<?= /* @escapeNotVerified */ $block->getProductPrice($_item, '-compare-list-top') ?>
<div class="product-item-actions">
<div class="product-item-actions hidden-print">
<div class="actions-primary">
<?php if ($_item->isSaleable()): ?>
<form data-role="tocart-form" action="<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Product\Compare')->getAddToCartUrl($_item) ?>" method="post">
Expand Down
29 changes: 24 additions & 5 deletions app/code/Magento/Checkout/view/frontend/web/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ define([
'Magento_Customer/js/customer-data',
'Magento_Ui/js/modal/alert',
'Magento_Ui/js/modal/confirm',
'underscore',
'jquery/ui',
'mage/decorate',
'mage/collapsible',
'mage/cookies'
], function ($, authenticationPopup, customerData, alert, confirm) {
], function ($, authenticationPopup, customerData, alert, confirm, _) {
'use strict';

$.widget('mage.sidebar', {
Expand Down Expand Up @@ -219,6 +220,11 @@ define([
* @param {HTMLElement} elem
*/
_updateItemQtyAfter: function (elem) {
var productData = this._getProductById(Number(elem.data('cart-item')));

if (!_.isUndefined(productData)) {
$(document).trigger('ajax:updateCartItemQty', productData['product_sku']);
}
this._hideItemButton(elem);
},

Expand All @@ -241,11 +247,24 @@ define([
* @private
*/
_removeItemAfter: function (elem) {
var productData = customerData.get('cart')().items.find(function (item) {
return Number(elem.data('cart-item')) === Number(item['item_id']);
});
var productData = this._getProductById(Number(elem.data('cart-item')));

if (!_.isUndefined(productData)) {
$(document).trigger('ajax:removeFromCart', productData['product_sku']);
}
},

$(document).trigger('ajax:removeFromCart', productData['product_sku']);
/**
* Retrieves product data by Id.
*
* @param {Number} productId - product Id
* @returns {Object|undefined}
* @private
*/
_getProductById: function (productId) {
return _.find(customerData.get('cart')().items, function (item) {
return productId === Number(item['item_id']);
});
},

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
require([
'jquery',
'Magento_Customer/js/customer-data',
'underscore',
'domReady!'
], function ($, customerData) {
], function ($, customerData, _) {
'use strict';

var selectors = {
Expand Down Expand Up @@ -41,7 +42,7 @@ require([
if (!(data && data.items && data.items.length && productId)) {
return;
}
product = data.items.find(function (item) {
product = _.find(data.items, function (item) {
if (item['item_id'] === itemId) {
return item['product_id'] === productId ||
item['item_id'] === productId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
<form data-bind="attr: {'data-hasrequired': $t('* Required Fields')}">
<fieldset id="billing-new-address-form" class="fieldset address">
<fieldset
data-bind="attr: { id:'billing-new-address-form-'+index, value:index}"
class="billing-new-address-form fieldset address">
<!-- ko foreach: getRegion('additional-fieldsets') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@
<span class="count" if="maxItemsToDisplay < getCartLineItemsCount()" text="maxItemsToDisplay"/>
<translate args="'of'" if="maxItemsToDisplay < getCartLineItemsCount()"/>
<span class="count" text="getCartLineItemsCount()"/>
<translate args="'Item in Cart'" if="getCartLineItemsCount() === 1"/>
<translate args="'Items in Cart'" if="getCartLineItemsCount() > 1"/>
<!-- ko if: (getCartLineItemsCount() === 1) -->
<span translate="'Item in Cart'"/>
<!--/ko-->
<!-- ko if: (getCartLineItemsCount() > 1) -->
<span translate="'Items in Cart'"/>
<!--/ko-->
</div>

<each args="getRegion('subtotalContainer')" render=""/>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Config/Block/System/Config/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ protected function _getAdditionalElementTypes()
}

/**
* Temporary moved those $this->getRequest()->getParam('blabla') from the code accross this block
* Temporary moved those $this->getRequest()->getParam('blabla') from the code across this block
* to getBlala() methods to be later set from controller with setters
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
* Defines status of visibility of form elements on Stores > Settings > Configuration page
* in Admin Panel in Production mode.
* @api
* @since 100.2.0
* @deprecated class location was changed
* @see \Magento\Config\Model\Config\Structure\ElementVisibility\ConcealInProduction
*/
class ConcealInProductionConfigList implements ElementVisibilityInterface
{
Expand Down Expand Up @@ -54,7 +55,7 @@ public function __construct(State $state, array $configs = [])

/**
* @inheritdoc
* @since 100.2.0
* @deprecated
*/
public function isHidden($path)
{
Expand All @@ -66,7 +67,7 @@ public function isHidden($path)

/**
* @inheritdoc
* @since 100.2.0
* @deprecated
*/
public function isDisabled($path)
{
Expand Down
Loading

0 comments on commit ca0e89c

Please sign in to comment.