Skip to content

Commit

Permalink
Merge pull request #72 from magento-vanilla/PR
Browse files Browse the repository at this point in the history
[Vanilla] Bug Fixes
  • Loading branch information
guz-anton committed Oct 31, 2015
2 parents f748e57 + 177723d commit 820f306
Show file tree
Hide file tree
Showing 25 changed files with 586 additions and 325 deletions.
240 changes: 104 additions & 136 deletions app/code/Magento/Backup/view/adminhtml/templates/backup/dialogs.phtml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ $product = $block->getSaleableItem();
<?php foreach ($tierPrices as $index => $price) : ?>
<li class="item">
<?php
$popupId = 'msrp-popup-' . $product->getId() . $block->getRandomString(20);
$productId = $product->getId();
$popupId = 'msrp-popup-' . $productId . $block->getRandomString(20);
if ($msrpShowOnGesture && $price['price']->getValue() < $product->getMsrp()):
$addToCartUrl = '';
if ($product->isSaleable()) {
Expand Down Expand Up @@ -54,7 +55,8 @@ $product = $block->getSaleableItem();
}
?>
<?php /* @escapeNotVerified */ echo __('Buy %1 for: ', $price['price_qty']); ?>
<a href="#" id="<?php /* @escapeNotVerified */ echo($popupId);?>"
<a href="javascript:void(0);"
id="<?php /* @escapeNotVerified */ echo($popupId);?>"
data-tier-price="<?php echo $block->escapeHtml($block->jsonEncode($tierPriceData)); ?>">
<?php /* @escapeNotVerified */ echo __('Click for price'); ?></a>
<?php else:
Expand Down Expand Up @@ -87,9 +89,13 @@ $product = $block->getSaleableItem();
{
".product-info-main": {
"addToCart": {
"origin": "tier",
"addToCartButton": "#product_addtocart_form [type=submit]",
"inputQty": "#qty",
"attr": "[data-tier-price]",
"productForm": "#product_addtocart_form"
"productForm": "#product_addtocart_form",
"productId": "<?php /* @escapeNotVerified */ echo $productId; ?>",
"productIdInput": "input[type=hidden][name=product]"
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions app/code/Magento/Catalog/view/frontend/requirejs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ var config = {
relatedProducts: 'Magento_Catalog/js/related-products',
upsellProducts: 'Magento_Catalog/js/upsell-products',
productListToolbarForm: 'Magento_Catalog/js/product/list/toolbar',
tierPrice: 'Magento_Catalog/js/tier-price',
addToCart: 'Magento_Msrp/js/msrp',
catalogGallery: 'Magento_Catalog/js/gallery',
priceBox: 'Magento_Catalog/js/price-box',
priceOptionDate: 'Magento_Catalog/js/price-option-date',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
<?php endif; ?>
<div class="actions">
<button type="button"
<button type="submit"
title="<?php /* @escapeNotVerified */ echo $buttonTitle ?>"
class="action primary tocart"
id="product-updatecart-button">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
</div>
</div>
</div>
<fieldset class="fieldset">
<div class="fieldset">
<?php echo $block->getChildHtml('matrix'); ?>

<!-- Select Associated Product popup -->
Expand All @@ -53,7 +53,7 @@
</div>

<input type="hidden" name="affect_configurable_product_attributes" value="1" />
</fieldset>
</div>
</div>
<script type="text/x-magento-init">
{
Expand Down
18 changes: 11 additions & 7 deletions app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,33 @@ if ($product->isSaleable()) {
$priceElementId = $priceElementIdPrefix . $productId . $block->getIdSuffix();
$popupId = 'msrp-popup-' . $productId . $block->getRandomString(20);
$data = ['addToCart' => [
'origin'=> 'msrp',
'popupId' => '#' . $popupId,
'productName' => $product->getName(),
'productId' => $productId,
'productIdInput' => 'input[type="hidden"][name="product"]',
'realPrice' => $block->getRealPriceHtml(),
'isSaleable' => $product->isSaleable(),
'msrpPrice' => $msrpPrice,
'priceElementId' => $priceElementId,
'closeButtonId' => '#map-popup-close',
'popupCartButtonId' => '#map-popup-button',
'addToCartUrl' => $addToCartUrl,
'paymentButtons' => '[data-label=or]'
]];
if ($block->getRequest()->getFullActionName() === 'catalog_product_view') {
$data['addToCart']['addToCartButton'] = '#product_addtocart_form [type=submit]';
} else {
$data['addToCart']['cartForm'] = sprintf(
'form:has(input[type="hidden"][name="product"][value="%s"])',
$data['addToCart']['addToCartButton'] = sprintf(
'form:has(input[type="hidden"][name="product"][value="%s"]) button[type="submit"]',
(int) $productId
);
}
?>
<span id="<?php /* @escapeNotVerified */ echo $block->getPriceId() ? $block->getPriceId() : $priceElementId ?>" style="display:none"></span>
<a href="#"
<a href="javascript:void(0);"
id="<?php /* @escapeNotVerified */ echo($popupId);?>"
class="action map-show-info"
data-mage-init="<?=$block->escapeHtml($this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data))?>"><?php /* @escapeNotVerified */ echo __('Click for price'); ?>
data-mage-init='<?= /* @escapeNotVerified */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($data)?>'><?php /* @escapeNotVerified */ echo __('Click for price'); ?>
</a>
<?php else: ?>
<span class="msrp-message">
Expand All @@ -87,10 +90,11 @@ if ($product->isSaleable()) {

<?php if ($block->getZone() == \Magento\Framework\Pricing\Render::ZONE_ITEM_VIEW): ?>
<?php $helpLinkId = 'msrp-help-' . $productId . $block->getRandomString(20); ?>
<a href="#"
<a href="javascript:void(0);"
id="<?php /* @escapeNotVerified */ echo $helpLinkId;?>"
class="action map-show-info"
data-mage-init='{"addToCart":{"helpLinkId": "#<?php /* @escapeNotVerified */ echo $helpLinkId;?>",
data-mage-init='{"addToCart":{"origin": "info",
"helpLinkId": "#<?php /* @escapeNotVerified */ echo $helpLinkId;?>",
"productName": "<?php /* @escapeNotVerified */ echo $product->getName() ?>",
"closeButtonId": "#map-popup-close"}}'><span><?php /* @escapeNotVerified */ echo __("What's this?"); ?></span>
</a>
Expand Down
Loading

0 comments on commit 820f306

Please sign in to comment.