VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Mister Paul on March 09, 2019, 14:53:43 PM

Title: Clone Product Bug ?
Post by: Mister Paul on March 09, 2019, 14:53:43 PM
Hi,

I have VirtueMart 3.4.0 for now and saw today a strange behaviour when cloning a product:
modifying Image or Description in the cloned product is changing Image or Description in the original product...
And vice versa!

Is it a known bug or did I do something wrong?

Thanks for your help
Paul
Title: Re: Clone Product Bug ?
Post by: GJC Web Design on March 09, 2019, 15:01:59 PM
QuoteIs it a known bug

not known bug, known behaviour .. I never use cloning of products .. too complex for me...
Title: Re: Clone Product Bug ?
Post by: jenkinhill on March 09, 2019, 16:14:42 PM
If you change the SKU for the cloned product then the changes in desc etc become disassociated.
Title: Re: Clone Product Bug ?
Post by: Mister Paul on March 09, 2019, 23:30:28 PM
Thanks very much jenkinhill for the trick!
But as there's no automatic SKU generated by default by Virtuemart, we get confused by Virtuemart cloning product option if we leave SKU empty.
That's not an obvious behaviour...
Title: Re: Clone Product Bug ?
Post by: AH on March 10, 2019, 09:05:00 AM
We use cloning very often.

It is unlikely to be the SKU

Consider the product-alias - that has to be unique across products - should be handled by cloning for uniqueness - but sometimes people mess with it and make it non-unique?
Title: Re: Clone Product Bug ?
Post by: Mister Paul on March 10, 2019, 09:14:13 AM
I did empty the cloned Alias name. So it has been reinitialized on saving.
There must be something else that still bind original and cloned products...
Title: Re: Clone Product Bug ?
Post by: AH on March 10, 2019, 09:56:50 AM
Have you checked that the two products NOW have different aliases
Title: Re: Clone Product Bug ?
Post by: GJC Web Design on March 10, 2019, 10:06:59 AM
I'm sure we had a long discussion ages ago incl. Max about clones and image handling ... have of course forgotten what was said but I know I was doing the image changing wrong and as MP found both get changed..
There is a trick somewhere i think..
Title: Re: Clone Product Bug ?
Post by: Mister Paul on March 10, 2019, 10:11:50 AM
@ AH
Unfortunately I can't check that now as I have deleted the problematic cloned product and replaced it by a fresh new created product...
I'll check that next time I'll clone a product (if I use this option again...)

@GJC Web Design
Yes, I think too that there's a tricky process in cloning products
Title: Re: Clone Product Bug ?
Post by: Jörgen on March 10, 2019, 10:28:08 AM
I clone products all the time and have never seen the crosslinking of product description. The "image description" on the other hand is a database etnry that holds the image and some extra data title etc. The same image description can be used in more than one place and will of course change image or image data on both appearances.

Jörgen @ Kreativ Fotografi
Title: Re: Clone Product Bug ?
Post by: AH on March 10, 2019, 10:29:25 AM
Oh doh!!

Of course - I must remember to read the question properly.

This has nothing to do with SKU or aliases.

Yes the image file is the same for BOTH images

When you clone - the new product has an entry created in the product_medias table - It will point to an entry in the   _medias table

The media entry both products are pointing to in the media table will be the SAME entry.

To differentiate the images you need to create a new media table entry and have your cloned product point to that.

If you want to keep the images separate (i.e changing the original image will not affect multiple products)  you need to create a new media table entry.

In the images tab "clear" the cloned image value
Then
(Browse) to get a new media file for this product.  Select the image and save the product.

(See my screen grabs below)

This will create a new media record in the media table and your new product will point to it.

If you do not do this - working on a media file will affect ALL items that point to the same entry in the media table



Sometimes we WANT this single image behaviour - where one image is used for multiple products - where one single image change will affect many products that are "pointing/using" it.




Title: Re: Clone Product Bug ?
Post by: Mister Paul on March 10, 2019, 11:05:45 AM
Thanks for your posts.

AH, I almost did the process you described for image replacement.
But I'm not sure to have fully cleared the thumbnail + main image before image replacement...

In my opinion, a cloned product was a just the copy of a product at a given moment. But with no crosslinks.
I'll be more suspicious next time.
Title: Re: Clone Product Bug ?
Post by: AH on March 10, 2019, 12:54:13 PM
Note

You are not "replacing"  - that process will change the exiting image in the media table

You are uploading new image file to the media table and pointing to it for the current product - so the image action is (NONE)

IMHO the current cloning - where the image is the saem for the cloned and clonee - can save a lot of time :-)
Title: Re: Clone Product Bug ?
Post by: Mister Paul on March 10, 2019, 15:43:36 PM
Thanks, that's more clear now for me.
;)
Title: Re: Clone Product Bug ?
Post by: Studio 42 on March 10, 2019, 19:09:42 PM
Quote from: Mister Paul on March 09, 2019, 14:53:43 PM
modifying Image or Description in the cloned product is changing Image or Description in the original product...
And vice versa!

images are shared for all products.
If you need 1 image per product, you have to upload a new one for each product else if you modify the description, you modify the description for all products using same image.
Title: Re: Clone Product Bug ?
Post by: Milbo on March 11, 2019, 10:35:19 AM
Right and it is intended.

Imagine you have set a manufacturer, then you clone the product,... there is the same manufacturer set, obvious. But of course when you go to the manufacturers list, you still see ONE manufacturer. And of course, when you used the same manufacturer 100 times and you see spelling error, then you assume automatically, that you fix the manufacturer entry and it is fixed for any occurences of the manufacturer. The same counts for the media. A lot shops use for 1000s of products always the same standard image. Imagine you sell RAMs, or tubes.
Title: Re: Clone Product Bug ?
Post by: Mister Paul on June 24, 2019, 09:59:12 AM
OK Milbo I understand the "cloning" process now.

But it would be great, useful, to have also a "duplicate" button for almost identical products :
we could then customize them after they have been generated... and with no interaction with original product!

In my eshop I have 3 kinds of products (physical products, downloadable products, virtual products) with custom fields for each kind, but different categories, etc.
Products are unique but with a lot of parameters in common with others. So, as I can't use "clone product", it's time consuming to create a new product from scratch and reproduce the parameters of the product family.
Title: Re: Clone Product Bug ?
Post by: Jörgen on June 24, 2019, 10:09:48 AM
AFAIK ther is no interaction with the original product. If You change manufacturer, add new image items they will belong to the new product and will not go back into the old one. If You use the same a manufacturer both products point to the same manufacturer and in miy opinion would have the same information. Changing the info int the manufacturer object will of course be seen by all using this object.

What do You want to change that You think reflects back to the original product?

Jörgen @ Kreativ Fotografi
Title: Re: Clone Product Bug ?
Post by: Mister Paul on June 24, 2019, 10:41:33 AM
Milbo took the example of Manufacturer but it's not important in my case as I have only 1 manufacturer.
;)
But as it's said in this thread, if I clone a product the cloned products stay linked. If I change Image or Description, it's automatically repercuted in the other product.
Milbo explained that it is intended. That's why I'd whish a "duplicate" button also!
Title: Re: Clone Product Bug ?
Post by: Jörgen on June 24, 2019, 10:56:51 AM
No that is not the case.

VM uses image items for the images, if You use the same image item it will be displayed at all placed using this image item. But there is nothing to stop You from creating a new image item that uses another image. I do this all the time. Remove the image item from the product and create a new one, do not change the image in the image item, this will show in all places where this item is used.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Clone Product Bug ?
Post by: Studio 42 on June 24, 2019, 10:58:54 AM
Quote from: Mister Paul on June 24, 2019, 10:41:33 AM

But as it's said in this thread, if I clone a product the cloned products stay linked. If I change Image or Description, it's automatically repercuted in the other product.
Since when ?
A clone is a real Db copy, so cloned product do not inherit from original when you change something in the original product after.
The media information is in the DB, so if you change media informations, it's for all because you use same media.
If you want change information for same image, then you have to manually copy the link form original file when you create a media, so you have a DB copy, but use same file image.
Title: Re: Clone Product Bug ?
Post by: Mister Paul on June 24, 2019, 11:37:20 AM
not exactly: it's when I customize the clone product that it's repercuted to the original product...
It occurs since I updated in January after I migrate from my old good VM 1... to the actual VM 3... version
;)

What I initially wanted to do was to clone a product (to keep Custom fields, Categories,...) but then change Image, Description, Stock, Size, etc.
Title: Re: Clone Product Bug ?
Post by: Jörgen on June 24, 2019, 11:52:08 AM
Like studio42 and I am trying to tell You. If you change the image in the image media item You will get changes where ever it is used. Remove the used image media item create a NEW image media item and add new images to this item. This works since years. The beauty with the image media item has actually nothing to do with cloning. Sharing image media items works without cloning. Cloning just creates a pointer to the same image media item that the original uses. Remove this image media item (click on the red cross down to the right under the thumb) and upload a new image make sure upload image is ticked (option nr 2 from left under upload) and click save. Now you get a new image media item containing Your new image.

You can also add an already created image media item, just use the search at the top.

All the other fields would be real clones of the original and free for You to change, Image medias should be treated differently.

Jörgen @ Kreativ Fotografi
Title: Re: Clone Product Bug ?
Post by: Mister Paul on June 24, 2019, 21:23:52 PM
I thank you very much Jörgen for your partience.
That's finally clear now.
(but this VM process is tricky guys!)

And Thanks to all!
:)
Title: Re: Clone Product Bug ?
Post by: Jörgen on June 24, 2019, 22:01:18 PM
Nice to hear that you got it straight :)

regards

Jörgen @ Kreativ Fotografi