Jump to content

Add to Cart Links


Recommended Posts

Using PS 1.4.6.2

 

Is there a quick and easy well documented way to add an Add to Cart link from within other controllers. I have built my own controller and templates for it. All good and I've learned a lot. On my final page I want to add some line listings with upsell items. I want these items to have a quick and easy "Add to Cart" that takes the visitor nowhere. Would be really great if the slide to cart worked but not completely necessary as long as the easing works on the blockcart.

 

Here is where I am:

<a class="exclusive_small ajax_add_to_cart_button" rel="ajax_id_product_593" href="#" title="{l s='Add to cart'}" onclick="ajaxCart.add(593, 0, true, null, 1, null)">Add Me</a>

 

Seems to work sort of. Only problem is that it is adding a quantity of 2 even though I have 1 designated.

 

Is there any documentation on how ajaxCart works? I've found none really just a bunch of users doing trial and error.

 

In the end I would really like to pass a text value to a customization as well.

 

Thanks for any help anyone has to offer.

 

Wil

Link to comment
Share on other sites

<a class="exclusive_small ajax_add_to_cart_button" title="{l s='Add to cart'}" onclick="ajaxCart.add(593, null, true, null, 1, null)">Add Me</a>

 

Revising that the above does work fine for adding a product with no customizations or required attributes. The quantity problem was because I was using both the ajaxCart.add and passing the rel="ajax_id_product_593". Thus it was honoring both. Either or is the name of the game here.

 

Now if only I can figure out how to pass a text value to be added to a customization. {hint hint}

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