If this is what you are wanting, you could add the code in **RED **to the bottom of the file:
/includes/classes/shopping_cart.php
return $new_qty;
}
[B]// bof: change $total_count for options_id/options_values_id combo
/**
* calculate the number of items in a cart based on an attribute option_id and option_values_id combo
* USAGE: $chk_attrib_1_16 = $this->in_cart_check_attrib_quantity(1, 16);
* USAGE: $chk_attrib_1_16 = $_SESSION['cart']->in_cart_check_attrib_quantity(1, 16);
*
* @param float $check_qty
* @param int $check_option_id
* @param int $check_option_values_id
* @param string $message
*/
function in_cart_check_attrib_quantity($check_option_id, $check_option_values_id) {
// if nothing is in cart return 0
if (!is_array($this->contents)) return 0;
// compute total quantity for match
$in_cart_check_qty = 0;
// get products in cart to check
$chk_products = $this->get_products();
for ($i=0, $n=sizeof($chk_products); $i<$n; $i++) {
if (is_array($chk_products[$i]['attributes'])) {
foreach ($chk_products[$i]['attributes'] as $option => $value) {
if ($option == $check_option_id && $value == $check_option_values_id) {
// echo 'Attribute FOUND FOR $option: ' . $option . ' $value: ' . $value . ' quantity: ' . $chk_products[$i]['quantity'] . '<br><br>';
$in_cart_check_qty += $chk_products[$i]['quantity'];
}
}
}
}
return $in_cart_check_qty;
}
// eof: change $total_count for options_id/options_values_id combo
[/B]}
Then customize your file:
/includes/modules/shipping/table.php
with the code in RED:
function quote($method = '') {
global $order, $shipping_weight, $shipping_num_boxes, $total_count;
[B]// bof: change $total_count for options_id/options_values_id combo
$chk_options_id = 20;
$chk_options_values_id = 72;
$additional_shipping = 22.00;
$reduce_count = $_SESSION['cart']->in_cart_check_attrib_quantity($chk_options_id, $chk_options_values_id);
$total_count = $total_count - $reduce_count;
// eof: change $total_count for options_id/options_values_id combo
[/B]
// shipping adjustment
switch (MODULE_SHIPPING_TABLE_MODE) {
[B]// bof: change $total_count for options_id/options_values_id combo
$additional_shipping_charge = $reduce_count * $additional_shipping;
[/B]
$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[B] + $additional_shipping_charge [/B]+ (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
[B]// eof: change $total_count for options_id/options_values_id combo
[/B]
if ($this->tax_class > 0) {
And this will now charge the count for Products based on the number of regular Products that are Prints using the Table Rate table settings and for the Framed Prints it will charge $22.00 each ...
NOTE: change the values on:
[B] $chk_options_id = 20;
$chk_options_values_id = 72;
[/B]
To match your options_id value and the options_values_id value ...
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!