I've just imported about 100 products from my old shopping cart. And of course that means I have a bunch of products in "Latest products" on the home page that I really don't want there! I can't figure out what controls the "latest products" list. I thought maybe it was lasted edited, or added date, etc., but it doesn't seem like any changes I make to these fields make much difference.
Any ideas how to control this page?
Thanks.
Danita
Any ideas how to control this page?
Thanks.
Danita
Hmmm - changing the dates around in the database doesn't seem to do anything though - so I guess I just have to live with what is there for now. I'll revisit this later - still have a lot of setup to do that is more important than this!
Thanks.
Danita
Thanks.
Danita
Mate this might help!
We had similar implementation to display the products we wanted all the time Irrespective of any latest products added. Small hack but worked for us.
Details
Step 1
(Locate the following file)
<Installation>/catalog/model/catalog/product.php
Step 2
(Locate the following function)
public function getLatestProducts ...
Step 3
(Change the SQL Listed as below, Note - The products numbers are for the products you want to see )
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND ss.language_id = '" . (int)$this->config->get('config_language_id') ."' AND p.product_id in ('71','29','30','31','33','35','102','42','43','44','45','127') ORDER BY p.date_added DESC LIMIT " . (int)$limit);
Step 4
Delete the cache in <installation> System/Cache folder.
Refresh the screen. You should see your products listed.
Let me know how you go
venkat@morrisnphilip
We had similar implementation to display the products we wanted all the time Irrespective of any latest products added. Small hack but worked for us.
Details
Step 1
(Locate the following file)
<Installation>/catalog/model/catalog/product.php
Step 2
(Locate the following function)
public function getLatestProducts ...
Step 3
(Change the SQL Listed as below, Note - The products numbers are for the products you want to see )
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND ss.language_id = '" . (int)$this->config->get('config_language_id') ."' AND p.product_id in ('71','29','30','31','33','35','102','42','43','44','45','127') ORDER BY p.date_added DESC LIMIT " . (int)$limit);
Step 4
Delete the cache in <installation> System/Cache folder.
Refresh the screen. You should see your products listed.
Let me know how you go
venkat@morrisnphilip
Thanks kedgetech - that worked perfectly. I assume that somewhere down the line, after I have added a few more "new" products, I'll be able to just remove this part and it will sort itself out again to actually put in the "latest" products. Problem for me of course was that since they were all imported at the same time, years old products were showing as "latest"!
I will point out that everyone in this forum is very helpful! I feel like I've just about got the cart working the way I want now!
Thanks.
Danita
I will point out that everyone in this forum is very helpful! I feel like I've just about got the cart working the way I want now!
Thanks.
Danita
danitaz - Glad it worked for you. If you remove the extra code it will work a normal. Its a small hack as per my customer requirement they dont want to see the latest products.
maema - I am using OC 1.4.4. Mate can you be a little more eloborate than "doesnt work for me..."?
venkat@morrisnphilip
maema - I am using OC 1.4.4. Mate can you be a little more eloborate than "doesnt work for me..."?
venkat@morrisnphilip
Mate I did not use 1.3.4 version before. I will see if i could get the older version and help you but never the less I would suggest you should upgrade to latest version at least 1.4.4 + as support wise its not easy for any one to help troubleshoot unless you have a support contact with OC
venkat@morrisnphilip

venkat@morrisnphilip
Here you go mate 1.3.4 version . Let me know how you go.
* Note this is Untested fit for OC1.3.4 *
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->language->getId() . "' AND ss.language_id = '" . (int)$this->language->getId() ."' AND p.product_id in ('71','29','30','31','33','35','102','42','43','44','45','127') ORDER BY p.date_added DESC LIMIT " . (int)$limit);
venkat@morrisnphilip
* Note this is Untested fit for OC1.3.4 *
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->language->getId() . "' AND ss.language_id = '" . (int)$this->language->getId() ."' AND p.product_id in ('71','29','30','31','33','35','102','42','43','44','45','127') ORDER BY p.date_added DESC LIMIT " . (int)$limit);
venkat@morrisnphilip
OPEN CART 1.3.4
There is the Hack Using LOCATION field under PRODUCT > DATA to sort :
Step 1
(Locate the following file)
<Installation>/catalog/model/catalog/product.php
Step 2
(Locate the following function)
public function getLatestProducts ...
Step 3
modify :
SRC
..... ORDER BY p.date_added DESC LIMIT " . (int)$limit);
MOD
..... ORDER BY p.location ASC LIMIT " . (int)$limit);
Work using location ;-)
Just notice is not sorted by 1, 2 ,3...10 but more like 01,02,03...10.. it' s sort in alphanumeric... so can use A ,b, c, 3...
can specialist can tell me if it is ok ?
There is the Hack Using LOCATION field under PRODUCT > DATA to sort :
Step 1
(Locate the following file)
<Installation>/catalog/model/catalog/product.php
Step 2
(Locate the following function)
public function getLatestProducts ...
Step 3
modify :
SRC
..... ORDER BY p.date_added DESC LIMIT " . (int)$limit);
MOD
..... ORDER BY p.location ASC LIMIT " . (int)$limit);
Work using location ;-)
Just notice is not sorted by 1, 2 ,3...10 but more like 01,02,03...10.. it' s sort in alphanumeric... so can use A ,b, c, 3...
can specialist can tell me if it is ok ?
Last edited by maema on Sat May 01, 2010 6:36 pm, edited 5 times in total.
anyone tested this? because this is what i'm looking for.. i'm using v1.3.4 and i'm very satisfied with this version. if anyone can help me with this situation it will be much appriciated.kedgetech wrote:Here you go mate 1.3.4 version . Let me know how you go.
* Note this is Untested fit for OC1.3.4 *
$query = $this->db->query("SELECT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, (SELECT AVG(r.rating) FROM " . DB_PREFIX . "review r WHERE p.product_id = r.product_id GROUP BY r.product_id) AS rating FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) WHERE p.status = '1' AND p.date_available <= NOW() AND pd.language_id = '" . (int)$this->language->getId() . "' AND ss.language_id = '" . (int)$this->language->getId() ."' AND p.product_id in ('71','29','30','31','33','35','102','42','43','44','45','127') ORDER BY p.date_added DESC LIMIT " . (int)$limit);
venkat@morrisnphilip
Thank you.
hello,
I tested..but not working...
I made my own just few post before with my poor knowledge (take 4h todo it).
So mister specialist how to write the correct php to do this:
first sort by location... then by date ?
location is priority of course.
and how to transform location field in admin in order to have a popup with fixed value (values will be in the source code of course, no need to be edited) ?
I tested..but not working...
I made my own just few post before with my poor knowledge (take 4h todo it).
So mister specialist how to write the correct php to do this:
first sort by location... then by date ?
location is priority of course.
and how to transform location field in admin in order to have a popup with fixed value (values will be in the source code of course, no need to be edited) ?
Who is online
Users browsing this forum: No registered users and 36 guests