search
Homephp教程PHP开发How to modify the random order of new products in zen cart

The first step to modify the random ordering of new products in zencart: First, you can define the time period for new products: Store Settings - Maximum Value - Definition of New Products

Randomization of new products in zencart The second step of the sorting modification method:
Modify the new products on the homepage:
/includes/modules/new_products.php

Add the corresponding ORDER BY xxx in $new_products_query

Example :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

The third step of modifying the random ordering of new products in zencart:
Modify the new products in the border:
/includes/ modules/sideboxes/whats_new.php
Change
$random_whats_new_sidebox_product =zen_random_select($random_whats_new_sidebox_product_query);
to
$random_whats_new_sidebox_product =$db->Execute($random_whats_new_sidebox_product_query);

zencart Step 4 of the random order modification method for new products:

Then change the /includes/modules /new_products.php file:
$db->ExecuteRandomMulti
to
$db->Execute

MoveNextRandom()
Changed to
MoveNext()

For more related articles on how to modify the random order of new zen cart products, please pay attention to PHP Chinese website!

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

Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
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.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

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.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),