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

Optional Shipping Insurance Module [Support Thread]

Views: 168,604

Results 341 to 360 of 416
2 Nov 2014, 8:06 PM
#341
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Optional Shipping Insurance Module [Support Thread]

NOTE: on the file:
/includes/modules/order_total/ot_ot_optionalinsurance.php

you should comment the echo around line 144:

      $insurance = $_SESSION['shipping']['insurance'];
[B]//[/B]echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
      $selected = (($_SESSION['insurance'] == '1') ? true : false);

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Nov 2014, 8:09 PM
#342
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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?

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:

Extra Services (International)
Included in postage rates. Not shown to the customer.
WARNING: Some services cannot work with other services.

Insurance

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Nov 2014, 8:23 PM
#343
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

I checked them and it adds insurance to the shipping amount automatically without option.

2 Nov 2014, 8:42 PM
#344
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Nov 2014, 8:56 PM
#345
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

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!

2 Nov 2014, 9:03 PM
#346
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

      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', [B]$selected[/B], '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:

      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', [B]true[/B], '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 {

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Nov 2014, 9:22 PM
#347
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

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!

2 Nov 2014, 9:43 PM
#348
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

      $selected = (($_SESSION['insurance'] == '1') ? true : false);
[B]//override optional setting and force decline to be checked from the start
      $selected = true;
[/B]

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

2 Nov 2014, 10:00 PM
#349
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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:

  $selected = (($_SESSION['insurance'] == '1') ? true : false);

[B]//override optional setting and force decline to be checked from the start
$selected = true;
[/B]


It still does the same thing. I didn't see any change at all...
2 Nov 2014, 10:39 PM
#350
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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

3 Nov 2014, 1:02 AM
#351
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Optional Shipping Insurance Module [Support Thread]

What domain are you testing this on?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Nov 2014, 1:40 PM
#352
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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:

  $selected = (($_SESSION['insurance'] == '1') ? true : false);

[B]//override optional setting and force decline to be checked from the start
$selected = true;
[/B]


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!
5 Nov 2014, 2:54 PM
#353
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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:

[B]//[/B]echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
      $selected = (($_SESSION['insurance'] == '1') ? true : false);
[B]//override optional setting and force decline to be checked from the start
      $selected = true;
[/B]

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

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Nov 2014, 4:14 PM
#354
doooomed avatar

doooomed

Zen Follower

Join Date:
Jun 2009
Posts:
275
Plugin Contributions:
0

Re: Optional Shipping Insurance Module [Support Thread]

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:

[B]//[/B]echo 'shipping insurance: ' . $_SESSION['shipping']['insurance'] . '<br>';
$selected = (($_SESSION['insurance'] == '1') ? true : false);
[B]//override optional setting and force decline to be checked from the start
$selected = true;
[/B]

> 
> 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!
5 Nov 2014, 7:12 PM
#355
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

5 Dec 2014, 11:46 PM
#356
dennisns7d avatar

dennisns7d

New Zenner

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

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: if ($_SESSION['opt_insurance']) { to ```
if ($_SESSION['insurance']) {


Change line 244: ```
$selected = (($_SESSION['opt_insurance'] == '1') ? true : false);
``` to ```
if (isset($_SESSION['insurance'])) {
  $selected = (($_SESSION['insurance'] == '1') ? true : false);
} else {
  $selected = true;	// true for opt-out, false for opt-in
}
5 Dec 2014, 11:56 PM
#357
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Optional Shipping Insurance Module [Support Thread]

What shipping module are you using?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Dec 2014, 12:05 AM
#358
dennisns7d avatar

dennisns7d

New Zenner

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

Re: Optional Shipping Insurance Module [Support Thread]

I'm using Zone Rates.

16 Jan 2015, 6:14 PM
#359
aldo_campione avatar

aldo_campione

New Zenner

Join Date:
Nov 2011
Posts:
7
Plugin Contributions:
0

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

16 Jan 2015, 6:39 PM
#360
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Optional Shipping Insurance Module [Support Thread]

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

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.