If you were to add this code into the quote section of the Item Rate item shipping module:
Code:
// check if manufacturer 1 or 2 is in cart
if (IS_ADMIN_FLAG == false) {
global $cart;
$chk_manufacturers_id1 = $_SESSION['cart']->in_cart_check('manufacturers_id', '1');
$chk_manufacturers_id2 = $_SESSION['cart']->in_cart_check('manufacturers_id', '2');
$chk_manufacturers_id = $chk_manufacturers_id1 + $chk_manufacturers_id2;
}
You would know how many items are from manufacturers_id 1 and from manufacturers_id 2 ...
The Item Rate is using the number of items in the cart ...
If you were to subtract from the number of items about to be calculated the $chk_manufacturers_id you would then just be charging the Item Rate for all products not in 1 and 2 ... just under this code in item.php
Code:
// adjusted count for free shipping
$item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
then, you can add in the extra charge for the Flat Rate amount to this calculation based on $chk_manufacturers_id1 >= 1 add $15.00 and $chk_manufacturers_id2 >= 1 add $35 ... by adjusting the code in this section:
Code:
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,
'cost' => (MODULE_SHIPPING_ITEM_COST * $item_total_count) + MODULE_SHIPPING_ITEM_HANDLING)));
So Flat Rate should only be used for manufacturers_id 1 and 2 and the amounts altered to $15 or $35 or both ... otherwise, Flat Rate should not show if there are other products in the cart ...
Item Rate should be altered to not show when only products are from manufacturers_id 1 and 2 ...
Item Rate should be altered to reduce the item count based on anything from manufacturers_id 1 and 2 ... and add the additional charges for manufacturers_id 1 and 2 ...
Note: in theory, this could all be done in Item Rate item as the Item Rate would be 0 when only products are from manufacturers_id 1 and 2 ... and then the calculations for manufacturers_id 1 and 2 would be used ... providing you write the code correctly ...
Bookmarks