Author Topic: Duplicate Custom Fields in Product Children  (Read 757 times)

hazael

  • Beginner
  • *
  • Posts: 32
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Duplicate Custom Fields in Product Children
« on: July 13, 2018, 17:18:35 pm »
How to hide duplicates of custom fields from parent products in child products?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Duplicate Custom Fields in Product is Children
« Reply #1 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

hazael

  • Beginner
  • *
  • Posts: 32
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #2 on: July 14, 2018, 14:26:34 pm »
I have over 1k of such products. :-/ How to do it massively for all parent products?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Duplicate Custom Fields in Product is Children
« Reply #3 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3248
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Duplicate Custom Fields in Product is Children
« Reply #4 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 ?

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Duplicate Custom Fields in Product is Children
« Reply #5 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3248
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Duplicate Custom Fields in Product is Children
« Reply #6 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.



hazael

  • Beginner
  • *
  • Posts: 32
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #7 on: July 15, 2018, 18:50:13 pm »
Quote
Why 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

Jörgen

  • Global Moderator
  • Full Member
  • *
  • Posts: 1608
    • Kreativ Fotografi
  • VirtueMart Version: 3.2.12
Re: Duplicate Custom Fields in Product Children
« Reply #8 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
Joomla 3.8.3
Virtuemart 3.2.12
Olympiantheme Hera (customized)

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 3248
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Duplicate Custom Fields in Product Children
« Reply #9 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.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7885
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #10 on: July 16, 2018, 17:20:50 pm »
Quote
I 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
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

hazael

  • Beginner
  • *
  • Posts: 32
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #11 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?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7885
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #12 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 )
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

hazael

  • Beginner
  • *
  • Posts: 32
    • Biżuteria etniczna i orientalna
  • VirtueMart Version: 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #13 on: July 31, 2018, 12:02:42 pm »
I do not know how to do this :(
i have two positions (product and product list):
Quote
echo shopFunctionsF::renderVmSubLayout('customfields',array ('product'=>$product,'position'=>'front-param'));
Quote
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'ontop'));

How to separate it and hide duplicates or parrent products?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7885
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.14
Re: Duplicate Custom Fields in Product Children
« Reply #14 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..
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation