LeagueOfPie Posted April 25, 2015 Share Posted April 25, 2015 Hi, Other than physical products I do also sell services. So I was wondering if I were to make single cms pages for a service out of html and make it all fancy is there a way to add a button that adds that product to the customers cart? Link to comment Share on other sites More sharing options...
NemoPS Posted April 25, 2015 Share Posted April 25, 2015 There is, given that you hardcode something like: <a class="button ajax_add_to_cart_button btn btn-default" href="http://127.0.0.1:8080/presta16/en/cart?add=1&id_product=1&token=cccbcfcc6a09ec304932c108430a5250" rel="nofollow" title="Add to cart" data-id-product="1"> <span>Add to cart</span> </a> Using your own url, of course. Just make sure it has this class ajax_add_to_cart_buttonand data-id-product="1" WIth the product id Link to comment Share on other sites More sharing options...
LeagueOfPie Posted April 25, 2015 Author Share Posted April 25, 2015 (edited) There is, given that you hardcode something like: <a class="button ajax_add_to_cart_button btn btn-default" href="http://127.0.0.1:8080/presta16/en/cart?add=1&id_product=1&token=cccbcfcc6a09ec304932c108430a5250" rel="nofollow" title="Add to cart" data-id-product="1"> <span>Add to cart</span> </a> Using your own url, of course. Just make sure it has this class ajax_add_to_cart_button and data-id-product="1" WIth the product id Thanks for the reply,I went ahead and tried and it looked like it would work up till you click on the button. Error message would say this product was not available anymore. Then I noticed in the code that the example you gave me is automatically changing to this every time I save the cms page. <p><a class="button ajax_add_to_cart_button btn btn-default" title="Add to cart" href="/www.leagueofpie.com/"> Add to cart </a></p> I don't know if prestashops cms page can not support part of the code but it ends up just reformatting to that and cause the product Id to be removed. So rendering the button defective. You got any ideas on why? Edited April 25, 2015 by LeagueOfPie (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now