mankomal Posted July 17, 2013 Share Posted July 17, 2013 Hello, I want to add "Add to Cart" in my product description also , how can I do this my product is : http://www.kc-india....ugust-2013.html I want the register now button to act as my add to cart button All help is appreciated Cheers MS Link to comment Share on other sites More sharing options...
Krystian Podemski Posted July 17, 2013 Share Posted July 17, 2013 I think the easier way is use code like this: <a href="#" class="add2cart" title="add to cart">Add to cart</a> <script> {literal} $('.add2cart').click(function() { $('#add_to_cart input').trigger('click'); }); {/literal} </script> Of course <a> you can paste in description textarea on back office but javascript you should place in .tpl file. 1 Link to comment Share on other sites More sharing options...
vekia Posted July 17, 2013 Share Posted July 17, 2013 or you can modify the tinymce editor to support all available markups (including <script>) then you will be able to use scripts (for example script mentioned by Krystian) in each product description if you will use this method - remember to remove the {literal} tags 1 Link to comment Share on other sites More sharing options...
mankomal Posted July 18, 2013 Author Share Posted July 18, 2013 I think the easier way is use code like this: <a href="#" class="add2cart" title="add to cart">Add to cart</a> <script> {literal} $('.add2cart').click(function() { $('#add_to_cart input').trigger('click'); }); {/literal} </script> Of course <a> you can paste in description textarea on back office but javascript you should place in .tpl file. Thanks Krystian for your prompt reply! I am a bit of amateur in this can you help me in getting this done... I am not sure how to make .tpl file and link it with <a> Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 go to the themes/YOUR_THEME/product.tpl open it and paste there the code mentioned by Krystian then in product description you will be able to use <a href="#" class="add2cart" title="add to cart">Add to cart</a> 1 Link to comment Share on other sites More sharing options...
mankomal Posted July 18, 2013 Author Share Posted July 18, 2013 go to the themes/YOUR_THEME/product.tpl open it and paste there the code mentioned by Krystian then in product description you will be able to use <a href="#" class="add2cart" title="add to cart">Add to cart</a> AWESOME!!! Works Beautifully!!! +1 rep to you and Krystian Link to comment Share on other sites More sharing options...
vekia Posted July 18, 2013 Share Posted July 18, 2013 you're welcome It's a Krystian's solution, and as you can see it works very well im going to mark this thread as [solved] happy selling! Link to comment Share on other sites More sharing options...
Recommended Posts