Forums / Setting Up Categories, Products, Attributes / How to pass in custom price from remote add to cart?

How to pass in custom price from remote add to cart?

Views: 803

Results 1 to 3 of 3
27 Feb 2014, 11:41 PM
#1
joeydev avatar

joeydev

New Zenner

Join Date:
Feb 2014
Location:
NYC
Posts:
2
Plugin Contributions:
0

How to pass in custom price from remote add to cart?

I have a 1 page web app to build a customized product, and I want to add it to the cart of a current zencart installation on the same domain. I have it mostly figured out, and tested by manually copy/pasting security token (will figure out how to automate next).

My main question is, what attribute can I pass via the html form to set the price of the product? There are thousands of price possibilities, so I can't manually create them.

For example, I've done this on another cart software with this <input type="hidden" id="price" name="price" value="[price injected dynamically]">.

For reference, here is my custom product builder with the remote add to cart button: https://www.chair-mat-office.com/custom-mat-builder/

28 Feb 2014, 11:18 PM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: How to pass in custom price from remote add to cart?

You sir will need to inject the price into the product price, and most certainly make a product to handle this fancy new price.

Can you send more than just the price?

It would be handy for the customer to reference the actual product they purchase...

Which leads me to believing it's far wiser to use your code to 'make' a product with attributes when the customer completes the product builder.

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

1 Mar 2014, 6:34 PM
#3
joeydev avatar

joeydev

New Zenner

Join Date:
Feb 2014
Location:
NYC
Posts:
2
Plugin Contributions:
0

Re: How to pass in custom price from remote add to cart?

I currently have a custom product, so they know they ordered a "custom mat". It would be nice to pass in the price and description. Do you know the html input name attributes to do that?