News:

Support the VirtueMart project and become a member

Main Menu

Modify cart variable php

Started by Nicola1008, March 27, 2017, 18:31:53 PM

Previous topic - Next topic

Nicola1008

Hi,

it's some day that I have to do this thing but I can't and I haven't found anything searching on Web.

I want to change the value of some cart's variables in the PHP file. For example, if the "totalproductprice" is less than 50€ I have to increase the shipping of 5€. To do this I thought to edit from PHP the shipping cost variable for example $shipping = $shipping + 5.

So, in this way in the cart the user see this increase of price but when for example he makes the payment with PayPal (or in other way) the addition of 5€ is not applied and in fact in the administrator --> orders I can't see the addition of 5€.

I hope I have explained what I want to do.

Please, reply me! Thank you!

Studio 42

You have to hack the payment plugin to add your additional rules

Nicola1008

Quote from: Studio 42 on March 28, 2017, 02:00:17 AM
You have to hack the payment plugin to add your additional rules

I tried to change the variable in PHP file (for example $name_of_variable += 5) but it seems that this variable is only a "visual" variable and not the correct variable that will be saved within the order, so I don't know how to do