search
Homephp教程php手册zen cart新进商品的随机排序修改方法

由于新进商品的数量可能比页面上能显示的数量多,所以采用的是随机显示的方式。如果想改为按时间顺序显示,可以按照radnows提供的 方法修改。(记住使用文件替代)

zencart新进商品的随机排序修改方法第一步:首先,网站空间,美国服务器,新进商品可以自己定义时间段:商店设置-最大值-新进商品的定义

zencart新进商品的随机排序修改方法第二步:
修改首页上新进商品:
/includes/modules/new_products.php

在$new_products_query里增加相应ORDER BY xxx

例: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 fromzen_products p, zen_products_description pd where p.products_id =pd.products_id and pd.language_id = '1' and p.products_status = 1order by pd.products_name

zencart新进商品的随机排序修改方法第三步:
修改边框中新进商品:
/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);

zencart新进商品的随机排序修改方法第四步:

然后将/includes/modules /new_products.php 文件中的:
$db->ExecuteRandomMulti
改为
$db->Execute

MoveNextRandom()
改 为
MoveNext()

,服务器空间
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor