Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / Need expert help updating Optional Insurance Mod for 1.3.8

Need expert help updating Optional Insurance Mod for 1.3.8

Locked

Views: 3,544

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
19 Dec 2007, 12:57 AM
#1
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Need expert help updating Optional Insurance Mod for 1.3.8

OK, I had updated the Optional Insurance mod that had been hanging around. I got it working for 1.3.6 and 1.3.7 (and earlier), but since 1.3.8 came out, it is broken. I've tried a few things, and have done a lot of file comparing, but I can't figure out the issue. With this mod enabled, the Checkout Payment page is completely blank. There are no errors in the error log. Does an expert on what is new in 1.3.8 have any suggestions on what I should focus on?

19 Dec 2007, 2:07 AM
#2
kim avatar

kim

Obaa-san

Join Date:
Jun 2003
Posts:
26,594
Plugin Contributions:
0

Re: Need expert help updating Optional Insurance Mod for 1.3.8

Jade - the only difference I can think of that could be affecting it is the security token that is now being used.

19 Dec 2007, 4:11 AM
#3
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Need expert help updating Optional Insurance Mod for 1.3.8

Kim:

Jade - the only difference I can think of that could be affecting it is the security token that is now being used.

Hmmm, any tips on files to look to for adjustments? The optional insurance mod is loaded on Step 2 of checkout, and is in the modules/order_total/ folder. I've tried comparing 1.3.7 to 1.3.8 of other modules/order_total/ files but I can't find any differences that would help me fix the issue.

19 Dec 2007, 4:29 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Need expert help updating Optional Insurance Mod for 1.3.8

You have this section of code:

            if ($pass == 'true') {
                $cart_content_type = $_SESSION['cart']->get_content_type();
                $gv_content_only = $_SESSION['cart']->gv_only();
                if ($cart_content_type == 'physical' or $cart_content_type == 'mixed') {
                    $charge_it = true;
                } else {
                    // check to see if everything is virtual, if so - skip the low order fee.
                    if ((($cart_content_type == 'virtual') and MODULE_ORDER_TOTAL_LOWORDERFEE_VIRTUAL == 'true')) {
                        $charge_it = false;
                        if ((($gv_content_only > 0) and MODULE_ORDER_TOTAL_LOWORDERFEE_GV == 'false')) {
                            $charge_it = true;
                        }
                    }
                    
                    if ((($gv_content_only > 0) and MODULE_ORDER_TOTAL_LOWORDERFEE_GV == 'true')) {
                        // check to see if everything is gift voucher, if so - skip the low order fee.
                        $charge_it = false;
                        if ((($cart_content_type == 'virtual') and MODULE_ORDER_TOTAL_LOWORDERFEE_VIRTUAL == 'false')) {
                            $charge_it = true;
                        }
                    }
                }
                //end else - $pass is still open
            }
            //end pass

NOTE: $charge_it is using true or false ...

However, everywhere else, $charge_it is using: 'true' and 'false' ...

Same with $usps ...

Not sure if there is an issue caused by this as I have not had time to test this module ...

27 Dec 2007, 2:00 PM
#5
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Need expert help updating Optional Insurance Mod for 1.3.8

Ajeh:

You have this section of code:

        if ($pass == 'true') {
            $cart_content_type = $_SESSION['cart']->get_content_type();
            $gv_content_only = $_SESSION['cart']->gv_only();
            if ($cart_content_type == 'physical' or $cart_content_type == 'mixed') {
                $charge_it = true;
            } else {
                // check to see if everything is virtual, if so - skip the low order fee.
                if ((($cart_content_type == 'virtual') and MODULE_ORDER_TOTAL_LOWORDERFEE_VIRTUAL == 'true')) {
                    $charge_it = false;
                    if ((($gv_content_only > 0) and MODULE_ORDER_TOTAL_LOWORDERFEE_GV == 'false')) {
                        $charge_it = true;
                    }
                }
                
                if ((($gv_content_only > 0) and MODULE_ORDER_TOTAL_LOWORDERFEE_GV == 'true')) {
                    // check to see if everything is gift voucher, if so - skip the low order fee.
                    $charge_it = false;
                    if ((($cart_content_type == 'virtual') and MODULE_ORDER_TOTAL_LOWORDERFEE_VIRTUAL == 'false')) {
                        $charge_it = true;
                    }
                }
            }
            //end else - $pass is still open
        }
        //end pass
> 
> NOTE: $charge_it is using true or false ...
> 
> However, everywhere else, $charge_it is using: **true** and false ...
> 
> Same with $usps ...
> 
> Not sure if there is an issue caused by this as I have not had time to test this module ...

Would that be a 1.3.8 ONLY issue though? And I'm not fully following what you mean.

Thanks!
27 Dec 2007, 5:20 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Need expert help updating Optional Insurance Mod for 1.3.8

I don't know the issues with your module ... I just noticed that you are interchanging true and 'true' and false with 'false' ...

27 Dec 2007, 6:21 PM
#7
swguy avatar

swguy

Administrator

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

Re: Need expert help updating Optional Insurance Mod for 1.3.8

Jettrue, the problem is as described here:

http://www.zen-cart.com/forum/showpost.php?p=468942&postcount=212

For some reason (seems odd to me) this is a credit class and credit classes need a get_order_total() function in 1.3.8. You can start with the one in Quantity Discounts if you'd like or use one of the native modules (Group Discounts, etc.) for a template. But my suspicion is that you in fact do not want this to be a credit class.

Scott

28 Dec 2007, 6:50 AM
#8
golowenow avatar

golowenow

New Zenner

Join Date:
Jul 2006
Location:
Washington State
Posts:
78
Plugin Contributions:
0

Re: Need expert help updating Optional Insurance Mod for 1.3.8

This mod should actually be incorporated into Zencart future versions as many users send goods via the postal service and such and thus use insurance. I am constantly using it. This has now caused me yet another headache. Hope a fix is done soon Jettrue. Please post updates to this thread. I am subscribed to it now as I am sure others will be.:smartalec: Good luck!

28 Dec 2007, 2:34 PM
#9
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Need expert help updating Optional Insurance Mod for 1.3.8

swguy:

Jettrue, the problem is as described here:

http://www.zen-cart.com/forum/showpost.php?p=468942&postcount=212

For some reason (seems odd to me) this is a credit class and credit classes need a get_order_total() function in 1.3.8. You can start with the one in Quantity Discounts if you'd like or use one of the native modules (Group Discounts, etc.) for a template. But my suspicion is that you in fact do not want this to be a credit class.

Scott

Thanks for the heads up Scott. I may not want it to be a credit class, but what a credit class even is is beyond me, so whether or not I want it to be one is moot. :P I simply updated this mod from some old mod someone else created. I am a php hacker, not a writer. But the above should help me hack it back together.

Ajeh, if you read my first post, you would have seen that the issue was that it worked in 1.3.7, but not in 1.3.8.

28 Dec 2007, 3:03 PM
#10
swguy avatar

swguy

Administrator

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

Re: Need expert help updating Optional Insurance Mod for 1.3.8

jettrue:

Thanks for the heads up Scott. I may not want it to be a credit class, but what a credit class even is is beyond me, so whether or not I want it to be one is moot

OK. Delete line 25 which says

$this->credit_class = 'true';

and retest.

28 Dec 2007, 3:05 PM
#11
swguy avatar

swguy

Administrator

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

Re: Need expert help updating Optional Insurance Mod for 1.3.8

Ajeh:

I don't know the issues with your module ... I just noticed that you are interchanging true and 'true' and false with 'false' ...

While this is stylistically awkward, it's still valid. PHP is a typeless language, so

true == 'true'

This causes Java programmers who are not stout of heart to run screaming into the night. :)

Scott

28 Dec 2007, 3:19 PM
#12
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Need expert help updating Optional Insurance Mod for 1.3.8

swguy:

OK. Delete line 25 which says

$this->credit_class = 'true';

and retest.

Thanks! LOL, although I just fixed it by adding the order_total function. But I will try that way as well.

Ok, removing that line simply stopped the option from showing up on the page. So, I will leave it with credit class on, and with the new function added.

28 Dec 2007, 3:34 PM
#13
jettrue avatar

jettrue

Totally Zenned

Join Date:
Jan 2005
Location:
USA, St. Louis
Posts:
3,651
Plugin Contributions:
5

Re: Need expert help updating Optional Insurance Mod for 1.3.8

I've posted an updated includes/modules/order_total/ot_insurance.php here:

http://www.zen-cart.com/forum/showpost.php?p=480479&postcount=95

I'll post an update to the downloads section soon.

Thanks again for your help Scott!