Full service web hosting, great prices and support. Starts at $1.99/month!
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Customer doesn't allways see shipping cost in checkout

  1. #1
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Customer doesn't allways see shipping cost in checkout

    osCmax 2.5.4

    Anyone have a problem with the code for checking if a shipping method has been selected? In all the checkout_x files there is the check:

    PHP Code:
    // if no shipping method has been selected, redirect the customer to the shipping method selection page
      
    if (!tep_session_is_registered('shipping')) {
        
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
      } 
    however that isn't reliably working for me now that I have Fedex Web Services as my sole shipping company. Canada Post is going into lockout Friday so I had to turn it off.
    The shipping cost also never shows up in the /catalog/checkout_payment.php screen.
    If I go back to the checkout_shipping.php page once or twice (and click the shipping option radio button) then the shipping cost does show up on checkout_confirmation.php
    Suggestions? No PHP errors show up at all for that page.

    I am running PHP 5.6.11 on my localhost setup. Similar problem with the live store running PHP 5.6.23

  2. #2
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    Checking further the problem is related somehow to the Cheapest Shipping line. The system automatically selects a button (least cost) and that is supposed to be passed on to the next pages. However that does not happen unless the user actually clicks the radio button or another button to select a different service. In other words unless the user makes a selection for shipping the system allows moving on through payment and confirmation and at confirmation does not show a cost for shipping.

    This is around line 240 of catalog/checkout_shipping.php:

    PHP Code:
     if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping $shipping_modules->cheapest(); 
    Commenting that line out has 'fixed' the problem of not passing the cheapest shipping method on. Not sure why. Will have to check and see if it is actually a bug or if it is just my setup.

    If anyone else had that problem and this fixes it please let me know here and I will move this to the bug fix area.

  3. #3
    osCMax Development Team

    Customer doesn't allways see shipping cost in checkout

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Arrow Re: Customer doesn't allways see shipping cost in checkout

    Good find. Looks to be the most obvious candidate:

    PHP Code:
     if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 0) ) ) $shipping $shipping_modules->cheapest(); 
    I'd suggest that this is better than simply commenting out the line - it's there for a reason. It may break the cheapest function though. I've commented on this line in isolation though and other code in the file may have an influence eg. is $shipping properly set prior to the above test?
    Do you force cookie usage in Admin.? (Just a thought.)
    Last edited by ridexbuilder; 07-08-2016 at 06:49 AM.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  4. #4
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    Cookies are working, I was mucking with the catalog/includes/configure.php file and forgot the backslash (bolded just below) on the lines:

    define('HTTP_COOKIE_PATH', '/catalog/');
    define('HTTPS_COOKIE_PATH', '/catalog/');

    which led to my not being able to log in as one of my test users. So I am sure cookies are working...

    I do have Force Cookie Use set to True under Administrator!Sessions! I have my own SSL certificate (not shared)
    Session Directory /tmp
    Force Cookie Use True
    Check SSL Session ID True
    Check User Agent False
    Check IP Address False
    Prevent Spider Sessions True
    Recreate Session True
    Last edited by JRR; 07-09-2016 at 09:41 AM.

  5. #5
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    Changing (tep_count_shipping_modules() > 1) to (tep_count_shipping_modules() > 0) didn't change the problem. Only when I force the customer to select by removing the 'cheapest' line does it work.

    This is a bit of _ms2 code, and there appears to have been a bit clipped off after lines 145 to 150 when compared with the source.

    http://www.oscdox.com/crossx/nav.htm...hp.source.html

    Considering that there is a bunch of code in the template section /catalog/templates/fallback/content/checkout_shippping.tpl.php, perhaps the problem is there with the radio buttons routine? I assume that is supposed to take care of the missing code in the original ms2 module.

    What I have been doing is putting

    PHP Code:
    echo $shipping
    Into the various checkout files to see what is being passed on - so far all I see is "Array" as the echo.

    More to come...
    Last edited by JRR; 07-10-2016 at 04:32 PM.

  6. #6
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    More...

    Reading up on how to display an array - you use the format:

    PHP Code:
    echo '<pre>'print_r($array); echo '</pre>'
    So I put into the checkout_payment.php (and the other checkout_x.php modules):


    PHP Code:
    echo '<pre>'print_r($shipping); echo '</pre>'
    And I get (at the top of the page - don't do this on a live store if you don't want your customers seeing this - I am on localhost):

    Code:
    Array 
    (
    [id] => canadapost_Tracked Packet - International (Estimated Delivery Date: Friday     
    [title] => Canada Post [1 box(es) to be shipped]
    Lettermail_small_Bubble - 0.06(kg) (Tracked Packet - International (Estimated Delivery Date: Friday, July 22, 2016))     
    [cost] => 43.43     
    [invcost] => 0 
    )
    Obviously Canada Post was the cheapest shipping as I've left the cheapest turned on. I will poke a sharp stick at it some more and see if I can find when this is not working, what the $shipping array shows.

  7. #7
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    OK, even though the $shipping array is present in checkout_shipping.php (with cheapest shipping code enabled) it is not always passed on to checkout_payment.php. The echo variable $shipping bit shows nothing at all if the radio button didn't 'take'. This is with a fresh test customer on my localhost site.

    Then I go back to 'Checkout', again I get the valid array, and without doing anything else I select 'continue' and now the echo $shipping array is showing on the checkout_payment.php page where it didn't just before.

    It appears that the array isn't always being registered (is that the correct word?) the first time when it is automatically selected by the 'cheapest' line of code. If I return to the Checkout page then it does get locked in. This is consistent.

    Yet more research is needed...

    Running osCmax 2.5.4, and PHP 5.6.11

  8. #8
    osCMax Development Team

    Customer doesn't allways see shipping cost in checkout

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Default Re: Customer doesn't allways see shipping cost in checkout

    "PHP 5.6.11" - I suggest that you back off that version to something like 5.5.xx and try again and/or look into the differences between PHP versions.

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

  9. #9
    Senior Member
    Customer doesn't allways see shipping cost in checkout


    Join Date
    Sep 2009
    Location
    Vancouver, BC, Canada
    Posts
    501
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    JRR     $ 180.00
    Rep Power
    76


    Default Re: Customer doesn't allways see shipping cost in checkout

    Unfortunately session_is_registered was dropped as of 5.4.0, so one has to go all the way back to 5.3.x to 'fix' it. Not sure what else I can do though. Pity. Let's see, the last stable version of PHP is 5.3.29 and is no longer supported.

    I wonder if that will enable One Page Checkout (OPC) again, that hasn't worked reliably for me for a while now and I have long since turned it off...

  10. #10
    osCMax Development Team

    Customer doesn't allways see shipping cost in checkout

    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    4,164
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    ridexbuilder     $ 15.00
    Rep Power
    99


    Default Re: Customer doesn't allways see shipping cost in checkout

    Around line 117 of catalog/includes/functions/sessions.php, you might like to try replacing the following:
    PHP Code:
      function tep_session_is_registered($variable) { 
         return isset(
    $_SESSION) && array_key_exists($variable$_SESSION); 
      } 
    With...
    PHP Code:
      function tep_session_is_registered($variable) { 
         return isset(
    $_SESSION['$variable']) && array_key_exists($variable$_SESSION); 
      } 
    I have no idea what this will do, so test thoroughly!
    Last edited by ridexbuilder; 07-11-2016 at 04:10 AM. Reason: c&p error - d'oh!

    Developers resource at bitbucket
    *** *** ***
    oscmax.co.uk / ejsolutions.co.uk
    Hosting plans with installation, configuration, contributions, support and maintenance.
    *** FREE osCmax hosting available ***
    oscmaxtemplates.com

Page 1 of 2 12 LastLast

Similar Threads

  1. [Products/Categories] I need My Cost and the cost to the customer - do not need MSRP
    By Chris.Anderson in forum Store Administration
    Replies: 2
    Last Post: 04-27-2014, 09:04 PM
  2. Replies: 2
    Last Post: 06-19-2012, 12:41 PM
  3. Looking for multiple item shipping - 1 cost z - 2 cost z1 - 3 cost z2 etc
    By ozstar in forum osCmax v2 Customization/Mods
    Replies: 5
    Last Post: 12-05-2011, 07:11 AM
  4. google checkout with shipping cost??
    By nahi_sonu in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 07-04-2009, 11:40 PM
  5. PayPal doesn't carry sales tax forward from total @ checkout
    By jmateus in forum osCmax v2 Installation issues
    Replies: 4
    Last Post: 01-07-2006, 11:42 PM

Bookmarks

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
  •