(05-08-2016 04:32 PM)bulent35 Yazılan: [ -> ]Opencart 2.1.0.1 versiyonuna uygun olacak şekilde herhangibir Kategori sayfasına her defasında girildiğinde her seferinde ürünlerin rastgele sıralanması dolayısıyla farklı görüntülenmesi mümkünmüdür ? Nasıl gerçekleştirebilirim ?
/catalog/controller/product/category.php gir
Bul:
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
}
Değiştir:
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1,
'rating' => $result['rating'],
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)
);
shuffle($data['products']);
}
Bu Şekilde Düzenlersen Her Girdiğinde yada Her Sayfa Yenilediğinde ürünlerin sıralaması değişir.