rbartz Posted March 13, 2003 Share Posted March 13, 2003 Here is a contribution that calculates Shipping Insurance based on a RATE times the TOTAL order (less tax, including shipping) minus any EXEMPT amount. I needed it for UPS but it should work well with any other shipping method that uses a similar scheme for calculating the fees. http://www.oscommerce.com/community/contributions,1069 UPS gives insurance free on the first $100 of value, and charges 50 cents per $100 after that... so this calculates a shipping insurance fee of 50 cents (RATE) for each $100 or part thereof (INCREMENT) on the amount above $100 (EXEMPT). The RATE, EXEMPT amount and INCREMENT amounts are all configurable in the Modules->Order Total Modules-> Shipping Insurance Edit panel. The customer CANNOT choose whether to add it or not if you turn it on. That seemed dumb to me since I end up with the loss if they don't insure. I ought to be the one to choose... You can turn the module on or off, and choose if it is for national, international, or both shipments, and even set a tax rate on the shipping insurance if needed. Gunter Sammet rewrote Harold Ponce de Leon's ot_loworderfee.php to start this, I rewrote his work. Hope it works for you! I am using it live with a 11 November 2002 snapshot and authorizenet and mail order payment modules. careintilky 1 Quote Link to comment Share on other sites More sharing options...
Deskdirect Posted March 13, 2003 Share Posted March 13, 2003 This is just what I have been waiting for. It would have been nice if it included a admin controlled option to add special fees like delivery confirmation......... but I am not complaining! The instructions are vague. I added the files to the order_total directories in the catalog directory............ now what? The special instructions - do they apply if you are not using the low order fee module or do the instruction apply only to the placement of the added part and should be added by everyone? HELP I've got all sorts of errors happening? Warning: main(/www/m/xxxxx/htdocs/store/includes/languages/english/modules/order_total/ot_insurance.php) [function.main]: failed to create stream: No such file or directory in /www/m/xxxx/htdocs/admin/modules.php on line 120 Warning: order_total(includes/languages/english/modules/order_total/ot_insurance.php) [function.order-total]: failed to create stream: No such file or directory in /www/m/xxxxx/htdocs/store/includes/classes/order_total.php on line 25 HELP! Quote Link to comment Share on other sites More sharing options...
rbartz Posted March 14, 2003 Author Share Posted March 14, 2003 Hi... There are only two files and the readme... You evidently did not install the language file. When you unzip the package, you should have the correct directory stucture in a directory named "shipping_insurance". You may have unzipped the files NOT using folder names... no good. Unzip preserving the directory structure. Then copy the two files into the two directories where you find then.... One is /includes/languages/english/modules/order_total/ot_insurance.php The other is /includes/modules/order_total/ot_insurance.php After that it is just a matter of going to admin, turning it on, and adjusting the values... the defaults are for UPS. If you do not know how to unzip a file preserving directory structure, e-mail me and I will send you a self-executing zip that will do it for you. Quote Link to comment Share on other sites More sharing options...
drakonan Posted March 14, 2003 Share Posted March 14, 2003 This is exactly what I have wanted as well... I use authorize.net to take the money from user's credit card, though. Is this going to add the additional charge amount to authorize.net also? I've heard about people modifying the "total" value and (while it SHOWS the correct price) it charges the "pre-modification" price (without added insurance) to authorize.net What I mean is will authorize.net recieve the total price with insurance included, or will it also need to be modified to grab the new total price (with insurance) Tell me if I've made it clear enough. I'm trying to say that I'm afraid that it might LOOK right (on the invoice) but authorize.net will charge the TOTAL to the credit card WITHOUT (!) insurance. Thanks for your time, Brandon Quote - - - - Sometimes, ignorance is bliss. Link to comment Share on other sites More sharing options...
Deskdirect Posted March 14, 2003 Share Posted March 14, 2003 Thanks, the file did open without a file directory structure. I downloaded it again with a different program and it worked out fine. This is just what I have been waiting for. It would have been nice if it included a admin controlled option to add special fees like delivery confirmation......... but I am not complaining! Can you think about adding anther feature like delivery confirmation? Thanks again for all of your effort! Annette Quote Link to comment Share on other sites More sharing options...
rbartz Posted March 14, 2003 Author Share Posted March 14, 2003 Brandon, Just do "Step 3" in the readme.txt installation, and it will work perfectly with the authorize_direct ADC Payment Module. There are some other posts about all that the last few days. Annete, IF I have some time this weekend, I will look into that... RDB Quote Link to comment Share on other sites More sharing options...
Deskdirect Posted March 15, 2003 Share Posted March 15, 2003 rbartz, I ran into a snag! I'm using PayPal IPN - I have the option of including shipping in the order total but PayPal IPN won't allow me to include the insurance. Since I'm without a Merchants Account I guess this it was just not to be. Thanks, Annette BTW - It works perfectly with checks/moneyorder payments! Quote Link to comment Share on other sites More sharing options...
rbartz Posted March 15, 2003 Author Share Posted March 15, 2003 I don't use Paypal, so am not familiar with where that module gets its totals. Most payment modules use a final total (like AuthNet) and get authorization for that amount. If Paypal gets a total as parts (subtotal, tax, shipping, etc.) then the module would need to look at all the parts. The author of the PayPal IPN would probably be glad to help you do this. "Ask and you (probably) will receive." It would seem like good programmig for a payment module to look at all order_total modules like the OSC program does so that discounts, add-ons like this, and other adjustments to totals would all be considered without having to alter the payment module for each variant. Since this is an order_total module it is processed and included in the "totaling" table on an order automatically, and thus it should work with almost all of the payment modules automatically with no adjustments necessary. Quote Link to comment Share on other sites More sharing options...
Deskdirect Posted March 16, 2003 Share Posted March 16, 2003 rbartz, Thanks for the reply. I honestly thought my understanding of how any the order_total_modules were processed was flawed. I include the url of this post in another post I made to the PayPal IPN contrib post - your response clearly laid out exactly what I could not express. Thanks! I'll keep you posted. Annette Quote Link to comment Share on other sites More sharing options...
drakonan Posted March 22, 2003 Share Posted March 22, 2003 This is a newbie and actually embarrasing Q. I haven't kept track of what modules I add to the software (I know that's bad) I didn't think I'd need more than one or two... Incorrect thinking. Anyone making a new site KEEP TRACK OF EVERYTHING YOU DO. I haven't done too much and may even go to MS1 before I go live so i can track everything I add... But anyway... How do I know if I've added the ADC connection to my osC? I don't think I have, but I called up authorize.net and the guy checked my account and said i was using the best and most current method of connecting to them (He called it AIM) Thanks, Brandon PS: Anyone know of serious changes since the checkout process was revamped in november (I've got a December snapshot)? Quote - - - - Sometimes, ignorance is bliss. Link to comment Share on other sites More sharing options...
rbartz Posted March 23, 2003 Author Share Posted March 23, 2003 Unless you use AuthorizeNet to process your credit card orders, you have no use for the Authorize Net ADC payment module.... and would thus not have any reason to install it. :) rdb Quote Link to comment Share on other sites More sharing options...
rbartz Posted March 24, 2003 Author Share Posted March 24, 2003 Sorry, I didn't finish... If you use the AuthorizeNet ADC payment module, then you are using what they call AIM... Sorry for not answering all in one note. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 3, 2003 Share Posted July 3, 2003 has anyone modified this code so the customer does have the option of selecting insurance or not ? thanks in advance Quote Link to comment Share on other sites More sharing options...
Guest Posted October 12, 2003 Share Posted October 12, 2003 Same quesiton as 'caz' above. I will find this useful only if I can let the customer choose whether they want insurance or not. You can't force them to pay for insurance if they are collecting the goods from a pickup point/brick and mortar store. Besides that, not all people want insurance...and if you have a secure enough trading policy, they are aware that if an order gets lost/broken etc, it's their problem. Come on guys, enabling "insurance? Yes/No" on the shipping page can't be too much hassle for the people who know how to code these things. Thanks. Quote Link to comment Share on other sites More sharing options...
donbaker Posted February 10, 2004 Share Posted February 10, 2004 This can only work for me if the insurance is optional. How do I do that? Quote Link to comment Share on other sites More sharing options...
cgchris99 Posted February 13, 2004 Share Posted February 13, 2004 Brandon, I too use authorize.net, did you install this contribution yet? Does it work as expected? Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted August 30, 2004 Share Posted August 30, 2004 Anyone got an idea to make this optional for customers at checkout rather than forcing it upon them? Thanks. Quote Link to comment Share on other sites More sharing options...
rezdwan Posted November 26, 2004 Share Posted November 26, 2004 Hello rbartz, this contribution works very well for me except for two problems. 1) Speedpost (i.e the carrier I will be using) offers an insurance premium of $1 for every $100. But the minimum insurance premium is $5. 2) They also have a maximum insurance limit (which I have not found out yet). Do you any suggestions as to how I can get around this? Thank You Quote Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2004 Share Posted December 27, 2004 (edited) hi thanks for the nice mod. if you guys want the easiest way to allow the customer to chose if they want insurance just add this code some where on your checkout payment page: ? <tr> ? ? ? ?<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> ? ? ? ? ?<tr class="infoBoxContents"> ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ?<td class="main" width="100%" valign="top"><b>Add Shipping Insurance? <input name="ship_insurance" type="checkbox" value="1"></b></td> ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ?</tr> ? ? ? ? ? ?</table></td> ? ? ? ? ?</tr> ? ? ? ?</table></td> ? ? ?</tr> i added it just below the payment option. then in ot_insurance.php find this: if (MODULE_ORDER_TOTAL_INSURANCE_USE == 'true') { ? ? ? ?switch (MODULE_ORDER_TOTAL_INSURANCE_DESTINATION) { ? ? ? ? ?case 'national': ? ? ? ? ? ?if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'international': ? ? ? ? ? ?if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'both': ? ? ? ? ? ?$pass = true; break; ? ? ? ? ?default: ? ? ? ? ? ?$pass = false; break; ? ? ? ?} replace with this: if($_POST['ship_insurance']=='1'){ if (MODULE_ORDER_TOTAL_INSURANCE_USE == 'true') { ? ? ? ?switch (MODULE_ORDER_TOTAL_INSURANCE_DESTINATION) { ? ? ? ? ?case 'national': ? ? ? ? ? ?if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'international': ? ? ? ? ? ?if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'both': ? ? ? ? ? ?$pass = true; break; ? ? ? ? ?default: ? ? ? ? ? ?$pass = false; break; ? ? ? ?}} it works fine for me :) Edited December 27, 2004 by adrenalinepcs Quote Link to comment Share on other sites More sharing options...
Guest Posted December 27, 2004 Share Posted December 27, 2004 sweet! This worked a treat, thank you! Any idea how to exclude the shipping costs from the insurance calculation? The insurance to be calculated on goods total only, not including the shipping costs. Thanks Quote Link to comment Share on other sites More sharing options...
211655 Posted December 29, 2004 Share Posted December 29, 2004 what if i just want a radio button like above and say that if they want insurance, use a table rate shipping table or a flat fee of 20 dollars or so... Quote 211655 SEO Optimization Export Orders into CSV file Link to comment Share on other sites More sharing options...
Guest Posted January 27, 2005 Share Posted January 27, 2005 hi thanks for the nice mod. if you guys want the easiest way to allow the customer to chose if they want insurance just add this code some where on your checkout payment page: ? <tr> ? ? ? ?<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> ? ? ? ? ?<tr class="infoBoxContents"> ? ? ? ? ? ?<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> ? ? ? ? ? ? ?<tr> ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ? ?<td class="main" width="100%" valign="top"><b>Add Shipping Insurance? <input name="ship_insurance" type="checkbox" value="1"></b></td> ? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> ? ? ? ? ? ? ?</tr> ? ? ? ? ? ?</table></td> ? ? ? ? ?</tr> ? ? ? ?</table></td> ? ? ?</tr> i added it just below the payment option. then in ot_insurance.php find this: if (MODULE_ORDER_TOTAL_INSURANCE_USE == 'true') { ? ? ? ?switch (MODULE_ORDER_TOTAL_INSURANCE_DESTINATION) { ? ? ? ? ?case 'national': ? ? ? ? ? ?if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'international': ? ? ? ? ? ?if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'both': ? ? ? ? ? ?$pass = true; break; ? ? ? ? ?default: ? ? ? ? ? ?$pass = false; break; ? ? ? ?} replace with this: if($_POST['ship_insurance']=='1'){ if (MODULE_ORDER_TOTAL_INSURANCE_USE == 'true') { ? ? ? ?switch (MODULE_ORDER_TOTAL_INSURANCE_DESTINATION) { ? ? ? ? ?case 'national': ? ? ? ? ? ?if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'international': ? ? ? ? ? ?if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break; ? ? ? ? ?case 'both': ? ? ? ? ? ?$pass = true; break; ? ? ? ? ?default: ? ? ? ? ? ?$pass = false; break; ? ? ? ?}} it works fine for me :) <{POST_SNAPBACK}> This in fact does NOT work. If you actually process a dummy order, insurance is listed in the order totals on the checkout_confirmation.php page, but is dropped from the order after completion of order. It does not appear in admin->orders, the order email or customers order history details online. If you reverse the change you suggest in the ot_insurance.php, it works perfectly again. Any suggestions? Quote Link to comment Share on other sites More sharing options...
polywings168 Posted February 8, 2005 Share Posted February 8, 2005 I am having similar problem, any suggestions? Please help, thanks in advance. Quote Link to comment Share on other sites More sharing options...
guntersammet Posted February 9, 2005 Share Posted February 9, 2005 The code looks fine to me. You might can try to change if($_POST['ship_insurance']=='1'){ to if($HTTP_POST_VARS['ship_insurance']=='1'){ Otherwise I am not sure what it could be. HTH Gunter Quote Link to comment Share on other sites More sharing options...
Guest Posted February 9, 2005 Share Posted February 9, 2005 The code looks fine to me. You might can try to change if($_POST['ship_insurance']=='1'){ to if($HTTP_POST_VARS['ship_insurance']=='1'){ Otherwise I am not sure what it could be. HTH Gunter <{POST_SNAPBACK}> Hehe, thanks but I have tried all variations and still get no joy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.