Recently when working with Commerce PDM's "Clone" product feature, I faced an issue where if you were to attempt to clone a product while the SKU was being auto-generated via Commerce AutoSKU module , I would get a duplicate SKU error (I use specific patterns for generating the SKU).
“This SKU is already in use and must be unique. Please supply another value”
This prevented me from "Cloning" a product, after some investigation into the code that cloned a product, I found out that if the SKU was reset when the clone object was created it would not cause this hindrance.
The basic idea here being even though you clone a product, the SKU of products within the system should be unique and not be duplicated, so while cloning the product all aspects of the product can be copied over to the new product except the SKU which needs to be reset.
I have attached a patch for the change I made.
-- Santhosh
| Comment | File | Size | Author |
|---|---|---|---|
| commerce_pdm_product_clone.inc_SKU_Reset.patch | 687 bytes | fragger_fox |