I need to set up shipping insurance based on several different flat rates.
The products have free shipping but require the insurance. How do I do this.
Thanks
Brian
I need to set up shipping insurance based on several different flat rates.
The products have free shipping but require the insurance. How do I do this.
Thanks
Brian
My only advice to you is to open up inlcudes/modules/order_total/ot_insurance.php and look around at the different rates (they're hard coded into the module), and see if you can adjust them to your needs. For example this section says:
if ($order->info['subtotal'] < 50.01) {
$insurance = 1.35;
If the order is less than $50.01, charge $1.35.
You may be able to do something like this, if you're charging these rates by cart total.
Good luck!
Hmm ... I'm going to brush up on my PHP
the only way I can think of that might work is to create a statement like:
if ($productID=30) {
insurance= 29.99 }
(you get the idea)
does this make sense?
Brian
It makes sense, though I believe the if statement would be a little different, I don't know if you'd need something like this:
if (int($_GET['product_id']) ??
I did a search in the developers tool kit for "product_id", perhaps doing that yourself will give you some ideas.
Then I think you'd need some sort of function in there that gets the product_id in the database if that's even able to do in that stage of the game? Then I don't know how it would take each product, then add up all the insurances?? Seems complicated to me. My point is, I'm not sure if the above code is enough
I'm just a php hacker, to be honest. I guess maybe I've progressed from a php hacker to a php mauler, but I'm still no guru. So, sorry for not having a better answer!!
ETA: Just thought of another idea, if you're having free shipping, perhaps you get close to your desired costs with the per unit shipping module, then enter different weights in the weight boxes, so that different items have higher charges. Then you could change the text from "shipping" to "insurance" with the language files....
Last edited by jettrue; 20 Mar 2007 at 04:08 PM.
Old thread but I think this is where everyone would tell me to put it so..
I appear to have the module installed correctly and it shows up in the Admin-modules-order total screen and can be edited but insurance does not seem to be getting added to either USPS (which I use to non-U.S.) or UPS (all U.S. shipments.
Any common problem out there that would cause this not to work?
Maybe I missed a thread somewhere but read most/all of them.
Thanks.
Sorry, no link-local work right now.
Does not show as option on checkout (would prefer it to be mandatory/added in by the way).
Only thing to tell me it's there right now is the Admin item that appears to be fine.
Because of that I don't even know where to start!
Thanks for quick reply and any suggestions you might have.
First off, make sure all of the files are uploaded.
Secondly, what is the sort order of the mod under "modules", "order total".
To do the mandatory, follow these instructions here:
http://www.zen-cart.com/forum/showpo...4&postcount=20
(of course we'll have to get it showing up first)
Copied the mod for later...hopefully! Thanks.
File uploading was a little bumpy at first for some reason but pretty sure they are in the right place now:
../zencart/includes/languages/english/modules/order_total/ot_insurance.php
../zencart/includes/modules/order_total/ot_insurance.php
Didn't seem to work in override places so this is where they are at now.
Fooled with sort order too but right now it is set back to default of 500.
Thanks for help.
Bookmarks