Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Passing addition information to shopping cart

Passing addition information to shopping cart

Started by royndoggy on 20 Jul 2012, 5:36 AM · Views: 854

Results 1 to 6 of 6
20 Jul 2012, 5:36 AM
#1
royndoggy avatar

royndoggy

New Zenner

Join Date:
Jul 2012
Posts:
5
Plugin Contributions:
0

Post #1 by royndoggy

I have created a jQuery Widget on a product page (lets call it product_id = 999) with an output of a text string about 80 characters long. I would like this extra bit of information passed on to the shopping cart because it describes some customization of the product ordered. I am a PHP programmer but new to Zen Cart.

How would I do this? Can I pass a hidden field vis the add to cart form? What files would be altered? Table changes, etc...

I am sure something in the template and modules folder should be altered.

Please Help?

20 Jul 2012, 11:18 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,770
Plugin Contributions:
56

Post #2 by swguy

Welcome to the Zen Cart forum! The capability you want is already available - do some searching for "Text Attributes." These can be added to a product for free form text entry when a product is purchased.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

20 Jul 2012, 12:56 PM
#3
royndoggy avatar

royndoggy

New Zenner

Join Date:
Jul 2012
Posts:
5
Plugin Contributions:
0

Post #3 by royndoggy

Thanks for the starting point. Actually my jQuery Widget outputs three text strings (each about 30 characters Long)

Can I have 3 Text Attributes?

Also, I want to stuff the output of that widget into the text attribute fields; in other words, the widget is the interface and not a input form.

How would I make this work?

Thanks in advance.

20 Jul 2012, 6:54 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Post #4 by schoolboy

I have no idea what you are trying to do this for, so perhaps if you explain **why **you need such complex stuff to tell your customers something about the product, we may be in a position to help. You don't need a space shuttle to drive to the corner shop.

If you need to tell them something about the product, then just include it in the description text. If the customer needs to add their own text, provide a couple of text attribute fields.

20 years a Zencart User

20 Jul 2012, 8:51 PM
#5
royndoggy avatar

royndoggy

New Zenner

Join Date:
Jul 2012
Posts:
5
Plugin Contributions:
0

Post #5 by royndoggy

The site has a product that is a gift box with three jars of jam. This box is fixed price but the buyer can select one of 15 types of jam for each of the three slots in the box. The box has a window where you can see the unique labels for each jar. Using jQuery, the buyer can select a jam and watch the box change with the correct jar of jam. Very cool visually and everyone loves the interactivity.

This is all working and jQuery not only swaps the images but stuffs the names of the jams name in a <div> container.

When the buyer selects ADD TO CART (since this is all on the product page for this specific product) then we would like to pass the information as a text to the shopping cart item. Basically the names of the three shopper selected jams.

Any ideas? You mentioned the product text attribute. Could I stuff it in a field somehow and pass it to the cart... when the user hits ADD TO CART.

Any help and direction would be greatly appreciated. And I loved your space shuttle to coffee shop phrase.

20 Jul 2012, 9:53 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #6 by drbyte

Example of a product with several kinds of attributes (radio buttons, pulldowns, text, etc): http://www.zen-cart.net/index.php?main_page=product_info&cPath=22&products_id=34

If you create attributes for your specific product, then you can have your custom code select or fill in the corresponding input fields (the field names will be determined based on the attributes you create in your store). Then when the customer uses the normal add-to-cart button, those fields' data will be included and reflected in the shopping cart and therefore also on the final order.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.