News:

Looking for documentation? Take a look on our wiki

Main Menu

How to change the payment fee calculation method?

Started by andorfy, May 14, 2020, 23:20:42 PM

Previous topic - Next topic

andorfy

I already read the FAQ about the calculation method of payment fees, here https://forum.virtuemart.net/index.php?topic=123359.0, and I understand why is it good usually, but I would like to change it to the "simple way".
So if I give a 5% discount to a $100 cart total amount, I would like to see a $95 sum.

Where should I change the code?

VirtueMart 3.6.10 10211
Joomla 3.9.18
PHP 7.3.17

pinochico

www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

andorfy

Thank you pinochico!

I found the file (/administrator/components/com_virtuemart/plugins/vmpsplugin.php), and changed, now it works as I would like.

I have only one last question. Is there any way to move this file somwhere else, to make it an override, so if I update the VM, it won't be overwritten with the new version?
I try to put it to the /templates/my_template_name/html/com_virtuemart/plugins/ folder, as the other overrides, but it didn't works.

GJC Web Design

move it into your payment plugins

have a look at most of the bundled payment methods .. they all over ride the function

function setCartPrices (VirtueMartCart $cart, &$cart_prices, $method, $progressive = true) {
    // your code
}
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