can anyone tell me why I am getting this error message after installing/adding a new language? With the default english I do not have any issues, only after adding and enabling other languages and switching between pages. Thanks in advance!
PHP Notice: Use of undefined constant php - assumed 'php' in /home/effect/public_html/catalog/view/theme/theme208/template/module/featured.tpl
usually that error occurs when someone uses a variable without using a $ sign in front of it. PHP is smart enough to assume that it is a variable so it can keep moving.
Check that tpl file for a 'php' somewhere being used like a variable.
- Mel
http://online.enterpriseconsulting.com.au
Site with OpenCart extensions & code downloads, many new extensions coming soon!
Follow us on twitter for more updates
Can you be a bit specific? I'm not an expert in PHP.melbagnato wrote:Hi istyfu,
usually that error occurs when someone uses a variable without using a $ sign in front of it. PHP is smart enough to assume that it is a variable so it can keep moving.
Check that tpl file for a 'php' somewhere being used like a variable.
- Mel
Example: the variable "template" will be "$template"
Look in your "featured.tpl" file for a missing $ sign.
The error message gives you the location and should also give you the line number of the error.
OpenCart custom solutions @ https://villagedefrance.net
Better Together: Buy one product, get another at a discount.
Discount Chooser: Buy a group of products, get another group at a discount.
Code: Select all
<div class="inner-indent">
<?php if ($product['thumb']) { ?>
<div class="image2">
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a>
<a href="<?php echo $product['href']; ?>" rel="colorbox" class="colorbox<?php echo $i;?> quick-view-button button"><span><?php echo $text_quick;?></span></a>
</div>
<?php } ?>
<div class="name maxheight-feat"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div>
<?php // if ($product['description']) {?>
<div class="description"><?php// echo mb_substr($product['description1'],0,60,'UTF-8').'...';?></div>
<?php// } ?>
<div style="display:none;">
<div class="quick-view<?php echo $i;?> preview">
<div class="wrapper marg">
<div class="left">
<?php if ($product['thumb1']) { ?>
<div class="image3">
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb1']; ?>" alt="<?php echo $product['name']; ?>" /></a>
</div>
Code: Select all
62: <?php // if ($product['description']) {?>
63: <div class="description"><?php// echo mb_substr($product['description1'],0,60,'UTF-8').'...';?></div>
64: <?php// } ?>
Code: Select all
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
So change.
Code: Select all
<?php//
Code: Select all
<?php //
It worked with the first error! Thank you so much!ADD Creative wrote:You may need to add a space between the php tag and the comment.
So change.toCode: Select all
<?php//
Code: Select all
<?php //
Can you help with the second error, it remains in error log:
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
Here is the line 408 from product.tpl:
Code: Select all
line 407: <div class="cart">
line 408: <a href="<?php echo $product['href']; ?>" class="button details btn_view"><span><?php echo $button_details; ?></span></a>
line 409: <a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart btn_cart"><span><?php echo $button_cart; ?></span></a>
line 410: </div>
Theme222 is a custom theme. If you switch back to the default template from the admin - > systems - > settings - > edit store - > General tab - > Select Default template - > Save changes. Are you able to reproduce the same issue on the store-front end?jetmosquitoe wrote:It worked with the first error! Thank you so much!ADD Creative wrote:You may need to add a space between the php tag and the comment.
So change.toCode: Select all
<?php//
Code: Select all
<?php //
Can you help with the second error, it remains in error log:
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
2016-07-22 16:03:56 - PHP Notice: Undefined variable: button_details in .../catalog/view/theme/theme222/template/product/product.tpl on line 408
Here is the line 408 from product.tpl:Code: Select all
line 407: <div class="cart"> line 408: <a href="<?php echo $product['href']; ?>" class="button details btn_view"><span><?php echo $button_details; ?></span></a> line 409: <a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart btn_cart"><span><?php echo $button_cart; ?></span></a> line 410: </div>
Note: I would suggest to post your site under temporary maintenance before trying the above solution from your admin - > systems - > settings - > edit store - > server tab - > Maintenance Mode.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I switched to default OC theme, and checked. This error in error log file apears only in my custom theme. What would you recommend to do?straightlight wrote: Theme222 is a custom theme. If you switch back to the default template from the admin - > systems - > settings - > edit store - > General tab - > Select Default template - > Save changes. Are you able to reproduce the same issue on the store-front end?
Note: I would suggest to post your site under temporary maintenance before trying the above solution from your admin - > systems - > settings - > edit store - > server tab - > Maintenance Mode.
I would suggest to contact the developer of the custom theme to resolved this issue. If the developer does not respond after sometime, you can always request a quote from the Commercial Support section of the forum.jetmosquitoe wrote:I switched to default OC theme, and checked. This error in error log file apears only in my custom theme. What would you recommend to do?straightlight wrote: Theme222 is a custom theme. If you switch back to the default template from the admin - > systems - > settings - > edit store - > General tab - > Select Default template - > Save changes. Are you able to reproduce the same issue on the store-front end?
Note: I would suggest to post your site under temporary maintenance before trying the above solution from your admin - > systems - > settings - > edit store - > server tab - > Maintenance Mode.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
PHP Notices does not effect your site correct work. Navigate to System -> Settings -> Edit -> Server -> Display Errors -> No.
It is set No already Looks like the question is fixed.
After some time the log file will have so big size that the admin menu with error log will open because it will be too heavy I had to clear it manually recently because of this.
That is correct. The error logs may be overloaded after a certain size as it may no longer be able to write on it unless manually cleared from the admin-end or by FTP / File manager's host console.jetmosquitoe wrote:Here, what technical support of the theme developer have answered:
PHP Notices does not effect your site correct work. Navigate to System -> Settings -> Edit -> Server -> Display Errors -> No.
It is set No already Looks like the question is fixed.
After some time the log file will have so big size that the admin menu with error log will open because it will be too heavy I had to clear it manually recently because of this.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
change:
Code: Select all
line 408: <a href="<?php echo $product['href']; ?>" class="button details btn_view"><span><?php echo $button_details; ?></span></a>
Code: Select all
line 408: <a href="<?php echo $product['href']; ?>" class="button details btn_view"><span><?php if (isset($button_details)) { echo $button_details; } ?></span></a>
Mike
cue4cheap not cheap quality
theme developers' support is currently doing smth with that error. I will try your offer a bit later, and return here with comments. Thank you )Cue4cheap wrote:Try the one I changed it to in the post above.
Mike
The number of lines is also changed and the block looks like this now.
Code: Select all
404: <div class="cart">
405: <a href="<?php echo $product['href']; ?>" class="button details btn_view"></a>
406: <a data-id="<?php echo $product['product_id']; ?>;" class="button addToCart btn_cart"><span><?php echo $button_cart; ?></span></a>
407: </div>
Users browsing this forum: No registered users and 95 guests