Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2012
    Posts
    5
    Plugin Contributions
    0

    Default Passing addition information to shopping cart

    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?

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,545
    Plugin Contributions
    127

    Default Re: Passing addition information to shopping cart

    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.

  3. #3
    Join Date
    Jul 2012
    Posts
    5
    Plugin Contributions
    0

    Default Re: Passing addition information to shopping cart

    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.

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: Passing addition information to shopping cart

    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

  5. #5
    Join Date
    Jul 2012
    Posts
    5
    Plugin Contributions
    0

    Default Re: Passing addition information to shopping cart

    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.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: Passing addition information to shopping cart

    Example of a product with several kinds of attributes (radio buttons, pulldowns, text, etc): http://www.zen-cart.net/index.php?ma...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.

 

 

Similar Threads

  1. v150 Shopping cart not passing billing address to PayPal
    By WebKat in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 7 Mar 2012, 08:56 PM
  2. Shopping Cart Original Price Addition
    By Kunal in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 23 Jan 2010, 12:08 AM
  3. Show individual unit price in addition to total in shopping cart
    By JimmyV in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 24 Mar 2008, 05:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg