| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
altered carts OnSale mod for php 7+ | ||||
|
|
Thread Tools |
#11
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
I did get this error with the php code checker...
Quote:
Code:
It that really an error or is the code ok?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
#12
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
So i've made a few changes to the OnSale mod to try and get it in line with php7.2 and here one I'm stuck on... I currently have
Code:
Quote:
Apparently I need to add the connection to the db in the mysqli function part Code:
and am I headed in the right direction? Thanks.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
#13
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
Don't update the original code to use mysqli_real_escape_string(). Instead, leave the old code as-is and recreate the missing mysql_real_escape_string() function that was removed in PHP7.
The details on how to do it are explained here: https://forum.x-cart.com/showpost.php?p=410661&postcount=10 .
__________________
Thomas / USA XCart V4.4.5 Gold XCart Mobile V1.4.12 XCart X-PDF XCart X-HotProducts AlteredCart Checkout One (One Page Checkout) BCSE Back In Stock CFL Holiday Message CFL System Message Smack Digital (WebsiteCM) Remember Anon Carts xcartmods Testimonials xcartmods reCAPTCHA for X-Cart Classic Unix, PHP 7.0 (patched 5.4). MySQL 5.6 |
|||||||
|
#14
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
I notice that post says if it is the ionCube version than that fix won't help. The instructions in the Bills unencrypted source code says that
Quote:
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
#15
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
In the Final weeks of Bill closing down his business he provided unencrypted source code (ioncube removed) to existing customers for a small fee. It was a limited time offer.
If that is what you have then you can ignore the ioncube license comment in his instructions since it does not apply.
__________________
Thomas / USA XCart V4.4.5 Gold XCart Mobile V1.4.12 XCart X-PDF XCart X-HotProducts AlteredCart Checkout One (One Page Checkout) BCSE Back In Stock CFL Holiday Message CFL System Message Smack Digital (WebsiteCM) Remember Anon Carts xcartmods Testimonials xcartmods reCAPTCHA for X-Cart Classic Unix, PHP 7.0 (patched 5.4). MySQL 5.6 |
|||||||
#16
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
Looks like it may have worked, stand by.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
|
#17
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
I'm still working through this and am getting this Warning...
count(): Parameter must be an array or an object that implements Countable here are the 2 lines of code it referring to... Code:
Should this be different for php7?
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
#18
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
That warning was suppressed in earlier PHP versions. But now PHP7.2+ has elevated the warning to encourage better coding practices.
The solution is to test the variable to confirm it is countable BEFORE counting it. It would be something like this: Code:
This is just a coding example and may not work as-is. My example is just to give you a fundamental idea on how to fix it. BTW, PHP7.3 introduced the is_countable() function as alternate way to do the "instanceof Countable" var test. Details here: https://www.php.net/manual/en/function.is-countable.php .
__________________
Thomas / USA XCart V4.4.5 Gold XCart Mobile V1.4.12 XCart X-PDF XCart X-HotProducts AlteredCart Checkout One (One Page Checkout) BCSE Back In Stock CFL Holiday Message CFL System Message Smack Digital (WebsiteCM) Remember Anon Carts xcartmods Testimonials xcartmods reCAPTCHA for X-Cart Classic Unix, PHP 7.0 (patched 5.4). MySQL 5.6 |
|||||||
|
#19
|
|||||||
|
|||||||
Re: altered carts OnSale mod for php 7+
I've worked through the changes that were suggested and still don't have this working right. I get a bunch of Undefined index: and Undefined variable: notices and have no idea how to fix them. For example...
Undefined index Quote:
Code:
example of Undefinded variable Quote:
Code:
can someone give me an example of what I should do so I can fix the rest of them? I tried google but they talk way over my head so it's like comparing apples to oranges. Thanks.
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3 mods: reCaptcha running on UNIX www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2 mods: reCaptcha cdseo pro running on UNIX |
|||||||
#20
|
|||||||||
|
|||||||||
Re: altered carts OnSale mod for php 7+
These are notices not even warnings. So you can ignore them. If you want them to go away you will have to assign a value no matter what.
So for example for the $p_query you need to find where its value is assigned somewhere before this line 524 and check if value is not assign and you can do something like $p_query = ''; It will highly depend on the code there what it does and how it does it to decide how to assign the variable value.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
|
|||
X-Cart forums © 2001-2020
|