Zen Cart Logo
Forums / General Questions / Use add multi products form for products with attributes!

Use add multi products form for products with attributes!

Locked

Views: 1,817

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
31 Jan 2008, 4:27 AM
#1
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Use add multi products form for products with attributes!

Given that the prids are passed (products_id+attribute string), I wonder if the function actionMultipleAddProduct can handle it, or must we tweak the code to do so.

31 Jan 2008, 10:52 AM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Use add multi products form for products with attributes!

I see where you are going with this, but I'm afraid that prods aren't the answer. The prid is constructed from the product id + an md5 hash of the attributes.

However its purpose is to recognise uniqueness of product attribute combinations in the shopping cart, allowing a customer to have the same product twice with different attributes and a unique reference for each of them.

Alas the unique reference, the prid, is constructed using md5 which is a one way encryption technique whose main benefit for this task is an extremely low collision rate in the generated results. So once the prid has been built, the attribute information is no longer accessible.

That's 99% accurate. I guess we would discuss the team of Chinese cryptopgraphers who have shown that it is possible to reverse md5 hashing, provided you have big enough computers.

More practically, you could re-write the zen_get_uprid function to use a more reversible methodology, but I rather suspect that this would be fraught with other problems and wouldn't recommend it.

Easier I suspect, would be to re-write the product listings screen to include simple attribute choices, e.g. color and allow them to be placed directly into the shopping cart. But that's wouldn't be a trivial undertaking either.

4 Feb 2008, 6:17 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Use add multi products form for products with attributes!

Kuroi, I'm looking for a way to allow customers add the products they purchased last time back to cart easily through account_history_info page.
On this page, next to each product I have an input box that let customers specify the number of items to re-order. And I want to use the multiple add-to-cart for this.

The trouble is that this doesnt play nice with products that have attributes. I really let customers add the exact products with the exact attributes back (since they already chose last time any way)

5 Feb 2008, 1:16 AM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Use add multi products form for products with attributes!

Just a quick update: I finally have this working for normal products as well as products with attributes. Thanks Kuroi.