LOL fair enough. Thanks for updating this in your contribs. Once MAMP releases a version with PHP7 I will do likewise.
LOL fair enough. Thanks for updating this in your contribs. Once MAMP releases a version with PHP7 I will do likewise.
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.
Not saying need to un out and make the change, but if touching the files in the mean time, __construct would work just as well on pretty much anything runniing PHP 5.x and above (yes, I know there is a lower limit, but can't remember now what it is/was). I've been moving that way relatively recently.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Usually just renaming the function to __construct is enough ..... but, double check your code to be sure that you don't ever directly call that function from code either inside or outside that class.
For example, in ZC the Admin object_info class gets called in numerous files via pInfo->objectInfo() ... so, we've rewritten (and are rewriting the v160 rewrite of) the class to have both a __construct() and an objectInfo() function ... which makes it PHP7 compatible and also backward-compatible to PHP5.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
The MAMP team just announced that they'd be releasing a new MAMP with PHP7 in the next 10 days!
https://twitter.com/mamp_en/status/673846269643726848
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.
And for Debian based Linux users try this PPA for your LAMP stack:
https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0
Other downloads of PHP 7.0.1 from the php.net server:
https://downloads.php.net/~ab/
I appear to have some sort of bran fog today, thought about wating to post back, but might as well get the ball rolling... Trying to understand if in fact the reverse compatibilty isn't really wth PHP 5 in general, but instead wth older ZC versions (ie. "This" file will work on ZC versions that are compatible wth Php 5.x and PHP 7...) Such that the older code that still calls the previous constructor doesn't need to be modified (as much) to work wth the newer version(s)... Otherwse I don't see the potential compatibility issue of leaving out the function by the name of the class when referring to PHP 5 (brain fog part at the moment)...
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
I don't think I fully understand what you're saying.
PHP5 will understand __construct() just fine. So will PHP7.
What PHP7 and 8 are moving towards is not automatically treating a class method of "foo" inside class named "foo" as the constructor. Instead, it will ignore the "foo" method and assume the class has no constructor if no __construct() method exists. To create the same functionality as PHP5, the __construct() method can simply call $this->foo(); to accomplish the old behaviour.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
This is my website http://hopshop.bg/, .this is product page http://hopshop.bg/index.php?main_pag...oducts_id=7187. added a contact form on products and quick order, but does not work on php 7 .... this is the code:
My Version Zen Cart 1.5.5a
PHP Code:<! ------------------------------------------------ --------------------------------------->
<? Php echo "Quick order with a click of product: .. (* for this product on this page): >>"?> <B> <? Php echo $ products_name; ?> <? Php echo "... Price"?>
<! - Bof Product Price block ->
<? Php
####echo $ one_time. ((Zen_has_product_attributes_values ((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
?>
<! - Eof Product Price block ->
</ B>
<? Php
// Contact Form via email // itbg.eu // Dev7 //
$ Gg = 'http: //';
$ Ggg = $ products_name;
$ Gggg = $ one_time. ((Zen_has_product_attributes_values ((int) $ _ GET [ 'products_id']) and $ flag_show_product_info_starting_at == 1)? TEXT_BASE_PRICE: ''). zen_get_products_display_price ((int) $ _ GET [ 'products_id']);
$ Contact_email = $ _POST [ 'EmailAddress'];
$ Contact_subject = $ _POST [ 'Subject'];
$ Contact_name = $ _POST [ 'FullName'];
$ Contact_message = $ _POST [ 'Message'];
$ Mydate = date ( 'l, F d Y g: i A', time () + 240);
$ To = "[email protected]"; // E-mail to which messages will be sent //
$ Message. = "Address:". $ Address. "\ R \ n";
$ Subject = "HopShop-Order:". $ Ggg. "\ R \ n". "Name:". $ Contact_name. "\ R \ n". "Tel:". $ Contact_subject. "\ R \ n"; // // Subject
$ Message = "From HopShop.Bg ---- Tel: 0878843093 \ r \ n \ r \ n" // text message //
. "Product: $ products_name \ r \ n". "Price: $ gggg \ r \ n"
. "Model: $ products_model; \ r \ n"
. "Link product ordered: $ gg {$ _ SERVER [ 'SERVER_NAME']} {$ _ SERVER [ 'REQUEST_URI']} \ r \ n"
. "------------------------------------------------ ------------------------------- \ r \ n "
. "------------------------------------------------ ------------------------------- \ r \ n "
. "Name: $ contact_name \ r \ n"
. "Phone client: $ contact_subject \ r \ n"
. "Shipping Address (+ Other information on order): \ r \ n \ r \ n $ contact_message \ r \ n"
. "------------------------------------------------ ------------------------------- \ r \ n "
. "------------------------------------------------ ------------------------------- \ r \ n "
. "Date: $ mydate \ r \ n"
. "From IP: {$ _SERVER [ 'REMOTE_ADDR']} \ r \ n \ r \ n";
$ Headers = "From: $ contact_name <$ contact_email> \ n"
. "Content-type: text / plain; charset = UTF-8 \ n"
. "Reply-To: $ contact_email \ n"
. "X-Mailer: PHP /". Phpversion ();
if (empty ($ contact_name) || empty ($ contact_email) || empty ($ contact_subject) || empty ($ contact_message)) {
?>
<Form id = "contact" method = "post" action = ""> <br/>
<Div id = "from">
Full name: <br /> <input type = "text" name = "FullName" size = "25" /> <br/>
</ Div>
E-mail: <br/> <input type = "text" name = "EmailAddress" size = "25" /> <br/>
Phone: <br /> <input type = "text" name = "Subject" size = "25" /> <br/>
Delivery address (or Econt office)
<br/> <textarea rows = "6" name = "Message" size = "10" cols = "10" class = "input"> </ textarea> <br/>
<Input type = "submit" value = "confirm order with just one click" /> <input type = "reset" value = "Clear" />
</ Form>
<? Php
} Elseif (! Ereg ( "^ [_ a-z0-9 -] + (\. [_ A-z0-9 -] +) * @ [a-z0-9 -] + (\. [A-z0-9 -] +) * (\. [az] {2,3}) $ ", $ contact_email)) {
echo "<p> Error: Please enter a valid e-mail. </ p>";
} Else {
mail ($ to, $ subject, $ message, $ headers);
echo "<h3> Your order is accepted! </ h3> <p> $ contact_name, <br /> as possible - will soon contact you $ contact_email.";
}
?>
Does that work on php anything? There appear to be a number of coding errors throughout. Not to mention that with the use of the form tag, it is not ZC compliant and will cause an issue if attempting to submit it because it doesn't have the applicable session information saved with it.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
@Mustang80 have you looked at the Ask A Question contribution in the plugins area? It might do what you want, and it already works with PHP7.
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.