morning everyone.
i'm newbie in zen cart. want to start my first online store.
i've problem here.
i want to add shipping module that connect to shipping rates in another page.
the script for module is like general modul (this case is perweight unit). but in function quote, i add script for database connection. this script cause my checkout shipping blank.
the script is like this (the problem is in italic):
function quote($method = '') {
global $order, $cart, $total_count, $shipping_weight_x, $shipping_num_boxes_x, $shipping_count_x;
if ( zen_not_null($method) && (isset($this->types[$method])) ) {
$this->_setService($method);
}
$customer_city_rate_query = $db->Execute("select city, rate1, rate2, types from " .TABLE_KURIRTIKI." where city = '" . $order->delivery['city'] . "'");
if(zen_db_num_rows($customer_city_rate_query) > 0 ){
$total_count = $shipping_count_x[1];
if ($cart->weight > 0) {
$total_weight_units = ceil($cart->weight / 1);
} else {
$total_weight_units = ceil(1 );
}
$methods = array();
$this->quotes = array('id' => $this->code,
'module' => $this->title . 'Shipping to : ' . $order->delivery['city'] . ', Weight : ' . $total_weight_units);
if (isset($this->service)) {
$this->types = array($this->service => $this->types[$this->service]);
}
while(!$customer_city_rate->EOF) {
$city_ship_rate = $customer_city_rate->fields['rate1'];
$city_ship_rate2 = $customer_city_rate->fields['rate2'];
if ($total_weight > 1) {
$total_cost = $city_ship_rate + (($total_weight - 1) * $city_ship_rate2);
} else { $total_cost = 1 * $city_ship_rate; }
$methods[] = array('id' => $customer_city_rate->fields['types'] ,
'title' => $this->types[$customer_city_rate->fields['types']] , 'cost' => $total_cost );
}
$this->quotes['methods'] = $methods;
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
} else {
$this->quotes = array('id' => $this->code,
'error' => MODULE_SHIPPING_KURIRTIKI_TEXT_ERROR);
}
if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
return $this->quotes;
}
can u help me ?
note:
i'm using v 1.3.8
regards
Bookmarks