Jump to content
Johnson

[CONTRIBUTION] Max Orders

Recommended Posts

This simple mod is a variation on Minimum price to order V1.7 by Joachim de Boer.

It sets a credit limit on a per order/customer basis.It is compliant with multiple

currencies, and each customer's credit limit can be set using the admin>customers

module. The default limit is set in the max_order.sql file. You may change this

before you execute the file or change it directly in the database - there is no

provision for changing the default setting through the admin interface at this stage.

 

HOW IT WORKS

 

The customers credit limit is checked at log on and again when they click the checkout

button. If the cart total exceeds their credit limit they are redirected to a page

displaying how much above their credit limit the order is, with a link to the contact_us

page. The limit is checked before shipping is calculated.


Matti Ressler

 

We were all once expert at...... nothing

_____

Share this post


Link to post
Share on other sites

@Johnson

Old thread...and pretty simple mod, but I installed this yesterday and today, 2 out of 5 customers so far, have had issues with completing a transaction with far less than the max_value entry in the DB (I currently have it set to 2499.99).  One customer's cart was only ~$150, but he was still directed from checkout_shipping to the max_order page.  Both were new customers, and had just set up their accounts.  But I tested new account functionality immediately after installation, with no issues whatsoever.  In addition, other transactions went through just fine.  

I'm waiting to hear back from the customers on device type, OS, and browser, but I can't understand what might have happened...thoughts?

 

Share this post


Link to post
Share on other sites

Well..for anyone else that needs something like this, in create_account_success.php add:

  $max_order_query = tep_db_query("SELECT max_order FROM " . TABLE_CUSTOMERS . " WHERE customers_id = '" . $_SESSION['customer_id'] ."'");
  $max_order_result = tep_db_fetch_array($max_order_query);
  $max_order = $max_order_result['max_order'];
  tep_session_register('max_order');

Just below:

require(DIR_WS_INCLUDES . 'template_top.php');

And in checkout_shipping.php, add:

    if (isset($_SESSION['max_order'])) {
            $max_order = $_SESSION['max_order'];
    }

just above:

  if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  } 

 

This fixed it for me...or some part of it did =P

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×