Hi everybody.
A small introduction. Imagine you have a t-shirt store. You need Size customfield, maybe color one. In your store you have 1000 products, so in your virtuemart_product_customfields table you have 6000 entries. That's a lot.
In virtuemart 2 I found a trick. I only asigned size and colour in one product. Then copy the customfields template html output and paste in the whole template. In helpers/cart.php i commented:
// $product -> customfieldsCart = empty($tmpProduct -> customfieldsCart)? array(): $tmpProduct -> customfieldsCart;
With this little hack, all products in cart had the size and colour customfields.
Now in vm3 is more dificult. In helpers/cart.php the function "add" check customfields with this line:
$product->customfields = $customFieldsModel->getCustomEmbeddedProductCustomFields($product->allIds,0,1);
Ok, i've developed a plugin that extends virtuemartCart and links a custom vmprices.js in the frontend. When i debug the cart, the products have "fake" customfields (ok, that's good), but are not showing in the cart, neither in orders because product customfields are checked more times with the function getCustomEmbeddedProductCustomFields.
Is there anyway to make this work again without hacking the core? Maybe a pluggin that modify the product in the cart and in the order?
Thanks a lot.