Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 42
  1. #31
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: PHP error with the zone shipping module

    Do you have any checkout add ons?

    Can you post the full contents of your file:
    /includes/modules/pages/checkout_shipping/header_php.php

    What version of Zen Cart is this again?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  2. #32
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    Quote Originally Posted by Ajeh View Post
    Do you have any checkout add ons?

    Can you post the full contents of your file:
    /includes/modules/pages/checkout_shipping/header_php.php

    What version of Zen Cart is this again?
    One thing at a time:

    Sorry Linda I made a mistake in the previous reply...

    The correct answer is:

    Shipping From= Italy
    Shipping to = US, EU (all the state of UE)
    Weight = 1
    What I meant is that if the customer has a registered address outside IT (tha is the country code in the "Skip Countries" field) the error doesn't appear.
    The log error is written every time else, the only solution is to remove the IT code from the fied.

    Question 2:
    Yes I have few add on that modify checkout here the list:
    - Stock by attributes 1.5.1.2
    - Reward Point full 2.1b
    The zen cart version is 1.51.
    Note: even in a fresh new install i got the same error without any add-ons.

    Here the /includes/modules/pages/checkout_shipping/header_php.php
    PHP Code:
    <?php
    /**
     * Checkout Shipping Page
     *
     * @package page
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: header_php.php 18697 2011-05-04 14:35:20Z wilt $
     * Updated for Stock by Attributes 1.5.1.2 by POTTERYHOUSE
     */
    // This should be first line of the script:
      
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SHIPPING');

      require_once(
    DIR_WS_CLASSES 'http_client.php');

    // if there is nothing in the customers cart, redirect them to the shopping cart page
      
    if ($_SESSION['cart']->count_contents() <= 0) {
        
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
      }

    // if the customer is not logged on, redirect them to the login page
      
    if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
        
    $_SESSION['navigation']->set_snapshot();
        
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
      } else {
        
    // validate customer
        
    if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
          
    $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL''page' => FILENAME_CHECKOUT_SHIPPING));
          
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
        }
      }

    // Validate Cart for checkout
      
    $_SESSION['valid_to_checkout'] = true;
      
    $_SESSION['cart']->get_products(true);
      if (
    $_SESSION['valid_to_checkout'] == false) {
        
    $messageStack->add('header'ERROR_CART_UPDATE'error');
        
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      }

    // Stock Check
      
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {

            
    // START "Stock by Attributes"
            // Added to allow individual stock of different attributes
            
    unset($attributes);
            if(
    is_array($products[$i]['attributes'])){
                
    $attributes $products[$i]['attributes'];
            } 
            else{
                  
    $attributes null;
            }
        
            if(!empty(
    $attributes)){
                if (
    zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) {
                    
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
                    break;
                }
            }
            else{
          if (
    zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
        }
      }
        
    // END "Stock by Attributes"
     
    }

    // if no shipping destination address was selected, use the customers own address as default
      
    if (!$_SESSION['sendto']) {
        
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
      } else {
    // verify the selected shipping address
        
    $check_address_query "SELECT count(*) AS total
                                FROM   " 
    TABLE_ADDRESS_BOOK "
                                WHERE  customers_id = :customersID
                                AND    address_book_id = :addressBookID"
    ;

        
    $check_address_query $db->bindVars($check_address_query':customersID'$_SESSION['customer_id'], 'integer');
        
    $check_address_query $db->bindVars($check_address_query':addressBookID'$_SESSION['sendto'], 'integer');
        
    $check_address $db->Execute($check_address_query);

        if (
    $check_address->fields['total'] != '1') {
          
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
          
    $_SESSION['shipping'] = '';
        }
      }

      require(
    DIR_WS_CLASSES 'order.php');
      
    $order = new order;

    // register a random ID in the session to check throughout the checkout procedure
    // against alterations in the shopping cart contents
    if (isset($_SESSION['cart']->cartID)) {
      if (!isset(
    $_SESSION['cartID']) || $_SESSION['cart']->cartID != $_SESSION['cartID']) {
        
    $_SESSION['cartID'] = $_SESSION['cart']->cartID;
      }
    } else {
      
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }

    // if the order contains only virtual products, forward the customer to the billing page as
    // a shipping address is not needed
      
    if ($order->content_type == 'virtual') {
        
    $_SESSION['shipping'] = 'free_free';
        
    $_SESSION['shipping']['title'] = 'free_free';
        
    $_SESSION['sendto'] = false;
        
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
      }

      
    $total_weight $_SESSION['cart']->show_weight();
      
    $total_count $_SESSION['cart']->count_contents();

    // load all enabled shipping modules
      
    require(DIR_WS_CLASSES 'shipping.php');
      
    $shipping_modules = new shipping;

      
    $pass true;
      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;
        }

        
    $free_shipping false;
        if ( (
    $pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          
    $free_shipping true;
        }
      } else {
        
    $free_shipping false;
      }

      require(
    DIR_WS_MODULES zen_get_module_directory('require_languages.php'));

      if (isset(
    $_SESSION['comments'])) {
        
    $comments $_SESSION['comments'];
      }


    // process the selected shipping method
      
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
        if (
    zen_not_null($_POST['comments'])) {
          
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
        }
        
    $comments $_SESSION['comments'];
        
    $quote = array();

        if ( (
    zen_count_shipping_modules() > 0) || ($free_shipping == true) ) {
          if ( (isset(
    $_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
            
    /**
             * check to be sure submitted data hasn't been tampered with
             */
            
    if ($_POST['shipping'] == 'free_free' && ($order->content_type != 'virtual' && !$pass)) {
              
    $quote['error'] = 'Invalid input. Please make another selection.';
            } else {
              
    $_SESSION['shipping'] = $_POST['shipping'];
            }

            list(
    $module$method) = explode('_'$_SESSION['shipping']);
            if ( 
    is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) {
              if (
    $_SESSION['shipping'] == 'free_free') {
                
    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
                
    $quote[0]['methods'][0]['cost'] = '0';
              } else {
                
    $quote $shipping_modules->quote($method$module);
              }
              if (isset(
    $quote['error'])) {
                
    $_SESSION['shipping'] = '';
              } else {
                if ( (isset(
    $quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
                  
    $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                    
    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' $quote[0]['methods'][0]['title'] . ')'),
                                    
    'cost' => $quote[0]['methods'][0]['cost']);

                  
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
                }
              }
            } else {
              
    $_SESSION['shipping'] = false;
            }
          }
        } else {
          
    $_SESSION['shipping'] = false;

          
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
        }
      }

    // get all available shipping quotes
      
    $quotes $shipping_modules->quote();

      
    // check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
      
    if (isset($_SESSION['shipping']) && $_SESSION['shipping'] != FALSE && $_SESSION['shipping'] != '') {
        
    $checklist = array();
        foreach (
    $quotes as $key=>$val) {
          foreach(
    $val['methods'] as $key2=>$method) {
            
    $checklist[] = $val['id'] . '_' $method['id'];
          }
        }
        
    $checkval = (is_array($_SESSION['shipping']) ? $_SESSION['shipping']['id'] : $_SESSION['shipping']);
        if (!
    in_array($checkval$checklist)) {
          
    $messageStack->add('checkout_shipping'ERROR_PLEASE_RESELECT_SHIPPING_METHOD'error');
        }
      }

    // if no shipping method has been selected, automatically select the cheapest method.
    // if the modules status was changed when none were available, to save on implementing
    // a javascript force-selection method, also automatically select the cheapest shipping
    // method if more than one module is now enabled
      
    if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) $_SESSION['shipping'] = $shipping_modules->cheapest();


      
    // Should address-edit button be offered?
      
    $displayAddressEdit = (MAX_ADDRESS_BOOK_ENTRIES >= 2);

      
    // if shipping-edit button should be overridden, do so
      
    $editShippingButtonLink zen_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS'''SSL');
      if (isset(
    $_SESSION['payment']) && method_exists($$_SESSION['payment'], 'alterShippingEditButton')) {
        
    $theLink = $$_SESSION['payment']->alterShippingEditButton();
        if (
    $theLink) {
          
    $editShippingButtonLink $theLink;
          
    $displayAddressEdit true;
        }
      }

      
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
      
    $breadcrumb->add(NAVBAR_TITLE_2);

    // This should be last line of the script:
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SHIPPING');

  3. #33
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    Quote Originally Posted by DivaVocals View Post
    Yes, and if I had/remembered the answer, I would have shared it..

    Ummm.. well from where I was sitting Linda was/is helping you.. my point was that snarky sounding comments are generally not helpful around here when someone is helping.. Especially someone as nice as Linda.. IJS..
    You couldn't be more right and that go in both direction.
    I probably get a little upsetted by a word that really meaned no harm but You know sometime when everything goes wrong just a little spark can rise a fire.

  4. #34
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: PHP error with the zone shipping module

    Quote Originally Posted by izar74 View Post
    You couldn't be more right and that go in both direction.
    I probably get a little upsetted by a word that really meaned no harm but You know sometime when everything goes wrong just a little spark can rise a fire.
    I do understand.. but as a piece of friendly advice.. temper tantrums directed to the community are generally not well received.. That said solo temper tantrums are not an issue.. I've had PLENTY of those..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  5. #35
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: PHP error with the zone shipping module

    Go to your Zen Cart Admin and go to Locations / Taxes ... Countries ...

    Find Italy ...

    Click on it and look in the URL, what is the cID for that?

    What are the other settings for the whole row?

    Next, go to the Customers in the Admin, and EDIT the customer that you are using for this checkout ...

    Is the Country setup right for Italy?

    I am assuming that this is your test Customer account that you are testing things with and that you can login as that customer ...

    Login as that Customer and go to the My Account and check the Addresses setup for it ...

    Edit the one(s) for Italy and do an Update ...

    So far, nothing I have done in testing here as triggered this error that you are getting ...

    You have Zone Rates setup to Weight and have the Skip Countries set to:
    IT

    You have only the first Zone 1 defined as:
    US, CA

    and are not using any other Zones ...

    The only other shipping module installed is Flat Rate flat and the Zone Rate zones is green dot and Flat Rate flat is green dot and ALL other shipping modules are red dots ... correct?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  6. #36
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    Quote Originally Posted by Ajeh View Post
    Go to your Zen Cart Admin and go to Locations / Taxes ... Countries ...

    Find Italy ...

    Click on it and look in the URL, what is the cID for that?

    What are the other settings for the whole row?
    url and cID = /countries.php?page=6&cID=105
    Setting = ISO Code (2): IT ISO Code (3): ITA Address Format: 5

    Next, go to the Customers in the Admin, and EDIT the customer that you are using for this checkout ...

    Is the Country setup right for Italy?

    I am assuming that this is your test Customer account that you are testing things with and that you can login as that customer ...

    Login as that Customer and go to the My Account and check the Addresses setup for it ...

    Edit the one(s) for Italy and do an Update ...
    Yes is the account i use for testing, and i can login as customer.
    Did as You say, edited the adresses and saved it (was already set with Italy as country)

    Yet the error is generated.

    So far, nothing I have done in testing here as triggered this error that you are getting ...
    May I ask what version of PHP and MYSQL are You testing on?

    You have Zone Rates setup to Weight and have the Skip Countries set to:
    IT

    You have only the first Zone 1 defined as:
    US, CA

    and are not using any other Zones ...

    The only other shipping module installed is Flat Rate flat and the Zone Rate zones is green dot and Flat Rate flat is green dot and ALL other shipping modules are red dots ... correct?
    All damned correct...
    I've tryed this thing on a fresh new install, no mods or anything and the error is generated in the same way, the only thing i'm gonna try is using the very base Zencart 1.51 not the Italian version (localization made by www.zencartitalia.it).

  7. #37
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    Update: I've made a fresh new install with the english version 1.51, no add-on, installed with demo data. Removed all the shiping except Flat rate and Zone rates.
    The error is still there, same as before:
    PHP Code:
    Invalid argument supplied for foreach() in C:\wamp\www\negozio151eng\includes\modules\pages\checkout_shipping\header_php.php on line 191 

    PHP Code:
    <?php
    /**
     * Checkout Shipping Page
     *
     * @package page
     * @copyright Copyright 2003-2011 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: header_php.php 18697 2011-05-04 14:35:20Z wilt $
     */
    // This should be first line of the script:
      
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SHIPPING');

      require_once(
    DIR_WS_CLASSES 'http_client.php');

    // if there is nothing in the customers cart, redirect them to the shopping cart page
      
    if ($_SESSION['cart']->count_contents() <= 0) {
        
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
      }

    // if the customer is not logged on, redirect them to the login page
      
    if (!isset($_SESSION['customer_id']) || !$_SESSION['customer_id']) {
        
    $_SESSION['navigation']->set_snapshot();
        
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
      } else {
        
    // validate customer
        
    if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
          
    $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL''page' => FILENAME_CHECKOUT_SHIPPING));
          
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
        }
      }

    // Validate Cart for checkout
      
    $_SESSION['valid_to_checkout'] = true;
      
    $_SESSION['cart']->get_products(true);
      if (
    $_SESSION['valid_to_checkout'] == false) {
        
    $messageStack->add('header'ERROR_CART_UPDATE'error');
        
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      }

    // Stock Check
      
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {
          if (
    zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
        }
      }
    // if no shipping destination address was selected, use the customers own address as default
      
    if (!$_SESSION['sendto']) {
        
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
      } else {
    // verify the selected shipping address
        
    $check_address_query "SELECT count(*) AS total
                                FROM   " 
    TABLE_ADDRESS_BOOK "
                                WHERE  customers_id = :customersID
                                AND    address_book_id = :addressBookID"
    ;

        
    $check_address_query $db->bindVars($check_address_query':customersID'$_SESSION['customer_id'], 'integer');
        
    $check_address_query $db->bindVars($check_address_query':addressBookID'$_SESSION['sendto'], 'integer');
        
    $check_address $db->Execute($check_address_query);

        if (
    $check_address->fields['total'] != '1') {
          
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
          
    $_SESSION['shipping'] = '';
        }
      }

      require(
    DIR_WS_CLASSES 'order.php');
      
    $order = new order;

    // register a random ID in the session to check throughout the checkout procedure
    // against alterations in the shopping cart contents
    if (isset($_SESSION['cart']->cartID)) {
      if (!isset(
    $_SESSION['cartID']) || $_SESSION['cart']->cartID != $_SESSION['cartID']) {
        
    $_SESSION['cartID'] = $_SESSION['cart']->cartID;
      }
    } else {
      
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }

    // if the order contains only virtual products, forward the customer to the billing page as
    // a shipping address is not needed
      
    if ($order->content_type == 'virtual') {
        
    $_SESSION['shipping'] = 'free_free';
        
    $_SESSION['shipping']['title'] = 'free_free';
        
    $_SESSION['sendto'] = false;
        
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
      }

      
    $total_weight $_SESSION['cart']->show_weight();
      
    $total_count $_SESSION['cart']->count_contents();

    // load all enabled shipping modules
      
    require(DIR_WS_CLASSES 'shipping.php');
      
    $shipping_modules = new shipping;

      
    $pass true;
      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;
        }

        
    $free_shipping false;
        if ( (
    $pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          
    $free_shipping true;
        }
      } else {
        
    $free_shipping false;
      }

      require(
    DIR_WS_MODULES zen_get_module_directory('require_languages.php'));

      if (isset(
    $_SESSION['comments'])) {
        
    $comments $_SESSION['comments'];
      }


    // process the selected shipping method
      
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
        if (
    zen_not_null($_POST['comments'])) {
          
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
        }
        
    $comments $_SESSION['comments'];
        
    $quote = array();

        if ( (
    zen_count_shipping_modules() > 0) || ($free_shipping == true) ) {
          if ( (isset(
    $_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
            
    /**
             * check to be sure submitted data hasn't been tampered with
             */
            
    if ($_POST['shipping'] == 'free_free' && ($order->content_type != 'virtual' && !$pass)) {
              
    $quote['error'] = 'Invalid input. Please make another selection.';
            } else {
              
    $_SESSION['shipping'] = $_POST['shipping'];
            }

            list(
    $module$method) = explode('_'$_SESSION['shipping']);
            if ( 
    is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) {
              if (
    $_SESSION['shipping'] == 'free_free') {
                
    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
                
    $quote[0]['methods'][0]['cost'] = '0';
              } else {
                
    $quote $shipping_modules->quote($method$module);
              }
              if (isset(
    $quote['error'])) {
                
    $_SESSION['shipping'] = '';
              } else {
                if ( (isset(
    $quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
                  
    $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                    
    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' $quote[0]['methods'][0]['title'] . ')'),
                                    
    'cost' => $quote[0]['methods'][0]['cost']);

                  
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
                }
              }
            } else {
              
    $_SESSION['shipping'] = false;
            }
          }
        } else {
          
    $_SESSION['shipping'] = false;

          
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
        }
      }

    // get all available shipping quotes
      
    $quotes $shipping_modules->quote();

      
    // check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
      
    if (isset($_SESSION['shipping']) && $_SESSION['shipping'] != FALSE && $_SESSION['shipping'] != '') {
        
    $checklist = array();
        foreach (
    $quotes as $key=>$val) {
          foreach(
    $val['methods'] as $key2=>$method) {
            
    $checklist[] = $val['id'] . '_' $method['id'];
          }
        }
        
    $checkval = (is_array($_SESSION['shipping']) ? $_SESSION['shipping']['id'] : $_SESSION['shipping']);
        if (!
    in_array($checkval$checklist)) {
          
    $messageStack->add('checkout_shipping'ERROR_PLEASE_RESELECT_SHIPPING_METHOD'error');
        }
      }

    // if no shipping method has been selected, automatically select the cheapest method.
    // if the modules status was changed when none were available, to save on implementing
    // a javascript force-selection method, also automatically select the cheapest shipping
    // method if more than one module is now enabled
      
    if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) $_SESSION['shipping'] = $shipping_modules->cheapest();


      
    // Should address-edit button be offered?
      
    $displayAddressEdit = (MAX_ADDRESS_BOOK_ENTRIES >= 2);

      
    // if shipping-edit button should be overridden, do so
      
    $editShippingButtonLink zen_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS'''SSL');
      if (isset(
    $_SESSION['payment']) && method_exists($$_SESSION['payment'], 'alterShippingEditButton')) {
        
    $theLink = $$_SESSION['payment']->alterShippingEditButton();
        if (
    $theLink) {
          
    $editShippingButtonLink $theLink;
          
    $displayAddressEdit true;
        }
      }

      
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
      
    $breadcrumb->add(NAVBAR_TITLE_2);

    // This should be last line of the script:
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SHIPPING');

  8. #38
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    I've put everything on a test server:

    http://www.viaincenso.com/

    http://www.viaincenso.com/admintest for admin.

    Sent Linda the login info and ftp info if you want to have a look

  9. #39
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    155
    Plugin Contributions
    0

    Default Re: PHP error with the zone shipping module

    Update: the error still generate but if you go for checkout, and go streight to the end no error is generate (seem so at the moment, still investigating) but if for any reason you decide to change something and go back or restar the checkout process the error pop!

  10. #40
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: PHP error with the zone shipping module

    I am assuming that while the error is generated in your debug logs ... that the checkout is still working ...

    I have generated the error, finally, and come up with a fix for you ...

    Edit the file:
    /includes/modules/shipping/checkout_shipping/header_php.php

    and add the code in RED:
    Code:
      // check that the currently selected shipping method is still valid (in case a zone restriction has disabled it, etc)
      if (isset($_SESSION['shipping']) && $_SESSION['shipping'] != FALSE && $_SESSION['shipping'] != '') {
        $checklist = array();
        foreach ($quotes as $key=>$val) {
          if ($val['methods'] != '') {
            foreach($val['methods'] as $key2=>$method) {
              $checklist[] = $val['id'] . '_' . $method['id'];
            }
          } else {
            // skip
          }
        }
        $checkval = (is_array($_SESSION['shipping']) ? $_SESSION['shipping']['id'] : $_SESSION['shipping']);
        if (!in_array($checkval, $checklist)) {
          $messageStack->add('checkout_shipping', ERROR_PLEASE_RESELECT_SHIPPING_METHOD, 'error');
        }
      }
    
    // if no shipping method has been selected, automatically select the cheapest method.
    See if this stops you from generating any more debug logs ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 
Page 4 of 5 FirstFirst ... 2345 LastLast

Similar Threads

  1. FREE SHIPPING! Module with no shipping zone
    By ebaobao in forum Built-in Shipping and Payment Modules
    Replies: 6
    Last Post: 24 May 2013, 03:57 PM
  2. v150 Problems with Zone Rates shipping module
    By Skull88 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 20 Apr 2012, 11:37 PM
  3. Cloning the Zone Based Rates Shipping Module?
    By pe7er in forum Addon Shipping Modules
    Replies: 15
    Last Post: 11 Mar 2010, 01:23 PM
  4. Error installing cloned zone shipping module
    By shocker in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 16 Aug 2007, 04:15 AM
  5. Problem with World Zone Shipping Module?
    By SysFix in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 28 Feb 2007, 06:36 PM

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