HomeHome Product Discus... Product Discus...SmithCartSmithCartGet variant product options choosen by the userGet variant product options choosen by the user
Previous
 
Next
New Post
9/8/2011 7:55 AM
 

Hi,

 

In the dnn database, how can I get the variant options choosen by the user ?

The only thing I could note is that the ProductName includes for each variant ", variant title = option value". I could parse the ProductName but it is not very reliable over time (variant title change?).

 

Thanks.

 
New Post
9/8/2011 3:01 PM
 
Hi Rico,

I'm not sure I am following what you are trying to accomplish Do you want to export the data to another system?

Thanks,
 
New Post
9/9/2011 3:04 AM
 

Hi Kevin,

 

I would like to plan automated post-purchase operations to get precisely what the customer has bought. Therefor I must get each variant option the user has choosen. Unfortunately, there is no datatable that list all variant ID (with its variantGroup ID) choosen for each order detail ID.

The only way I found to identify the choosen options is to parse ProductName in the OrderDetail datatable (which will not match if the variant group or option is changed between the customer purchase and the automated post-purchase operations). But maybe there is a other way to do it...

 

The datatable solution will be the most reliable one.

Thanks.

 
New Post
9/9/2011 12:58 PM
 

I understand you are trying to parse your orders and export to another system so in order to get the variant group and name you would need to use the asp.net split function to parse. It sounds like your business has the requirement to change historical data on the order if you change the variant at a later date. Generally speaking its not a good idea to change historical data in the order table as a possible solution you could write a trigger in your database to log the variant group id and variant name to a new table so that when you run your custom exporter program that loads your back end system you will be able to do a lookup on the variant tables and get the new variant group and/or variant name if you changed it subsequent to the order being processed.
 


Scott Kelly
Project Manager
DotNetNuke Consulting, DotNetNuke Store and DNN Ecommerce
 
New Post
9/14/2011 8:28 AM
 

Hi Scott.

 

Parsing productName is a solution regarding to the actual implementation. But I did not think about changing orderDetail table, but changing Variant name (reformulation for example). In this case the variant options will not be parsable anymore for all existing orders. And I think the database triggers are a bit overkilled for such a scenario.

The only other possible solution will be to create a new variant instead of changing existing variants. With this approach, all ProductName data will still be parsable (but the drawback is that the same options (that is renamed) will be considered as 2 differents variants).

 

In all cases, the datatable that list all variant ID (with its variantGroup ID) choosen for each order detail ID would be the best solution.

Anyway, thanks for your answer.

 
Previous
 
Next
HomeHome Product Discus... Product Discus...SmithCartSmithCartGet variant product options choosen by the userGet variant product options choosen by the user