How can you restrict orders to be above a certain minimum order value ?
How can you restrict orders to be above a certain minimum order value ?
Zen cart installation / maintenance / customisation / hosting
Supported Modules: Dutch language pack, Multi site, Dynamic Price Updater and more.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Hi, the Minimum Order plugin mentioned above is great (as is everyone who posts replies here on this lovely forum, thankyou so much by the way) it works very nicely by preventing the 'Go to checkout' button working unless they have hit the minimum order value.
But.. if I have the 'Checkout with paypal' module installed there is a button that will still take them out to pay pal to make their payment even though they are below the min order value.
I was wondering, there probably is a way to get this button to also check before working
but im not sure how (not good with code) anyone got an idea or fancy updating this plugin? Thank you in advance, George
While PayPal doesn't like it when you do, you have the option to entirely turn off that "Express Checkout Shortcut Button" inside your Express Checkout module settings.
Alternatively this might work too:
edit /includes/modules/payment/paypal/tpl_ec_button.php and add the section shown here:
You'll need to re-add that customisation during any Zen Cart upgrades you do.Code:// cart contents qty must be >0 and value >0 if ($_SESSION['cart']->count_contents() <= 0 || $_SESSION['cart']->total == 0) { $paypalec_enabled = false; } // enforce minimum order value if (defined('MIN_ORDER_AMOUNT') && MIN_ORDER_AMOUNT > 0 && $currencies->value($_SESSION['cart']->total, true, DEFAULT_CURRENCY) < MIN_ORDER_AMOUNT) { $paypalec_enabled = false; } // PayPal module cannot be used for purchase > $10,000 USD equiv if ($currencies->value($_SESSION['cart']->total, true, 'USD') > 10000) { $paypalec_enabled = false; }
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
FYI This module is incorporated in Zen Cart core.
Adjustments are made in Admin >> Configuration >> Minimum Values
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
Time passed for edit. This mod is not included in the current version.
A little help with colors.
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.
Hi, this is a really late reply but thank you DrByte your suggestion worked perfectly. I didn't see your original reply but i have just re discovered this thread after upgrading to ZC 1.5.8a and your tweak worked brilliantly, the Checkout with paypal just appears by magic once the order is above the threshold set, thank you. And in case anyone else finds this helpful the minimum order quantity plugin being discussed here works fine with 158a and php 8.1