Page 1 of 1
Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 5:27 am
by yl
After I finished an installment of the Latest_Featured_Special_Products_vo79.1, I got an error 1054 when disabled the product status.
I removed and replaced the admin/controller/product.php, the error's gone. Please direct me to fix the file product.php!
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 8:07 am
by bthirsk
Add this first at this link.
http://forum.opencart.com/index.php/top ... l#msg13098
add to your catalog/template/module/*.tpl files for the latest/feature/specials
">" title="" alt="">">
in catalog/extension/module/*.php add the following for each of the three files for latest/featured/ specials
if ($product_data) {
$view->set('products', $product_data);
}
These changes might help.
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 11:08 am
by yl
Thank you!

I will Look at it tomorrow... and update.
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 5:40 pm
by Qphoria
I'm not sure this is necessary. If there are no products, then the foreach loop will just exit. I have added the fix for admin/controller/product.php from the other post.
Then I set Product 1 to featured: yes, special: yes. I see the product on the front page
Then I set Product 1 status to "disabled". I no longer see the product on the front page. But no error.
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 6:04 pm
by Qphoria
I've updated the contrib with the admin/controller/product.php fix:
http://forum.opencart.com/index.php/top ... w.html#new
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 8:36 pm
by bthirsk
The reason for the if clause in the .tpl is if you have a module set, but no products returned yet,
you receive errors when tpl is called.
The current code still calls tpl.
I did this when testing my random code because I wanted to check by adding one item at a time
and making sure when the random effect started.
Because I had no products set in specials, page errors occurred until I added the if clause so tpl
code would not run until there where results.
Also, If you include this, no message is required because there will be no output for a module that has no data.
When testing, if there is no data, such as in specials, you don't end up displaying a SPECIAL OFFER header with the message no products to display.
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Sun Dec 28, 2008 8:57 pm
by Qphoria
bthirsk wrote:
The reason for the if clause in the .tpl is if you have a module set, but no products returned yet,
you receive errors when tpl is called.
The current code still calls tpl.
But like i said, the foreach loop will just exit if there are no products. There is no error:
http://kewlazme.homeip.net/r272/
All products deleted from my database.
Also, If you include this, no message is required because there will be no output for a module that has no data.
When testing, if there is no data, such as in specials, you don't end up displaying a SPECIAL OFFER header with the message no products to display.
This would be the only use for it.
Re: Product Data "disable" error with "Latest_Featured_Special"
Posted: Mon Dec 29, 2008 12:03 am
by bthirsk
You are correct.
The if clause was required in the original because it did not check for no data or print
the no products message.
I had just added the line so I could continue testing.