Author Topic: Copy products -> duplicate media  (Read 90 times)

sandomatyas

  • Jr. Member
  • **
  • Posts: 127
Copy products -> duplicate media
« on: August 17, 2017, 10:44:23 am »
When I copy a product VM assigns the image of the original product to it, so there will be 2 records in #__virtuemart_product_medias table with the same virtuemart_media_id but different virtuemart_product_ids.
When I open the second product and change the image title, description, meta etc it will change the media's data so the first product will be changed too
I'm just wondering if there is any disadvantages to duplicate the media entry too when a product is copied? Or what is the good solution to fix that? Downloading and re-uploading is a bit old fashion :)

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2182
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Copy products -> duplicate media
« Reply #1 on: August 18, 2017, 15:25:48 pm »
virtuemart_product_medias is to refer to a media, the media description is same for a media used by many products.
So if you really need to have description per product, you have to reupload the image 2 times so you can change description for each product.
Another solution is to get description from the product, but this need of course some change in the PHP files