Facing issue as our client changed product sku's for some of the products in the catalog. This is causing problems getting old purchase orders, as all products in the orders can only be identified by sku.. there is no product id in orderline table... (As far as I know). So now we have to delete all our existing order. This is possible now as site is still in the testing phase. But is it possible to avoid this from happening by somehow DISABLING product sku or making it UNEDITABLE.
In my humble opinion i think you are making some wrong assumptions about the orderhistory.
When creating an orderline, uCommerce copies the information from the product to the orderline to create a "snapshot" of the product at the time the customer buys it. This way it preserves the state it had when the customer bought it.
If you want to create an orderhistory list, i would advice you to fetch all the "mandatory" info from the orderline (price, variant etc.), and a "if(Product.FirstOrDefault(orderlineSku) != null)" to fetch nice to have info like pictures, descriptions etc.
Locking the SKU will, im afraid, create more problems that it solves (the customer would have to delete a product to correct a SKU typing mistake).
Hi Nickolaj, I am extremely sorry for this very late reply. Earlier I did not have understanding of what SKU stands for. But as I understand it now it will be very rare case that product sku is changed. And yes, I understand your point and agree with it at some extent. But I dont understand the case when I will need to show order history for the products whose SKU is changed. Your - 'a "if(Product.FirstOrDefault(orderlineSku) != null)" to fetch nice to have info like pictures, descriptions etc.' will not return descriptions and pictures for those products whose sku is changed, which may not be acceptable to some clients. Any solution to this?
In my point of view, a SKU defines a unique product, so a new SKU is a new product. If a client needs to keep more information about a sold,and later deleted product that what is store on the orderline, they should keep the product with the "wrong" SKU instead of deleting/ changing the SKU, disable ordering and set it to DisplayOnWebsite false (not sure that's the correct uCommerce term - but i hope you manages). I know this causes some issues with pulling order statistic, and the only way to avoid this is to have somekind of SKU history for a product.(And Im fairly sure the dev. time would be better spend elsewhere). :)
If you want to use your original approach:
In the file
Add this " ReadOnly="true" "
to the <asp:TextBox ID="SkuTextBox"></asp:TextBox>
Just remember to do this everytime you update uCommerce :)
I can only see one easy way to do this (and ofcourse depending on how much information you need to store). I would use the OrderProperties on the OrderLine objects. When you add an new orderline to a basket then you stamp all your information you want to be available for an overview in to the OrderProperties.
Then when you create an order overview you just fetch your information from the same collection and you don't have to worry about lost information since they will be attached to the order itself.
And as Nickolaj stated earlier, it will not be a good idea to modify uCommerce itself. You will perhaps at some point face som problems due to the change.
Making Product Sku uneditable in backend
Hi all,
Facing issue as our client changed product sku's for some of the products in the catalog. This is causing problems getting old purchase orders, as all products in the orders can only be identified by sku.. there is no product id in orderline table... (As far as I know). So now we have to delete all our existing order. This is possible now as site is still in the testing phase. But is it possible to avoid this from happening by somehow DISABLING product sku or making it UNEDITABLE.
Regards,
Girish
In my humble opinion i think you are making some wrong assumptions about the orderhistory.
When creating an orderline, uCommerce copies the information from the product to the orderline to create a "snapshot" of the product at the time the customer buys it. This way it preserves the state it had when the customer bought it.
If you want to create an orderhistory list, i would advice you to fetch all the "mandatory" info from the orderline (price, variant etc.), and a "if(Product.FirstOrDefault(orderlineSku) != null)" to fetch nice to have info like pictures, descriptions etc.
Locking the SKU will, im afraid, create more problems that it solves (the customer would have to delete a product to correct a SKU typing mistake).
Please let me know what you think :)
//Nicko
Hi Nickolaj,
I am extremely sorry for this very late reply.
Earlier I did not have understanding of what SKU stands for. But as I understand it now it will be very rare case that product sku is changed.
And yes, I understand your point and agree with it at some extent. But I dont understand the case when I will need to show order history for the products whose SKU is changed. Your - 'a "if(Product.FirstOrDefault(orderlineSku) != null)" to fetch nice to have info like pictures, descriptions etc.' will not return descriptions and pictures for those products whose sku is changed, which may not be acceptable to some clients. Any solution to this?
Hi Girish
No problem :)
In my point of view, a SKU defines a unique product, so a new SKU is a new product. If a client needs to keep more information about a sold,and later deleted product that what is store on the orderline, they should keep the product with the "wrong" SKU instead of deleting/ changing the SKU, disable ordering and set it to DisplayOnWebsite false (not sure that's the correct uCommerce term - but i hope you manages). I know this causes some issues with pulling order statistic, and the only way to avoid this is to have somekind of SKU history for a product.(And Im fairly sure the dev. time would be better spend elsewhere). :)
If you want to use your original approach:
In the file
Add this " ReadOnly="true" "
to the <asp:TextBox ID="SkuTextBox"></asp:TextBox>
Just remember to do this everytime you update uCommerce :)
Hi Girish,
I can only see one easy way to do this (and ofcourse depending on how much information you need to store). I would use the OrderProperties on the OrderLine objects. When you add an new orderline to a basket then you stamp all your information you want to be available for an overview in to the OrderProperties.
Then when you create an order overview you just fetch your information from the same collection and you don't have to worry about lost information since they will be attached to the order itself.
And as Nickolaj stated earlier, it will not be a good idea to modify uCommerce itself. You will perhaps at some point face som problems due to the change.
Best regards Martin
is working on a reply...