If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Disable Minimum order value for user

Disable Minimum order value for user

Started by solo_400 on 21 Jan 2013, 12:06 PM · Views: 760

Results 1 to 3 of 3
21 Jan 2013, 12:06 PM
#1
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Disable Minimum order value for user

Is there a way to disable Minimum order value for a specified user ?

thank you

21 Jan 2013, 3:56 PM
#2
jc8125 avatar

jc8125

Zen Follower

Join Date:
Oct 2007
Posts:
143
Plugin Contributions:
0

Re: Disable Minimum order value for user

we've edited the minimum order amount to be disabled if you're logged in as admin.. you could do something similar for a specific user..

in the file includes/classes/observers/class.minimum_order_amount.php, change this code:

if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
            $_SESSION['valid_to_checkout'] = false;
            $messageStack->add('shopping_cart', sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)) . '<br />', 'caution');

to this:

if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT && $_SESSION['customer_id'] != '9999') {
            $_SESSION['valid_to_checkout'] = false;
            $messageStack->add('shopping_cart', sprintf(TEXT_ORDER_UNDER_MIN_AMOUNT, $currencies->format(MIN_ORDER_AMOUNT)) . '<br />', 'caution');

and right below it, changed this code:

if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT) {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

to this:

if ($_SESSION['cart']->count_contents() > 0 && MIN_ORDER_AMOUNT > 0) {
          if($_SESSION['cart']->show_total() < MIN_ORDER_AMOUNT && $_SESSION['customer_id'] != '9999') {
            zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));

just tested quickly and it seems to work, but as always test on a backup before applying to live site. and obviously, replace '9999' with the customer_id in questions..

22 Jan 2013, 8:48 AM
#3
solo_400 avatar

solo_400

Zen Follower

Join Date:
Aug 2009
Posts:
369
Plugin Contributions:
0

Re: Disable Minimum order value for user

Thank you so much , works very well !