Originally Posted by
keneso
Thank you.
I know my English comprehension is causing me some difficulties ... so please bare with me.
What do you mean by " if admin enabled" and "then enabled if enabled in admin"?
modules > shipping > free shipping options
-- enable Free Options Shipping: true
-- shipping Cost: 0
-- handling Fee: 0
-- total >=: 100
-- total <=:
-- weight >=:
-- weight <=
-- item count >=
-- item count <=
-- tax class: none
-- tax basis: shipping
-- shipping zone: none
-- sort order: 0
modules > shipping > USPS
Have not configure anything yet (still in local), and the default settings are in place, I guess I'd need to configure only the international rates only?
To address just the few things above...
If admin enabled or if enabled in admin are the same thing... Notice above that for free shipping options, the first line is: enable Free Options Shipping. The constant that is set there represents whether the option is enabled in admin or not. (Ie. if you are in your admin panel and disabled free shipping, would you want a customer to be offered free shipping?) I would think the answer would be no. :)
The "words" (sometimes also called pseudo-code) identify the criteria that would be needed to be met and "translated" to computer code.
For the above free shipping, it is set to show when the total is >= 100 regardless of the destination. Basically that portion of the code takes care of itself and will be offered to the customer if the criteria is met of the total price equaling or exceeding the entry of 100 regardless of the destination zone.
As for USPS, yes if that "clone" will only be used for international purposes, then basically the code takes care of itself to not process through the US shipping (don't forget to consider what you define as US, because there are territories and other destinations that *are* part of the US, but not part of say the lower continental 48 states, or the 50 united states, etc...) and will only need to be setup for the international part.
Now as far as "specific" code... In ZC 1.5.4, the flat rate shipper code is in part:
Code:
// class constructor
function flat() {
global $order, $db;
$this->code = 'flat';
$this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE;
$this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER;
$this->icon = '';
$this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS;
$this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS;
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
$this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
}
if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag && $_SESSION['cart']->show_total() >= '100') { // This could be written to support the way the free shipper code is written so that as free shipper is modified, so is this section...
$check_flag = false;
}
/* // ie: Below is a portion of the free shipping options code for the total price of the cart. It deactivates this method of shipping if the current method has been identified as possible to be active and if the free shipping method is active.
if($check_flag) {
switch (true) {
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='' and MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// free shipping total should not need adjusting
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN and ($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$check_flag = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
if (($_SESSION['cart']->show_total()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
$check_flag = false;
}
break;
case ((MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX !='')):
// if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
if (($_SESSION['cart']->show_total()) <= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MAX) {
$check_flag = false;
}
break;
}
}
*/
if ($check_flag == false) {
$this->enabled = false;
}
}
}
Bookmarks