Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2017
    Location
    White City
    Posts
    15
    Plugin Contributions
    0

    Default Minimum Order plugin converted to Maximum Order

    Due to postal regulations foreign orders have a max order value of $2500.

    So I am trying to use the Minimum Order plugin that i converted to work as a Maximum Order plugin and it works.

    The problem I am running in to is I only want the plugin to run on International orders. I haven't been able to make the plugin only work for International orders.

    I thought something like this would work but it just breaks my site. (My International zone is 2)

    // bof: International Shipping
    if (!IS_ADMIN_FLAG) {
    global $cart;
    if ($this->enabled == true && $check->fields['zone_id'] = 2) {
    $this->enabled = true;
    } else {
    $this->enabled = false;
    }
    }
    // eof: International Shipping

    Any help how to add a international only function to the plugin would be very helpful.
    I am really surprised this is something that there is not a fix for already.
    Thanks in advance.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Minimum Order plugin converted to Maximum Order

    Quote Originally Posted by kadeepro View Post
    Due to postal regulations foreign orders have a max order value of $2500.

    So I am trying to use the Minimum Order plugin that i converted to work as a Maximum Order plugin and it works.

    The problem I am running in to is I only want the plugin to run on International orders. I haven't been able to make the plugin only work for International orders.

    I thought something like this would work but it just breaks my site. (My International zone is 2)

    // bof: International Shipping
    if (!IS_ADMIN_FLAG) {
    global $cart;
    if ($this->enabled == true && $check->fields['zone_id'] = 2) {
    $this->enabled = true;
    } else {
    $this->enabled = false;
    }
    }
    // eof: International Shipping

    Any help how to add a international only function to the plugin would be very helpful.
    I am really surprised this is something that there is not a fix for already.
    Thanks in advance.
    For one, the "check" does an assignment rather than a validation because of a missing "=":
    Code:
    // bof: International Shipping
     if (!IS_ADMIN_FLAG) {
    global $cart;
    if ($this->enabled == true && $check->fields['zone_id'] == 2) {
    $this->enabled = true;
    } else {
    $this->enabled = false;
    }
     }
     // eof: International Shipping
    There is though a "method" to evaluate whether a destination is international or not as seen in the checkout_shipping header file:
    Code:
      $pass = true;
      $free_shipping = false;
      if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
        $pass = false;
    
        switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
          case 'national':
            if ($order->delivery['country_id'] == STORE_COUNTRY) {
              $pass = true;
            }
            break;
          case 'international':
            if ($order->delivery['country_id'] != STORE_COUNTRY) {
              $pass = true;
            }
            break;
          case 'both':
            $pass = true;
            break;
        }
    
        if ( ($pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          $free_shipping = true;
        }
      }
    While the above relates to free shipping, the principle is the same, basically if the delivery location isn't in the same country as the store, then it is obviously "international" to the store... There perhaps could be other such associations, but it is more "generic" (and easier to maintain) to identify nationality as related to the store rather than some other adjustable defined area...

    Anyways, when the store "breaks" with trying the above modified code, there should be a myDebug log file in the logs directory (for ZC 1.5.1 and above) the contents of which should help identify the issue and a potential solution. I would further suggest that this discussion be carried out in the associated forum thread if one exists for that plugin, that way those more familiar with the plugin could help and/or benefit from the discussion. I am not specifically familiar with it to guide much further.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. Easy Populate Minimum Order/Order Units
    By jdnp in forum General Questions
    Replies: 3
    Last Post: 24 May 2010, 04:30 AM
  2. Maximum order
    By Fidz in forum General Questions
    Replies: 2
    Last Post: 14 Apr 2009, 04:55 PM
  3. Setting minimum order for check/money order only
    By coldspag in forum Managing Customers and Orders
    Replies: 0
    Last Post: 26 Nov 2008, 02:18 PM
  4. Opening order minimum and re-order minimums - possible in ZC?
    By CreativeWitch in forum General Questions
    Replies: 1
    Last Post: 20 Jan 2007, 06:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR