改變zencart 首頁隨機顯示產品

2021-05-24 09:03:56 字數 1055 閱讀 5480

zen cart新進商品的隨機排序修改方法第一步:首先,新進商品可以自己定義時間段: 商店設定-最大值-新進商品的定義

zen cart新進商品的隨機排序修改方法第二步:

修改首頁上新進商品:

/includes/modules/new_products.php

在$new_products_query裡增加相應order by ***

例:select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, p.products_date_added, p.products_price, p.products_type, p.master_categories_id from zen_products p, zen_products_description pd where p.products_id = pd.products_id and pd.language_id = 』1′ and p.products_status = 1 order by pd.products_name

zen cart新進商品的隨機排序修改方法第三步:

修改邊框中新進商品:

/includes/modules/sideboxes/whats_new.php

將 $random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);

改為 $random_whats_new_sidebox_product = $db->execute($random_whats_new_sidebox_product_query);

zen cart新進商品的隨機排序修改方法第四步:

然後將/includes/modules /new_products.php 檔案中的:

$db->executerandommulti

改為 $db->execute

movenextrandom()

改為 movenext()

Zencart首頁分類顯示二級目錄方法

2.開啟檔案 includes classes category tree.php 分類目錄類裡面 1 查詢 把 if zen not null cpath 改為 if zen not null cpath or 1 2 在一下兩行 之間插入新 原 reset cpath array while l...

ZenCart在首頁直接新增購買按鈕

如何直接在首頁的最新商品上面加上直接 購買 按鈕?要新增 購買 按鈕,可以參考 includes templates template default templates l product info display.php 這個檔案中購買按鈕的 需要修改的 在 includes modules n...

zencart 顯示全部分類

改的檔案 includes classes category tree.php,最簡單的修改 if isset first element kcyarrar categories fields categories id kcy categories movenext foreach kcyarra...