Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] Max Orders


Guest

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.

Link to comment
Share on other sites

  • 14 years later...

@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?

 

Link to comment
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

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