Jump to content

Add to cart in a cms page


Recommended Posts

Hi guys, wanna share some information with you.

 

In this post http://www.prestasho...-in-a-cms-page/ the guy is explaining how to implement an "add to cart" button CMS page of your choice, but there is one thing you have to avoid or the error

 

TECHNICAL ERROR: unable to add the product.

 

Details:

Error thrown: [object XMLHttpRequest]

Text status: error

 

Is thrown. Just DONT provide a link

 

False:

<p><a onclick="ajaxCart.add(product_id=2, attribute_id=0, true, null, quantity=1, null);" href="http://www.whatever.com">Klickhier</a></p>

Correct:

 

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

 

Hope it helps some guys.

 

Bye

 

Edit: if it helped you, let me know it. Thanks

Edited by robertrobert (see edit history)
Link to comment
Share on other sites

  • 2 years later...

Hello Robert

 

I have used the same method but after saving in my test cms page , it removes the onclick function from anchor link .

 

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

 

After save it becomes :

 

<a>Add to cart</a> is left.

 

Please help . Its urgent for me

Link to comment
Share on other sites

Hello Robert

 

I have used the same method but after saving in my test cms page , it removes the onclick function from anchor link .

 

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

 

After save it becomes :

 

<a>Add to cart</a> is left.

 

Please help . Its urgent for me

 

 

Hello SandeepRV,

 

Follow the below links for support of TinyMCE editor with HTML tags.

 

http://mypresta.eu/en/art/know-how/tinymce-editor-full-options-all-html-tags.html

http://mypresta.eu/en/art/prestashop-16/extended-rich-text-editor.html

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