Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Big shipping rates problem


spencermjax

Recommended Posts

in the code posted below you can see I made a modification to how shipping is calculated ('cost' => ).

Here is how my shipping works:

This is my shipping costs: (basicly $10 per 1-3 items)

1-3 items - $10.00

4-6 items - $20.00

7-9 items - $30.00

 

 

I now have a problem in that I have a new product that has a flat rate of $10 for each item shipped. so this is how the shipping would work with a new item.

 

2 regular items - $10

1 new item - $10

TOTAL - $20

 

or

 

4 regular items - $20

3 new items - $30

TOTAL - $50

 

How can I get this to work???

 

 

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

  $this->quotes = array('id' => $this->code,
						'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
						'methods' => array(array('id' => $this->code,
												 'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
												 'cost' => ((ceil($total_count/3 )) * MODULE_SHIPPING_ITEM_COST ) + MODULE_SHIPPING_ITEM_HANDLING)));
												 //'cost' => (MODULE_SHIPPING_ITEM_COST * $total_count) + MODULE_SHIPPING_ITEM_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;
}

function check() {
  if (!isset($this->_check)) {
	$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'");
	$this->_check = tep_db_num_rows($check_query);
  }
  return $this->_check;
}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...