Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Customized shipping modules not working after upgrade

    Hello. So a while back Ajeh patiently helped me customize my USPS and flat rate module files so that if a certain product were in my cart a flat fee would be added in addition to any other shipping fee for the regular products, and it was working out.

    A few months ago I upgraded to 1.3.9h, and I've just gotten around to testing out the checkout process, and now if I have one of these special products in the cart that would trigger the added flat rate, it just goes to a blank page and shows the paragraph I had written in to explain the flat fee. There's no way to continue, so no way to check out. I'm attaching a screen shot of what it looks like. If I remove this product and just have regular USPS triggered, it works as it should, it calculates the shipping charge by weight and there are no errors in the checkout process.

    I looked at my debug logs and it says this:

    [22-May-2011 14:27:01] PHP Warning: Cannot modify header information - headers already sent by (output started at ....../store/includes/modules/shipping/usps.php:276) in ..../store/includes/functions/functions_general.php on line 45

    Here is line 276 in usps.php, it is part of the customized code:
    PHP Code:
    global $cart;

        
    //check if manufacturer alchemy is in cart 
          
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','1') > 0)); {
            
    $manufacturer_alchemy $_SESSION['cart']->in_cart_check('manufacturers_id','1');
      
            
    $drop_ship_extra_charge $manufacturer_alchemy;
          }  
       
    // charge dropship fee for alchemy 
          
    if ($drop_ship_extra_charge 0) { 
            
    $cat_extra_charge 5
            echo 
    '<br /><font color="#660000" size="2"><em>A flat $5 shipping fee to cover all Alchemy items in your cart has been added to the shipping quote below. Please note that Alchemy products ordered from Black Orchid Couture can only be shipped to addresses in the United States. All Alchemy products are special ordered from England and will be mailed to you separate from any other items in your order, and will take between 2-3 weeks to be delivered.</em></font>';
          } else {
            
    $cat_extra_charge 0;
          }

            
    $methods = array();
            
    $size sizeof($uspsQuote);
            for (
    $i=0$i<$size$i++) {
              list(
    $type$cost) = each($uspsQuote[$i]); 
    The question is, did some part of the usps.php code change that would interfere with the custom code above? Or maybe I made a mistake in transfering it to the new code? I'm just not sure how to interpret the error log, I looked at the other file (functions_general.php) and there is no custom code in there. I just don't know how to fix this other than installing the usps.php fresh and starting over trying to figure out how to customize it.

    Thanks for any help!!!!
    Attached Images Attached Images  

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Customized shipping modules not working after upgrade

    Insure that in the upgrade, that you checked for any files that had new versions - especially those that you edited/cloned for this

    Blank page issues in general
    Zen-Venom Get Bitten

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

    Default Re: Customized shipping modules not working after upgrade

    Take out the echo that you have in there ... does it work now?
    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: v1.5.5]
    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!

  4. #4
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Customized shipping modules not working after upgrade

    Ok, I took out the echo and it's now going to the regular checkout page, so that fixed going to the blank page, thanks! BUT, it's not applying the $5.00 flat shipping fee on top of the regulara USPS fee (I put a regular item and a special item).

    The thing is this used to work, it would apply the $5.00 flat fee and also include my echoed paragraph. But this is better than a complete error!

  5. #5
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Customized shipping modules not working after upgrade

    Why do you not just apply in the shipping module setup a $5.00
    Handling Fee

    All using stock code
    Zen-Venom Get Bitten

  6. #6
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Customized shipping modules not working after upgrade

    Quote Originally Posted by kobra View Post
    Why do you not just apply in the shipping module setup a $5.00
    Handling Fee

    All using stock code
    That's an intersting idea on how to do it, but I'd have to set it up so that the $5.00 handling fee only got charged if there were any products from this particular category/manufacturer. I'm thinking customizing the code is the only way to do this? But I haven't ever looked at how to add a handling fee. Would this be in the USPS module?

  7. #7
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: Customized shipping modules not working after upgrade

    only got charged if there were any products from this particular category/manufacturer.

    But I haven't ever looked at how to add a handling fee. Would this be in the USPS module?
    Did you clone the USPS module for the specific cat thing??

    Then handling fee would be set in that cloned module setup in the admin

    Depending on the age of what you upgraded from...

    You might need to merge your customizations into the most recent USPS module
    Zen-Venom Get Bitten

  8. #8
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Customized shipping modules not working after upgrade

    I didn't clone any shipping module, I customized both the flat rate and the USPS files to look for the product category and also look for weight, as I set these products to zero weight. So if the whole cart is zero weight, then it means that only this category is in the cart, so only the flat rate gets activated. If there is any weight in the cart, it looks for whether or not this one product category is in the cart, if not then only the USPS module is activated. If the cart is mixed, it uses both.

    In terms of the latest USPS module, I had updated it when Ajeh put out the latest one in January, I merged the custom code in with the updated code.

    I will have to explore cloning shipping modules more as well as adding a handling fee. If I can add a $5.00 handling fee just if any products from this one category are in the cart, I could just use the USPS module and it should work. I will look more closely at all this tomorrow....

    Thanks!

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

    Default Re: Customized shipping modules not working after upgrade

    What are you doing with the:
    $cat_extra_charge

    in the rest of the code?
    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: v1.5.5]
    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!

  10. #10
    Join Date
    Apr 2010
    Location
    Albuquerque, NM
    Posts
    198
    Plugin Contributions
    0

    Default Re: Customized shipping modules not working after upgrade

    I will show you all the custom code on the USPS and flat files. Now that I look at it, that is the only place that $cat_extra_charge shows up.

    Towards the beginning of usps.php:

    PHP Code:
    global $cart;

    // check cart weight
      
    if (IS_ADMIN_FLAG == false) {  
        
    $chk_products_weight $_SESSION['cart']->show_weight();
      }


    // enable if total product weight is more than zero
      
    if (IS_ADMIN_FLAG == false && $chk_products_weight 0) {
        
    // show USPS
        
    $this->enabled true;
      } else {
        
    $this->enabled false;
      } 
    Later in usps.php, I'll inlude some of the code that comes after so you can see where it is:

    PHP Code:
    global $cart;

        
    //check if manufacturer alchemy is in cart 
          
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('manufacturers_id','1') > 0)); {
            
    $manufacturer_alchemy $_SESSION['cart']->in_cart_check('manufacturers_id','1');
      
            
    $drop_ship_extra_charge $manufacturer_alchemy;
          }  
       
    // charge dropship fee for alchemy 
          
    if ($drop_ship_extra_charge 0) { 
            
    $cat_extra_charge 5
            } else {
            
    $cat_extra_charge 0;
          }

            
    $methods = array();
            
    $size sizeof($uspsQuote);
            for (
    $i=0$i<$size$i++) {
              list(
    $type$cost) = each($uspsQuote[$i]);

    // fix new trademark and reg 01-02-2011
    //$type = str_replace('&amp;lt;sup&amp;gt;&amp;amp;reg;&amp;lt;/sup&amp;gt;', '<sup>&reg;</sup>', $type);
    //$type = str_replace('&amp;lt;sup&amp;gt;&amp;amp;trade;&amp;lt;/sup&amp;gt;', '<sup>&trade;</sup>', $type); 
    In flat.php:

    PHP Code:
    global $cart;

    // check total cart weight
      
    if (IS_ADMIN_FLAG == false) {  
        
    $chk_products_weight $_SESSION['cart']->show_weight();
      }

    // enable if total product weight is 0 
      
    if (IS_ADMIN_FLAG == false && $chk_products_weight == 0) {
        
    // show FLAT
        
    $this->enabled true;
      } else {
        
    // hide FLAT
        
    $this->enabled false;
      } 

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. v151 Shipping estimator not working after upgrade from 1.3.8
    By HalRau in forum Upgrading to 1.5.x
    Replies: 12
    Last Post: 28 Mar 2014, 04:33 PM
  2. Free Shipping not working correctly after upgrade?
    By Jeff_Mash in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 6 Oct 2010, 03:39 PM
  3. Problems after upgrade of customized site
    By gage in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 10 Jun 2008, 07:37 AM
  4. USPS shipping module not working after upgrade
    By bobage24 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 14 Nov 2006, 06:04 AM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR