News:

Looking for documentation? Take a look on our wiki

Main Menu

Add custom plugin data to product

Started by sandomatyas, October 26, 2016, 14:41:38 PM

Previous topic - Next topic

sandomatyas

I want to create a plugin which writes data to the productdetails page or the addtocart area based on the product's data and the plugin's settings without any template override.

E.g. the plugin checks the product price and if the price is under a limit (which is a plugin parameter) writes a link (which is an other parameter), if it's above a limit writes an other text, etc. So I need product data and plugin settings, too.

I can create a customfield plugin but I have to add mannually to the products which isn't a thing what I need. I can do it with template override but the goal is writing a template-independent solution which uses VM customfield postitions to display data.

How should I start whith this?

Milbo

Use a product pattern, create the customfield one time there and the other children have it automatically
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

sandomatyas

But there are >3000 existing products, multi variants, other parent-child products, etc.
It doesn't sounds good.

Milbo

Why not? you can use one sql to update all products to the new parent product
Read my chapter about caching please https://docs.virtuemart.net/manual/general-concepts/223-caches.html

"It is important to know that VirtueMart has a lot static caching variables to deliver the already produced result directly. Lets say we display a product group, derivated from one parent, then the parent product is loaded only once for all children. "
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/