Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

can't get minimum order addon to work


brunner82

Recommended Posts

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. ;)

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 weeks later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...