-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: CatalogComponent: CatalogWidgetFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions (*)
Version 2.2.6 (Community Edition).
Steps to reproduce (*)
- Create a product attribute, for example Size with several values (S, M and L). This attribute must have property "use in product listing" set to Yes.
- Create a product that uses this attribute with a configuration setting. Define different quantities for each values. Set this product as new for the current month.
- Create a block with a widget for new products (choose the grid template) and add this block at any page.
- On this page click on Add to cart (from a computer, not smartphone) for this new product.
Expected result (*)
User should see the product page with the message "You need to choose options for your item."
Actual result (*)
User is redirected to the cart page and the product is not added to the cart.
I think the issue is in vendor/magento/module-catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml.
I replaced :
<?php if ($_item->getTypeInstance()->hasRequiredOptions($_item)): ?>
with :
<?php if (!$_item->getTypeInstance()->isPossibleBuyFromList($_item)): ?>
This way it is consistent with Magento\Catalog\Block\Product\AbstractProduct->getAddToCartUrl(), since this method uses isPossibleBuyFromList() to choose the url.
Several templates are concerned with this issue :
- vendor/magento/module-catalog-widget/view/frontend/templates/product/widget/content/grid.phtml (for the widget "Catalog Products List")
- vendor/magento/module-catalog/view/frontend/templates/product/widget/new/content/new_grid.phtml (for the widget "Catalog New Products List" with "New Products Grid Template")
- vendor/magento/module-catalog/view/frontend/templates/product/widget/new/content/new_list.phtml (for the widget "Catalog New Products List" with "New Products List Template")
- vendor/magento/module-catalog/view/frontend/templates/product/widget/new/column/new_default_list.phtml (for the widget "Catalog New Products List" with "New Products Images and Names Template")
andkirby
Metadata
Metadata
Assignees
Labels
Component: CatalogComponent: CatalogWidgetFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release