How to modify the random sorting of new zencart products _ PHP Tutorial

Source: Internet
Author: User
How to modify the random sorting of new zencart products. The first step is to modify the random order of new products in zencart: first, you can define the time range for new products: Store settings-maximum value-definitions of new products zencart Step 1 of the method for modifying the random sorting of new zencart products: First, you can define the time period for new products: shop settings-maximum value-new product definitions

Step 2 of the method for modifying the random sorting of new zencart products:
Modify the new product on the home page:
/Shortdes/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. required age_id = '1' and p. products_status = 1 order by pd. products_name

Step 3 of the method for modifying the random sorting of new zencart products:
Modify the new product in the border:
/Shortdes/modules/sideboxes/whats_new.php
Set
$ Random_whats_new_sidebox_product = zen_random_select ($ random_whats_new_sidebox_product_query );
Change
$ Random_whats_new_sidebox_product = $ db-> Execute ($ random_whats_new_sidebox_product_query );

Step 4 of the method for modifying the random sorting of new zencart products:

Then, in the/shortdes/modules/new_products.php file:
$ Db-> ExecuteRandomMulti
Change
$ Db-> Execute

MoveNextRandom ()
Change
MoveNext ()

Tips: first, you can define the time period for new products: Store settings-maximum value-zencart for new products...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.