sususapi Posted May 3, 2011 Share Posted May 3, 2011 cuma mau share gan.. mungkin agan2 ada yg blm tau cara urutin produk di homefeatured. kebanyakan urutan produknya dari yg lama. ada tips supaya produk yg tampil dimulai dari yg terbaru, nah mudah2an script ini bisa membantuedit prestashop/modules/homefaetured/homefeatured.php (bukan yg TPL ya..)hapus isinya lalu replace semua scriptnya dengan yg ini : <?php class HomeFeatured extends Module { private $_html = ''; private $_postErrors = array(); function __construct() { $this->name = 'homefeatured'; $this->tab = 'Tools'; $this->version = '0.9'; parent::__construct(); // The parent construct is required for translations $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Featured Products on the homepage'); $this->description = $this->l('Displays Featured Products in the middle of your homepage'); } function install() { if (!Configuration::updateValue('HOME_FEATURED_NBR', 8) OR !parent::install() OR !$this->registerHook('home')) return false; return true; } public function getContent() { $output = ''.$this->displayName.''; if (Tools::isSubmit('submitHomeFeatured')) { $nbr = intval(Tools::getValue('nbr')); if (!$nbr OR $nbr <= 0 OR !Validate::isInt($nbr)) $errors[] = $this->l('Invalid number of product'); else Configuration::updateValue('HOME_FEATURED_NBR', $nbr); if (isset($errors) AND sizeof($errors)) $output .= $this->displayError(implode(' ', $errors)); else $output .= $this->displayConfirmation($this->l('Settings updated')); } return $output.$this->displayForm(); } public function displayForm() { $output = ' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> _path.'logo.gif" alt="" title="" />'.$this->l('Settings').' '.$this->l('In order to add products to your homepage, just add them to the "home" category.').' '.$this->l('Number of product displayed').' <input type="text" size="5" name="nbr" value="'.Tools::getValue('nbr', Configuration::get('HOME_FEATURED_NBR')).'" /> '.$this->l('The number of products displayed on homepage (default: 10)').' <input type="submit" name="submitHomeFeatured" value="'.$this->l('Save').'" class="button" /> </form>'; return $output; } function hookHome($params) { global $smarty; $category = new Category(1); $nb = intval(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC'); $smarty->assign(array( 'allow_buy_when_out_of_stock' => Configuration::get('PS_ORDER_OUT_OF_STOCK', false), 'max_quantity_to_allow_display' => Configuration::get('PS_LAST_QTIES'), 'category' => $category, 'products' => $products, 'currency' => new Currency(intval($params['cart']->id_currency)), 'lang' => Language::getIsoById(intval($params['cookie']->id_lang)), 'productNumber' => sizeof($products) )); return $this->display(__FILE__, 'homefeatured.tpl'); } } yg saya pake presta 1.3 gan, tapi kayanya berfungsi di semua versi..Note: backup dulu file aslinya supaya ga beresiko..Mudah2an bermanfaat... 1 Link to comment Share on other sites More sharing options...
kakalushop Posted May 28, 2011 Share Posted May 28, 2011 Ini yang saya cari pak. Segera saya coba. Terimakasih atas sharingnya.Salam Prestashoper Indonesia Link to comment Share on other sites More sharing options...
stock tips Posted May 30, 2011 Share Posted May 30, 2011 This is my first time i visit here. I found so many entertaining stuff in your post, especially its discussion. From the tons of comments on your post, I guess I am not the only one having all the enjoyment here! Keep up the good work.regards:Stock Tips Link to comment Share on other sites More sharing options...
Zaid Posted May 30, 2011 Share Posted May 30, 2011 Terima kasih, namun saya kira tidak perlu di ganti semua codenya, hapus / cukup comment out aja: $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); lalu insert tepat dibawahnya $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC'); perhatikan 'date_add' dan 'DESC' keduanya adalah kunci untuk mengurutkan ... 2 Link to comment Share on other sites More sharing options...
kakalushop Posted June 4, 2011 Share Posted June 4, 2011 Sudah saya ganti dengan kode yang diberikan dan alhamdulillah sudah berhasil. Produk di homefeatured otomatis diurutkan new product first.Terimakasih pencerahannya pak Link to comment Share on other sites More sharing options...
tuyul93 Posted June 21, 2011 Share Posted June 21, 2011 ini yg sy cari...terimkasih bro ilmunya... Link to comment Share on other sites More sharing options...
espresso Posted July 7, 2011 Share Posted July 7, 2011 ditesting dulu ya,,makasih tippsnya Link to comment Share on other sites More sharing options...
auliashop Posted September 12, 2011 Share Posted September 12, 2011 klo dirandom gimana yah,,,,soalnya gak smua produk yang terbaru saya masukan ke home featured,,,, Link to comment Share on other sites More sharing options...
Zaid Posted September 12, 2011 Share Posted September 12, 2011 klo dirandom gimana yah,,,,soalnya gak smua produk yang terbaru saya masukan ke home featured,,,, Untuk tampil di home featured, maka produk harus masuk ke kategori Home. Pakai kode ini untuk menmpilkan random (PS 1.4) $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC', false, true, true); Link to comment Share on other sites More sharing options...
bambangindra Posted September 28, 2011 Share Posted September 28, 2011 trus saya juga mau tanya kalo mengurutkan produk sesuai abjad gimana? Link to comment Share on other sites More sharing options...
neody Posted October 22, 2011 Share Posted October 22, 2011 kalau mengurutkan sesuai produk terbaru, tetapi bukan dari category home gimana ya? saya sudah mencoba, dengan utak-atik pada bagian $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? yang angka 1 tersebut sepertinya kategori, stuck disitu saya hehe.. Link to comment Share on other sites More sharing options...
purwantoaries Posted December 22, 2011 Share Posted December 22, 2011 ikutan nyimak master-master coding Link to comment Share on other sites More sharing options...
x2fashion Posted December 26, 2011 Share Posted December 26, 2011 di ps 1.4 its works Link to comment Share on other sites More sharing options...
shinigamikun Posted December 26, 2011 Share Posted December 26, 2011 di ps 1.4 its works yeaah..it works thanks you.. Link to comment Share on other sites More sharing options...
azka2012 Posted February 15, 2012 Share Posted February 15, 2012 Wah mantap nih... ini yang saya cari-cari. Link to comment Share on other sites More sharing options...
gunawan949 Posted February 15, 2012 Share Posted February 15, 2012 sory melengceng sedikit dari yng di bahas , ps saya kok featured produk nya kosong setiap 1 selang baris. www.acehunique.com Link to comment Share on other sites More sharing options...
ewincool Posted February 25, 2012 Share Posted February 25, 2012 kalau mengurutkan sesuai produk terbaru, tetapi bukan dari category home gimana ya? saya sudah mencoba, dengan utak-atik pada bagian $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? yang angka 1 tersebut sepertinya kategori, stuck disitu saya hehe.. iy, gmn y klo mau mengurutkan produk paling baru, tp d dalam category... tolong d bantu donk para suhu... Link to comment Share on other sites More sharing options...
auliashop Posted February 25, 2012 Share Posted February 25, 2012 Untuk tampil di home featured, maka produk harus masuk ke kategori Home. Pakai kode ini untuk menmpilkan random (PS 1.4) $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC', false, true, true); ini ditaroh dimana suhu?mohon pencerahaannya Link to comment Share on other sites More sharing options...
ElangLiar Posted March 12, 2012 Share Posted March 12, 2012 saya memakai prestashop 1.4.7 kok enggak ada $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DES kemana harus saya cari? Link to comment Share on other sites More sharing options...
ewincool Posted April 4, 2012 Share Posted April 4, 2012 klo mau mengurutkan yang di dalam "kategori", bagaimana caranya, Suhu....?? mengurutkan sesuai dari barang yang paling "baru" HELP !! para suhuu... Link to comment Share on other sites More sharing options...
prestanesia Posted April 13, 2012 Share Posted April 13, 2012 klo mau mengurutkan yang di dalam "kategori", bagaimana caranya, Suhu....?? mengurutkan sesuai dari barang yang paling "baru" HELP !! para suhuu... Kalo mau kategori tertentu, querynya harus dikustomisasi lagi. karena kategori kan bisa unik di masing2 website. Link to comment Share on other sites More sharing options...
quinsha_shop Posted August 7, 2012 Share Posted August 7, 2012 tanya dong om Zaid, yang random koq gak bisa di pake ya? Link to comment Share on other sites More sharing options...
Zaid Posted August 7, 2012 Share Posted August 7, 2012 (edited) saya memakai prestashop 1.4.7 kok enggak ada $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DES kemana harus saya cari? di PS1.4.7.3 ada di file modules/homefeatured/homefeatured.php baris ke-99 ini ditaroh dimana suhu?mohon pencerahaannya Silakan baca di posting #4 tanya dong om Zaid, yang random koq gak bisa di pake ya? PS1.4 kan? Edited August 7, 2012 by Zaid (see edit history) Link to comment Share on other sites More sharing options...
quinsha_shop Posted August 7, 2012 Share Posted August 7, 2012 iya di 1.4.8 bisa sih... tapi akhirnya hanya 1 produk yang muncul yang lainnya hilang, padahal saya sudah isikan 10 produk yang ada di home featured Link to comment Share on other sites More sharing options...
Zaid Posted August 7, 2012 Share Posted August 7, 2012 (edited) coba cek setting jumlah produk yang ditampilkan di konfigurasi module homefeatured, dan pastikan produk sudah berada di kategory "home" Edited August 7, 2012 by Zaid (see edit history) Link to comment Share on other sites More sharing options...
Zaid Posted August 7, 2012 Share Posted August 7, 2012 klo mau mengurutkan yang di dalam "kategori", bagaimana caranya, Suhu....?? mengurutkan sesuai dari barang yang paling "baru" HELP !! para suhuu... Masuk ke Admin Product Preference ( Back Office > Preference > Product ) Atur Default Order by menjadi 'product added date' Link to comment Share on other sites More sharing options...
anakweb Posted August 7, 2012 Share Posted August 7, 2012 Mantabb dapet tip nye di copas ye gan Link to comment Share on other sites More sharing options...
Zaid Posted August 7, 2012 Share Posted August 7, 2012 Mantabb dapet tip nye di copas ye gan Monggo... Silakan.... Link to comment Share on other sites More sharing options...
ewincool Posted August 28, 2012 Share Posted August 28, 2012 Masuk ke Admin Product Preference ( Back Office > Preference > Product ) Atur Default Order by menjadi 'product added date' agan zaid, thx for information hal kecil tapi tak terlihat oleh ane thx yoooo Link to comment Share on other sites More sharing options...
irsan2110 Posted October 20, 2012 Share Posted October 20, 2012 Terima kasih, namun saya kira tidak perlu di ganti semua codenya, hapus / cukup comment out aja: $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); lalu insert tepat dibawahnya $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC'); perhatikan 'date_add' dan 'DESC' keduanya adalah kunci untuk mengurutkan ... nah ini dia Gan yang saya cari2.... terima kasih ya atas informasinya.... sy sdh coba dan berhasil.... salam kenal ya.... http://www.suryalistrik.com Link to comment Share on other sites More sharing options...
titopratama Posted January 19, 2013 Share Posted January 19, 2013 INFONYA BERMANFAAT BANGEEETTT... YANG KUASA YANG MEMBALAS KEBAIKANMU SOB.... TERIMA KASIH.... www.malioboro123.com Link to comment Share on other sites More sharing options...
ardi85 Posted January 22, 2013 Share Posted January 22, 2013 Terima kasih, namun saya kira tidak perlu di ganti semua codenya, hapus / cukup comment out aja: $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); lalu insert tepat dibawahnya $products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_add', 'DESC'); perhatikan 'date_add' dan 'DESC' keduanya adalah kunci untuk mengurutkan ... makasih gan Link to comment Share on other sites More sharing options...
zakidd Posted March 3, 2013 Share Posted March 3, 2013 untuk versi 1.5.3.1 ada gak gan? Link to comment Share on other sites More sharing options...
syzlope Posted March 7, 2013 Share Posted March 7, 2013 untuk ps 1.5.3.1 udah di coba, caranya sama aja, makasih atas tips dan triks nya buat master prestashop semuanya. Link to comment Share on other sites More sharing options...
priyanto78 Posted March 10, 2013 Share Posted March 10, 2013 ikut menyimak ... Link to comment Share on other sites More sharing options...
imampriyadi Posted March 21, 2013 Share Posted March 21, 2013 Terimakasih, saya pakai ps 1.5.3 dan berhasil Link to comment Share on other sites More sharing options...
Recommended Posts