Jump to content
thirty bees forum
  • 0

Duplicating products


SLiCK_303

Question

There are a couple problems, at least these two, that happen when you duplicate a product. The specific prices and downloads(attachements) are not duplicated. They are supposed to be, if you look at the code in controllers/admin/AdminProductsController.php, via this block of code, and the associated functions in classes/Product.php.. if ($product->add() && Category::duplicateProductCategories($idProductOld, $product->id) && Product::duplicateSuppliers($idProductOld, $product->id) && ($combinationImages = Product::duplicateAttributes($idProductOld, $product->id)) !== false && GroupReduction::duplicateReduction($idProductOld, $product->id) && Product::duplicateAccessories($idProductOld, $product->id) && Product::duplicateFeatures($idProductOld, $product->id) && Product::duplicateSpecificPrices($idProductOld, $product->id) && Pack::duplicate($idProductOld, $product->id) && Product::duplicateCustomizationFields($idProductOld, $product->id) && Product::duplicateTags($idProductOld, $product->id) && Product::duplicateDownload($idProductOld, $product->id) ) { ...but they don't get duplicated.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

After looking into it a bit more, a 'download' is NOT an 'attachment'. Sorry for my confusion. So it's not duplicating that because it's not told to. I will add it to the above code and see if it does duplicate attachments or not.

edit: yes it does duplicate attachments if it's told to. Just put this in the code after.. && Product::duplicateDownload($idProductOld, $product->id) add.. && Product::duplicateAttachments($idProductOld, $product->id) So that can be done with an override, but I think it should be done to the core.

Link to comment
Share on other sites

  • 0

I think I fixed it...amazing no? At any rate, in /classes/Product.php, find.. foreach (SpecificPrice::getIdsByProductId((int) $oldProductId) as $data) { change to.. foreach (SpecificPrice::getByProductId((int) $oldProductId) as $data) { I'll keep testing to make sure it's working.. I'll get back to ya...

edit: seems to be working for me, try it yourself and let me know. I'm sure I'm not the only person who had issue with this not working. Again I could make this an override, but it needs to be fixed in the core instead.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...