Forums / Built-in Shipping and Payment Modules / Table Rate/Free Shipping + Additional Optional Fee?

Table Rate/Free Shipping + Additional Optional Fee?

Locked

Started by msmith29063 on 20 Nov 2008, 6:35 AM · Views: 3,983

Results 1 to 20 of 28
This thread is locked. New replies are disabled.
20 Nov 2008, 6:35 AM
#1
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Table Rate/Free Shipping + Additional Optional Fee?

Okay, I have table rate shipping based on the amount of the order. Works great. And I have the free shipping (over $100) enabled in the order total. Works great. NOW, I need to add an OPTIONAL additional $15 fee at the end -- preferably a checkbox -- for expedited shipping. One flat rate for all products in the order. It would always be one amount. How would I do this? Thanks for your help!

21 Nov 2008, 11:28 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

Clone the Table Rate table shipping module and add $15 to the Handling Fee ...

Change the text to read Expedite ... or Really Really Fast ... or what have you ...

Would that work for you?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

22 Nov 2008, 12:28 PM
#3
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Thanks for looking at this, Linda. I need the expedited fee to be optional (selectable by a checkbox or something)? Will this do that? If so, this would be fine.

Also, if the additional fee is to be applied PER PRODUCT -- what's your recommendation there?

Thanks!

22 Nov 2008, 3:50 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

If the Table Rate table was correct for everything on normal shipping ...

Then on the Expedited you need to add $15.00 to the shipping, you can clone Table Rate table shipping module and use the handling fee ...

If on the Expedited you need to add $15.00 per item to the shipping, you can clone Table Rate table shipping module and use the handling fee * the number of items ...

Now what happens is they see:
Table Rate (normal price)
Table Rate Expedited (normal + 15.00)

And the customer can choose one or the other ...

You can change the text on the shipping modules in the language files ...

You can customize your clone of Table Rate table to add the extra charge ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Nov 2008, 3:36 AM
#5
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Ahhhh. That makes sense now. Thank you for the explanation.

One more quick question: Should I now disable free shipping in the order total (shipping is free for orders over $100 -- unless they add the $15 expedited shipping) and just do the free shipping in the table rate? Wouldn't the free shipping (in the order total admin) override all this?

24 Nov 2008, 3:52 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

The Free Shipping on the Order Totals module for Shipping ot_shipping overrides everything ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Nov 2008, 12:57 PM
#7
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

That's what I thought. BTW, I found out from the user that the expedited fee is per product AND that there is a category of products that this is NOT available for. Should I still use this method and have a script workaround for the category that it's not available for? Can you get me started with that? Any advice? Thanks -- and I'll leave you along after this...

24 Nov 2008, 2:01 PM
#8
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Question: And how do I set-up the expedited table rate handling fee to be PER ITEM?

24 Nov 2008, 3:00 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

You need to start with the right shipping module base ...

If you now want to do per item shipping then you need to use the Item Rate item as your base ...

You can run any combination of shipping modules or clone as many as you like or take a look in the Free Software Add Ons to see if any of these can help you with what you are trying to do ... or you can write your own ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 Nov 2008, 8:22 PM
#10
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

I apologize. I was just referring my question to your comment above:

If on the Expedited you need to add $15.00 per item to the shipping, you can clone Table Rate table shipping module and use the handling fee * the number of items ...

Now what happens is they see:
Table Rate (normal price)
Table Rate Expedited (normal + 15.00)
I just didn't know how to do the handling fee * the number of items. Is this easily done? Thank you so much!

25 Nov 2008, 4:08 AM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

In the Table Rate table shipping module the variable $total_count tells you how many items are in the cart ...

$total_count - $_SESSION['cart']->free_shipping_items() tells you how many are in the cart that are not marked as Free Shipping ...

The Handling fee comes from the value of MODULE_SHIPPING_TABLE_HANDLING and you can see where that is used in the module and adjust its value ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

28 Nov 2008, 9:05 PM
#12
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Okay. Thank you for the explanation. Not too difficult...

One last question and I'll put this issue to bed, I promise.

Is it possible to EXCLUDE a master category of products from being included with this handling (expedited) fee?

The category ID to exclude is 4.

So, if I'm purchasing three items and one of them is from master category 4, this shipping option would calculate the handling (expedited) fee by two items -- not three. Is this possible? Can you provide some direction here? Thank you!

29 Nov 2008, 3:45 AM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

There is a function in the shopping_cart class that you could use to check the number of items that match the master_categories_id and adjust the amount by that:

  /**
   * 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') {

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Nov 2008, 3:01 PM
#14
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Okay. That's great. The only issue I'm having now is that I have products in SUB-categories in category 4. The master_categories_id stores the sub-category ID, if the product is in one. My issue is that I am trying to check for the CATEGORY ID of 4. Is that possible? Or am I going to have to run the function for each sub-category in category 4 and tally them up? Thanks!

Question: And should this be performed inside the quote() function in my shipping module? Or does it matter where I put this?

30 Nov 2008, 7:36 PM
#15
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Crap. Okay -- I just found out that the expedited fee is for the ENTIRE order. Not per item. That's an easy fix to go back and remove the calculation.

Here's my new (and last) question: How can I disable this new expedited shipping option when there is ONLY one or more item(s) in the cart from master category 4? If there is a mix of items from category 4 AND others -- then the option is available. Or if there is items from categories other than 4, the option is available.

Thank you for your help!

1 Dec 2008, 2:52 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

You can use the same function using the master_categories_id for when to enable or disable the module by controlling the $this->enabled ...

When false, this does not show the module ...

When true, the module will show ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

12 Dec 2008, 8:35 PM
#17
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

I'm not exactly clear on how to implement. Could you elaborate more for me? Thank you for your help!

12 Dec 2008, 11:44 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

Find the section in the code that reads, note the } in there:

  }
  /**
   * Enter description here...
   *
   * @param unknown_type $method
   * @return unknown
   */

and change to read:

    global $cart;
    if ( (defined('IS_ADMIN_FLAG') && IS_ADMIN_FLAG == false) &&  $_SESSION['cart']->in_cart_check('master_categories_id', 4) > 0 ) {
        $this->enabled = false;
    }

  }
  /**
   * Enter description here...
   *
   * @param unknown_type $method
   * @return unknown
   */
 

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Dec 2008, 10:57 PM
#19
msmith29063 avatar

msmith29063

New Zenner

Join Date:
Jan 2008
Posts:
71
Plugin Contributions:
0

Re: Table Rate/Free Shipping + Additional Optional Fee?

Thanks again for your help, Linda. Unfortunately, this didn't test correctly. It works as it should if the order contains items from master categories other than 4. BUT, if I JUST purchase an item from master category 4, this shipping option is still being offered. Any ideas? Thanks!

24 Dec 2008, 3:49 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Table Rate/Free Shipping + Additional Optional Fee?

Not sure what to tell you other than to confirm that the master_categories_id is 4 on the product that you are purchasing as I am not able to duplicate this problem ...

For me, if nothing is from master_categories_id 4 I see Table Rate table shipping module, but if just 1 Product either by itself or with other products is from master_categories_id 4 then I do not see it ... :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!