VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: victoria_b on October 18, 2016, 13:44:01 PM

Title: HOW TO exclude Shipment fee on calculating Payment fee
Post by: victoria_b on October 18, 2016, 13:44:01 PM
Hello,
I am using VirtueMart 2.6.18 / Joomla! 2.5.24 and also the plugins "Shipping by Rules for Virtuemart" and "VP One Page Checkout".

So, on my eshop the client pays:

So, I have created one (1) shipment method named "Shipping by Courier" (please check the image attached to see the Shipment method Rules. Note that there are also calculations for the weight)
and two (2) Payment methods for each case:

It works great for all cases (for all order totals) except... :
When a client makes an order that costs e.g. 47.50 euros (amount<49) and he chooses for shipment "Shipping by Courier" the total amount becomes now 49.50 (+2€ for shipment).
So, If now he also chooses for payment "Cash on delivery", well... the payment amount is 0 (because of the new total) , while I want it to be 2 euros (as of the products total).
What I mean in a few words is that... I want the payment amount to be calculated as of the products total and NOT as of the Big Total where the shipment cost is also included.

I hope my english do not confuse you and I also hope of a prompt reply.
Thank you in advance for the help!
Victoria.
Title: Re: HOW TO exclude Shipment fee on calculating Payment fee
Post by: GJC Web Design on October 18, 2016, 15:34:56 PM
u don't say what payment method  .. I assume the standard

you need to hack the Checkconditions function .. possibly something as simple as

$amount = ($this->getCartAmount($cart_prices) - 2);

or extract from the cart object the net (no ship fee ) price
Title: Re: HOW TO exclude Shipment fee on calculating Payment fee
Post by: victoria_b on October 19, 2016, 08:36:58 AM
Thank you GJC for the reply.
Yes I meant the standard payment method.
Could you please give me more details on how to extract the net price?
Which file should I hack?
Thanks agaian
Victoria.
Title: Re: HOW TO exclude Shipment fee on calculating Payment fee
Post by: GJC Web Design on October 19, 2016, 11:18:24 AM
plugins\vmpayment\standard\standard.php
Title: Re: HOW TO exclude Shipment fee on calculating Payment fee
Post by: victoria_b on November 15, 2016, 12:54:21 PM
Hello again.
Well, I am sending you the file which I have to modify in order to help me out with the code.
So, could you please tell me which line of code I have to change and what to write?
I tried various things but nothing  :-[  and also I do not want to risk it because the site in online.

Thank you in advance!
Victoria.