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

    Default add t ocart link for products with attributes

    hi, I'm hoping someone can help me, I need an url, a link to add product to cart, but with attributes, say the product id is "x" and product has 1 attribute, flavour, wiht 3 posible values (cho, vanilla and strawberry), I need a link that would add the product to the cart with vanilla selected, and then direct you to the shopping cart.

    Best Regards
    Joćo Mustra

  2. #2
    Join Date
    May 2012
    Posts
    6
    Plugin Contributions
    0

    Default add products to cart from any url, including attributes

    hi, I'm hoping someone can help me, I need an url, a link to add product to cart, but with attributes, say the product id is "x" and product has 1 attribute, flavour, wiht 3 posible values (cho, vanilla and strawberry), I need a link that would add the product to the cart with vanilla selected, and then direct you to the shopping cart.

    Best Regards
    Joćo Mustra

  3. #3
    Join Date
    Jan 2004
    Posts
    59,773
    Blog Entries
    4
    Plugin Contributions
    133

    Default Re: add products to cart from any url, including attributes

    Duplicate posts merged. Please don't re-post the same thing over and over again in multiple places.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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.

  4. #4
    Join Date
    Jan 2004
    Posts
    59,773
    Blog Entries
    4
    Plugin Contributions
    133

    Default Re: add t ocart link for products with attributes

    Quote Originally Posted by joricam View Post
    I need an url, a link to add product to cart, but with attributes, say the product id is "x" and product has 1 attribute, flavour, wiht 3 posible values (cho, vanilla and strawberry), I need a link that would add the product to the cart with vanilla selected, and then direct you to the shopping cart.
    You cannot do that with a URL. Attribute-selections are not auto-selectable via any URL parameters. Only via <form> POST data.

    You would need to build a <form> with all the corresponding <input> fields embedded in it with all your predefined values. You would have to reverse-engineer that by studying the dynamically-generated product page and recreating the HTML for your very unique needs. And remember that when you do that you cannot change those attributes in the admin without it affecting the <form> data, and then you'll have to manually rebuild that <form> again after making those edits.

    Why are you trying to skip the main product page in Zen Cart, when it already intelligently does all the magic you're looking for? If it's because you want the page to look different, then just style it according to your needs instead of reinventing the wheel.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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
    May 2012
    Posts
    6
    Plugin Contributions
    0

    Default Re: add t ocart link for products with attributes

    Hello DrByte, I was exactly looking for you!! Yes its not a problem to use post, I can even use it with jquery post, I really need this badly, it's not to style the page, its so that I can include this in a facebook app that posts open graph objects with a link to add the product directly to the cart, please show me the url structure, the post variables and affected files please.

    Best Regards
    Joćo Mustra

  6. #6
    Join Date
    Jan 2004
    Posts
    59,773
    Blog Entries
    4
    Plugin Contributions
    133

    Default Re: add t ocart link for products with attributes

    You can see all the details in the generated HTML page source for your product when you view the product in your store.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donations always welcome: www.zen-cart.com/donate

    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. add to cart button on product listing (for products with attributes)
    By easy3dsource in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 10 Apr 2011, 06:08 PM
  2. Is it possible to add flash to link with attributes?
    By BlackDotSurfing in forum General Questions
    Replies: 0
    Last Post: 29 Apr 2010, 07:13 PM
  3. Show 'Add to cart box' for products with optional attributes
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 26 Feb 2010, 10:52 AM
  4. Use add multi products form for products with attributes!
    By yellow1912 in forum General Questions
    Replies: 3
    Last Post: 5 Feb 2008, 02:16 AM

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
  •