- Katılım
- 13 Ağu 2009
- Mesajlar
- 3,200
- Tepkime puanı
- 1
- Puanları
- 38
- Yaş
- 39
- Konum
- Bursa
- Web sitesi
- www.opencart-tr.com
Ana sayfada ya da yan taraflarda blok olarak rastgele ürünleri yayınlamanızı sağlar.
Ekdeki dosyayı indirin, kurun, gerekli ayarları, grup izinleri ayarlaryın ve aşağıdaki eklemeyi yapınız.
catalog\model\catalog\product.php
BUL
PHP:
}
?>
ÜZERİNE EKLE
PHP:
//retrieve products randomly
public function getRandomProducts($limit) {
$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') . "' ORDER BY rand() DESC LIMIT " . (int)$limit);
$product_data = $query->rows;
return $product_data;
}
//end of retrieve products randomly
1.4.7 ve alt sürümleri kullananlar bu konuyu inceleyiniz
http://forum.opencart-tr.com/thread-525.html