News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Add discount to product using a plugin

Started by mesie, September 23, 2012, 01:23:37 AM

Previous topic - Next topic

mesie

Hi

i'm trying to build a plugin where i want to temporaly give a discount to some products when some rules are true.
I've found that i can add this discount when the product is added to cart by editing file components/com_virtuemart/controllers/cart.php

The problem is that i need to set this discount when a user views this product or when he views the category that the product belongs.
Anybody knows a way to call a virtuemart's function to do this?

mesie

Maybe i can do it with modifyPrice( $product, $field,$param,$selected ) but does anyone know how to use it??