latest products not updating
latest products not updating
Sorry everyone. Seeing as people were helpful on the last post I've found another problem :]
Have just reinstated the latest products code but i'm not sure why it's showing the products it is. I added a new test product and it didn't show up as a newly added product. Running Opencart 0.7.7/8.
http://www.foxythings4u.com/oc/
Original opencart code----------------------------------------------------
<div class="heading"><?php echo $text_latest; ?></div>
<?php foreach ($products as $product) { ?>
<div class="products"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a><br /><b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b><br /><?php echo $product['price']; ?></div>
<?php } ?>
----------------------------------------------------------------------------
Thanks,
Michael
Have just reinstated the latest products code but i'm not sure why it's showing the products it is. I added a new test product and it didn't show up as a newly added product. Running Opencart 0.7.7/8.
http://www.foxythings4u.com/oc/
Original opencart code----------------------------------------------------
<div class="heading"><?php echo $text_latest; ?></div>
<?php foreach ($products as $product) { ?>
<div class="products"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" title="<?php echo $product['name']; ?>" alt="<?php echo $product['name']; ?>" /></a><br /><b><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></b><br /><?php echo $product['price']; ?></div>
<?php } ?>
----------------------------------------------------------------------------
Thanks,
Michael
Re: latest products not updating
The problem is not in the tlp file.
Try this. Change in catalog/extension/modul/latest.php the line from:
to
Try this. Change in catalog/extension/modul/latest.php the line from:
Code: Select all
$results = $database->getRows("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.status = '1' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1' order by p.date_added desc" . $limit);
Code: Select all
$results = $database->getRows("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.status = '1' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1' and p.latestpr = '1' order by p.date_added desc" . $limit);
Re: latest products not updating
I curious. What is latestpr?
Code: Select all
p.latestpr = '1'Re: latest products not updating
Well the interesting thing with that is that I don't have a latest.php module. I did look for it, but it doesn't seem to exist. Found a 0.7.9 install zip and it's not in their either. So I can only assume that is a later addition; maybe 0.8x.
Re: latest products not updating
Code: Select all
ALTER TABLE `product`
ADD `latestpr` int(1) NOT NULL default '0' AFTER `status`,
ADD `special_offer` int(1) NOT NULL default '0' AFTER `status`,
ADD `featured` int(1) NOT NULL default '0' AFTER `status`;
To correct the original latest problem open /catalog/controller/home.php
Code: Select all
$results = $database->getRows("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.status = '1' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1' order by p.date_added limit 6");
Re: latest products not updating
I have never had that column.ADD `latestpr` int(1) NOT NULL default '0' AFTER `status`,
What purpose is it used for? Do we need it.
In the code here, latest is always created by the latest products added.
Mikki
I don't know where you will find the code for pre 7.9 versions.
There where quite a few core changes and a 7.9 version won't work with 7.8 or earlier without modifications.
Re: latest products not updating
Ok, I remember.
Somebody asked me add the possibility to enable/disable products showing up in latest as well.
Somebody asked me add the possibility to enable/disable products showing up in latest as well.
- Attachments
-
- Products_1282656428760.png (8.55 KiB) Viewed 15395 times
Re: latest products not updating
My version is old enough to not have any way to find out what version it is, heh.
I assume that even the version I have came with latest products and that it worked or it'd be pointless it being there :]
I'm trying not to upgrade incase it breaks everything which it why I'm just hacking what I can to get it to work. Next year it'll all be migrated to super duper latest version.
I assume that even the version I have came with latest products and that it worked or it'd be pointless it being there :]
I'm trying not to upgrade incase it breaks everything which it why I'm just hacking what I can to get it to work. Next year it'll all be migrated to super duper latest version.
Re: latest products not updating
mikki
As I have mentioned above the problem with latest products is the missing "desc" in /catalog/controller/home.php .
Without it the cart shows the first added products instead of the last added.
As I have mentioned above the problem with latest products is the missing "desc" in /catalog/controller/home.php .
Without it the cart shows the first added products instead of the last added.
Re: latest products not updating
In home.php, post the function latest(&$view) code