0

I want to add customize add to add button near add to cart button and on that click, the product should add in the cart in magento2 I have followed this link:magento 2 Adding one more Add to cart button but no output is coming

Ronak Rathod
6,58020 silver badges46 bronze badges
asked Mar 27, 2019 at 9:28

1 Answer 1

2

Copy the below file:

vendor/magento/module-catalog/view/frontend/templates/product/view/addtocart.phtml

to your theme like below:

app/design/frontend/[Vendor]/[theme]/Magento_Catalog/templates/product/view/addtocart.phtml

Add This For Secound Button :-

<div class="actions">
 <button type="submit"
 title="<?= /* @escapeNotVerified */ $buttonTitle ?>"
 class="action primary tocart"
 id="product-addtocart-button">
 <span><?= /* @escapeNotVerified */ $buttonTitle ?></span>
 </button>
 <?= $block->getChildHtml('', true) ?>
 </div>
answered Mar 27, 2019 at 9:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.