-
Shipping per Categories
Can anyone help me out with shipping?
I recently added a new category, which have items that are very small, does not cost a lot to ship, so I need different ship fee for this category, but other category will need to be not touched.
here are the two categories that need shipping fees:
1. Waterslide Decals
2. Nail Art Waterslide Decals
I set #1 category as zone rate because the items are large, so shipping fee set at $2.50 US per sheet, Canada is $3.00 per sheet, and Rest of World is $6.16 per sheet.
now I add the new Nail Art Waterslide Decals, which are very small items, which will have less shipping fee, for example, US shipping will be $0.46 per sheet, Canada will be $2.00 per sheet, and rest of world will have $3.00 per sheet.
by the way, both categories, I set item weight to "1" (not sure is lb, or oz).
How do I set up the shipping modules so I dont over charge customers for #2 category?
Thank you so much in advance.
here is my website if you needed: http://the4thmuse.com
by the way, should I upgrade to newest zencart?
Arwen
-
Re: Shipping per Categories
This is rather complicated to write ...
I will see what I can come up with over the next few days or so ... I am such a glutton for punishment ...:lookaroun
-
Re: Shipping per Categories
And yes, you need to upgrade to v1.5.1 if possible, as soon as possible. V1.3.8a has known vulnerabilities and will get hacked sooner or later. Upgrading now will save you the trouble of recovering from a hack and then upgrading.
After you have upgraded you can concentrate on enhancements.
-
Re: Shipping per Categories
You could try this special shipping module that I wrote ...
This lets you set the Rates for each Category as well as a Rate for Categories not defined ...
Install it on your site and see if it works without error ...
Then for the 1st Category group enter the Categories that the Products are in for each of the Water Decals and the Rate of 2.50 ...
Then for the 2nd Category group enter the Categories that the Products are in for each of the Nail Art Waterslide Decals and the Rate of 0.46 ...
Then on the Undefined Categories, set the Rate to 0.0 ...
If this gives the rates correctly for the US, make a Zone Definition for the US and add it to this shipping module ...
Now, you need to Clone this shipping module and set it up in a similar manner for Canada and make its own Zone Definition for Canada ...
Then Clone it again for the Rest of the World and create a Zone Definition for the Rest of the World ...
-
Re: Shipping per Categories
Hi Ajeh Oba-san,
Thank you so much for reply back,
I have been sick for last few weeks and sorry not reply back to your sooner.
when you mentioned that you wrote this special shipping module just for me, where can I find this module to install?
Arwen
Quote:
Originally Posted by
Ajeh
You could try this special shipping module that I wrote ...
This lets you set the Rates for each Category as well as a Rate for Categories not defined ...
Install it on your site and see if it works without error ...
Then for the 1st Category group enter the Categories that the Products are in for each of the Water Decals and the Rate of 2.50 ...
Then for the 2nd Category group enter the Categories that the Products are in for each of the Nail Art Waterslide Decals and the Rate of 0.46 ...
Then on the Undefined Categories, set the Rate to 0.0 ...
If this gives the rates correctly for the US, make a Zone Definition for the US and add it to this shipping module ...
Now, you need to Clone this shipping module and set it up in a similar manner for Canada and make its own Zone Definition for Canada ...
Then Clone it again for the Rest of the World and create a Zone Definition for the Rest of the World ...
-
1 Attachment(s)
Re: Shipping per Categories
Sorry, thought I posted it ...
Try this attachment and set your categories_id in the different Category Groups with the prices that you want to charge for them ...
Then on the Undefined Categories set the shipping to 0.00
-
Re: Shipping per Categories
will do, Thank you so much for doing this for me!!!
Arwen
Quote:
Originally Posted by
Ajeh
Sorry, thought I posted it ...
Try this attachment and set your categories_id in the different Zones with the prices that you want to charge for them ...
Then on the Undefined Categories set the shipping to 0.00
-
2 Attachment(s)
Re: Shipping per Categories
Hi there,
I followed the file path and installed the two files within zip file to my server,
I was unable to modify "Zone Rates" section, I can only click on it. see attachments
please help me!!!
Attachment 13796
Attachment 13797
Quote:
Originally Posted by
Ajeh
Sorry, thought I posted it ...
Try this attachment and set your categories_id in the different Zones with the prices that you want to charge for them ...
Then on the Undefined Categories set the shipping to 0.00
-
Re: Shipping per Categories
You appear to be trying to customize the Zone Rate and the shipping module that I wrote should be called ItemCat ...
I meant to say the:
Quote:
Itemcat group1 categories
No clue why I said Zone ... must of been a senior moment ... :cool:
I will fix that in the post ...
-
Re: Shipping per Categories
Hi there,
So far I got my categories entered in "itemcat", but have no idea what you mean by below:
=============================================
If this gives the rates correctly for the US, make a Zone Definition for the US and add it to this shipping module ...
Now, you need to Clone this shipping module and set it up in a similar manner for Canada and make its own Zone Definition for Canada ...
Then Clone it again for the Rest of the World and create a Zone Definition for the Rest of the World ...
===========================================
I looked for "Zone Definition" but can not find it anywhere. its this also located within "Shipping Modules"?
Arwen
-
Re: Shipping per Categories
You want 3 sets of shipping rates for your category groups ...
1 US
2 Canada
3 Rest of the World
Once you can make the shipping work correctly for the US you would be cloning the Itemcat shipping module ...
You need to make 3 Zones for:
1 US
2 Canada
3 Rest of the World
This can be done manually or you can look in the FAQs with a search on:
zones
and you should find:
http://www.zen-cart.com/content.php?...ne-definitions
This has some quick ways to make various Zones that can be used for the Zone Definitions that you need ...
For example, what is *your* idea of the US? Is this the 48 states plus DC? The 50 States plus DC or the 50 States plus DC plus the US territories?
Once you have your Zone Definitions complete, we get to the "cloning" of the Itemcat shipping module ...
Cloning is done by copying the 2 shipping module files to new names:
/includes/modules/shipping/itemcat.php
/includes/languages/english/modules/shipping/itemcat.php
For Canada you can use:
/includes/modules/shipping/itemcatcan.php
/includes/languages/english/modules/shipping/itemcatcan.php
For the Rest of the World you can use:
/includes/modules/shipping/itemcatworld.php
/includes/languages/english/modules/shipping/itemcatworld.php
Then, in the files for Canada:
/includes/modules/shipping/itemcatcan.php
/includes/languages/english/modules/shipping/itemcatcan.php
you need to change all references to:
itemcat
to
itemcatcan
and then
ITEMCAT
to
ITEMCATCAN
these replacements are case sensitive ...
Then, for Rest of the world you would change in the files:
/includes/modules/shipping/itemcatworld.php
/includes/languages/english/modules/shipping/itemcatworld.php
all references to:
itemcat
to
itemcatworld
and for:
ITEMCAT
to
ITEMCATWORLD
again, these are case sensitive ...
Once you have the 3 sets of Itemcat files the the US, Canada and the Rest of the World made and set the Zones inside these modules ... you are using the same settings for each set of Category Group and the price that you want for each Zone ...
On the Pricing, you just use your 3 sets of prices:
1 US (itemcat)
Category Group 1 2.50
Category Group 2 .46
Undefined Categories 0.00
2 Canada (itemcatcan)
Category Group 1 3.00
Category Group 2 2.00
Undefined Categories 0.00
3 Rest of the World (itemcatworld)
Category Group 1 6.16
Category Group 3.00
Undefined Categories 0.00
If you read this post a few times, you should see how to build the 3 Zone Definitions that you need, then the cloned copies for Canada and the Rest of the World, then the Pricing for the Category groups in each one ...
And when your eyes start to cross and the words begin to blur ... don't be afraid to ask for help as you go along as many do need more help as they go through this process ... :lookaroun
-
Re: Shipping per Categories
OK, I cloned these files:
=============================================
For Canada you can use:
/includes/modules/shipping/itemcatcan.php
/includes/languages/english/modules/shipping/itemcatcan.php
For the Rest of the World you can use:
/includes/modules/shipping/itemcatworld.php
/includes/languages/english/modules/shipping/itemcatworld.php
=============================================
However my issue is, I am unable to remove "Zone Rates" value since there is no "remove" and "edit" buttons anymore since I installed custom itemcat module. so regardless what I put into my shopping cart, shipping values are pulling information from "Zone Rates".
any idea what I can fix this?
Thanks
Arwen
-
Re: Shipping per Categories
Sounds like you have typos in the cloned versions ...
Can you Zip your files:
/includes/modules/shipping/itemcatcan.php
/includes/languages/english/modules/shipping/itemcatcan.php
/includes/modules/shipping/itemcatworld.php
/includes/languages/english/modules/shipping/itemcatworld.php
and attach them to your post, please?
-
2 Attachment(s)
Re: Shipping per Categories
here are the files:
the first attached zip file is from: \includes\modules\shipping
the 2nd one is from: \includes\languages\english\modules\shipping
Quote:
Originally Posted by
Ajeh
Sounds like you have typos in the cloned versions ...
Can you Zip your files:
/includes/modules/shipping/itemcatcan.php
/includes/languages/english/modules/shipping/itemcatcan.php
/includes/modules/shipping/itemcatworld.php
/includes/languages/english/modules/shipping/itemcatworld.php
and attach them to your post, please?
-
Re: Shipping per Categories
Have you ever installed this Debug program for v1.3.8?
If not, please install it and try to reproduce the problem where you cannot see the Install or Delete in the Admin for the shipping ...
Then, look in the /cache directory for the Debug logs and read any that are created and post the contents here ...
-
Re: Shipping per Categories
should I remove the custom module frist, then run Debug program?
or just run Debug program?
Quote:
Originally Posted by
Ajeh
Have you ever installed this Debug program for v1.3.8?
If not, please install it and try to reproduce the problem where you cannot see the Install or Delete in the Admin for the shipping ...
Then, look in the /cache directory for the Debug logs and read any that are created and post the contents here ...
-
Re: Shipping per Categories
No, leave the shipping modules installed and the debugger may help determine the problem ...
I tested them and they seem to be working fine ...
One thing to also check is that the code files are in the:
/includes/modules/shipping
and that the language files are in the:
/includes/languages/english/modules/shipping
to make sure they did not get mixed up or might be missing ...
In the Tools ... Developers Tool Kit ... you could check in the bottom input box for:
itemcat.php
itemcatcan.php
itemcatworld.php
and make sure you see them in the right directories ...
-
Re: Shipping per Categories
Can you tell me where can I find this "Debut program" for v1.3.8.
sorry about all these questions, I am just not as savvy as you, but I do can follow instructions :)
Quote:
Originally Posted by
Ajeh
Have you ever installed this Debug program for v1.3.8?
If not, please install it and try to reproduce the problem where you cannot see the Install or Delete in the Admin for the shipping ...
Then, look in the /cache directory for the Debug logs and read any that are created and post the contents here ...
-
Re: Shipping per Categories
A search of the plugins for:
debug
will show this one:
http://www.zen-cart.com/downloads.php?do=file&id=606
-
Re: Shipping per Categories
Yay!!!!
I got it to work!!!
You are right all a long, I was not scroll to the right on my page, when I enter a long country codes for my Zone shipping for Rest of world section.
Now I got "Zone Rates" module disable, everything work great!!!
Now I only have one more question (I hope!!!)
People will not only purchase one sheet of decal from me, they always purchase more then one, some time even 10 sheets.
however I dont want to charge too much if they purchase more then one.
at my etsy store, when people purchase two sheets, the 2nd sheet will be extra $0.40 on top of $2.50 (the first sheet), and another extra $0.40 if they purchase 3 sheets.
how do I add this to the custom shipping module?
Thanks
Arwen
-
Re: Shipping per Categories
You would have to control how much is being charged in this section:
Code:
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
$chk_total_charge += ($chk_total_charge_constant * ${$chk_cat_group});
$chk_total_count += ${$chk_cat_group};
The price is set in:
$chk_total_charge_constant
you would want to change that from the amount you set per sheet of 2.50 to the lower amount of 0.40 when the count:
$chk_total_count
is at the number of sheets where you want to charge less ...
Keep in mind that the count:
$chk_total_count
is set after the charge is calculated ... so when the first item is calculated the count is 0 ...
Plus, you have to decide if all of the item counts when > 1 get changed to 0.40 or if you want different charges for the groups as it could get complicated to figure out the:
$chk_total_charge_constant
-
Re: Shipping per Categories
so I have to write a "IF" statement?
Quote:
Originally Posted by
Ajeh
You would have to control how much is being charged in this section:
Code:
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
$chk_total_charge += ($chk_total_charge_constant * ${$chk_cat_group});
$chk_total_count += ${$chk_cat_group};
The price is set in:
$chk_total_charge_constant
you would want to change that from the amount you set per sheet of 2.50 to the lower amount of 0.40 when the count:
$chk_total_count
is at the number of sheets where you want to charge less ...
Keep in mind that the count:
$chk_total_count
is set after the charge is calculated ... so when the first item is calculated the count is 0 ...
Plus, you have to decide if all of the item counts when > 1 get changed to 0.40 or if you want different charges for the groups as it could get complicated to figure out the:
$chk_total_charge_constant
-
Re: Shipping per Categories
Yes, you will need an IF in this section of the code ...
I would start by rearrange that section of code as:
Code:
$chk_total_count += ${$chk_cat_group};
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
$chk_total_charge += ($chk_total_charge_constant * ${$chk_cat_group});
so you can better tell if you are on sheet 1 or sheet 2, sheet 3 etc.
Then, you have to decide when/what to use the cost setting for:
$chk_total_charge_constant
the issue is how much to charge based on the count but you are dropping the rate based on count from 2.50 to 0.40 ...
The difficulty is, this is using multiple rates based on the Category ... it wasn't written to suddenly decide to charge different rates for different quantities for different categories ...
You have some categories for 2.50 and some categories for 0.46 ... then, you suddenly want on the categories for 2.50 to only charge the 2.50 if it is 1 sheet but then charge a different price of 0.40 if there are more than 1 sheet ...
But, this is not the same logic for all of the category groups, meaning that on the categories for the 2.50 you want 2.50 for sheet 1 and 0.40 for sheet 2+ but on the categories for 0.46 you want 0.46 for sheet 1 and 0.46 for sheet 2+ ...
I am not sure just how hard it will be to do that with the multiple categories settings ...
The main idea is to get the:
$chk_total_charge_constant
set to the right amount to charge for the sheet for the right category group at the right time ...
You will really need to work with that section to get the IF right on how much to charge ...
-
Re: Shipping per Categories
This is over my head, I dont think I can do any of what you suggested above :(
is there a shipping module will work for my situation? or do I need to pay someone to do this for me?
I am hoping to get this shipping module done, so I can upgrade to the new version of Zen Cart.
thank you so much for your help!
-
Re: Shipping per Categories
You could try this to charge sheet 1 2.50 and 0.40 sheet 2+ in category group 1 and charge sheet 1 0.46 and 0.40 sheet 2+ in category group 2
Code:
$chk_total_count += ${$chk_cat_group};
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
// $chk_total_charge += ($chk_total_charge_constant * ${$chk_cat_group});
$chk_total_charge += (${$chk_cat_group} > 0 ? (1 * $chk_total_charge_constant) + ( (${$chk_cat_group} - 1) * .40) : 0);
It should work but you will need to test it ...
-
Re: Shipping per Categories
it works for US and Rest of World shipping, Yay!!!!
however Canada shipping is not, it seems it charge the same shipping fees as US shipping.
I am not sure where I did wrong on itemcatcan.php, can you take a look?
Thank you!!!
Code:
<?php
/**
* @package shippingMethod
* @copyright Copyright 2003-2013 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version itemcatcan.php 1969 2104-01-03 06:57:21Z ajeh $
*/
class itemcatcan extends base {
/**
* $code determines the internal 'code' name used to designate "this" shipping module
*
* @var string
*/
var $code;
/**
* $title is the displayed name for this shipping method on the storefront
*
* @var string
*/
var $title;
/**
* $description is a soft name for this shipping method, rarely used
*
* @var string
*/
var $description;
/**
* module's icon, if any. Must be manually uploaded to the server's images folder, and an appropriate call to zen_image() added to the constructor.
*
* @var string
*/
var $icon;
/**
* $enabled determines whether this module shows or not during checkout.
* Can be updated with custom code in the module's update_status() method.
* Can be overridden with observers via notifier points NOTIFY_SHIPPING_CHECK_ENABLED_FOR_ZONE and NOTIFY_SHIPPING_CHECK_ENABLED
* @var boolean
*/
var $enabled;
/**
* additional category groups itemcatcan rate
*/
var $num_cat_group;
/**
* constructor
*
* @return itemcatcan
*/
function __construct() {
$this->code = 'itemcatcan';
$this->title = MODULE_SHIPPING_ITEMCATCAN_TEXT_TITLE;
$this->description = MODULE_SHIPPING_ITEMCATCAN_TEXT_DESCRIPTION;
$this->sort_order = MODULE_SHIPPING_ITEMCATCAN_SORT_ORDER;
$this->icon = ''; // add image filename here; must be uploaded to the /images/ subdirectory
$this->tax_class = MODULE_SHIPPING_ITEMCATCAN_TAX_CLASS;
$this->tax_basis = MODULE_SHIPPING_ITEMCATCAN_TAX_BASIS;
$this->enabled = (MODULE_SHIPPING_ITEMCATCAN_STATUS == 'True') ? true : false;
$this->update_status();
$this->notify('MODULE_SHIPPING_' . strtoupper($this->code) . '_INSTANTIATED');
/*
** CUSTOMIZE SETTING FOR THE NUMBER OF CATEGORY GROUPS NEEDED **
If Itemcat Rates module is currently installed ...
1. Change number below for the number of Category Groups for this->num_cat_group
2. Upload changed itemcatcan.php
3. Go to Modules ... Shipping ...
4. Go to Modules ... Shipping ... a second time to clear any error messages
5. Click on Itemcat Rates and Edit and Configure new Category groups
If Itemcat Rates module is not currently installed
1. Change number below for the number of Category Groups for this->num_cat_group
2. Upload changed itemcatcan.php
3. Go to Modules ... Shipping ...
4. Click on Itemcat Rates and Click Install
5. Edit and Configure new Item category groups
*/
$this->num_cat_group = 3;
if (IS_ADMIN_FLAG === true) {
// build in admin only additional category groups if missing in the configuration table due to customization of default $this->num_cat_group = 2
global $db;
for ($i = 1; $i <= $this->num_cat_group; $i++) {
$check = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEMCATCAN_GROUP_" . $i . "'");
if ($this->enabled && $check->EOF) {
$default_categories_group = '';
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Itemcat group" . $i . " categories', 'MODULE_SHIPPING_ITEMCATCAN_GROUP_" . $i ."', '" . $default_categories_group . "', 'What categories belong to this category group<br />Separate categories by commas, Example: 53,67 or 10, 12', '6', '0', 'zen_cfg_textarea(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost Itemcat group" . $i . "', 'MODULE_SHIPPING_ITEMCATCAN_COST" . $i ."', '" . '2.50' . "', 'The shipping cost will be multiplied by the number of items in an order that uses this Category Group.', '6', '0', now())");
}
}
} // build in admin only
}
/**
* Coders can add custom logic here in the update_status() method to allow for manipulating the $this->enabled status
*/
function update_status() {
global $order, $db;
if (IS_ADMIN_FLAG == TRUE) return;
// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code) == FALSE) $this->enabled = FALSE;
/** CUSTOM ENABLE/DISABLE LOGIC CAN BE ADDED IN THE AREA SPECIFIED BELOW **/
if ($this->enabled) {
global $template, $current_page_base;
// CUSTOMIZED CONDITIONS GO HERE
// Optionally add additional code here to disable the module by changing $this->enabled to false based on whatever custom rules you require.
// -----
// -----
// eof: optional additional code
}
//echo 'ITEM function ' . __FUNCTION__ . ' $this->enabled: ' . ($this->enabled ? ' ON' : ' OFF') . ' $shipping_weight: ' . $shipping_weight . '<br>';
}
/**
* Sets $this->enabled based on zone restrictions applied to this module
* @return boolean
*/
function check_enabled_for_zone()
{
global $order, $db;
if ($this->enabled == true && (int)MODULE_SHIPPING_ITEMCATCAN_ZONE > 0) {
$check_flag = false;
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . "
where geo_zone_id = '" . MODULE_SHIPPING_ITEMCATCAN_ZONE . "'
and zone_country_id = '" . (int)$order->delivery['country']['id'] . "'
order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$check_flag = true;
break;
} elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$check_flag = true;
break;
}
$check->MoveNext();
}
if ($check_flag == false) {
$this->enabled = false;
}
}
return $this->enabled;
}
/**
* Returns the value of $this->enabled variable
* @return boolean
*/
function check_enabled()
{
return $this->enabled;
}
/**
* Obtain quote from shipping system/calculations
*
* @param string $method
* @return array
*/
function quote($method = '') {
global $order, $total_count;
$chk_products_id_list_defined = '';
$chk_total_count = 0;
$chk_free_shipping_total_count = 0;
$chk_products_in_cart = $_SESSION['cart']->get_product_id_list();
//echo '$chk_products_in_cart: ' . $chk_products_in_cart . '<br><br>';
for ($i=1; $i<=$this->num_cat_group; $i++) {
$chk_cat_group = '$chk_cat_group_' . $i;
${$chk_cat_group} = 0;
$cat_group = '$cat_group_' . $i;
$cat_group_constant = constant('MODULE_SHIPPING_ITEMCATCAN_GROUP_' . $i);
${$cat_group} = preg_split("/[,]/" , $cat_group_constant);
$size = sizeof(${$cat_group});
if ($cat_group_constant == '') break; // do not continue if empty
for ($j=0, $n=$size; $j<$n; $j+=1) {
if (${$cat_group}[$j] != '') {
${$chk_cat_group} += $_SESSION['cart']->in_cart_check('master_categories_id', trim(${$cat_group}[$j]));
}
//echo 'Looking at trim(${$cat_group}[$j]): ' . trim(${$cat_group}[$j]) . '<br>';
// check free shipping products
global $categories_products_id_list;
$categories_products_id_list = '';
$chk_products_id_list = array();
$chk_cat_group_products = trim(${$cat_group}[$j]);
$chk_products_id_list = zen_get_categories_products_list($chk_cat_group_products);
//echo '<pre>'; echo var_dump($chk_products_id_list); echo '</pre>';
//echo 'itemcatcan $chk_products_id_list';print_r($chk_products_id_list);
if (is_array($chk_products_id_list) && sizeof($chk_products_id_list) > 0) {
// build products list
$list_of_products = '';
foreach($chk_products_id_list as $key => $value) {
$list_of_products .= $key . ', ';
}
// if any $list_of_products are in cart check if free shipping
$chk_products = trim(trim($list_of_products), ',');
//echo '$chk_products: ' . $chk_products . '<br>in cart $chk_products_in_cart: '. $chk_products_in_cart . '<br>';
$chk_donotchargeshipping = '';
$chk_donotchargeshipping_cnt = 0;
$arr1 = explode(", ", $chk_products_in_cart);
$arr2 = explode(", ", $chk_products);
// echo '<pre>'; echo var_dump($chk_products); echo '</pre>';
$chk_donotchargeshipping = array_intersect($arr1, $arr2);
//echo '<br>itemcatcan $chk_donotchargeshipping<br> '; print_r($chk_donotchargeshipping); echo '<br>';
foreach($chk_donotchargeshipping as $key2 => $value) {
$chk_products_id_list_defined .= $value . ', ';
$chk_donotchargeshipping_cnt = itemcatcan_free_shipping($value);
if ($chk_donotchargeshipping_cnt) {
$chk_free_shipping_total_count += 1;
echo '<br>Do not charge $key2 $value: ' . $value . ' $chk_donotchargeshipping_cnt: ' . $chk_donotchargeshipping_cnt . '<br>';
}
${$chk_cat_group} += -$chk_donotchargeshipping_cnt;
}
//echo 'Cat: ' . trim(${$cat_group}[$j]) . ' ${$chk_cat_group}: ' . ${$chk_cat_group} . '<br>';
}
}
$chk_total_count += ${$chk_cat_group};
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
// $chk_total_charge += ($chk_total_charge_constant * ${$chk_cat_group});
$chk_total_charge += (${$chk_cat_group} > 0 ? (1 * $chk_total_charge_constant) + ( (${$chk_cat_group} - 1) * .75) : 0);
}
//echo '$chk_total_count: ' . $chk_total_count . ' $chk_total_charge found: ' . $chk_total_charge . '<br>';
//echo '$chk_products_in_cart: ' . $chk_products_in_cart . '<br>vs $chk_products_id_list_defined: ' . $chk_products_id_list_defined . '<br>';
// check products undefined for Free shipping
//$chk_products_id_list
// if any $list_of_products are in cart check if free shipping
$chk_products_id_list_defined = trim(trim($chk_products_id_list_defined), ',');
//echo '$chk_products: ' . $chk_products . '<br>in cart $chk_products_in_cart: '. $chk_products_in_cart . '<br>';
$chk_donotchargeshipping_undefined = '';
$chk_undefined_free_shipping = 0;
$chk_free_shipping_total_count_undefined = 0;
$arr1 = explode(", ", $chk_products_in_cart);
$arr2 = explode(", ", $chk_products_id_list_defined);
$chk_donotchargeshipping_undefined = array_diff($arr1, $arr2);
foreach($chk_donotchargeshipping_undefined as $key2 => $value) {
// $chk_products_id_list .= $value . ',';
$chk_donotchargeshipping_undefined_cnt = itemcatcan_free_shipping($value);
if ($chk_donotchargeshipping_undefined_cnt) {
echo 'itemcatcan Do not charge UNDEFINED $key2: ' . $value . '<br>';
$chk_free_shipping_total_count_undefined += 1;
}
$chk_undefined_free_shipping += $chk_donotchargeshipping_undefined_cnt;
}
//echo '$chk_undefined_free_shipping: ' . $chk_undefined_free_shipping . '<br>';
// calculate any undefined categories and add to $chk_total_charge
$undefined_products = $_SESSION['cart']->count_contents() - ($chk_total_count + ($chk_free_shipping_total_count + $chk_undefined_free_shipping));
$undefined_products_charge = (MODULE_SHIPPING_ITEMCATCAN_COST_UNDEFINED * ($undefined_products - $chk_undefined_free_shipping));
//echo '$undefined_products: ' . $undefined_products . ' $undefined_products_charge: ' . $undefined_products_charge . '<br>';
$chk_total_charge += $undefined_products_charge;
//echo 'TOTAL CHARGE $chk_total_charge: ' . $chk_total_charge . '<br>';
// adjusted count for free shipping
$item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_ITEMCATCAN_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => MODULE_SHIPPING_ITEMCATCAN_TEXT_WAY,
'cost' => ($chk_total_charge) + MODULE_SHIPPING_ITEMCATCAN_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title);
$this->notify('MODULE_SHIPPING_' . strtoupper($this->code) . '_QUOTES_PREPARED');
return $this->quotes;
}
/**
* Check to see whether module is installed
*
* @return boolean
*/
function check() {
global $db;
if (!isset($this->_check)) {
$check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEMCATCAN_STATUS'");
$this->_check = $check_query->RecordCount();
}
return $this->_check;
}
/**
* Install the shipping module and its configuration settings
*/
function install() {
global $db;
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Itemcat Shipping', 'MODULE_SHIPPING_ITEMCATCAN_STATUS', 'True', 'Do you want to offer per itemcatcan rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())");
for ($i = 1; $i <= $this->num_cat_group; $i++) {
$check = $db->Execute("select * from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEMCATCAN_GROUP_" . $i . "'");
if ($this->enabled && $check->EOF) {
$default_categories_group = '';
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Itemcat group" . $i . " categories', 'MODULE_SHIPPING_ITEMCATCAN_GROUP_" . $i ."', '" . $default_categories_group . "', 'What categories belong to this category group<br />Separate categories by commas, Example: 53,67', '6', '0', 'zen_cfg_textarea(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost Itemcat group" . $i . "', 'MODULE_SHIPPING_ITEMCATCAN_COST" . $i ."', '" . '2.50' . "', 'The shipping cost will be multiplied by the number of items in an order that uses this Category Group.', '6', '0', now())");
}
}
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost for Itemcat category groups undefined', 'MODULE_SHIPPING_ITEMCATCAN_COST_UNDEFINED', '', 'The shipping cost will be multiplied by the number of items in an order that are not in a defined category group.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEMCATCAN_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEMCATCAN_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_ITEMCATCAN_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEMCATCAN_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
$db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEMCATCAN_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");
}
/**
* Remove the module and all its settings
*/
function remove() {
global $db;
$db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_ITEMCATCAN\_%'");
}
/**
* Internal list of configuration keys used for configuration of the module
*
* @return array
*/
function keys() {
$keys = array('MODULE_SHIPPING_ITEMCATCAN_STATUS', 'MODULE_SHIPPING_ITEMCATCAN_HANDLING', 'MODULE_SHIPPING_ITEMCATCAN_TAX_CLASS', 'MODULE_SHIPPING_ITEMCATCAN_TAX_BASIS', 'MODULE_SHIPPING_ITEMCATCAN_ZONE', 'MODULE_SHIPPING_ITEMCATCAN_SORT_ORDER');
for ($i=1; $i<=$this->num_cat_group; $i++) {
$keys[] = 'MODULE_SHIPPING_ITEMCATCAN_GROUP_' . $i;
$keys[] = 'MODULE_SHIPPING_ITEMCATCAN_COST' . $i;
}
$keys[] = 'MODULE_SHIPPING_ITEMCATCAN_COST_UNDEFINED';
return $keys;
}
}
function itemcatcan_free_shipping($product_id) {
global $db;
if ($product_id == '' || $product_id == 0 || !$product_id) {
// echo 'Blank $product_id<br>';
return 0;
}
if (!zen_has_product_attributes_downloads_status($product_id)) {
//echo 'itemcatcan_free_shipping 1 - A Download: ' . $product_id . ' - ' . zen_has_product_attributes_downloads_status($product_id) . '<br><br>';
return 1;
}
$sql = "SELECT product_is_always_free_shipping, products_virtual, products_model, products_weight from " . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$product_id . "'";
$chk_free_shipping = $db->Execute($sql);
if (($chk_free_shipping->fields['product_is_always_free_shipping'] == 1) or ($chk_free_shipping->fields['products_virtual'] == 1) or (preg_match('/^GIFT/', addslashes($chk_free_shipping->fields['products_model'])))) {
//echo 'itemcatcan_free_shipping 1 - B Virtual: ' . $product_id . '<br><br>';
return 1;
}
if ($chk_free_shipping->fields['products_weight'] == 0 && ORDER_WEIGHT_ZERO_STATUS == 1) {
//echo 'itemcatcan_free_shipping 1 - C Weight: ' . $product_id . '<br><br>';
return 1;
}
return 0;
}
-
Re: Shipping per Categories
I believe this line:
Code:
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCAT_COST' . $i);
should be:
Code:
$chk_total_charge_constant = constant('MODULE_SHIPPING_ITEMCATCAN_COST' . $i);
-
Re: Shipping per Categories
YAY!!! It all works...!!!!
I bought everyone round of coffees!!!
Thank you so much!!!!
-
Re: Shipping per Categories
Glad that all is now working for you!
Thanks especially for the coffees and donuts! It really helps the Zen Cart Team to continue to help you ... :cool:
-
Re: Shipping per Categories
Ajeh Oba San -
(giddy with excitement). Will this mod you wrote work in the case when:
1. I have 3 clones of the Zone Rates working just fine
2. Setting a Per Unit (or other shipping module) to a specific category
3. When a use adds two different products from different categories, the shipping adds fine in the cart?
thanks a bunch!
gabstero
-
Re: Shipping per Categories
This is designed to assign a single rate to each Category for pricing.
So it will not work like Per Unit perweightunit that uses the Product Weight to determine the shipping cost of a Product.
It will not work like Zone Rate zones that uses either Item, Weight or Price to determine the shipping costs based on specific country zones.
Can you be more specific in describing what it is exactly that you are trying to do with shipping? :lookaroun
-
Re: Shipping per Categories
Ajeh -
thanks for giving me the chance to speak it out :-)
I am planning to ship items from at least (for now) two different locations in the world. The majority of the categories (with products originated in Budapest, Hungary) will include items that use the Zone Rate module to calculate the shipping from that origin.
But there are (for now) some products (I grouped them in a separate category) that originate in a whole different location (say NYC, USA).
What can I do to calculate the shipping rate depending from where the product originates?
I was thinking of grouping the products that originate from a different location in one separate category and handle that category with a different shipping module (preferably Zone Rate).
Please let me know if I am making sense.
thanks!
g
-
Re: Shipping per Categories
What are the settings in your Zone Rates zones right now?
Basically, are you trying to say:
3 Products from categories_id 12 ship from New York so 3 * $2.75 = $8.50
2 Products from categories_id 15 ship from Florida so 2 * 1.75 = $3.50
then add that to the Zone Rates zones shipping amount?
Or, do you want do something like that, but each Zone defined in Zone Rates zones has a different shipping cost for the two different categories_id?
-
Re: Shipping per Categories
Thanks Ajeh -
The latter of your reply. The products shipped from FL should have a different shipping cost than the ones sent from NYC. It is going to be more drastic than that since we are talking of products shipped from two different locations in the world so shipping cost to customer has to be calculated relative to their origins.
hope I am making sense.
thanks
g
-
Re: Shipping per Categories
I really need to know what settings you are using in the Zone Rates zones shipping ...
Go to the Modules ... Shipping ... and click on Zone Rates zones shipping and post what is in the right hand panel ...
Are the shipping costs for the two Categories the same for all shipping zones?
-
Re: Shipping per Categories
Thanks Ajeh!
Are the shipping costs for the two Categories the same for all shipping zones?
No. I want them to be different calculated in relation from where those shipments are originating.
I didn't instal your mod yet though. This is a fresh ZC v1.5.1 install.
Here it is what I have in the Zone Rate:
Zone Based Rates for UPS
Enable Zones Method
True
Calculation Method
Weight
Tax Class
--none--
Tax Basis
Shipping
Sort Order
0
Skip Countries, use a comma separated list of the two character ISO country codes
Zone 1 Countries
Zone 1 Shipping Table
Zone 1 Handling Fee
0
Handling Per Order or Per Box Zone 1 (when by weight)
Order
Zone 2 Countries
HK,
Zone 2 Shipping Table
0.5:31, 1.0:35, 1.5:39, 2.0:43, 2.5:47, 3.0:52, 3.5:57, 4.0:62, 4.5:67, 5.0:72, 5.5:73, 6.0:75, 6.5:77, 7.0:78, 7.5:80, 8.0:81, 8.5:82, 9.0:83, 9.5:85, 10.0:86, 10.5:87, 11.0:88, 11.5:89, 12.0:90, 12.5:91, 13.0:91, 13.5:92, 14.0:93, 14.5:93, 15.0:94, 15.5:95, 16.0:96, 16.5:97, 17.0:98, 17.5:98, 18.0:99, 18.5:99, 19.0:99, 19.5:99, 20.0:100, 20.5:104, 21.0:104, 22.0:109, 23.0:114, 24.0:119, 25.0:124, 26.0:129, 27.0:134, 28.0:139, 29.0:144, 30.0:149, 31.0:154, 32.0:159, 33.0:164, 34.0:169, 35.0:174, 36.0:179, 37.0:184, 38.0:189, 39.0:194, 40.0:199, 50.0:228, 60.0:274, 70.0:319, 80.0:362, 90.00:407, 100.0:448,
Zone 2 Handling Fee
0
Handling Per Order or Per Box Zone 2 (when by weight)
Order
Zone 3 Countries
Zone 3 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 3 Handling Fee
0
Handling Per Order or Per Box Zone 3 (when by weight)
Order
Zone 4 Countries
Zone 4 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 4 Handling Fee
0
Handling Per Order or Per Box Zone 4 (when by weight)
Order
Zone 5 Countries
US,CA, MX, PR
Zone 5 Shipping Table
0.5:18, 1:22, 1.5:26, 2:30, 2.5:34, 3:37, 3.5:41, 4:44, 4.5:47, 5:51, 5.5:54, 6:57, 6.5:108, 7:114, 7.5:119, 8:125, 8.5:127, 9:130, 9.5:132, 10:134, 10.5:136, 11:138, 11.5:140, 12:142, 12.5:144, 13:147, 13.5:149, 14:151, 14.5:153, 15:155, 15.5:158, 16:160, 16.5:163, 17:166, 17.5:168, 18:172, 18.5:175, 19:178, 19.5:181, 20:185, 20.5:194, 21:194, 22:203, 23:213, 24:222, 25:231, 26:240, 27:250, 28:259, 29:268, 30:277, 31:286, 32:296, 33:305, 34:314, 35:323, 36:333, 37:342, 38:351, 39:360, 40:370, 50:454, 60:544, 70:593, 80:668, 90:752, 100:779
Zone 5 Handling Fee
0
Handling Per Order or Per Box Zone 5 (when by weight)
Order
Zone 6 Countries
Zone 6 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 6 Handling Fee
0
Handling Per Order or Per Box Zone 6 (when by weight)
Order
Zone 7 Countries
Zone 7 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 7 Handling Fee
0
Handling Per Order or Per Box Zone 7 (when by weight)
Order
Zone 8 Countries
Zone 8 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 8 Handling Fee
0
Handling Per Order or Per Box Zone 8 (when by weight)
Order
Zone 9 Countries
Zone 9 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 9 Handling Fee
0
Handling Per Order or Per Box Zone 9 (when by weight)
Order
Zone 10 Countries
Zone 10 Shipping Table
3:8.50,7:10.50,99:20.00
Zone 10 Handling Fee
0
Handling Per Order or Per Box Zone 10 (when by weight)
Order
thanks!
g
-
Re: Shipping per Categories
Currently, shipping is based on Product Weight ...
Let's assume these special Products are from categories_id 12 and categories_id 15 ...
Will ALL zones have the same shipping rate for Products in categories_id 12?
Will ALL zones have the same shipping rate for Products in categories_id 15?
The idea is to count the number of Items in categories_id 12 and categories_id 15 then multiple those by their specific shipping cost ...
So if 3 Products are from categories_id 12 and 2 Products are from categories_id 15, does that rate get computed as:
3 * 2.75 = 8.25 and add that to the current charges for each of the Zones
2 * 1.75 = 3.00 and add that to the current charges for each of the Zones
to get the total shipping cost ...
-
Re: Shipping per Categories
Ajeh -
Thanks - To answer your questions:
Quote:
Originally Posted by
Ajeh
Currently, shipping is based on Product Weight ...
Let's assume these special Products are from categories_id 12 and categories_id 15 ...
Will ALL zones have the same shipping rate for Products in categories_id 12?
Yes.
Quote:
Originally Posted by
Ajeh
Will ALL zones have the same shipping rate for Products in categories_id 15?
Yes. But note that the products from this category ship from a different location that the ones in categories_id 12. So their rates should be calculated accordingly.
If easier, it would be nice to apply Product Weight shipping module strictly to this category. This way I have two categories that have two different shipping modules.
Quote:
Originally Posted by
Ajeh
The idea is to count the number of Items in categories_id 12 and categories_id 15 then multiple those by their specific shipping cost ...
So if 3 Products are from categories_id 12 and 2 Products are from categories_id 15, does that rate get computed as:
3 * 2.75 = 8.25 and add that to the current charges for each of the Zones
2 * 1.75 = 3.00 and add that to the current charges for each of the Zones
to get the total shipping cost ...
Yes - that's be nice!
thanks a lot!!
-
Re: Shipping per Categories
Cannot use weight as weight is what is used for Zone Rates ...
You can, however, use 0 weight so it does not add anything but the calculated rate for the two categories ...
In the file:
/includes/modules/shipping/zones.php
add the code in RED:
Code:
// bof: calculate rates for categories_id 12 and 15
$chk_cat12 = 0;
$chk_cat15 = 0;
$chk_cat12 = $_SESSION['cart']->in_cart_check('master_categories_id','12');
$chk_cat15 = $_SESSION['cart']->in_cart_check('master_categories_id','15');
$chk_cat12 = $chk_cat12 * 2.75;
$chk_cat15 = $chk_cat15 * 1.75;
$extra_charge = $chk_cat12 + $chk_cat15;
$this->quotes = array('id' => $this->code,
'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE,
'methods' => array(array('id' => $this->code,
'title' => $shipping_method,
'cost' => $shipping_cost + $extra_charge)));
// eof: calculate rates for categories_id 12 and 15
Note: check your settings on Configuration ... Shipping/Packaging ... for what you have on:
Quote:
Order Free Shipping 0 Weight Status
If there is no weight to the order, does the order have Free Shipping?
0= no
1= yes
Note: When using Free Shipping, Enable the Free Shipping Module this will only show when shipping is free.
that should be set to 0 so these 0 weight products do not affect your Zone Rates ...
-
Re: Shipping per Categories
Ajeh - thanks so much!!
Is there a specific spot I should insert this snippet in the zones.php?
thanks
-
Re: Shipping per Categories
Exactly where I placed it ...
The code in BLACK is current existing code in the zones.php file ... you add the new code in RED around and within the current existing code in BLACK in the zones.php file ...
-
Re: Shipping per Categories
@Ajeh
Just noted a little typo in the header of both files:
Code:
@version itemcat.php 1969 2104-01-03 06:57:21Z ajeh $
Don't think I will be alive then :laugh:
-
Re: Shipping per Categories
Ajeh -
thanks so much! it is seems to be working fine but I am realizing that calculating the extra charge will always be related to the global rate Table. Currently I have that set to whatever they get on the malaysian continent (UPS Zone Rates).
The cat 12, and 15 has items shipped from the US. if someone buys and item from one of these categories that ships from the US to the US, the calculated rate is too high. Should be actually less that as if it is shipped from Malaysia (all the categories not affected my the mod).
hope I am making sense.
thanks!
g
-
Re: Shipping per Categories
Quote:
Originally Posted by
frank18
@Ajeh
Just noted a little typo in the header of both files:
Code:
@version itemcat.php 1969 2104-01-03 06:57:21Z ajeh $
Don't think I will be alive then :laugh:
Always have been a tad bit dyslexic ... :blush:
-
Re: Shipping per Categories
Quote:
Originally Posted by
gabstero
Ajeh -
thanks so much! it is seems to be working fine but I am realizing that calculating the extra charge will always be related to the global rate Table. Currently I have that set to whatever they get on the malaysian continent (UPS Zone Rates).
The cat 12, and 15 has items shipped from the US. if someone buys and item from one of these categories that ships from the US to the US, the calculated rate is too high. Should be actually less that as if it is shipped from Malaysia (all the categories not affected my the mod).
hope I am making sense.
thanks!
g
You need to be a lot more specific ...
If you are trying to say the charges of $2.75 and $1.75 have to change with each different Zone then this is a heck of a lot harder to write, which is what I was trying to ask you about in post #37 ...
-
Re: Shipping per Categories
Ajeh -
I am sorry if I confused you. Reading again my post I can see it's confusing. The scenario is really simple:
The store has 3 categories:
- Two of the categories has products originating in Malaysia. The manufacturer here prefers the Zone Rate module.
- One category has products originating in USA. The manufacturer here prefers the Per Unit if shipped in the USA and the USPS if shipped worldwide.
Both locations are shipping worldwide including even their country of origin. Chances are that a customer say from... Romania would have a product from Malaysia and from the USA in the cart.
A friend mentioned that you wrote a mod somewhere where you can selectively disable shipping modules based on categories. Is this thread addressing that? That would be the ideal situation for me.
does this make sense? Again I apologize for the confusion.
thanks
g
-
Re: Shipping per Categories
On the Zone Rate zones shipping module, use the Zones in order as in Zone 1, Zone 2, Zone 3 etc. Do not skip Zones and then add more in Zones ...
You appear to be skipping Zones then using a Zone then skipping Zones then using Zone ...
I am going to have to think on this more as there will be issues when someone orders from multiple categories ...
Perhaps if you could spell out what shipping method is suppose to show for which Category and what to do when there is a mixed cart of Products from each of the categories and what shipping module should then be used ...
-
Re: Shipping per Categories
Quote:
Originally Posted by
Ajeh
On the Zone Rate zones shipping module, use the Zones in order as in Zone 1, Zone 2, Zone 3 etc. Do not skip Zones and then add more in Zones ...
You appear to be skipping Zones then using a Zone then skipping Zones then using Zone ...
I was skipping zones - that might have been the issue.
Quote:
Originally Posted by
Ajeh
I am going to have to think on this more as there will be issues when someone orders from multiple categories ...
Perhaps if you could spell out what shipping method is suppose to show for which Category and what to do when there is a mixed cart of Products from each of the categories and what shipping module should then be used ...
Thanks Ajeh - sure it is simple:
Category 1 (and its nested categories): using Zone Rates
Category 2 (and irs nested categories): using USPS api
It might be easier to just make a separate purchase for items from each location because indeed, if customer has items from different location, calculating the shipping rate might be a pain. But here's an idea:
What if customer has mixed items from different categories in the cart, price is calculated using the cheapest rate for each location? Example:
Item from category 1 (using Zone Rates)
Item form Category 2 (using USPS api)
Shipping rate total should be Zone Rate + Cheapest USPS rate
thanks
g
-
Re: Shipping per Categories
On Category 1 and is subcats, are you actually just trying to charge $4.00 per 0.5lbs?
What happens to those not in the Countries for:
HK, US, CA, MX and PR
are you just trying not to ship the Products in Category 1 and subcats to anywhere not in these 5 countries?
Do your Products that use USPS ship everywhere or only to these 5 countries?
-
Re: Shipping per Categories
Hello everyone !!
I have been searching for quite few days, but could not find anywhere..
I will be thankful if someone helps me here....
I want to setup shipping module that calculates the shipping cost by weight as well as price.
I am using two types of shipping on my website https://shopping.muteyaar.org - expedited shipping and regular mail shipping , both with zone rates that calculate by weight of shipment.
Now, the problem is that I want to restrict regular mail shipping for orders of high value (say USD 100 for example). I have already restricted the weight element to 1 KG. More than 1 KG is not shipped through regular mail... But I want also want to restrict the price value.
I mean I want to restrict regular mail shipping for orders of more than 100 USD price and 1 KG weight.
Only the orders with value less than 100 USD and weight 1 KG should be able to be shipped through regular mail......
Is that possible?
Kindly help me out on this.
thanks in advance.