Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Mar 2008
    Location
    Victoria AU
    Posts
    48
    Plugin Contributions
    0

    Default New Shipping Module with Multiple Methods showing as bold (best?)

    I'm developing a shipping module that calls make a JSON call to a common service we use internally that generates shipping estimates based on a cart (think Model, Qty and Postcode) and it returns Service Options and Price based on weights and postcode, number of parcels etc.

    Everything is working very well, and I was able to make a fairly simple change to the "Flat" rate calculator to get rates coming back through to ZC.

    However the returned methods are all showing as bolded, and I'd have thought only the cheapest would have been. Am I missing something simple here, as far as I could see the USPS calculator returns multiple rates so I'm hoping returning multiple services from a shipping module is supported.

    Attached pic shows how the results are displaying. I'm using a vanilla install of 155e with this as the only additional module.

    Name:  Capture.PNG
Views: 186
Size:  10.1 KB

    Code:
          $ShippingResult = json_decode($response,true);
          $methods = Array();
          
          foreach ($ShippingResult['options'] as $key => $value) {
             $Service = $ShippingResult['options'][$key]['service'];
             $Price = Round($ShippingResult['options'][$key]['price'],2);
    
             $methods[] = array('id' => $this->code,
                                'title' => $Service,
                                'cost' => $Price);
          }
                                
          if (sizeof($methods) == 0) { return false; }
    
          $this->quotes = array('id' => $this->code,
                                'module' => MODULE_SHIPPING_JSONSERVICE_TEXT_TITLE,
                                'methods' => $methods);
    Last edited by kanine; 27 Oct 2017 at 04:24 AM. Reason: code fragment

 

 

Similar Threads

  1. v150 New sidebar category not showing up bold
    By Scully in forum Templates, Stylesheets, Page Layout
    Replies: 35
    Last Post: 10 Jan 2013, 04:43 AM
  2. Best Shipping module / Multiple cities in same province
    By jinnxx73 in forum Addon Shipping Modules
    Replies: 3
    Last Post: 1 Oct 2010, 06:38 PM
  3. Multiple shipping methods/costs with big range of item sizes
    By terrykiwi in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 2 May 2008, 02:39 PM
  4. multiple shipping methods
    By kishore_peri in forum Addon Shipping Modules
    Replies: 2
    Last Post: 3 Apr 2008, 09:22 PM
  5. multiple shipping methods
    By magichat in forum General Questions
    Replies: 1
    Last Post: 19 Sep 2006, 08:59 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