0

Is it possible to move apply coupon code button on product page and it will work or not ?

3
  • I also want to show all available coupon codes of current products in product page
    – Mahendra
    Apr 2, 2019 at 12:53
  • 1
    So if you want to apply coupon code functionality in the product page, how would you apply the coupon code when the cart is empty? Apr 2, 2019 at 12:54
  • I will set the validation Kindly add product first. OR is there any other solution to pass selected coupon to cart page that is also ok for me.
    – Mahendra
    Apr 2, 2019 at 12:57

1 Answer 1

2

Create catalog_product_view.xmlat app/design/frontend/{VendorTheme}/{ThemeName}/Magento_Catalog/layout

and below code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
  <referenceContainer name="content">
        <block class="Magento\Checkout\Block\Cart\Coupon" name="checkout.cart.coupon" as="coupon" template="Magento_Checkout::cart/coupon.phtml"/>
    </body>
</referenceContainer>
</page>
2
  • Placed but functionality is not working
    – Mahendra
    Apr 2, 2019 at 13:47
  • what is not working?
    – Amit Bera
    Apr 2, 2019 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.