Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Table Rate Delivery Costs


Tim.Ford

Recommended Posts

I have adjusted the table rates to work like this

 

"299:5.00-PARCEL,300:10.00-COURIER"

 

The PARCEL and the COURIER link to:-

 

define('MODULE_ORDER_TOTAL_SHIPPING_COURIER','Shipped via Courier');

define('MODULE_ORDER_TOTAL_SHIPPING_PARCEL','Shipped via Parcelforce24');

 

in the language file.

 

The problem i am having is that anything over the 299 price does not work the text does not appear however the price is set to = 0:00. If someone could help me i would be greatly appreicated i am using ms2.2

 

If have included the the code below.

 

Thanks in Advance. Tim.

 

 

// class methods
   function quote($method = '') {
     global $order, $cart, $shipping_weight, $shipping_num_boxes;

     if (MODULE_SHIPPING_TABLE_MODE == 'price') {
       $order_total = $cart->show_total();
     } else {
       $order_total = $shipping_weight;
     }

     $table_cost = split("[:,-]" , MODULE_SHIPPING_TABLE_COST);
     $size = sizeof($table_cost);

     for ($i=0, $n=$size; $i<$n; $i+=2) {
       if ($order_total <= $table_cost[$i]) {  
           $shipping = $table_cost[$i+1];
	 $delivery_method = $table_cost[$i+2];
         break;
       }
     }

     if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
       $shipping = $shipping * $shipping_num_boxes;
     }

   switch ($delivery_method) {
  case 'PARCEL':
	 $this->description = MODULE_ORDER_TOTAL_SHIPPING_PARCEL;
      	 break;
     case 'COURIER':
	 $this->description = MODULE_ORDER_TOTAL_SHIPPING_COURIER;
      	 break;
  default:
	 $this->description = MODULE_SHIPPING_TABLE_TEXT_WAY;
   }

     $this->quotes = array('id' => $this->code,
                           'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE,
                           'methods' => array(array('id' => $this->code,
                                                    'title' => $this->description,
                                                    'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));

     if ($this->tax_class > 0) {
       $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
     }

     if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

     return $this->quotes;
   }

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...