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
Then customize your file:Code:return $new_qty; } // 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 }
/includes/modules/shipping/table.php
with the code in RED:
Code:function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes, $total_count; // 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 // shipping adjustment switch (MODULE_SHIPPING_TABLE_MODE) {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 ...Code:// bof: change $total_count for options_id/options_values_id combo $additional_shipping_charge = $reduce_count * $additional_shipping; $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 + $additional_shipping_charge + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) )); // eof: change $total_count for options_id/options_values_id combo if ($this->tax_class > 0) {
NOTE: change the values on:
To match your options_id value and the options_values_id value ...Code:$chk_options_id = 20; $chk_options_values_id = 72;


Reply With Quote
