magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.58k stars 9.32k forks source link

Configurable Options Not Working After Moving .price-box Outside of .product-info-main in Magento 2.4.7 #39134

Open Zwernemann opened 2 months ago

Zwernemann commented 2 months ago

Preconditions and environment

Magento Version: 2.4.7 Customizations: Modified catalog_product_view.xml layout file in Magento_Theme/Magento_Catalog/layout

Steps to reproduce

  1. Upgrade Magento to version 2.4.7.
  2. Modify the catalog_product_view.xml layout file by adding the following code (with this the price element will be added to a sticky footer)

image

  1. Ensure that the .price-box element is moved outside of the .product-info-main element and placed inside a sticky footer element.
  2. Attempt to select configurable options on the product page.

Expected result

Actual result

image

Additional information

Release note

No response

Triage and priority

m2-assistant[bot] commented 2 months ago

Hi @Zwernemann. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

m2-assistant[bot] commented 2 months ago

Hi @engcom-Delta. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Delta commented 3 weeks ago

Hi @Zwernemann ,

Thanks for your reporting and collaboration. We have re-verified the issue in Latest 2.4-develop instance , but we are unable to reproduce the issue. Kindly refer the screenshots.

Steps to reproduce

  1. Modify the catalog_product_view.xml layout file by adding the following code (with this the price element will be added to a sticky footer) image
  2. Attempt to select configurable options on the product page. Observe, user is able to view configurable options config options

Can you please re-verify and confirm if you are still facing the issue. Thanks.

Zwernemann commented 3 weeks ago

Hi @engcom-Delta ,

in my case the .price-box is outside of the .product-info-main.

image

The .product-info-main Class is located above in my case: image

then configurable.js stops working, because the normalPriceLabelSelector is as follows: image

In former release the priceHolderSelector in configurable.js was directly ".price-box".

See my comment in: here

engcom-Delta commented 6 days ago

Hi @engcom-Hotel ,

Assigning it to you as ticket is marked as dev experience.

Thanks.

m2-assistant[bot] commented 6 days ago

Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-Hotel commented 5 days ago

Hello @Zwernemann,

It seems something is missing with the issue reproduction steps, we are getting multiple errors while issue reproduction as follows:

image

We have added the below code in the file app/design/frontend/Magento/luma/Magento_Catalog/layout/catalog_product_view.xml:

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
        <container name="product.info.mzw.sticky.wrapper" htmlTag="div" before="product.info.detailed">
            <container name="product.info.mzw.sticky" htmlTag="div" htmlClass="mzwstickyfooter">
                <block class="Magento\Catalog\Block\Product\View" name="product.info.mzwprice" before="-" template="Magento_Theme::productpage/product_price_notsalable.phtml"/>
            </container>
        </container>
        <referenceBlock name="product.price.final" remove="true"/>
    </body>
</page>

Please let us know if we missed anything.

Thanks

Zwernemann commented 4 days ago

Hello @engcom-Hotel ,

the template that is referenced is in file /Magento_Theme/templates/productpage/product_price_notsalable.phtml

with content as follows:

<?php 
$_product = $block->getProduct();
if (!$_product->isSaleable()) :?>
<div class="product-info-price">
<?php 
    echo $this->getLayout()
          ->createBlock('Magento\Catalog\Pricing\Render',
                  "product.price.final.bymzw",
                    [
                        'data' => [
                            'price_render' => 'product.price.render.default',
                            'price_type_code' => 'final_price',
                            'zone' => 'item_view'
                        ]
                   ]
                  )
          ->toHtml();?>
</div>
<?php endif; ?>

Furthermore I missed one line in catalog_product_view.xml. The file is as follows:

<?xml version="1.0"?>

<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>

        <move element="page.main.title" destination="product.info.main" before="-"/>
        <move element="product.info.stock.sku" destination="product.info.price" after="product.price.final"/>
        <move element="product.info.review" destination="product.info.main" before="product.info.price"/>
        <container name="product.info.mzw.sticky.wrapper" htmlTag="div" before="product.info.detailed">
            <container name="product.info.mzw.sticky" htmlTag="div" htmlClass="mzwstickyfooter">
                <block class="Magento\Catalog\Block\Product\View" name="product.info.mzwprice" before="-" template="Magento_Theme::productpage/product_price_notsalable.phtml"/>
            </container>
        </container>

    <move element="product.info" destination="product.info.mzw.sticky" before="-"/>

        <referenceBlock name="product.price.final" remove="true"/>

    </body>
</page>
engcom-Hotel commented 4 days ago

Hello @Zwernemann,

Thanks for more information on this!

We have tried to reproduce the issue with the latest 2.4-develop branch and the issue is reproducible for us in the Luma theme. Please refer to the below screencast for the same:

Configurable1.webm

Hence confirming the issue.

Thanks

github-jira-sync-bot commented 4 days ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-13425 is successfully created for this GitHub issue.

m2-assistant[bot] commented 4 days ago

:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.