Let's try to test this ...
What will happen is when you look at Shipping Estimator or the checkout_shipping ... you will see it echo out the counts or Products in these categories_id where the Products use the matching master_categories_id ...
Edit the file:
/includes/modules/shipping/table.php
and change the function quote with this new code:
Code:
/**
* Enter description here...
*
* @param unknown_type $method
* @return unknown
*/
function quote($method = '') {
global $order, $shipping_weight, $shipping_num_boxes, $total_count;
// shipping adjustment
switch (MODULE_SHIPPING_TABLE_MODE) {
case ('price'):
$order_total = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
break;
case ('weight'):
$order_total = $shipping_weight;
break;
case ('item'):
$order_total = $total_count - $_SESSION['cart']->free_shipping_items();
break;
}
$order_total_amount = $_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() ;
$table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);
$size = sizeof($table_cost);
for ($i=0, $n=$size; $i<$n; $i+=2) {
if (round($order_total,9) <= $table_cost[$i]) {
if (strstr($table_cost[$i+1], '%')) {
$shipping = ($table_cost[$i+1]/100) * $order_total_amount;
} else {
$shipping = $table_cost[$i+1];
}
break;
}
}
if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
$shipping = $shipping * $shipping_num_boxes;
// show boxes if weight
switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
case (0):
$show_box_weight = '';
break;
case (1):
$show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
break;
case (2):
$show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes,2) . TEXT_SHIPPING_WEIGHT . ')';
break;
default:
$show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight,2) . TEXT_SHIPPING_WEIGHT . ')';
break;
}
}
global $cart;
$cnt_cards = $_SESSION['cart']->in_cart_check('master_categories_id','9');
$card_ship = ceil($cnt_cards/4) * .17;
$card_ship = $card_ship+ 1.05;
$cnt_hotwheels = $_SESSION['cart']->in_cart_check('master_categories_id','10');
$hotwheels_ship = ceil($cnt_hotwheels/4) * .51;
$hotwheels_ship = $hotwheels_ship+ 1.56;
$cnt_shoes = $_SESSION['cart']->in_cart_check('master_categories_id','11');
$shoes_ship = ceil($cnt_shoes/4) * 1.46;
$shoes_ship = $shoes_ship+ 11.56;
echo '<br><br>CARDS: ' . $cnt_cards . ' = ' . $card_ship . '<br>';
echo '<br><br>HOTWHEELS: ' . $cnt_hotwheels . ' = ' . $hotwheels_ship . '<br>';
echo '<br><br>SHOES: ' . $cnt_shoes . ' = ' . $shoes_ship . '<br>';
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_TABLE_TEXT_TITLE . $show_box_weight,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_TABLE_TEXT_WAY,
'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
return $this->quotes;
}
Again, it will look messie ... we care about the counts based on what you put in your cart ...
Don't worry about the quote yet ... first let's see if this identifies the number of Products in the cart for each of the 3 kinds ...
Bookmarks