Zen Cart Logo
Forums / General Questions / Adding a Residential Shipping checkbox in the Table Rate Module

Adding a Residential Shipping checkbox in the Table Rate Module

Views: 1,007

Results 1 to 3 of 3
5 Jun 2011, 2:38 AM
#1
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Adding a Residential Shipping checkbox in the Table Rate Module

I have modified the table.php shipping module to calculate shipping costs based a percentage of product price for each category. Now I need one more thing... I want to add a checkbox (on the estimator page as well as the checkout shipping page) that can be checked if the buyer has a residential shipping address. Then my code will add a predetermined surcharge for the residential address.

I am using the Table Rate module so I don't need any UPS or FedEx stuff, just a simple checkbox so they can click it if they want to signify that we are shipping to a residential address.

I imagine I need to set a global variable (ie: RESIDENTIAL_ADDRESS) that will store if they choose the residential address checkbox either from the shipping estimator screen or the checkout shipping screen and then my code in table.php can check that and add the appropriate amount to the total shipping cost variable ($this->quotes: 'cost' => $shipping).

Now I'm foggy on how to actually do this though. I know I'd edit the template files to add the checkbox but how do I actually track/store the varaiable?

Thanks for the help!

1 Jul 2011, 3:25 PM
#2
davemehta avatar

davemehta

Zen Follower

Join Date:
Aug 2005
Posts:
130
Plugin Contributions:
0

Re: Adding a Residential Shipping checkbox in the Table Rate Module

Ok, I'm digging this one up because I really need to make progress on it.

All I'm trying to accomplish is...
Add a checkbox at checkout, that if checked, will add $x dollars to the shipping price, otherwise leave it the same.

I've outlined how I think I need to go about this but need help on finding variables and files to make this happen. Appreciate any help I can get!

2 Jul 2011, 11:43 AM
#3
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Adding a Residential Shipping checkbox in the Table Rate Module

This is not just a case of adding a "simple" checkbox (in itself quite simple though) but your complications come in with the FUNCTION that you want it to perform... ie: ADDING a cost to the overall consignment value... and if this service is TAXABLE, then you have an additional challenge.

And if it was checked by mistake, what processes need be invoked to SUBTRACT the amount?

If it were SIMPLE, then you would have had several replies already.

When plotting these sorts of requirements, you not only have to think of how to ADD the variable, but also how to SUBTRACT it, and each is a separate function.

Your best bet is to solicit commercial help.