Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / hangup in checkout sequence, related to shipping module

hangup in checkout sequence, related to shipping module

Locked

Views: 1,568

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
12 Jun 2009, 7:40 PM
#1
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

hangup in checkout sequence, related to shipping module

so, today was the first time i had been on my site in a while... actually going thru the checkout process.

i am hanging up on step 1 of 3...

it comes to the page, and says "This is currently the only shipping method available to use on this order." however, there is nothing listed there.

i have free shipping for orders over $75, and otherwise, zone shipping setup.

i noticed the issue when i tried to set up a 10% off coupon earlier today. i disabled the coupon to go back to the root issue...

i have installed the debug tool, and have the cache folder set to 777, but am not getting any generated logs.

any suggestions?

https://www.customk9design.com

thanks as always!!

13 Jun 2009, 2:53 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

What are your shipping settings for your Zone Rate shipping module?

Do your products have weight?

If not, is 0 weight set to NOT be free shipping in the Shipping/Packaging? What are the settings in Shipping/Packaging?

13 Jun 2009, 3:30 AM
#3
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: hangup in checkout sequence, related to shipping module

ajeh, here are my settings... thanks for taking the time to take a look at this for me!
-ginny

settings for free shipping:
Free Options is used to display a Free Shipping option when other Shipping Modules are displayed. It can be based on: Always show, Order Total, Order Weight or Order Item Count. The Free Options module does not show when Free Shipper is displayed.

Setting Total to >= 0.00 and <= nothing (leave blank) will activate this module to show with all shipping modules, except for Free Shipping - freeshipper.

NOTE: Leaving all settings for Total, Weight and Item count blank will deactivate this module.

NOTE: Free Shipping Options does not display if Free Shipping is used based on 0 weight is Free Shipping. See: freeshipper

Enable Free Options Shipping
True

Shipping Cost
0.00

Handling Fee
0

Total >=
75.00

Total <=

Weight >=

Weight <=

Item Count >=

Item Count <=

Tax Class
--none--

Tax Basis
Shipping

Shipping Zone
--none--

Sort Order
0

settings for zone:
Zone Based Rates

Enable Zones Method
True

Calculation Method
Price

Tax Class
--none--

Tax Basis
Shipping

Sort Order
0

Skip Countries, use a comma separated list of the two character ISO country codes
US

Zone 1 Countries
CA, MX

Zone 1 Shipping Table
40:15.00,99.99:28.00,10000:35.00

Zone 1 Handling Fee
0

Zone 2 Countries
00

Zone 2 Shipping Table
40:15.00,99.99:40.00,10000:48.00

Zone 2 Handling Fee
0

Zone 3 Countries

Zone 3 Shipping Table

Zone 3 Handling Fee
0

13 Jun 2009, 4:16 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

So from these settings you have no shipping for the US unless I order more than $75.00 worth and then the Free Shipping Option will display ... is this correct?

NOTE: Trying to buy more than quantity 1 is a pain on your site as I have to try to find the product I want and re-add it to the cart as there are no Add to Cart boxes ... :unsure:

14 Jun 2009, 1:37 AM
#5
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: hangup in checkout sequence, related to shipping module

ajeh,

ok, so i dont know how i missed the US not having shipping... i had someone go thru the checkout before... and i did several test runs... with no problem, i have NO idea where/how it got changed.

needless to say, i added the US back in to zones, made it zone one, moved canada and mexico to zone 2, and everyone else to zone 3...

seems to be working ok now.

so, two other things..

  1. as for the quantity thing, i have very few customers who order more than one of an item, and if they do, they are often different sizes... like one small collar and one large collar. i disabled all the multi quantity stuff for most of the items (some of the toys have multi boxes) to 'force'' the customer to enter size information for each item.

  2. back to the shipping thing, only issue i have now, if you are in the US, and have more than $75 total, you get two shipping options, free shipping, and shippiing for $0. any way to eliminate the 2nd one?

THANKYOUTHANKYOUTHANKYOU!!!

-ginny

14 Jun 2009, 3:50 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

If only the US gets Free Shipping for over $75 and you finally have US in the Zone Rate ...

Set the last amount on US to be 75:0.00 and turn off the Free Shipping Options freeoptions as you really do not need that one since Zone Rate zones can cover it ...

If, however, you like the look of the Free Shipping Option freeoptions, then you need to do some customization on the Zone Rate zones shipping module to not show when the amount is $0.00 ...

14 Jun 2009, 4:14 AM
#7
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: hangup in checkout sequence, related to shipping module

so, i guess thats what im not sure how to do... i have to keep the freeshipping module running, to work with my free shipping notifier on my shopping cart...

any suggestions on modifying the zones module?

15 Jun 2009, 1:36 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

Surround the quote with an IF so that it doesn't show when the value is 0.00 ...

15 Jun 2009, 3:31 PM
#9
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: hangup in checkout sequence, related to shipping module

ajeh, thanks so much for your help! i hope you can take a quick moment to take it one step further.... i understand what you mean by an "if" statement, but im not sure how to write one or where to put it. below is my zones module, can you take a moment to show me where/what i should change?

fyi, zone one is US (which is the only one i need to disable the $0 over $75total option... i dont offer free shipping for international)

  class zones {
    var $code, $title, $description, $enabled, $num_zones;

// class constructor
    function zones() {
      $this->code = 'zones';
      $this->title = MODULE_SHIPPING_ZONES_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_ZONES_SORT_ORDER;
      $this->icon = '';
      $this->tax_class = MODULE_SHIPPING_ZONES_TAX_CLASS;
      $this->tax_basis = MODULE_SHIPPING_ZONES_TAX_BASIS;

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
      }

      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
      $this->num_zones = 3;
    }

// class methods
    function quote($method = '') {
      global $order, $shipping_weight, $shipping_num_boxes, $total_count;
      $dest_country = $order->delivery['country']['iso_code_2'];
      $dest_zone = 0;
      $error = false;

    $order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;

      for ($i=1; $i<=$this->num_zones; $i++) {
        $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
        $countries_table = strtoupper(str_replace(' ', '', $countries_table));
        $country_zones = split("[,]", $countries_table);
        if (in_array($dest_country, $country_zones)) {
          $dest_zone = $i;
          break;
        }
        if (in_array('00', $country_zones)) {
          $dest_zone = $i;
          break;
        }
      }

      if ($dest_zone == 0) {
        $error = true;
      } else {
        $shipping = -1;
        $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);

        $zones_table = split("[:,]" , $zones_cost);
        $size = sizeof($zones_table);
        $done = false;
        for ($i=0; $i<$size; $i+=2) {
          switch (MODULE_SHIPPING_ZONES_METHOD) {
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Weight'):
              if (round($shipping_weight,9) <= $zones_table[$i]) {
                $shipping = $zones_table[$i+1];

                switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
                case (0):
                  $show_box_weight = '';
                  break;
                case (1):
                  $show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
                  break;
                case (2):
                  $show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
                  break;
                default:
                  $show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
                  break;
                }

//                $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . (SHIPPING_BOX_WEIGHT_DISPLAY >= 2 ? ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS : '');
                $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
                $done = true;
        if (strstr($zones_table[$i+1], '%')) {
          $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
        } else {
          $shipping = $zones_table[$i+1];
        }
                break;
        	    }
      	    break;
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Price'):
// shipping adjustment
              if (($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices()) <= $zones_table[$i]) {
                $shipping = $zones_table[$i+1];
                $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country;
        if (strstr($zones_table[$i+1], '%')) {
          $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
        } else {
          $shipping = $zones_table[$i+1];
        }
                $done = true;
                break;
	            }
	          break;
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):
// shipping adjustment
              if (($total_count - $_SESSION['cart']->free_shipping_items()) <= $zones_table[$i]) {
                $shipping = $zones_table[$i+1];
                $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country;
                $done = true;
        if (strstr($zones_table[$i+1], '%')) {
          $shipping = ($zones_table[$i+1]/100) * $order_total_amount;
        } else {
          $shipping = $zones_table[$i+1];
        }
                break;
  	          }
	          break;
          }
          if ($done == true) {
            break;
          }
        }

        if ($shipping == -1) {
          $shipping_cost = 0;
          $shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
        } else {
          switch (MODULE_SHIPPING_ZONES_METHOD) {
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Weight'):
              // charge per box when done by Price
              $shipping_cost = ($shipping * $shipping_num_boxes) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
              break;
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Price'):
              // don't charge per box when done by Price
              $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
            break;
        	  case (MODULE_SHIPPING_ZONES_METHOD == 'Item'):
              // don't charge per box when done by Item
              $shipping_cost = ($shipping) + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
            break;
          }
        }
      }
      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost)));

      if ($this->tax_class > 0) {
        $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
      }

      if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);

      if (strstr(MODULE_SHIPPING_ZONES_SKIPPED, $dest_country)) {
        // don't show anything for this country
        $this->quotes = array();
      } else {
        if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
      }

      return $this->quotes;
    }

    function check() {
      global $db;
      if (!isset($this->_check)) {
        $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ZONES_STATUS'");
        $this->_check = $check_query->RecordCount();
      }
      return $this->_check;
    }

    function install() {
      global $db;
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Zones Method', 'MODULE_SHIPPING_ZONES_STATUS', 'True', 'Do you want to offer zone rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Calculation Method', 'MODULE_SHIPPING_ZONES_METHOD', 'Weight', 'Calculate cost based on Weight, Price or Item?', '6', '0', 'zen_cfg_select_option(array(\'Weight\', \'Price\', \'Item\'), ', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ZONES_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_ZONES_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
      $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Skip Countries, use a comma separated list of the two character ISO country codes', 'MODULE_SHIPPING_ZONES_SKIPPED', '', 'Disable for the following Countries:', '6', '0', 'zen_cfg_textarea(', now())");

      for ($i = 1; $i <= $this->num_zones; $i++) {
        $default_countries = '';
        if ($i == 1) {
          $default_countries = 'US,CA';
        }
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Countries', 'MODULE_SHIPPING_ZONES_COUNTRIES_" . $i ."', '" . $default_countries . "', 'Comma separated list of two character ISO country codes that are part of Zone " . $i . ".<br />Set as 00 to indicate all two character ISO country codes that are not specifically defined.', '6', '0', 'zen_cfg_textarea(', now())");
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Zone " . $i ." Shipping Table', 'MODULE_SHIPPING_ZONES_COST_" . $i ."', '3:8.50,7:10.50,99:20.00', 'Shipping rates to Zone " . $i . " destinations based on a group of maximum order weights/prices. Example: 3:8.50,7:10.50,... Weight/Price less than or equal to 3 would cost 8.50 for Zone " . $i . " destinations.<br />You can end the last amount as 10000:7% to charge 7% of the Order Total', '6', '0', 'zen_cfg_textarea(', now())");
        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Zone " . $i ." Handling Fee', 'MODULE_SHIPPING_ZONES_HANDLING_" . $i."', '0', 'Handling Fee for this shipping zone', '6', '0', now())");
      }
    }

    function remove() {
      global $db;
      $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      $keys = array('MODULE_SHIPPING_ZONES_STATUS', 'MODULE_SHIPPING_ZONES_METHOD', 'MODULE_SHIPPING_ZONES_TAX_CLASS', 'MODULE_SHIPPING_ZONES_TAX_BASIS', 'MODULE_SHIPPING_ZONES_SORT_ORDER', 'MODULE_SHIPPING_ZONES_SKIPPED');

      for ($i=1; $i<=$this->num_zones; $i++) {
        $keys[] = 'MODULE_SHIPPING_ZONES_COUNTRIES_' . $i;
        $keys[] = 'MODULE_SHIPPING_ZONES_COST_' . $i;
        $keys[] = 'MODULE_SHIPPING_ZONES_HANDLING_' . $i;
      }

      return $keys;
    }
  }
?>
15 Jun 2009, 6:31 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

One way to hide it is to use:

if ($dest_zone == 1 && ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() >= 75)) {
  // do not show when Zone 1 >= 75.00
} else {
      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost)));
}

where $dest_zone == 1 is the Zone 1 definition ...

11 Aug 2009, 9:28 PM
#11
customk1 avatar

customk1

Zen Follower

Join Date:
Mar 2009
Location:
Cornelius, NC
Posts:
334
Plugin Contributions:
0

Re: hangup in checkout sequence, related to shipping module

Linda, sorry to drag up an old post... i am JUST now getting around to applying your recommendation, however whenever i copy/paste your code above into my shipping zones file... it breaks. ie, cant load checkout on frontside and shipping tables in admin are messed up.

can you please clarify a little further what/how i should be modifying my zone.php file?

thanks

12 Aug 2009, 4:04 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: hangup in checkout sequence, related to shipping module

In the zones.php there is a section of code around line 235 that reads:

      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost)));

That is building the quote ...

What you want to do is "not" show that quote for Zone 1 IF the amount >= $75.00 ...

So, you can use this IF statement around the original code:

if ($dest_zone == 1 && ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() >= 75)) {
  // do not show when Zone 1 >= 75.00
} else {
      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => $shipping_method,
                                                     'cost' => $shipping_cost)));
}