Paypal plugin calculating package fee with shipping cost included

Started by dannette, March 21, 2023, 21:58:02 PM

Previous topic - Next topic

dannette

Our client would like the 5% package fee to just be on the total order, not including shipping and tax, but it is including shipping and tax and then adding the 5% to that amount.
Scenario:
Item totals are $37.00
With tax items are $39.22
Shipping is $8.00
Payment should add 5% to $37.00 but it adds it on $47.22 - adding on $2.36 instead of $1.85
Total is $49.58 instead of $49.07

Also is there a way to exclude that addon fee for one category? I would imagine I'd have to edit the plugin, but could use help in knowing where to start.

In the Paypal plugin, I do have Cost Method Calculation set to fixed (not progressive).

Versions: Joomla 4.2.9 and Virtuemart 4.0.12

PS - are we going to get a new board for VM 4?

Jörgen

You total payment through Paypal is 47,22.

It consist of cart items 39,22 incl vat and 8,00 shipping.

Why should it only add to payment withaout tax ?

This works as expected IMHO.

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

dannette

The question is how to get it to NOT add 5% to the tax and shipping. We want 5% on the original total of $37 for the items, not on tax and shipping too.

GJC Web Design

the calc is done in the administrator\components\com_virtuemart\plugins\vmpsplugin.php

but u can over ride this is the plugin by adding the function

see for example the weight shipping plugin

   function getCosts (VirtueMartCart $cart, $method, $cart_prices) {

      if ($method->free_shipment && $cart_prices['salesPrice'] >= $method->free_shipment) {
         return 0.0;
      } else {
         if(empty($method->shipment_cost)) $method->shipment_cost = 0.0;
         if(empty($method->package_fee)) $method->package_fee = 0.0;
         return $method->shipment_cost + $method->package_fee;
      }
   }
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation