Jump to content

CMS Page Add Product To Cart?


Recommended Posts

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
 
Link to comment
Share on other sites

 

 

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 by LeagueOfPie (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...