Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    57
    Plugin Contributions
    0

    Default zencart plays with my shipping data -Canpar

    I've heard other people going through similar problems, and the fixes all seem to be just workarounds, so I'm going to give an explicit case and try to get a real solution.

    Zen Cart 1.3.8a Patch: 1. with Canpar shipping module.

    I can post the code, if you like, but it basically writes a url requesting shipping data, and then gets the XML response.

    If I do this by hand, I get an XML with the correct pricing. But if I let the form do it, I get a totally unrelated price and there is NO logic to it.

    I have the Package Tares set to 0:0, nothing fancy. I just want it to use the information it gets back from the XML and not play with it. How can I do this?

    Thanks in advance.
    P.S. an otherwise excellent product, it's just that this is driving me nuts.
    Last edited by Kim; 15 Sep 2009 at 05:39 PM.

  2. #2
    Join Date
    Mar 2009
    Posts
    57
    Plugin Contributions
    0

    Default Re: zencart plays with my shipping data

    Just so you can see what I'm doing, the guts of the shipping module are thus:

    PHP Code:
    //Connect to CanPar here to get quote, and parse XML.
          
    $request join('&', array('service=1',
                                     
    'quantity=' $shipping_num_boxes,
                                     
    'unit=K',  //Weight is in Kilos
                                     
    'origin=' $srcFSA//postal code of the store
                                     
    'dest=' $desFSA,  //postal code of the buyer
                                     
    'cod=0',  //no COD charges
                                     
    'weight=' intval($shipping_weight), //Interger weight
                                     
    'put=0',
                                     
    'xc=0',
                                     
    'dec=0'));
            
          
    $body file_get_contents('http://www.canpar.com/CanparRateXML/BaseRateXML.jsp?' $request);
          
    $body_array explode("<BaseRate>"$body);

          
    $ShippingCost $body_array[1];
          
    $ShippingCost ereg_replace('</BaseRate></CanparCharges></CanparRate>'''$ShippingCost); 
    This writes a URL something like:
    HTML Code:
    http://www.canpar.com/XML/BaseRateXML.jsp?service=1&quantity=1&unit=L&weight=10&origin=M4X1W7&dest=L4Y2N9&cod=100&dec=200&put=0&xc=1
    if I write my own url, I will get back XML data like this:
    Code:
    <?xml version="1.0" encoding="windows-1252"?>
    
    <CanparRate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.canpar.com/XML/base_rate.xsd">
    
          <CanparShipment>
    
                <COD>0.00</COD>
    
                <Declared>0.00</Declared>
    
                <Origin>M4X1W7</Origin>
    
                <Destination>L4Y2N9</Destination>
    
                <ExtraCare>0.00</ExtraCare>
    
                <PUT>No</PUT>
    
                <Quantity>1</Quantity>
    
                <ServiceType>1</ServiceType>
    
                <Weight>10</Weight>
    
                <Unit>K</Unit>
    
          </CanparShipment>
    
          <CanparCharges>
    
                <BaseRate>8.65</BaseRate>
    
          </CanparCharges>
    
    </CanparRate>
    and yet, Zencart will NEVER give me a value of 8.65 for shipping.
    Last edited by Luxifer; 15 Sep 2009 at 05:31 PM.

 

 

Similar Threads

  1. CanPar Shipping Module
    By eggplant36 in forum Addon Shipping Modules
    Replies: 2
    Last Post: 8 May 2010, 06:08 PM
  2. Canpar Shipping XML
    By bellilint in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 31 Oct 2008, 07:18 PM
  3. New some help with Canpar shipping
    By breck in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 21 Mar 2008, 12:09 AM
  4. Shipping data integration with UPS / Zencart
    By batteriesareus.com in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 20 Sep 2006, 09: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