VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: hazael on July 13, 2018, 17:18:35 PM

Title: Duplicate Custom Fields in Product Children
Post by: hazael on July 13, 2018, 17:18:35 PM
How to hide duplicates of custom fields from parent products in child products?
Title: Re: Duplicate Custom Fields in Product is Children
Post by: Jörgen on July 14, 2018, 00:14:25 AM
Click on the d-box (disable) for the custom field and it will be hidden in the child.

Jörgen @ Kreativ Fotografi
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on July 14, 2018, 14:26:34 PM
I have over 1k of such products. :-/ How to do it massively for all parent products?
Title: Re: Duplicate Custom Fields in Product is Children
Post by: Jörgen on July 14, 2018, 21:14:43 PM
Why haven´t You noticed it until now ? Why creating 1000 products with incorrect data ?

You could make a dbase query to set this right
You could probably use a tool from Studio42 to batch process this, not quite sure if it works with this peticular issue.

regards

Jörgen @ Kreativ Fotografi
Title: Re: Duplicate Custom Fields in Product is Children
Post by: Studio 42 on July 14, 2018, 23:22:20 PM
Jorgen, i dont think that my tool VM be pro can fix this, but should the field not override the parent field by default ?
Title: Re: Duplicate Custom Fields in Product is Children
Post by: Jörgen on July 15, 2018, 00:14:42 AM
Yes, I suspected it might not fix this.

You could be right about the override, but I am not sure. At least my tests show the same result as hazaels. But honestly I do not see the reason to add an already inherited custom field. There is a reason Why it should be inherited in the first place, isn´t there.

Jörgen @ Kreativ Fotografi
Title: Re: Duplicate Custom Fields in Product is Children
Post by: Studio 42 on July 15, 2018, 12:40:21 PM
Jorgen the setting is perhaps not right.
But Virtuemart should not display the same customfield in child when the field exist by default.
I have do some test and the behavior is not always the same.
In this test page http://pro.st42.fr/fr/android/zte-nubia-z17.html
all customfields are set in parent and child.
I have one parent customfield in the back-end displayed before the child customfields on edit product.
This field is in the sample "technology" and is only displayed 1 time in front.
But the other parent field are displayed after in the edit form and are displayed 2 time in front.
So Virtuemart have a bug , because the behavioer should not depend the order in the form
I have set the "tags" customfield to disable (d checkbox) and its only displayed 1 time.

So the question is, should VM display or not the parent customfield by default if this exist in the parent ?
This is very important to know, because when you import customfields for 10000 product, you have to verify(or not), if this need to be imported, or if this need to have parent "d" checkbox to true.
The logic for all Virtuemart fields is to not get parent fields when child have same field set, so for me the behavior is bad.


Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on July 15, 2018, 18:50:13 PM
QuoteWhy haven´t You noticed it until now ? Why creating 1000 products with incorrect data ?

I migrated all products from Prestashop to Virtuemart.
Each product had similar parameters but often different values.
Some products had descriptions, price and photos were the same and I decided to connect them to the parent product
Title: Re: Duplicate Custom Fields in Product Children
Post by: Jörgen on July 15, 2018, 19:19:29 PM
This had been good to know. Patrick thinks there might be some inconsistancy in the behaviour. I really don't know what is right any more.
Jörgen @ Kreativ Fotografi
Title: Re: Duplicate Custom Fields in Product Children
Post by: Studio 42 on July 16, 2018, 00:17:51 AM
I have to add this feature in Vm Be Pro. I have done some tests and this can be painful when you have many parent products to disable or override.
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on July 16, 2018, 17:20:50 PM
QuoteI have done some tests and this can be painful when you have many parent products to disable or override.

Having had a client recently who configured 100's of products to a parent pattern ( should have used different patterns) and then had this same problem can agree it is not ideal when u want to remove/change them.
Also plagued with be unable to delete duplicate custom fields and have to leave them just disabled.. haven't looked into this
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on July 29, 2018, 16:10:15 PM
Is there any feature that will hide all Duplicate Custom Fields from parent product in product children?
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on July 29, 2018, 16:51:09 PM
if u know the index of the ones that are correct u can do it in the template display loop

but u have to be sure that the index is consistant ( they are returned as a numeric array of the layout position )
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on July 31, 2018, 12:02:42 PM
I do not know how to do this :(
i have two positions (product and product list):
Quoteecho shopFunctionsF::renderVmSubLayout('customfields',array ('product'=>$product,'position'=>'front-param'));
Quoteecho shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'ontop'));

How to separate it and hide duplicates or parrent products?
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on July 31, 2018, 18:51:37 PM
in the sublayout I guess in the loop look for dupes ...but how do u know which is the correct one?
but if u can't code then u need to hire a coder
or manually remove the dupes in the DB etc..
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on August 01, 2018, 09:35:44 AM
I found this solution in CSVI - support for "custom_disabler"
Maybe it will solve my problem.

https://csvimproved.com/support/import/1120-product-import-with-custom-fields
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on August 01, 2018, 15:38:42 PM
that is this

so u mean re-import them?

Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on August 01, 2018, 22:10:26 PM
Yes. I will export to CSV and in LibreOffice i will change all productchild  for column "custom_disabler" from "Y" to "N".
After importing this changes, everything should be turned off. This component is not cheap, but I think I have no choice but to buy it. :( It will be useful for the future ;-)
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on August 02, 2018, 10:56:12 AM
if it is only the product custom fields table u want to change u can export in csv and re-import directly with phpmyadmin in your hosting area

you don't need 3rd party software like csvi to do this
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on August 03, 2018, 16:18:41 PM
I have 112 positions of custom fields and 1730 products with this fields. In db table "virtuemart_product_customfields" in column "disabler" i have 39000 positions for different numbers of options from fields or if this no checked this is number 0...  ::)

list in child product in tab with parameters from custom fields should have "select all" checkbox. It would be faster...
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on August 03, 2018, 16:37:20 PM
ouch ...  u have my sympathy

just meant u don't need csvi to do this as its just a single table

csvi comes into its own when importing complete products etc a there are so many crosslinked tables etc
Title: Re: Duplicate Custom Fields in Product Children
Post by: Milbo on August 04, 2018, 14:37:24 PM
Actually, there is a tool in "tools" which removes customfields from children, when they are already inherited from the parent. Make a backup first.
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on August 09, 2018, 13:37:58 PM
My problem has been solved (with the CSVI component) in this forum :) :
https://csvimproved.com/forum?view=topic&defaultmenu=1054&catid=44&id=34445&limitstart=0
Title: Re: Duplicate Custom Fields in Product Children
Post by: Milbo on August 10, 2018, 10:17:19 AM
 vm3 provides a button in the tool view, which does it. "Remove old vm2 inherited customfields" in the tab migration. Just for the future
Title: Re: Duplicate Custom Fields in Product Children
Post by: hazael on August 12, 2018, 12:35:45 PM
I understand, but I did not want to delete all custom fields in child products - just duplicates. Children's products have their own custom fields that differ from the parent's products. They display double. The child product displays its custom field and same the parent product field - this is an bug. By default, the child should replace the parent.
I removed duplicates using CSVI. I replaced  custom field values from the parent product with a child product. :-)
Title: Re: Duplicate Custom Fields in Product Children
Post by: artemiy on May 06, 2020, 10:57:07 AM
Hello everyone,

I've been advised to report about VM issue here.
In short: I use RO CSVI Pro to import products.
Some customfields are inherited from parent product. Each child has "disable" option for those customfields. With CSVI pro I'm trying to activate "disabled" option, but I get duplicate and disabled at the same time instead just disabled.

Expectations
(https://rolandd.com/support?controller=attachment&task=download&tmpl=component&id=14142)

And reality
(https://rolandd.com/support?controller=attachment&task=download&tmpl=component&id=14143)

Here's what RolandD replied me

Good morning,

Your file is correct and RO CSVI is correct, in my findinds VirtueMart is doing some weird things. The import runs as expected and does the same as what VirtueMart does when you manually set the disabler option.

So I imported your file and on the child product I enabled the disabler in VirtueMart. This was saved. So I compared this to what is imported and that is the same. Now in the child product I removed the disabler and saved it in VirtueMart, suddenly this product has the custom field 4x. This is 2x the same one, so they are double. If I repeat this process, the product gets the fields duplicated again. You can try it as well.

After import in the database they are not duplicate, but only on screen.

Something weird is going on in VirtueMart, from the view of RO CSVI, the database is as needed. This is something you may need to report to the VirtueMart team.

Your import file is fine from what I can see.


Any thoughts?
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on May 06, 2020, 11:56:10 AM
this problem has been reported to the devs and I think fixed in the forth coming VM3.8.x
Title: Re: Duplicate Custom Fields in Product Children
Post by: artemiy on May 06, 2020, 12:10:59 PM
Anyone knows approximate release date?
Title: Re: Duplicate Custom Fields in Product Children
Post by: GJC Web Design on May 06, 2020, 12:15:02 PM
Its in final testing afaik
Title: Re: Duplicate Custom Fields in Product Children
Post by: artemiy on May 08, 2020, 19:20:38 PM
Upgraded to VirtueMart 3.8.0 10319.
No changes, unfortunately ((

Title: Re: Duplicate Custom Fields in Product Children
Post by: pinochico on May 08, 2020, 19:47:14 PM
Super,

if fixed this bug, maybe Virtuemart Dev Team fixed another bug related to work with customfield in administration, reported from Breakdesign:

http://forum.virtuemart.net/index.php?topic=144239

It stays from January 28, 2020 still.

Thanks



Title: Re: Duplicate Custom Fields in Product Children
Post by: artemiy on May 13, 2020, 16:38:07 PM
Hello everyone,
No news according the issue?
Title: Re: Duplicate Custom Fields in Product Children
Post by: balai on May 15, 2020, 10:49:37 AM
The custom fields inheritance feature, is a flaw in the 1st place. Either in terms of performance and user friendliness.
At least there should be a way to disable it through the configuration.

Imagine the extra work that needs to be done, to disable several custom fields in thousands of child products.
Using a db query can be a solution, but not regular admins are familiar with this.

Quoteif fixed this bug, maybe Virtuemart Dev Team fixed another bug related to work with customfield in administration, reported from Breakdesign:
Welcome to reality. Almost none of my reported issues got a reply, not to mention total absence of update about the issues status.
That's the price for using a forum as an issue tracker.