You could use the Product Weight to control this ...
Set the Product Weight for Short Sleeve to 5.1 ...
Set the Product Weight for Long Sleeve to 7.2 ...
Customize the Flat Rate flat shipping file:
/includes/modules/shipping/flat.php
with the code in RED:
Code:
// class methods
function quote($method = '') {
global $order;
// bof: calculate shipping
$chk_short = 0;
$chk_long = 0;
$ship_charge = 0.00;
$chk_short = $_SESSION['cart']->in_cart_check('products_weight','5.1');
$chk_long = $_SESSION['cart']->in_cart_check('products_weight','7.2');
switch (true) {
case ($chk_short > 0 && $chk_long == 0):
$ship_charge = 5.00 + (($chk_short -1) * 1);
break;
case ($chk_long > 0 && $chk_short == 0):
$ship_charge = 7.00 + (($chk_long -1) * 2);
break;
case ($chk_short > 0 && $chk_long > 0):
$ship_charge = 7.00 + (($chk_long -1) * 2) + (($chk_short) * 1);
break;
}
echo 'Comment out echos to not see them ...' . '<br>';
echo 'Short: ' . $chk_short . '<br>';
echo 'Long: ' . $chk_long . '<br>';
echo 'Shipping: ' . $ship_charge . '<br>';
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_FLAT_TEXT_WAY,
'cost' => $ship_charge)));
// eof: calculate shipping
if ($this->tax_class > 0) {
After testing, you can comment out the echo section with two // in front of each of the 4 lines starting with echo ...
Bookmarks