Forums / Addon Shipping Modules / Optional Shipping Insurance Module [Support Thread]

Optional Shipping Insurance Module [Support Thread]

Views: 168,604

Results 381 to 400 of 416
24 Jan 2019, 6:18 PM
#381
echexxxxxxxx10 avatar

echexxxxxxxx10

New Zenner

Join Date:
Feb 2010
Posts:
58
Plugin Contributions:
0

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

19 Feb 2019, 8:07 PM
#382
jimmie avatar

jimmie

Totally Zenned

Join Date:
Jan 2013
Location:
New Port Richey, Florida
Posts:
971
Plugin Contributions:
0

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?

24 Sep 2019, 3:42 PM
#383
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,296
Plugin Contributions:
39

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

PRO-Webs, Inc. since 2003 https://pro-webs.net/

28 Dec 2019, 1:42 PM
#384
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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:

[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]

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

28 Dec 2019, 6:18 PM
#385
dennisns7d avatar

dennisns7d

New Zenner

Join Date:
Jan 2010
Posts:
55
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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:

[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).
28 Dec 2019, 7:40 PM
#386
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: Optional Shipping Insurance Module [Support Thread]

no, no changes to anything. This happened as soon as I installed the mod.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

6 Jan 2020, 10:02 PM
#387
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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........

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

1 Apr 2022, 8:00 PM
#388
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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

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.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

1 Apr 2022, 9:08 PM
#389
dennisns7d avatar

dennisns7d

New Zenner

Join Date:
Jan 2010
Posts:
55
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

To eliminate the warning when using PHP 7+, change

		function ot_insurance() {

to

		function __construct() {
1 Apr 2022, 11:30 PM
#390
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

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.

The full-time Zen Cart Guru. WizTech4ZC.com
New template for 2.0 viewable here: 2.0 Demo

15 Feb 2023, 4:42 PM
#391
zamzom avatar

zamzom

New Zenner

Join Date:
Jun 2009
Location:
Europe
Posts:
60
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

dennisns7d:

To eliminate the warning when using PHP 7+, change

	function ot_insurance() {
> to
> ```
		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

	$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?

15 Feb 2023, 5:04 PM
#392
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: Optional Shipping Insurance Module [Support Thread]

Should there be an Admin page check?

Yep.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

17 Feb 2023, 11:15 AM
#393
zamzom avatar

zamzom

New Zenner

Join Date:
Jun 2009
Location:
Europe
Posts:
60
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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):

		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
		}
17 Feb 2023, 11:23 AM
#394
zamzom avatar

zamzom

New Zenner

Join Date:
Jun 2009
Location:
Europe
Posts:
60
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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)

		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
		}
31 Mar 2023, 4:17 PM
#395
zamzom avatar

zamzom

New Zenner

Join Date:
Jun 2009
Location:
Europe
Posts:
60
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

In ot_insurance.php (version 3.2.4) around line 245:

			$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?

31 Mar 2023, 4:25 PM
#396
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

Re: Optional Shipping Insurance Module [Support Thread]

Yeah it looks wrong to me too.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

31 Mar 2023, 4:35 PM
#397
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,718
Plugin Contributions:
56

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/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

20 Oct 2024, 10:01 PM
#398
clam_man avatar

clam_man

New Zenner

Join Date:
Jun 2019
Location:
Austin TX
Posts:
65
Plugin Contributions:
0

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?

25 Oct 2024, 3:45 AM
#399
clam_man avatar

clam_man

New Zenner

Join Date:
Jun 2019
Location:
Austin TX
Posts:
65
Plugin Contributions:
0

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?

25 Oct 2024, 4:16 AM
#400
clam_man avatar

clam_man

New Zenner

Join Date:
Jun 2019
Location:
Austin TX
Posts:
65
Plugin Contributions:
0

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.