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.
That's kind of what I thought it was saying also...but then I thought...why would it say that? This is an addon file that would go in custom templates (vs a core file that the addon modified).
So no, it doesn't exist because when I installed, I installed it into my custom template folder, per the folder structure in the addon's fileset.
It seems strange to me that an addon would be written to look in template_default rather than in custom_template. But that does appear to be what the error is indicating. A simple and obvious fix is to simply load that file into template_default, but I think the better thing to do is to make sure the code is properly written because putting an addon file in template_default instead of custom_template is incorrect procedure unless you want the addon to work in ALL templates vs. your chosen template.
However....this was not an issue in the vanilla install. It's only happening in my customized store. Not sure what's causing this issue.
First thing to do IMHO is to add the file to the default_template folder and see if the error goes away..
I do not think it's an issue for this file to be in the default_template folder.. It's not a core file and will not be overwritten in an upgrade because of this. (which is the primary purpose of the override system)
However, I'll leave it to those more knowledgeable than I to weigh in here..
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.
OMG I had the same thought as you, but before I did it, I checked the custom template folder and the file in question simply wasn't there - that's what was causing the error. I have no idea how that happened because I specifically remember uploading that file along with my customized tpl_product_info_display.php file.
So I uploaded it, and now I get this error:
The code for that file, lines 52 - 58 isPHP Parse error: syntax error, unexpected T_ELSE in /includes/modules/recent_products.php on line 57
I just don't understand why these legitimate code errors didn't show up during testing on a vanilla install. If the code is wrong - it's wrong - regardless of which template is being used.PHP Code:
$num_products_count = ($recent_products_query == '') ? 0 : $recent_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0)
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
$col_width = floor(100/$num_products_count);
} else {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS);
Is that right?
Yes, the code you quoted is wrong ... regardless of what template is being used.
.
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.
Wondering if I need a bracket after this line:
PHP Code:
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
$col_width = floor(100/$num_products_count);
so that it looks like this:
PHP Code:
$num_products_count = ($recent_products_query == '') ? 0 : $recent_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0)
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
$col_width = floor(100/$num_products_count); {
} else {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS);
Last edited by ScriptJunkie; 11 Apr 2012 at 08:03 PM.
that didn't work.
The semicolon is closing the two IF statements.
If you want to nest IF statements, and incorporate ELSE statements also, then you'd be better off using full brace structure.
Code:if (condition) { if (condition) { statement; } else { statement; } }
.
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.
Ahhh ok...so this:
becomes this?PHP Code:
$num_products_count = ($recent_products_query == '') ? 0 : $recent_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0)
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
$col_width = floor(100/$num_products_count);
} else {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS);
Edit: Ok, I tried the above but I must have done something wrong, because I'm still getting this error:PHP Code:
$num_products_count = ($recent_products_query == '') ? 0 : $recent_products->RecordCount();
// show only when 1 or more
if ($num_products_count > 0)
{
if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS == 0)
{
$col_width = floor(100/$num_products_count);
} else {
$col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_RECENT_PRODUCTS);
}
}
PHP Parse error: syntax error, unexpected T_ELSE in /includes/modules/recent_products.php on line 57
Last edited by ScriptJunkie; 11 Apr 2012 at 08:57 PM. Reason: provide testing results
Hi I have just checked the beta i attached a few posts back and the missing brace is there in the beta, i am guessing that perhaps you may have accidentally removed it, whilst getting rid of my commented out testing code
This is my "cleaned" version, which hasn't yet been tested, but should be fine as only the extraneous comments have been removed
Webzings Design
Semi retired from Web Design
Bookmarks