News:

Looking for documentation? Take a look on our wiki

Main Menu

Customfields cache and overides/disabler

Started by midnas, April 22, 2015, 15:07:00 PM

Previous topic - Next topic

midnas

Dears,

I think I found issue. When you called getCustomEmbeddedProductCustomFields it returns you customfield, from database or from cache (if it was used before). That is perfect, but in case that you have parent product and some children have customfields overidden or disabled it can come to issue with cache.

Because overrides and disabler are not saved inside cache and when customfields is return from cache, this information isn't there.

This is the code that saves customfield into cache:
      foreach($productCustoms as $customfield){
         $hkey = (int)$customfield->virtuemart_product_id.$hashCwAttribute;
         $_customFieldByProductId[$hkey][] = $customfield;
      }

And few lines later overrides and disabler are checked, but aren't saved into cache.

I think it would be right that cache is saved just before  return $productCustoms;

I hope it's understandable.

Best Regards,
Sandi Mlinar