Flat Rate Shipping based on Product
I could use some help with the following. How can I implement this shipping scenario. For shipments to Canada only, if the order does not contain product A, it is a flat rate of $25. If the order contains 1 or more units of Product A, It is a flat rate of $35.
Thanks
Re: Flat Rate Shipping based on Product
In the shopping_cart.php class there is a function that you can use to see how many of something about a product is in the cart:
Code:
/**
* Method to calculate the number of items in a cart based on an abitrary property
*
* $check_what is the fieldname example: 'products_is_free'
* $check_value is the value being tested for - default is 1
* Syntax: $_SESSION['cart']->in_cart_check('product_is_free','1');
*
* @param string product field to check
* @param mixed value to check for
* @return integer number of items matching restraint
*/
function in_cart_check($check_what, $check_value='1') {
Using that, you could check if any of the Products exist and if the Order is for Canada, then add on to the Flat Rate shipping charge the extra charges for Canada ...