Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Per item handling charge for one category?

Per item handling charge for one category?

Locked

Views: 2,573

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
27 Oct 2010, 4:30 PM
#1
dkervin avatar

dkervin

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

Per item handling charge for one category?

Hi, all.

I have cloned table rate shipping modules set up and they work just like I want for one category of products (swimsuits).

Now I have another category of products (hookahs) and I would like to charge a flat 10.00 per hookah shipping/handling fee in addition to the table rates.

I realize the easiest solution would be to just add 10.00 to each hookah's price, but I need this fee to show up on the invoice.

Ideally, the invoice would show the product price, the rate selected by the customer from the table shipping modules, and an additional 10.00 handling fee per hookah.

Here is a link to the site - cosmickips.com. I have password protection on it so please use "sandbox" for the user name and "sandbox" for the password.

I am almost ready to go live and I am very excited. Any help would be greatly appreciated.

27 Oct 2010, 4:47 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Per item handling charge for one category?

What happens on an order with Products from both categories?

On your Table Rate table shipping module, what are you using? Weight, Item or Price?

27 Oct 2010, 6:06 PM
#3
dkervin avatar

dkervin

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

Re: Per item handling charge for one category?

Ajeh:

What happens on an order with Products from both categories?

On your Table Rate table shipping module, what are you using? Weight, Item or Price?

Item. I have 3 table rate clones set up like this:

Regular Up to 6 items $ 8.95, 7 + items $ 11.95
Priority Up to 6 items $ 14.90, 7 + items $ 23.90
Express Up to 6 items $ 23.00, 7 + items $ 39.00

If they have no hookahs in their order, this is fine, they can choose from those 3 shipping options.

If they have hookahs in their order, I would like to add a 10.00 handling fee per hookah, in addition to them choosing one of the 3 shipping options.

27 Oct 2010, 7:26 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Per item handling charge for one category?

What you can do is calculate how many you have:

global $cart;
$chk_hookla_cat_19 = $_SESSION['cart']->in_cart_check('master_categories_id','19');
$chk_hookla_cat_20 = $_SESSION['cart']->in_cart_check('master_categories_id','20');
$chk_hookla_cat_21 = $_SESSION['cart']->in_cart_check('master_categories_id','21');

$extra_hookla_charge = ($chk_hookla_cat_19 + $chk_hookla_cat_20 $chk_hookla_cat_21) * 10;

Then add the:
$extra_hookla_charge

to where you see the cost calculated for the shipping ...

You can add additional checks for the hookla categories using this method ...

27 Oct 2010, 8:29 PM
#5
dkervin avatar

dkervin

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

Re: Per item handling charge for one category?

That is above my skill level, I believe, but I think I'm getting a glimmer of understanding.

Please let me know if I am understanding this right.

I am creating a variable ($chk_hookla_cat_19) and then checking the shopping cart to see if there are any products from that category. My new variable now contains the number of products in the shopping cart from that category.

I do this for all 3 categories of hookahs, add them, then multiply by my handling fee.

My final hookah handling fee is now in the variable $extra_hookah_charge.

Now I add this variable to where I see the shipping cost calculated, along with the necessary text "Hookah Handling Fee" or something similar.

Could you please advise me as to which files I would need to modify with this code to achieve this?

Thank you very much for your help.

27 Oct 2010, 8:34 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Per item handling charge for one category?

You should see code similar to:

    $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 + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));

Put the new code above it and you want to add that final total to the cost:

    $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' => $extra_hookah_charge + $shipping + (MODULE_SHIPPING_TABLE_HANDLING_METHOD == 'Box' ? MODULE_SHIPPING_TABLE_HANDLING * $shipping_num_boxes : MODULE_SHIPPING_TABLE_HANDLING) ) ));
28 Oct 2010, 12:40 AM
#7
dkervin avatar

dkervin

New Zenner

Join Date:
Sep 2010
Posts:
19
Plugin Contributions:
0

Re: Per item handling charge for one category?

Excellent. Thank you very much, that did the trick. Now I just add that code to the other two shipping clones and I'm on my way.

28 Oct 2010, 2:58 AM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Per item handling charge for one category?

Thanks for the update that this can work for you ... :smile:

16 Nov 2010, 2:21 AM
#9
ftroopdad avatar

ftroopdad

New Zenner

Join Date:
Nov 2009
Posts:
5
Plugin Contributions:
0

Re: Per item handling charge for one category?

Thank you Ajeh,
This information allows me to charge a separate crating fee for each category. I have it setup for 14 categories on two shipping modules, UPS and R+L Carriers.

Thinks so much,
FtroopDad

16 Nov 2010, 4:38 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Per item handling charge for one category?

You are most welcome ... thanks for the update that this was able to help you ... :smile: