Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Oct 2007
    Posts
    9
    Plugin Contributions
    0

    help question Automatically Add Products to the cart via URL?

    Hi,

    I was wondering if there is a way so, if one of my customers, is browsing through another part of my site. e.g. a wordpress blog, they can click a link, which would automatically add a product to cart, and forward them to the products page or the checkout.

    Any Help would be appreciated.

    Regards

    Jon

  2. #2
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Automatically Add Products to the cart via URL?

    I happen to have answered that question ealeir today here http://www.zen-cart.com/forum/showpo...08&postcount=8

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Automatically Add Products to the cart via URL?

    If it's a product with no attribute, you dont need a form, just a link is fine

    like:
    Code:
    http://linktostore.com/index.php?action=buy_now&products_id=1
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Automatically Add Products to the cart via URL?

    awesome I have been school and learned something

  5. #5
    Join Date
    Apr 2006
    Posts
    16
    Plugin Contributions
    0

    Default Re: Automatically Add Products to the cart via URL?

    This doesn't seem to work. At least with my products. I'm guessing it's because they have attributes (ie. size/color). Anyway to do this via URL for products with attributes?

  6. #6
    Join Date
    Dec 2009
    Location
    Pinner
    Posts
    230
    Plugin Contributions
    1

    Default Re: Automatically Add Products to the cart via URL?

    Quote Originally Posted by quixotic View Post
    This doesn't seem to work. At least with my products. I'm guessing it's because they have attributes (ie. size/color). Anyway to do this via URL for products with attributes?
    You could embed a hidden form in your HTML like

    Code:
    <form id="form_1" action="http://linktostore.com/index.php?main_page=product_info&amp;cPath=22&amp;products_id=44&amp;number_of_uploads=0&amp;action=add_product" method="POST">
    <input type="radio" name="id[1]" value="16" id="attrib-1-16" />
    </form>
    and then make a link

    Code:
    <a href="javascript: document.getElementById('form_1').submit()">Buy this in blue.</a>
    You need to go to your shop page, grab the HTML for the form of the item you are interested in, put in the attributes you want selected by looking for radio or <select . Then make sure the link refers to the correct form, so you are the one naming the form with an id, in this case form_1

    Matt

  7. #7
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Automatically Add Products to the cart via URL?

    ########################## answered the same question in post #2 above.
    .

    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.

  8. #8
    Join Date
    Dec 2008
    Location
    Rimini, Italy, Italy
    Posts
    67
    Plugin Contributions
    0

    Default Re: Automatically Add Products to the cart via URL?

    Quote Originally Posted by yellow1912 View Post
    Code:
    http://linktostore.com/index.php?action=buy_now&products_id=1
    You're adding a product to cart by products_id, what I have to do is adding a product by products_model. Is there an easy way to do it or I have to read some php/mysql tutorial?

  9. #9
    Join Date
    May 2005
    Location
    Western MA, USA
    Posts
    604
    Plugin Contributions
    6

    Default Re: Automatically Add Products to the cart via URL?

    Quote Originally Posted by moosesoom View Post
    You're adding a product to cart by products_id, what I have to do is adding a product by products_model. Is there an easy way to do it or I have to read some php/mysql tutorial?
    You would have to make custom code to use the model.
    The reason that the product id woks is because thats how zen cart figures out what product to do and action with (display, add to cart .ect)
    YOu would have to do more then read one manual you would have to know php and understand the Zen Cart Code base

  10. #10
    Join Date
    Dec 2008
    Location
    Rimini, Italy, Italy
    Posts
    67
    Plugin Contributions
    0

    Default Re: Automatically Add Products to the cart via URL?

    It was a joke, I know PHP programming, I think I'll write a new page that receive model # from the remote configurator, than execute a query on products table to find that model# (just in case I can test if there's more than 1 record with it and return a warning message, or launch advanced_search page to list all products found), then extract the right products_id and finally add it to shopping cart.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 10 Aug 2013, 07:14 PM
  2. v150 Pattern List - automatically add related products to cart?
    By adb34 in forum General Questions
    Replies: 0
    Last Post: 14 Feb 2012, 11:57 AM
  3. Replies: 2
    Last Post: 22 Aug 2009, 06:07 PM
  4. Automatically Add Products to cart
    By blackc2004 in forum General Questions
    Replies: 6
    Last Post: 24 Apr 2008, 12:25 AM
  5. How easy is Zen Cart to add products to via a web interface
    By vandiermen in forum General Questions
    Replies: 3
    Last Post: 11 Feb 2007, 05:59 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