-
Re: Optional Shipping Insurance Module Support Thread...
As an FYI I have tested this mod with Marco's USPS module, all works well if you have the settings correct.
If you used this method to hide the optional insurance when UPS is selected:
Code:
if ($_SESSION['shipping']['id'] != 'usps_EXPRESS'
&& $_SESSION['shipping']['id'] != 'usps_PRIORITY'
&& $_SESSION['shipping']['id'] != 'usps_PARCEL'
&& !IS_ADMIN_FLAG)
You need to change it to this: (if you are using upsxml)
Code:
if (($_SESSION['shipping']['id'] == 'free_free')
|| ($_SESSION['shipping']['id'] == 'upsxml_UPS Ground')
|| ($_SESSION['shipping']['id'] == 'upsxml_UPS 3 Day Select')
|| ($_SESSION['shipping']['id'] == 'upsxml_UPS 2nd Day Air')
|| ($_SESSION['shipping']['id'] == 'upsxml_UPS Next Day Air Saver')
|| ($_SESSION['shipping']['id'] == 'upsxml_UPS Next Day Air'))
If you need to hide the Opt. Ins for other shipping modules PM me and I'll help you with that if I can....
-
Re: Optional Shipping Insurance Module Support Thread...
Thanks to Mikestaps I was confident installing this on zen 1.3.9h. It works beautifully on my site with the standard zen cart usps shipping.
It did take me a long time to get this module working. Although it was probably my error, it should be clarified that you MUST use the SQL included to use the table rate, international or otherwise.
I noticed the included table rates were outdated, so here is the most current information for those wanting to use it.
50:1.80,100:2.30,200:2.85,300:4.75,400:5.80,500:6.85,600:7.90,700:8.95
Anything over $700.00 value you will want to add yourself.
-
Re: Optional Shipping Insurance Module Support Thread...
I've got the shipping insurance module enable and all of the settings appear correct but the shipping insurance entry never appears in the order total when checking out at all. What would be causing it to not show up at all and not effect the order total at all?
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
kbrown
I've got the shipping insurance module enable and all of the settings appear correct but the shipping insurance entry never appears in the order total when checking out at all. What would be causing it to not show up at all and not effect the order total at all?
Make sure you have zones set up and selected in the table rates, even if you are not using the table rates...
http://www.sicassracing.com/files/ins_1.gif
-
Re: Optional Shipping Insurance Module Support Thread...
Thanks a million mikestap, that totally fixed it.
I wasn't using zones at all so I didn't have any set up. I created an "Everywhere" zone and assigned shipping insurance to it and now it shows up fine.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
kbrown
Thanks a million mikestap, that totally fixed it.
I wasn't using zones at all so I didn't have any set up. I created an "Everywhere" zone and assigned shipping insurance to it and now it shows up fine.
:thumbsup: glad I could help!
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
JorgeR
What's the solution to this?
Thanks
Quote:
Originally Posted by
mikestaps
Jorge-
I'm going to look at using the same theory that in post#
315 to accomplish this. I am also looking at making this compatible with Marco's USPS module, so it may take me a little while....
Hi,
Could you kindly elabrate on which file to edit so that when optional insurance is not selected, it will not show up in the order total as $0.0. Your advise is very much appreciated. :smile:
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
abibliss
Hi,
Could you kindly elabrate on which file to edit so that when optional insurance is not selected, it will not show up in the order total as $0.0. Your advise is very much appreciated. :smile:
Ok, so I figured out the in tpl_checkout_confirmation_default.php these lines are what "prints" the order totals:
around line 164
Code:
<?php
if (MODULE_ORDER_TOTAL_INSTALLED) {
$order_totals = $order_total_modules->process();
?>
<div id="orderTotals"><?php $order_total_modules->output(); ?></div>
<?php
}
?>
I would think you could add in a if statement to exclude the ot_insurance module is it is not selected, just not really sure how to do that right now.
This is on the list of to do's, but unfortunately that list is getting pretty long! :ohmy:
-
Re: Optional Shipping Insurance Module Support Thread...
Hello
i am using zen cart 1.3.9h. i have installed various add ons with no problem but I've hit a snag with this one.
I installed it as per instructions and it shows up in admin. I have set it to the following settings
Enable Insurance Module: True
Sort Order : 102
Use Table rates : NO
Alternate insurance type : percent
Insurance percenatge : 3
insurance rate : .50
Increment Amount : 100
Amount Exempt from fee : 0
Tax Class : none
Required insurance amount : 0
Basically I just want the option to charge 3% shipping insurance if the customer chooses it.
i have tried altering the above settings, but I cannot get the option to show up when the customer is concluding their purchase.
any help appreciated, i just cannot see where im going wrong
many Thanks
-
Re: Optional Shipping Insurance Module Support Thread...
Sorry just forgot to add
i have not installed the SQl patch. I am only shipping to my local country South Africa. I have removed all other countries from the sql database.
Would i need to install the SQL patch anyway
thanks
-
Re: Optional Shipping Insurance Module Support Thread...
Sorry if this has already been answered, but I can't seem to sort it out.
How can the code be changed so that the insurance is preselected, but not required.I've been running in circles playing with the file to no avail.
-lindasdd
-
Re: i have tons of debug logs
still don't understand this one
[15-Oct-2012 13:36:42] PHP Warning: constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_5 in /home2/pwcforum/public_html/includes/modules/order_total/ot_insurance.php on line 43
http://www.zen-cart.com/downloads.php?do=file&id=232
i think something isn't matching up cause its for 1.3.8 can anyone help me and either take out zone 5 cause we don't use it anyway or help me update it so it will work with 1.5.1
Thanks
-
Re: Optional Shipping Insurance Module Support Thread...
i installed this on 1.5.1 and now i get this error
[15-Oct-2012 13:36:42] PHP Warning: constant() [<a href='function.constant'>function.constant</a>]: Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_5 in /home2/*******/public_html/includes/modules/order_total/ot_insurance.php on line 43
please help
-
Re: i have tons of debug logs
Dashizna,
Click "Remove" on that module, and then click "install" and set it up again. That should clear up those messages which were caused by the way in which you did your upgrade.
-
Re: i have tons of debug logs
Dashizna-
Take a look back at post#327...
I had to fill in ALL of the zones even if they are not being used. You could also go in to and edit the ot_insurance.php file to remove where it is looking for ZONE_5, but I wouldn't advise that if you are not comfortable working with the php files. (If you do this MAKE SURE TO BACK UP FIRST, just in case!)
-
Re: i have tons of debug logs
Just took a quick look at the file.
My line 40 reads:
Code:
$this->num_zones = $geozones->RecordCount();
you could remove $geozones->RecordCount(); and replace with the number of zones you use. Like so:
Code:
//$this->num_zones = $geozones->RecordCount();
$this->num_zones = 4;
I'm sure this is not the "right" way nor the "pretty" way but it should work
-
Re: Optional Shipping Insurance Module Support Thread...
Linda-
If you change it from a radio button to a check box the customer should be able to uncheck it... I'll take a look at this tomorrow and get back with you.
-
Re: Optional Shipping Insurance Module Support Thread...
Hi All,
I have installed the module on ZC version 1.5.1 and I can edit the mod in the admin area but nothing shows up in the store, no option 'check box' for the customer to select. I guess would like what I'm asking is does this mod work with version 1.5.1? I have the settings that I am using,
Shipping Insurance
Enable Insurance Module
True
Sort Order
500
Use Table Rates?
false
Alternate Insurance Type
percent
Insurance Percentage
1.5
Insurance Rate
$0.50
Increment Amount
$100.00
Amount Exempt From Fee
$0.00
Tax Class
--none--
No Insurance Fee on Virtual Products
true
No Insurance Fee on Gift Vouchers
true
No Insurance Fee on Free Shipping
true
Required Insurance Amount
$100.00
Insurance Zone 1
Australia
Zone 1 Insurance Table
50:1.65,100:2.05,200:2.45,300:4.60,400:5.50,500:6.40,600:7.30
Insurance Zone 2
Australia
Zone 2 Insurance Table
50:1.65,100:2.05,200:2.45,300:4.60,400:5.50,500:6.40,600:7.30
thanks Steve.
-
Re: Optional Shipping Insurance Module Support Thread...
Hi folks,
I search each thread and could not find answer for this but I was able to figured this out and sharing here so it may be helpful for you all!
Insurance not required but optional and want to have insurance checkbox marked when page loads.
If customer don't want insurance they can simply uncheck box. Using this modification you can get more orders with insurance as box is already selected.
Do following:
Module>Order total >Ot_insurance
Open above mentioned file then press CTRL + F
and type "Checkbox" in search box and hit "ENTER"
Few lines above the line you saw with word "Checkbox" there is a field
$selected = (($_SESSION['opt_insurance'] == '1') ? true : false);
change it to
$selected = (($_SESSION['opt_insurance'] == '1') ? true : true);
If you have standard file with no changes then you can find it by searching for line
Any comment or question contact me Thanks.
-
Re: Optional Shipping Insurance Module Support Thread...
Resurrecting this necro thread.
Had anyone noticed that this module no longer works properly with ZC 1.5.3?
insurance used to be exempted in 1.5.1 and prior for Walk-In Store Pickup orders, but after upgrade to 1.5.3, insurance is now added for Walk-In store pickup orders. This is reproducible in both of my shopping carts of different stores.
I know this issue was addressed early in page 9 of this thread, but looks like it might have resurfaced.
Currently running Zen-Cat 1.5.3. Optional Shipping Insurance Module version 3.2.2
Live shopping cart is here: http://www.harajukuhearts.com/
Any help would be appreciated.
-
Re: Optional Shipping Insurance Module Support Thread...
Try editing the file:
/includes/modules/order_total/ot_insurance.php
and add the code in RED:
Code:
//if ($_SESSION['shipping']['id'] == 'storepickup_storepickup') {
if (preg_match("/storepickup/i", $_SESSION['shipping']['id'])) {
Does this correct your issues with Store Pickup?
-
Re: Optional Shipping Insurance Module Support Thread...
Sorry about the delayed respond. Was traveling cross country on a trade show. Now that, I have a breather.
Yes, that apparently fixed the problem. Walking / Pickup now works properly like it had before. No doubt this should by default be change for the next update. Surprised that nobody else seem to have reported this problem so far.
Thank you again, Ajeh!
Quote:
Originally Posted by
Ajeh
Try editing the file:
/includes/modules/order_total/ot_insurance.php
and add the code in
RED:
Code:
//if ($_SESSION['shipping']['id'] == 'storepickup_storepickup') {
if (preg_match("/storepickup/i", $_SESSION['shipping']['id'])) {
Does this correct your issues with Store Pickup?
-
Re: Optional Shipping Insurance Module Support Thread...
Thanks for the update that this change fixed it for you ... :smile:
-
Problem with install sql
Hello,
I am having trouble with install.sql for this mod. Using the SQL Query Executor I get the following error mesage... WARNING: An Error occurred, please refresh the page and try again.
V.1.5.1
Thanks for any advice!
-
Re: Problem with install sql
What shipping module(s) are you using?
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
What shipping module(s) are you using?
Hi Ajeh,
This one... http://www.zen-cart.com/downloads.php?do=file&id=232
-
Re: Problem with install sql
And the Shipping Module(s) you are using with it?
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
And the Shipping Module(s) you are using with it?
USPS only
-
Re: Problem with install sql
What version of Zen Cart are you using?
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
What version of Zen Cart are you using?
v.1.5.1
-
Re: Problem with install sql
You could try this Order Total module on post #14:
http://www.zen-cart.com/showthread.p...ight=insurance
with the current USPS October 30, 2014 K6 update:
http://www.zen-cart.com/downloads.php?do=file&id=1292
This does overwrite the file:
/includes/modules/pages/checkout_shipping/header_php.php
and you should ignore the USPS K3 shipping module that is in that Zip file for the optional insurance ...
This will give the Optional Insurance amount the exact quote from USPS for insurance based on the USPS shipping method that the customer selects and give the customer an option to Opt-out of the insurance on the checkout_payment page ...
It requires no SQL changes to the database ...
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
You could try this Order Total module on post #14:
http://www.zen-cart.com/showthread.p...ight=insurance
with the current USPS October 30, 2014 K6 update:
http://www.zen-cart.com/downloads.php?do=file&id=1292
This does overwrite the file:
/includes/modules/pages/checkout_shipping/header_php.php
and you should ignore the USPS K3 shipping module that is in that Zip file for the optional insurance ...
This will give the Optional Insurance amount the exact quote from USPS for insurance based on the USPS shipping method that the customer selects and give the customer an option to Opt-out of the insurance on the checkout_payment page ...
It requires no SQL changes to the database ...
I updated the USPS mod although I am getting a message in admin/modules/shipping saying that a new version is available.
I have everything installed but I see no options or anything referring to insurance during checkout. The mod is turned on.
Thanks!
-
Re: Problem with install sql
When in the Modules ... Shipping ... if you click on the USPS shipping module, what date do you see?
Go to your Zen Cart Admin and go to Tools ... Developers Tool Kit ...
In the bottom input box enter:
usps.php
Then, select Catalog ... click SEARCH ...
What comes up on the paths to the files and the lines for:
* @version $Id: usps.php
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
When in the Modules ... Shipping ... if you click on the USPS shipping module, what date do you see?
Go to your Zen Cart Admin and go to Tools ... Developers Tool Kit ...
In the bottom input box enter:
usps.php
Then, select Catalog ... click SEARCH ...
What comes up on the paths to the files and the lines for:
* @version $Id: usps.php
Date is 2014-09-07
Line #12 : * @version $Id: usps.php 2014-09-07 ajeh Version K5 $
Line #13 : This module has been written for the usps.php shipping module March 7, 2014 K3 or newer
Line #13 : * @version $Id: usps.php 2014-09-07 ajeh Version K5 $
-
Re: Problem with install sql
You need to download the USPS October 30, 2014 K6 version:
http://www.zen-cart.com/downloads.php?do=file&id=1292
then do the:
1 install to your server
2 REMOVE
3 INSTALL
4 Configure
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
I just did the above two more times using filezilla and got the same result. I tried using cpanel and success. Strange. Thanks for the patience, not sure what happened there.
I still do not see insurance though...
Thanks!
-
1 Attachment(s)
Re: Problem with install sql
I've uninstalled and re installed the insurance mod and checked it file by file. Everything looks to be in order. The only mention of insurance is on step 2 of checkout...
Attachment 14648
Thanks!
-
Re: Problem with install sql
Go to your Tools ... Developers Tool Kit ... and in the bottom input box enter:
insurance
and search the Catalog ...
What are the paths/files and lines that come up?
-
Re: Optional Shipping Insurance Module Support Thread...
Acutally too much is shown ...
Do you see:
Code:
/includes/modules/pages/checkout_shipping/header_php.php |
Line #158 : $quote[0]['methods'][0]['insurance'] = 0;
Line #169 : 'insurance' => $quote[0]['methods'][0]['insurance']); |
-
Re: Problem with install sql
Quote:
Originally Posted by
Ajeh
Go to your Tools ... Developers Tool Kit ... and in the bottom input box enter:
insurance
and search the Catalog ...
What are the paths/files and lines that come up?
includes/languages/english/modules/order_total/ot_optionalinsurance.php
includes/modules/order_total/ot_optionalinsurance.php
includes/modules/pages/checkout_shipping/header_php.php
includes/modules/payment/paypal/paypal_functions.php
includes/modules/payment/paypaldp.php
includes/modules/payment/paypalwpp.php
includes/modules/shipping/usps.php
-
Re: Problem with install sql
NOTE: on the file:
/includes/modules/order_total/ot_ot_optionalinsurance.php
you should comment the echo around line 144:
Code:
$insurance = $_SESSION['shipping']['insurance'];
//echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
$selected = (($_SESSION['insurance'] == '1') ? true : false);
-
Re: Optional Shipping Insurance Module Support Thread...
If you look in the Modules ... Shipping ... and click on USPS and click EDIT ...
Did you check the boxes for the Insurance?
Quote:
Extra Services (Domestic)
Included in postage rates. Not shown to the customer.
WARNING: Some services cannot work with other services.
Insurance
Priority Mail Express Insurance
And for:
Quote:
Extra Services (International)
Included in postage rates. Not shown to the customer.
WARNING: Some services cannot work with other services.
Insurance
-
Re: Optional Shipping Insurance Module Support Thread...
I checked them and it adds insurance to the shipping amount automatically without option.
-
1 Attachment(s)
Re: Optional Shipping Insurance Module Support Thread...
I made a new Zip for v151 with USPS October 30, 2014 K6 with Optional Insurance for you ... in case I made any changes to these files with the new release ...
Try loading these files to your server, does it work better?
-
Re: Optional Shipping Insurance Module Support Thread...
It is working now! The only thing is that it is still automatically adding insurance and forcing the customer to opt out. Is that how this mod works? I want customers to be able to opt in.
Either way, coffee and donut on the way! Thanks for taking so much time with this!
-
Re: Optional Shipping Insurance Module Support Thread...
That is how this works ...
You would need to customize the file:
/includes/modules/order_total/ot_optionalinsurance.php
And change the setting from:
Code:
if ($display_insurance && $insurance > 0) {
$selection = array('id' => $this->code,
'module' => $this->title,
'redeem_instructions' => MODULE_ORDER_TOTAL_OPTIONALINSURANCE_TEXT_ENTER_CODE,
'fields' => array(array('field' => zen_draw_checkbox_field('opt_insurance', '1', $selected, 'id="opt_insurance"' . ($jsUpdateForm ? ' onclick="updateForm();"' : '')) . zen_draw_hidden_field('insurance', '1'),
'title' => $currencies->format($insurance, true, $order->info['currency'], $order->info['currency_value'])
)));
} else {
to read:
Code:
if ($display_insurance && $insurance > 0) {
$selection = array('id' => $this->code,
'module' => $this->title,
'redeem_instructions' => MODULE_ORDER_TOTAL_OPTIONALINSURANCE_TEXT_ENTER_CODE,
'fields' => array(array('field' => zen_draw_checkbox_field('opt_insurance', '1', true, 'id="opt_insurance"' . ($jsUpdateForm ? ' onclick="updateForm();"' : '')) . zen_draw_hidden_field('insurance', '1'),
'title' => $currencies->format($insurance, true, $order->info['currency'], $order->info['currency_value'])
)));
} else {
-
Re: Optional Shipping Insurance Module Support Thread...
Thanks Ajeh, but I don't like how the insurance cost is already added to the shipping costs and then showing a deduction. I was looking for something that a customer would click to add a displayed amount for insurance that would then be added to the costs. All the help is appreciated! Coffee and Donut sent!
-
Re: Optional Shipping Insurance Module Support Thread...
The only way this works to remove the USPS insurance is to have it added in on the checkout_shipping page and then you can remove it on the checkout_payment page ...
Remove the code change I gave you in in post #369 and see if adding this code works better for you:
Code:
$selected = (($_SESSION['insurance'] == '1') ? true : false);
//override optional setting and force decline to be checked from the start
$selected = true;
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
Ajeh
The only way this works to remove the USPS insurance is to have it added in on the checkout_shipping page and then you can remove it on the checkout_payment page ...
Remove the code change I gave you in in post #369 and see if adding this code works better for you:
Code:
$selected = (($_SESSION['insurance'] == '1') ? true : false);
//override optional setting and force decline to be checked from the start
$selected = true;
It still does the same thing. I didn't see any change at all...
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
doooomed
It still does the same thing. I didn't see any change at all...
Wow, I missed the first part never mind! Haha let me try...
-
Re: Optional Shipping Insurance Module Support Thread...
What domain are you testing this on?
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
Ajeh
The only way this works to remove the USPS insurance is to have it added in on the checkout_shipping page and then you can remove it on the checkout_payment page ...
Remove the code change I gave you in in post #369 and see if adding this code works better for you:
Code:
$selected = (($_SESSION['insurance'] == '1') ? true : false);
//override optional setting and force decline to be checked from the start
$selected = true;
Finally got a chance to sit back down with this! I'm a little lost. What do I remove from checkout_payment and add to checkout_shipping? Thanks!
-
Re: Optional Shipping Insurance Module Support Thread...
Make no changes to anything ...
Follow these steps ...
1 Get the Zip from from post #367 ...
2 Only install the files for the Order Total module for the Optional Insurance
/includes/modules/order_total/ot_optionalinsurance.php
/includes/languages/english/modules/order_total/ot_optionalinsurance.php
3 Edit the file:
/includes/modules/order_total/ot_optionalinsurance.php
and around line 144 comment out this line by adding the // and below it add the code in RED:
Code:
//echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
$selected = (($_SESSION['insurance'] == '1') ? true : false);
//override optional setting and force decline to be checked from the start
$selected = true;
this will make the checkbox on the checkout_payment default as Decline Insurance by having it pre-checked so that if the customer wants the Insurance on the shipping they need to uncheck it ...
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
Ajeh
Make no changes to anything ...
Follow these steps ...
1 Get the Zip from from post #367 ...
2 Only install the files for the Order Total module for the Optional Insurance
/includes/modules/order_total/ot_optionalinsurance.php
/includes/languages/english/modules/order_total/ot_optionalinsurance.php
3 Edit the file:
/includes/modules/order_total/ot_optionalinsurance.php
and around line 144 comment out this line by adding the
// and below it add the code in
RED:
Code:
//echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
$selected = (($_SESSION['insurance'] == '1') ? true : false);
//override optional setting and force decline to be checked from the start
$selected = true;
this will make the checkbox on the checkout_payment default as Decline Insurance by having it pre-checked so that if the customer wants the Insurance on the shipping they need to uncheck it ...
I have installed only the two files and commented out/added to includes/modules/order_total/ot_optionalinsurance.php
I uninstalled and installed admin/modules/order total/optional insurance. I have insurance set to on in the USPS mod.
Now insurance is being added still, but no insurance options at all. It also shows the cost with insurance added in the "estimated shipping cost"
Thanks!
-
Re: Optional Shipping Insurance Module Support Thread...
The shipping quotes will include the insurance in the Shipping Cost ... it is removed only if the checkbox is checked in the checkout_payment on the checkout ...
Do you see the checkout checkbox on the checkout_payment page now?
-
Re: Optional Shipping Insurance Module Support Thread...
I recently added Optional Shipping Insurance Module version 3.2.2 to a couple websites. Overall is performed as advertised, but it bothered me a bit that it "forgot" the insurance setting when moving from the confirmation page back to the payment page via the links. In studying the code, I noticed that $_SESSION['opt_insurance'] is used in two locations in /includes/modules/order_total/ot_insurance.php, but is never set. $_SESSION['insurance'] is also used and is set in the collect_posts function. I changed the two instances of $_SESSION['opt_insurance'] to $_SESSION['insurance'] and noted that now the insurance setting is "remembered" when moving from the confirmation page back to the payment page.
Then an easy method of setting the initial value of the insurance setting occurred to me.
In summary, the edits that I did in /includes/modules/order_total/ot_insurance.php:
Change line 116:
Code:
if ($_SESSION['opt_insurance']) {
to
Code:
if ($_SESSION['insurance']) {
Change line 244:
Code:
$selected = (($_SESSION['opt_insurance'] == '1') ? true : false);
to
Code:
if (isset($_SESSION['insurance'])) {
$selected = (($_SESSION['insurance'] == '1') ? true : false);
} else {
$selected = true; // true for opt-out, false for opt-in
}
-
Re: Optional Shipping Insurance Module Support Thread...
What shipping module are you using?
-
Re: Optional Shipping Insurance Module Support Thread...
-
Re: Optional Shipping Insurance Module Support Thread...
Hallo I downloaded the module but I have a question:
Is it possible to make the option not mandatory and let the customer choose if he wants or not the insurance on shpiing ?
Thank You
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
aldo.campione
Hallo I downloaded the module but I have a question:
Is it possible to make the option not mandatory and let the customer choose if he wants or not the insurance on shpiing ?
Thank You
I SWEAR, I'm not trying to be a smart a$$ here.. I think this may be a simply language barrier at play here.. The module is called the "Optional Shipping Insurance Module"
Optional = NOT required, shopper's choice
-
Re: Optional Shipping Insurance Module Support Thread...
aldo.campione ... out of curiosity, what shipping module(s) are you using?
-
Re: Optional Shipping Insurance Module Support Thread...
It has been some years i last checked this module, but if i remember correctly the optional in this module is that you set the insurance to kick in above a certain total price in your cart.
-
Re: Optional Shipping Insurance Module Support Thread...
Does anyone know how I might fix this so it will work with the
edit_orders-4
module.
My insurance adds correctly in the regular order total during check-out, but whenever you edit the order using the Edit Orders 4 interface, the new order total always leaves out the Shipping Insurance amount.
???
Andy
-
Re: Optional Shipping Insurance Module Support Thread...
@Andy_M - Did you ever find a solution to this? I am having the same problem with Edit Orders 4.1.4
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
Andy_M
Does anyone know how I might fix this so it will work with the
edit_orders-4
module.
My insurance adds correctly in the regular order total during check-out, but whenever you edit the order using the Edit Orders 4 interface, the new order total always leaves out the Shipping Insurance amount.
???
Andy
Quote:
Originally Posted by
jackie.taferner
@Andy_M - Did you ever find a solution to this? I am having the same problem with Edit Orders 4.1.4
Assuming that you both are discussing the plugin that's downloaded from the Plugins' area, it's relying on checkout-based session information to determine whether it's to be enabled and will require modification to work with EO 4.1.4 (since the admin environment contains no such session information).
-
Re: Optional Shipping Insurance Module Support Thread...
Thanks @lat9, yes I am trying to get this working on a client's site as we speak. Are there any plans to upgrade this module to not use session-based information on the backend? Or any pointers on how to accomplish this upgrade?
-
Re: Optional Shipping Insurance Module Support Thread...
Ok, for anyone else looking to fix up this module for Edit Orders v4.1.4, here's a bit of a workaround, but it seems to get the job done.
YOURADMIN/edit_orders.php
Right around line 430:
Code:
foreach($_POST['update_total'] as $order_total) {
$order_total['text'] = $currencies->format($order_total['value'], true, $order->info['currency'], $order->info['currency_value']);
$order_total['sort_order'] = $GLOBALS[$order_total['code']]->sort_order;
// TODO Special processing for some modules
if(zen_not_null($order_total['title']) && $order_total['title'] != ':') {
switch($order_total['code']) {
case 'ot_shipping':
$GLOBALS['order']->info['shipping_cost'] = $order_total['value'];
$GLOBALS['order']->info['shipping_module_code'] = $order_total['shipping_module'];
break;
Add this code:
Code:
//unset the insurance session before loading the next order
$_SESSION['opt_insurance'] = false;
foreach($_POST['update_total'] as $order_total) {
$order_total['text'] = $currencies->format($order_total['value'], true, $order->info['currency'], $order->info['currency_value']);
$order_total['sort_order'] = $GLOBALS[$order_total['code']]->sort_order;
// TODO Special processing for some modules
if(zen_not_null($order_total['title']) && $order_total['title'] != ':') {
switch($order_total['code']) {
//add insurance session if order has insurance
case 'ot_insurance':
$_SESSION['opt_insurance'] = true;
break;
case 'ot_shipping':
$GLOBALS['order']->info['shipping_cost'] = $order_total['value'];
$GLOBALS['order']->info['shipping_module_code'] = $order_total['shipping_module'];
break;
-
Re: Optional Shipping Insurance Module Support Thread...
I have a question I've upgraded my Zen Cart installation from 1.5.5e to 1.5.5f in my development server, as well as upgrading from PHP 5.6 to PHP 7.1.
I've made sure my customization php.ini definitions are migrated too.
Going through QC testing I've noticed ot_insurance no longer functions properly.
First symptom is upon a user attempts to checkout and pay for the product on index.php?main_page=checkout_payment , the screen returns blank.
Second symptom is the edit Edit and Remove buttons within the administration page of the module does not show up anymore. The module list is of course still green light. I can click on the module listing again to edit the attribute of the module that way.
According to the debug log, there's evident that something isnt compatible with the module.
[18-Jan-2018 20:08:08 America/Los_Angeles] PHP Fatal error: Uncaught Error: Call to undefined function split() in /home/www/includes/modules/order_total/ot_insurance.php:128
Stack trace:
#0 /home/www/includes/classes/order_total.php(185): ot_insurance->process()
#1 /home/www/includes/modules/pages/checkout_payment/header_php.php(101): order_total->pre_confirmation_check()
#2 /home/www/index.php(36): require('/home/apusa/ang...')
#3 {main}
thrown in /home/www/includes/modules/order_total/ot_insurance.php on line 128
Disabling, but not Removing (Since I cant do that without the button) the module will make my shopping cart work again.
Also ZC 1.5.5e and 1.5.5f works with Php 5.6 but this issue appears within Php 7.1 So far, I have no other issues with other modules, and general functionality of the cart except this module. As I'd like to force my customers to have insurance for every order.
Now, I think there's a work around using the USPS shipping insurance check box, and not using this module at all. But that is a bad work around as it does not show the customer that they are being charged for the extra service.
Any help would be greatly appreciated!
-
Re: Optional Shipping Insurance Module Support Thread...
The PHP split function was deprecated (i.e. letting you know that it' going to be removed) in PHP 5.3.0 and removed totally in PHP 7.0. That's why the ot_insurance worked under PHP 5.6 but not under PHP 7.0.
If you would post the contents of /includes/modules/order_total/ot_insurance.php's function on/around line 128, perhaps someone could propose a code-change to allow that order-total to (again) operate.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
lat9
The PHP split function was deprecated (i.e. letting you know that it' going to be removed) in PHP 5.3.0 and removed totally in PHP 7.0. That's why the ot_insurance worked under PHP 5.6 but not under PHP 7.0.
If you would post the contents of /includes/modules/order_total/ot_insurance.php's function on/around line 128, perhaps someone could propose a code-change to allow that order-total to (again) operate.
Okay that sounds logical enough.
This is the latest version from both Numinix's website and the one uploaded in the ZC Plugins page. Version number is 3.2.2
I look the liberty checking if there other occurrence of the split and I have found two. Here they are:
Starts at Line 125
// usps still open
$table = constant('MODULE_ORDER_TOTAL_INSURANCE_COST_' . $this->dest_zone);
$table_cost = split("[:,]", $table);
$size = sizeof($table_cost);
for ($i=0, $n=$size; $i<$n; $i+=2) {
if (round($order_total_insurance,9) <= $table_cost[$i]) {
$insurance = $table_cost[$i+1];
break;
Ends at Line 132
Starts at Line 219
if (MODULE_ORDER_TOTAL_INSURANCE_TABLE == 'true') {
$table = constant('MODULE_ORDER_TOTAL_INSURANCE_COST_' . $this->dest_zone);
$table_cost = split("[:,]", $table);
$size = sizeof($table_cost);
for ($i=0, $n=$size; $i<$n; $i+=2) {
if (round($order_total_insurance,9) <= $table_cost[$i]) {
$insurance = $table_cost[$i+1];
break;
}
Ends at 227
-
Re: Optional Shipping Insurance Module Support Thread...
Yes split has now changed to preg_split. For those changes:
change to:
PHP Code:
$table_cost = preg_split("/[:,]/", $table);
-
Re: Optional Shipping Insurance Module Support Thread...
AND it appears to work! Version zc 1.5.5f and Php 7.1
Oddly enough, this module never had a Edit and Remove button apparently to start with.
I guess I'll repackage it for the site repository since everyone is supposed to migrate to 7.x anyways, as 5.6 will be EOL this coming December.
Thank you for the quick fix!
Quote:
Originally Posted by
tmccaff
Yes split has now changed to preg_split. For those changes:
change to:
PHP Code:
$table_cost = preg_split("/[:,]/", $table);
-
Re: Optional Shipping Insurance Module Support Thread...
Another odd artifact that I've noticed now that the module worked with the above modification.
I have noticed now the built-in store pickup module cannot bypass insurance enforcement. It's annoying my customers, but I can sort of get around it by refunding the insurance amount upon pickup.
Anyone else having the same issue? And any advice on how to diagnose and perhaps find out how to actually get this mod somewhat up to date?
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
chibipaw
Another odd artifact that I've noticed now that the module worked with the above modification.
I have noticed now the built-in store pickup module cannot bypass insurance enforcement. It's annoying my customers, but I can sort of get around it by refunding the insurance amount upon pickup.
Anyone else having the same issue? And any advice on how to diagnose and perhaps find out how to actually get this mod somewhat up to date?
A new version, 3.3.0, has been released on our website. At the top of the file there is a check for storepickup. Can you confirm if that resolves your issue chibipaw?
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
numinix
A new version, 3.3.0, has been released on our website. At the top of the file there is a check for storepickup. Can you confirm if that resolves your issue chibipaw?
Woo hoo! And here I thought its abandoned. Alright going to start testing out the dev server tonight, and I'll let you know once I get some concrete results.
Thanks for the update ! in both the information and the new version!
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
numinix
A new version, 3.3.0, has been released on our website. At the top of the file there is a check for storepickup. Can you confirm if that resolves your issue chibipaw?
Alright, I've installed 3.3.0 into my dev environment and this is what I have discovered so far:
If there is previous version of ot_insurance installed, one must manually delete the values MODULE_ORDER_TOTAL_INSURANCE_* under the configuration_key in the configuration table before proceeding. Otherwise this module will display a +install button in the admin menu and then fail to install these values. Probably will need an uninstall SQL script of some sort.
Once installed, this module does not appear to know it has been installed. So the +install will return to the admin menu, and edit of the module's configuration_value's is not possible without directly manipulating the database directly. With that said, the -remove button will not appear, uninstall is not possible without deleting the above keys from the table mentioned above. This is of course going to be problematic.
If using a permitted zone address was used to check out using the Store Pickup option, no insurance was charged.
But here comes to show stopper. Checkouts using the normal delivery method (USPS), does not trigger ot_insurance to charge a fee either.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
chibipaw
Alright, I've installed 3.3.0 into my dev environment and this is what I have discovered so far:
If there is previous version of ot_insurance installed, one must manually delete the values MODULE_ORDER_TOTAL_INSURANCE_* under the configuration_key in the configuration table before proceeding. Otherwise this module will display a +install button in the admin menu and then fail to install these values. Probably will need an uninstall SQL script of some sort.
Once installed, this module does not appear to know it has been installed. So the +install will return to the admin menu, and edit of the module's configuration_value's is not possible without directly manipulating the database directly. With that said, the -remove button will not appear, uninstall is not possible without deleting the above keys from the table mentioned above. This is of course going to be problematic.
If using a permitted zone address was used to check out using the Store Pickup option, no insurance was charged.
But here comes to show stopper. Checkouts using the normal delivery method (USPS), does not trigger ot_insurance to charge a fee either.
The module needs to be uninstalled before uploading the new files and reinstalling. However, any future versions after 3.3.0 will auto upgrade.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
numinix
The module needs to be uninstalled before uploading the new files and reinstalling. However, any future versions after 3.3.0 will auto upgrade.
Do you know whats the procedures to cleanly uninstalling the module? perhaps manually?
v3.23 do not have the Remove button to uninstalling in the menu, as indicated in the documentation.
The best I know of is deleting the the SQL entries above and over writing the two files.
The closest thing I can see is after clicking on the module is the first option, which it's a True False button with the following dialog:
"Do you want to enable this module? To fully turn this off, both this option and the one below should be set to false."
Thanks.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
Ryk
For anyone else looking to do this, this answer was provided by the module author:
Now, having made it mandatory, the next requirement is to exclude it completely from the Store Pickup option! This would probably take a proficient php coder a matter of minutes...but I'm not, and I'm starting now! :D (So any suggestions are welcome!)
Thanks for the wonderful module to add shipping insurance.
I have two types of shipping options on my website:
1. expedited shipping
2. regular mail
Now, I need to add mandatory shipping insurance to the Regular mail shipping only. I do not want the shipping insurance to show with Expedited shipping option.
Kindly let me know how an this be made possible.
Thanks in advance.
muteyaar
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
chibipaw
Alright, I've installed 3.3.0 into my dev environment and this is what I have discovered so far:
Once installed, this module does not appear to know it has been installed. So the +install will return to the admin menu, and edit of the module's configuration_value's is not possible without directly manipulating the database directly. With that said, the -remove button will not appear, uninstall is not possible without deleting the above keys from the table mentioned above. This is of course going to be problematic.
I have this same problem. Did you find a solution?
-
Re: Optional Shipping Insurance Module Support Thread...
in the last version
ERROR: module not loaded because the language file is missing: /includes/languages/english/modules/order_total/ot_insurance.php
-
Re: Optional Shipping Insurance Module Support Thread...
zen version 1.51 when clicked nothing happens til i go to next screen, how to fix this. or what is broken?
-
Re: Optional Shipping Insurance Module Support Thread...
Zen 1.5.6C | PHP 7.3.9 | OPC 2.1.4
Numinix's 3.3.0 version doesn't work. It installs and can never be edited in the admin. Additionally it does not show in checkout at all
(https://www.zen-cart.com/downloads.php?do=file&id=232) 3.2.3 shows in checkout and works fine in admin, but the amount is never applied in checkout even though it's clearly registering an action when "apply" is clicked for insurance. Below are the logs
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined property: ot_insurance::$include_shipping in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 196
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined property: ot_insurance::$include_tax in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 197
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined index: opt_insurance in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 244
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined property: ot_insurance::$include_shipping in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 196
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined property: ot_insurance::$include_tax in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 197
[24-Sep-2019 11:23:31 America/New_York] PHP Notice: Undefined index: opt_insurance in /home/XXXX/public_html/XXXX/includes/modules/order_total/ot_insurance.php on line 116
-
Re: Optional Shipping Insurance Module Support Thread...
This is working on php 5.6 but creating warnings about the table rates. This site is not using table rates but this is what happens:
PHP Code:
[28-Dec-2019 08:32:01 America/New_York] PHP Warning: constant(): Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_4 in /home/xxxxf/public_html/includes/modules/order_total/ot_insurance.php on line 43
[28-Dec-2019 08:32:01 America/New_York] Request URI: /coffeemin/modules.php?set=ordertotal, IP address: 172.101.3.191
#1 constant() called at [/home/xxxxx/public_html/includes/modules/order_total/ot_insurance.php:43]
#2 ot_insurance->ot_insurance() called at [/home/xxxxx/public_html/coffeemin/modules.php:185]
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
delia
This is working on php 5.6 but creating warnings about the table rates. This site is not using table rates but this is what happens:
PHP Code:
[28-Dec-2019 08:32:01 America/New_York] PHP Warning: constant(): Couldn't find constant MODULE_ORDER_TOTAL_INSURANCE_ZONE_4 in /home/xxxxf/public_html/includes/modules/order_total/ot_insurance.php on line 43
[28-Dec-2019 08:32:01 America/New_York] Request URI: /coffeemin/modules.php?set=ordertotal, IP address: 172.101.3.191
#1 constant() called at [/home/xxxxx/public_html/includes/modules/order_total/ot_insurance.php:43]
#2 ot_insurance->ot_insurance() called at [/home/xxxxx/public_html/coffeemin/modules.php:185]
Did you recently add a zone definition (admin -> Location/Taxes -> Zone Definitions)?
I had done this not very long ago on a 1.5.5f cart and encountered this warning. To fix, I removed and reinstalled the ot_insurance module. It will then create the appropriate number of table entries (one per zone definition).
-
Re: Optional Shipping Insurance Module Support Thread...
no, no changes to anything. This happened as soon as I installed the mod.
-
Re: Optional Shipping Insurance Module Support Thread...
and please note that the mod does not actually allow you to have more than 3 table rates. The errors are for MODULE_ORDER_TOTAL_INSURANCE_ZONE_5 and MODULE_ORDER_TOTAL_INSURANCE_ZONE_4. Which do not exist in the mod, nor in this website which only has three zone definitions and is the reason for the error. It all still works but it just creates error files........
-
Re: Optional Shipping Insurance Module Support Thread...
warning Methods with the same name as their class will not be constructors in a future version of PHP; line 22
php 7.3 (was happening in 7.1 as well).
Line 22 is the last in this bit of code
PHP Code:
class ot_insurance extends base{
function process() {
}
}
} else {
class ot_insurance {
the function is also named ot_insurance. I'll fix if someone will confirm what it's referring to.
-
Re: Optional Shipping Insurance Module Support Thread...
To eliminate the warning when using PHP 7+, change
Code:
function ot_insurance() {
to
Code:
function __construct() {
-
Re: Optional Shipping Insurance Module Support Thread...
oh, I have been thru that before!n and had just forgotten. Thanks so much for answering so quickly.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
dennisns7d
To eliminate the warning when using PHP 7+, change
Code:
function ot_insurance() {
to
Code:
function __construct() {
OK, but for Zen-cart version 1.5.8, when you replace the function name with __construct() the following errors are given when the Order Total Modules page is visited in the Admin. Evidently it is trying to get an order delivery country which does not exist
--> PHP Warning: Attempt to read property "delivery" on null in C:\xampp\htdocs\includes\modules\order_total\ot_insurance.php on line 37.
--> PHP Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\includes\modules\order_total\ot_insurance.php on line 37.
Line 37 is like this
PHP Code:
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
Any ideas how to overcome this? Should there be an Admin page check?
-
Re: Optional Shipping Insurance Module Support Thread...
> Should there be an Admin page check?
Yep.
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
swguy
> Should there be an Admin page check?
Yep.
Thank you for the quick response. I was just not sure where to put the control. I am wondering if this is the right place to block out while in the admin section (added if control around ---> // Check if called in admin page):
PHP Code:
function __construct() {
global $order, $currencies, $db;
$this->code = 'ot_insurance';
$this->title = MODULE_ORDER_TOTAL_INSURANCE_TITLE;
$this->description = MODULE_ORDER_TOTAL_INSURANCE_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_INSURANCE_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_INSURANCE_SORT_ORDER;
$this->credit_class = true;
$this->output = array();
$geozones = $db->Execute("SELECT * FROM " . TABLE_GEO_ZONES);
$this->num_zones = $geozones->RecordCount();
if (!defined('IS_ADMIN_FLAG') || (IS_ADMIN_FLAG === false)) { // Check if called in admin page
if ($this->enabled == true) {
$this->dest_zone = 0;
for ($i = 1; $i <= $this->num_zones; $i++) {
if ((int) constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) > 0) {
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$this->dest_zone = $i;
break;
}
elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$this->dest_zone = $i;
break;
}
$check->MoveNext();
} // end while
} // END if ((int)constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) > 0)
} // END for ($i=1; $i<=$this->num_zones; $i++)
if ($this->dest_zone < 1 && MODULE_ORDER_TOTAL_INSURANCE_ZONE_1 > 0) {
$this->enabled = false;
}
}
} // Check if called in admin page
}
-
Re: Optional Shipping Insurance Module Support Thread...
Quote:
Originally Posted by
swguy
> Should there be an Admin page check?
Yep.
Thank you for the quick reply. I was just not sure about where to put the control. Is it OK to block the following segment as it is done with the if block (marked with----> // Check if called in admin page)
PHP Code:
function __construct() {
global $order, $currencies, $db;
$this->code = 'ot_insurance';
$this->title = MODULE_ORDER_TOTAL_INSURANCE_TITLE;
$this->description = MODULE_ORDER_TOTAL_INSURANCE_DESCRIPTION;
$this->enabled = ((MODULE_ORDER_TOTAL_INSURANCE_STATUS == 'true') ? true : false);
$this->sort_order = MODULE_ORDER_TOTAL_INSURANCE_SORT_ORDER;
$this->credit_class = true;
$this->output = array();
$geozones = $db->Execute("SELECT * FROM " . TABLE_GEO_ZONES);
$this->num_zones = $geozones->RecordCount();
if (!defined('IS_ADMIN_FLAG') || (IS_ADMIN_FLAG === false)) { // Check if called in admin page
if ($this->enabled == true) {
$this->dest_zone = 0;
for ($i = 1; $i <= $this->num_zones; $i++) {
if ((int) constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) > 0) {
$check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
while (!$check->EOF) {
if ($check->fields['zone_id'] < 1) {
$this->dest_zone = $i;
break;
}
elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
$this->dest_zone = $i;
break;
}
$check->MoveNext();
} // end while
} // END if ((int)constant('MODULE_ORDER_TOTAL_INSURANCE_ZONE_' . $i) > 0)
} // END for ($i=1; $i<=$this->num_zones; $i++)
if ($this->dest_zone < 1 && MODULE_ORDER_TOTAL_INSURANCE_ZONE_1 > 0) {
$this->enabled = false;
}
}
} // Check if called in admin page
}
-
Re: Optional Shipping Insurance Module Support Thread...
In ot_insurance.php (version 3.2.4) around line 245:
PHP Code:
$selected = ((isset($_SESSION['opt_insurance']) && $_SESSION['opt_insurance'] == '1') ? true : false);
$display_insurance = true;
if (($order_total_insurance >= MODULE_ORDER_TOTAL_INSURANCE_REQUIRED) || (($order_total_insurance <= MODULE_ORDER_TOTAL_INSURANCE_OVER) && (MODULE_ORDER_TOTAL_INSURANCE_OVER > 0) && ($order_total_insurance >= MODULE_ORDER_TOTAL_INSURANCE_REQUIRED))) {
$display_insurance = false;
}
What is the meaning of this if control?
Susbtituting with simple letters here is the simplified logic function:
(Let's say a is the upper limit and set to 10000, b is the lower limit and set to 100)
((ins>= a) || ((ins<=b) && (b>0) && (ins>=a)))
if ins>=a first part of the or function is fulfilled and result is true
if ins<a first part of or function valued false and the second part may never be true.
so mathematically this is equivalent of making only this logic control:
ins>=a
Am I missing something?
-
Re: Optional Shipping Insurance Module Support Thread...
Yeah it looks wrong to me too.
-
Re: Optional Shipping Insurance Module Support Thread...
@zamzom, this module hasn't been updated in a long time - perhaps you'd like to adopt it and make improvements?
https://docs.zen-cart.com/dev/plugins/adoption/
-
Re: Optional Shipping Insurance Module Support Thread...
Did anyone ever get this working for 1.5.8a on PHP 8+? If so can you share your modified plugin files?
-
Re: Optional Shipping Insurance Module Support Thread...
So I installed a fresh copy of zen cart 1.5.8a and have been trying to get this to work and I can't seem to figure it out. I renamed the function 'function ot_insurance()' to 'public function __construct()' and no matter what I do it never shows up in the order totals modules section in the admin. How is zen cart populating that list? The ot_insurance.php file is present in includes/modules/order_total/ot_shipping.php and the language file is in includes/languages/english/modules/order_total/ot_insurance.php. I've cleared the site's php cache and still I just see the 4 default order total modules. How are people getting by without shipping insurance functionality with this version?
-
Re: Optional Shipping Insurance Module Support Thread...
After some manual SQLing I was able to get it to appear. I don't think 1.5.8a knows to run the install function first, or maybe it's because it is below allow of the other stuff but zen cart is trying to read every variable which doesn't exist until you manually add all the configuration values into the database. I'm one step closer to getting this to work.