Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2009
    Posts
    51
    Plugin Contributions
    1

    Default Regarding Product Attributes

    Hi All,

    I have added a Product with attributes to the shopping cart. now i get the product id as say for e.g. 131:114b3ba9e51af1314e82dd3ce5ee88eb

    I would like to understand what this means and how it is generated.

    the user is not logged into the zencart site. the user just added the product to shopping cart.

    - Bala
    Amazon Payments

  2. #2
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Regarding Product Attributes

    Quote Originally Posted by AmazonPayments View Post
    Hi All,

    I have added a Product with attributes to the shopping cart. now i get the product id as say for e.g. 131:114b3ba9e51af1314e82dd3ce5ee88eb

    I would like to understand what this means and how it is generated.

    the user is not logged into the zencart site. the user just added the product to shopping cart.

    - Bala
    Amazon Payments
    As far as I understand it.
    Its a way of producing a unigue id using the product_id and relevent attrib ids combinations of the selection.
    This keeps it unique from the the same product with different attributes. It can now be uniquely accumulated, and displayed separately in the cart and checkout.

    How is it calculated, no idea.

  3. #3
    Join Date
    Apr 2007
    Location
    Herts. UK
    Posts
    890
    Plugin Contributions
    4

    Default Re: Regarding Product Attributes

    Quote Originally Posted by AmazonPayments View Post
    Hi All,

    I have added a Product with attributes to the shopping cart. now i get the product id as say for e.g. 131:114b3ba9e51af1314e82dd3ce5ee88eb

    I would like to understand what this means and how it is generated.
    It is the product id followed by a MD5 hash of the product attributes. It is generated by the zen_get_uprid() function in /includes/functions/functions_general.php .

    Regards,
    Christian.

  4. #4
    Join Date
    Oct 2009
    Posts
    51
    Plugin Contributions
    1

    Default Re: Regarding Product Attributes

    Quote Originally Posted by CJPinder View Post
    It is the product id followed by a MD5 hash of the product attributes. It is generated by the zen_get_uprid() function in /includes/functions/functions_general.php .

    Regards,
    Christian.
    gilby and CJPinder,

    thank you for replying.

    any specific reason why we are doing MD5 hash for the attributes? is it really needed while creating orders?

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

    Default Re: Regarding Product Attributes

    The hash is a unique combination of all the selected attributes for a given product when added to the cart.
    Since there could be hundreds of choices, the hash is the way to uniquely note which options were selected when the item was added to the cart.
    One of the several ways it's used is to reconstruct the item details as at the time of being added to the cart. Removing it loses that important information.
    .

    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.

  6. #6
    Join Date
    Oct 2009
    Posts
    51
    Plugin Contributions
    1

    Default Re: Regarding Product Attributes

    Quote Originally Posted by DrByte View Post
    One of the several ways it's used is to reconstruct the item details as at the time of being added to the cart. Removing it loses that important information.
    but MD5 is a one-way hash as far as i know. once generated in the shopping cart, it cannot be decrypted. i wonder how it is used while creating the order. also i found that the cart items are stored in session. once user logged in, the item attributes are stored in the table i guess.

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

    Default Re: Regarding Product Attributes

    Let me clarify:

    There is a customer_basket and a customer_basket_attribute and the prid is used to:
    1) relate the two database tables together
    2) match up the attribute combo to know when things are built together so if you add 5 products_id 27 to the cart but 1 is Red, 2 are Green and 2 are Blue , while the products_id is the same, the prid makes them unique so you can add more unique combinations to the cart, or delete the specific one, etc.
    .

    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
    Oct 2009
    Posts
    51
    Plugin Contributions
    1

    Default Re: Regarding Product Attributes

    DrByte,

    thank you. i got clarified.

 

 

Similar Threads

  1. v150 Question regarding attributes and alternatives...
    By CraftStudio in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 1 May 2013, 03:52 PM
  2. Product Info Page - Aligning issues regarding Shopping Cart and Attributes.
    By Treasuresbycaz in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Jul 2009, 01:56 PM
  3. Question regarding restricting some attributes
    By Lucretia in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 Sep 2008, 02:12 PM
  4. questions regarding attributes display
    By gamer78 in forum General Questions
    Replies: 3
    Last Post: 26 Aug 2008, 09:11 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