Jump to content

Add to Cart button in CMS


Recommended Posts

am making tutorials using CMS pages in prestashop about the items i sell , I need to add the needed items images with a link under them to add the item to the cart.

is that possible? my imagination to page is like the attached file, i made it using paint

post-625056-0-14432800-1374419423_thumb.png

Link to comment
Share on other sites

i checked the El Pantron's solution and it works

you have to use this code:

<p><a onclick="ajaxCart.add(product_id=2, attribute_id=0, true, null, quantity=1, null);">Add to cart</a>

 

remember to define correct product id and also attribute_id ! (if you don't use attribs, use null)

  • Like 1
Link to comment
Share on other sites

i think that is bad solution, what when someone will have other token? then it will not work.

 

make sure that you've got TOKEN off in your preferences tab in BO

then it will probably work :)

 

+ if you want to create nice ajax button as is mentioned above, make sure that youv'e got ajax cart enabled in the preferences tab in your bo + turn off TOKEN

Link to comment
Share on other sites

  • 11 months later...

I had a similar issue, and after screwing with a CMS page for a while, I simply copied the Home Featured module, and hooked it to the location I wanted it (i.e. not displayHome).  Add-to-Cart worked like a charm.  Now attribute values are a different story...I had to hack some code to pass through what I needed using JQuery form fields to get the data.  Not pretty, but it works

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...