Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2006
    Posts
    283
    Plugin Contributions
    0

    Default Add 2 different products (no attributes) to cart at one time via hardcode link

    1.5.1.
    Lots and lots of customizations ;}

    I am doing some custom coding and coding a link such as this:

    mysite.com/index.php?main_page=products_new&action=buy_now&products_id=107230

    It works great but I need to add both products_id=107230 and products_id=107231 at the same time.


    Can it be done? If I need custom coding... where would you recommend I start.

    Thanks!
    22 stores and counting! Ive been zenned.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Add 2 different products (no attributes) to cart at one time via hardcode link

    Can you post URLs to these two product_id so we can see the Products and consider the Products and how best to answer this?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Mar 2006
    Posts
    283
    Plugin Contributions
    0

    Default Re: Add 2 different products (no attributes) to cart at one time via hardcode link

    Im on a development server not accessible to the public... but they are basically 1 mit and 1 baseball both from the same category of 'baseball' which is a sub category of parent cat 'sports'. There are no attributes and quantity will always be 1 of each.

    dev://mysite.com/index.php?main_page=product_info&cPath=317_321&products_id=107230
    dev://mysite.com/index.php?main_page=product_info&cPath=317_321&products_id=107231
    parent cat 317 = 'sports'
    cat 321 = 'baseball'
    products_id=107230 = starter baseball
    products_id=107231 = starter mit

    I hope this will help you to help me ;)

    thank you very much....

    P.S. I was thinking of adding a session variable as a flag for the cart page. if the cart page sees that the session Varriable is not null (it would contain the second products_id) then if sessionVarrialbe not Null use javascript to window.location the second buy_now link from the cart. this seems like overkill tho... there must be a simpler way?
    Last edited by makenoiz; 1 Aug 2013 at 06:23 AM.
    22 stores and counting! Ive been zenned.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Add 2 different products (no attributes) to cart at one time via hardcode link

    A few options:

    a) consider the Better Together plugin in case it suits your needs and saves you writing code needlessly

    b) in a fresh install of Zen Cart, on the product-listing page in any category, the Multiple Add To Cart feature is active by default, and that presents a form that also presents qty input boxes for several items, and has submit buttons which submit those quantities for each of those products, which then triggers the code in the /includes/main_cart_actions.php file (custom changes or additions to that would NOT be put in that file, but instead in the extra_cart_actions folder) to take the submitted product ids and quantities and pass them to the shopping cart class to handle the actual insertion.
    So, if your customization is on a non-zen-cart page you could mimic the multiple-item-form-submit.
    Or you could intercept the cart-actions processing with your own extra-cart-actions code to check whether a certain product is being added and have it also add another one. For what it's worth I believe this is basically what the better-together plugin does ... but if I'm wrong about that, then what I've just described is how you can do what you've stated.

    c) or you could hack up the code and make upgrades more complicated in the future. I don't recommend this if there are more efficient ways to accomplish the same end result.
    .

    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.

  5. #5
    Join Date
    Mar 2006
    Posts
    283
    Plugin Contributions
    0

    Default Re: Add 2 different products (no attributes) to cart at one time via hardcode link

    Yes I try very hard to stay away from 'c'! Our upgrades right now take 2 days and BeyoneCompare is my very very best friend during those 2 days! But the boss is the boss .. ya know.. I dont think 'a' will work with the application so I will put my efforets into 'b'. For some reason I thought Multiple Add To Cart feature was no longer supported... Great idea...

    Thanks!
    22 stores and counting! Ive been zenned.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,708
    Plugin Contributions
    123

    Default Re: Add 2 different products (no attributes) to cart at one time via hardcode link

    @makenoiz - see your PM.
    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.

 

 

Similar Threads

  1. v150 Different drop-down displays on attributes with recurring v. one-time price
    By KenBaker in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 3 Feb 2013, 01:47 PM
  2. Can I change price attributes in all products at one time?
    By dat311 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 18 Jan 2012, 05:26 PM
  3. Stock by attributes for several products at one time
    By mews in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 3 Feb 2011, 02:51 PM
  4. Automatically Add Products to the cart via URL?
    By jonhurlock in forum General Questions
    Replies: 18
    Last Post: 13 Apr 2010, 03:49 PM
  5. Adding attributes to multiple products at one time.
    By nathan08 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 1 Feb 2009, 05:30 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR