HomeHome Product Discus... Product Discus...SmithCartSmithCartProduct Variant Qty on HandProduct Variant Qty on Hand
Previous
 
Next
New Post
9/20/2010 3:02 PM
 

Our products have both size and color under the same SKU. Here is my example.

Example Product
Quantity Small Large TotalbyColors
Blue 2 5 7
Red 3 6 9
TotalbySizes 5 11 16

I would like to verify how the shopping cart handles the sale of 1 Large Blue Example Product.

Realize that the Product Variant QtyOnHand field is in four records to start: (Blue, 7), (Red, 9), (Small, 5) and (Large, 11)

After the sale, the table looks like this or not?

Example Product (after sale)
Quantity Small Large TotalbyColor
Blue 2 4 6
Red 3 6 9
TotalbySize 5 10 15

With a change to two of the variant records.... (Blue, 6) and (Large, 10)?

Is this how multiple variants on one product works?

Regards,

Guy

 
New Post
9/20/2010 6:53 PM
 

When you have product variants setup the cart is not currently decrementing the qty on hand in the product variant table. The reason is because the qty on hand needs to be moved from the product variant table to a new table that allows you to define the qty on hand for variant combinations like in your example the Large Blue shirt. If you sold a Large Blue shirt it wouldnt make sense to decrement the qty on hand for the large and blue variants individually.


At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
9/20/2010 7:28 PM
 

We did not understand why there would be a Quantity On Hand field in the Product Variant record at first until we worked out this example. If you did decrement 1 from each variant record selected in the variant group (Blue and Large in Color and Size) then everything works out. Look at the quantity total in the lower right corner of the table. It went from 16 to 15.

Obviously, there is an assumption that all products have a color and a size (in other words the totals of variant quantities within each group must be the same, ie., match the number of products). In our case this is absolutely true.

There is no need for another table to track blue and large quantity. This database design is correct. It will handle even N-variant groups properly. Can we decrement the QtyOnHand ourselves after a sale if you are not doing so already?

 
New Post
9/20/2010 7:39 PM
 

In your sample tables you have and x and y axis with color and size those are not relational tables its some kind of cross tab. In your example the qty on hand is an intersection of variants size and color. The Smith_ProductVariant table is not able to define qty on hand as a combination of of multiple variants.


At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
9/20/2010 7:55 PM
 

I used the table to clear things up for us and yes, the numbers on the inside four cells are intersections and not in the database.

The important thing is that your table Smith_ProductVariant records quantities in their respective groups accurately... as long as a decrement occurs in each group for each sale.

You say that no such decrement occurs in the ProductVariant records now. I'd like to set that up because it makes sense and will allow us to accurately report the quantities in each variant.

 
New Post
9/20/2010 8:14 PM
 

You could write a trigger to decrement the qtys


At your service,
Dave Smith
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartProduct Variant Qty on HandProduct Variant Qty on Hand