Originally Posted by
kadeepro
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.
Bookmarks