I want to add product url as button for product programmatically. After clicking it should process for purchasing process. I want to add it on CMS or any custom page.(exactly how we can add it through

admin panel, 

> Page->edit page->add widget(product url link)->save).

you dont need to go very deep in to just add a new block and use button inside anchor tag and then add the product url and insert that block on homepage through widget for reference refer the code below:-

<a href="http://localhost:96/magento/laptops.html"><button type="button"> Shop Now</button> </a>

just do some here in url it is suggested to use dynamic url hope this helps

| improve this answer | |
  • does it work for you?? or if you need anymore help please let me know – Chikku Dec 30 '19 at 6:28

you can call one .phtml file on CSM page or Block and in .phtml file, you can load product and put add to cart button as you want.

| improve this answer | |

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.