Skip to content

Commit 68636ec

Browse files
Fixed Click for price in home page not work
1 parent 37b2eb6 commit 68636ec

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<update handle="msrp_popup"/>
10+
<body/>
11+
</page>

app/code/Magento/Msrp/view/base/templates/product/price/msrp.phtml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ if ($product->isSaleable()) {
7272
} else {
7373
$data['addToCart']['addToCartButton'] = sprintf(
7474
'form:has(input[type="hidden"][name="product"][value="%s"]) button[type="submit"]',
75+
(int) $productId) . ',' .
76+
sprintf('.block.widget .price-box[data-product-id=%s]+.product-item-actions button.tocart',
7577
(int) $productId
7678
);
7779
}

app/code/Magento/Msrp/view/frontend/templates/popup.phtml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,11 @@
3030
<span id="map-popup-price" class="actual-price"></span>
3131
</div>
3232
</div>
33-
<form action="" method="POST" id="product_addtocart_form_from_popup" class="map-form-addtocart">
34-
<input type="hidden" name="product" class="product_id" value="" id="map-popup-product-id"/>
33+
<form action="" method="POST" class="map-form-addtocart">
34+
<input type="hidden" name="product" class="product_id" value="" />
3535
<button type="button"
3636
title="<?= $block->escapeHtml(__('Add to Cart')) ?>"
37-
class="action tocart primary"
38-
id="map-popup-button">
37+
class="action tocart primary">
3938
<span><?= /* @escapeNotVerified */ __('Add to Cart') ?></span>
4039
</button>
4140
<div class="additional-addtocart-box">

0 commit comments

Comments
 (0)