brunner82 Posted November 12, 2013 Posted November 12, 2013 this is pretty vital to my store as i have some small stuff and if it is solely ordered i end up losing money. i have used this on the addons page http://addons.oscommerce.com/info/8714 i uploaded the sql file to the config in php myadmin. and then i edited my two files per below. i do see the option in the admin side to adjust the minimum order amount. but on the customer side it does nothing and lets them proceed to checkout. Minimum Order ========================= This contribution will add a configuration option that will allow you to specify a minimum order total that must be met before allowing checkout. This contribution is released under the GPL license. If you have any problems or questions please post a message in the Minimum Order topic in the Contributions section of the osCommerce support forums. ***************** Following are the steps to implement this contribution into your store. Import the min_order.sql file into mysql using either PHPMyAdmin or the command line. Then in Admin ~ Configuration ~ My store at the bottom you will see Minimum Order Amnout. Enter the amount that you want as your order minimum. ***************** In checkout_process.php pages after around line #47 require(DIR_WS_CLASSES . 'order.php'); $order = new order; add the following lines: // check order total minimum begin if ((MIN_ORDER_AMOUNT > 0) && ($order->info['total'] < MIN_ORDER_AMOUNT)) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode(sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, MIN_ORDER_AMOUNT, MIN_ORDER_AMOUNT - $order->info['total'])), 'NONSSL')); // check order total minimum end And in /includes/languages/english.php just before end of the page ?> // check order total minimum begin define('TEXT_ORDER_UNDER_MIN_AMOUNT', ' The minimum order to shipping is %s euros. You need to add another %s euros to be able to checkout.'); // check order total minimum end GO TO ADMIN MY STORE -> VERY END CHANGE THE AMOUNT. and that should do it. ;) Quote
brunner82 Posted November 13, 2013 Author Posted November 13, 2013 anyone? is this install readme wrong and im editing the wrong files? Quote
Stefan_MM Posted November 29, 2013 Posted November 29, 2013 Did you step through the whole order process? The module works only at the moment when the customer finally confirmes the order - at the very last step. Then there should be an error message and redirect to the cart. And it doesn't work with paypal express. Quote
♥joli1811 Posted November 29, 2013 Posted November 29, 2013 Paypal express will often bypass the normal order process including modifications you have made try with paypal standard. Regards Joli Quote To improve is to change; to be perfect is to change often.
Bob Terveuren Posted December 1, 2013 Posted December 1, 2013 Hi You could try adding that chunk of code // check order total minimum begin if ((MIN_ORDER_AMOUNT > 0) && ($order->info['total'] < MIN_ORDER_AMOUNT)) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART, 'error_message=' . urlencode(sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, MIN_ORDER_AMOUNT, MIN_ORDER_AMOUNT - $order->info['total'])), 'NONSSL')); // check order total minimum end Into checkout_shipping.php so folks would get caught there and returned to the cart try adding it after require(DIR_WS_CLASSES . 'order.php'); $order = new order; That's not going to beat paypal_express though so the idea there would be to use that chunk of code to intercept the call to PayPal express/pause checkout catalog\ext\modules\payment\paypal\express.php add that chunk in at line 120 (so after $order gets created and before shipping) Ideally you'd want to pop it into the cart page to hide the checkout bitton entirely but the paypal express button woudl still display as it sits in a world of it's own with respect to <div><p>and<span> Stefan_MM 1 Quote
Guest Posted January 10, 2014 Posted January 10, 2014 tried to insert code as mentioned above but no error.... customers can order no matter what.... and i dont use paypal at all Quote
Guest Posted January 10, 2014 Posted January 10, 2014 been looking at modules.... there is a single one for 2.3... http://addons.oscommerce.com/info/8714/v,23 but that one is blocks checkout.... what if i still want to allow people to do a store pickup? Quote
Guest Posted January 11, 2014 Posted January 11, 2014 btw.... tried a few modules.... if i get one to work i will still have one problem in that they block checkout in general... what i want to use it for is to block shipping options except one: store pickup the story behind is that i live in a small town where it does not make sense to be deliver if the order is not above a set minimum..... then you would say why not just mail the stuff.... well picture a family size pizza in an envelope and 2 days to get there.... :-D Quote
Guest Posted January 15, 2014 Posted January 15, 2014 no one able to help out? is there a way to get the module to NOT block store pickup option? Quote
a.forever Posted January 21, 2014 Posted January 21, 2014 no one able to help out? is there a way to get the module to NOT block store pickup option? It might be easier to block your already installed modules if they don't meet a certain requirement. Your code will become if ($order->info['total'] < XXXX) { $this->enabled = false; } XXXX is your minimum amount. This code translates to: If the order's total is smaller than XXXX, then this shipping module is not active. And this line of code would be posted in every shipping module you have installed, for each shipping module you want to disable. At least I think that's how it works. I haven't tested it myself. Quote
zwak Posted February 16, 2014 Posted February 16, 2014 I made min quantity check by changing tep_check_stock() function (in general.php) and changed shopping cart to show better message for it. a.forevers way should work, but doesn't give any feedback to customer. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.