0

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

  • I also want to show all available coupon codes of current products in product page – 55840 Apr 2 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? – Raj Mohan R Apr 2 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. – 55840 Apr 2 at 12:57
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>
  • Placed but functionality is not working – 55840 Apr 2 at 13:47
  • what is not working? – Amit Bera Apr 2 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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