Zencart secondary development-auto-search product details

Source: Internet
Author: User

Download credits from hereZencart secondary development-auto-search product details

Use the followingCodeWhen the zencart product information page is opened, the system can automatically find the corresponding product details based on the product ID on the information page, which is more efficient than the default system method.

 

 1   $ SQL = 'Select' products _ additional_image 'from'. table_products. 'Where products_id = '. $ _ Get ['Products _ id'];
2 $ Small_pic = $ DB -> Execute ( $ SQL );
3 $ Small_pic_path =Explode ('| ', $ Small_pic -> Fields ['products _ additional_image ']);
4 If ( Is_array ( $ Small_pic_path )&& Strlen ( $ Small_pic_path [0])! = 0 ){
5 Echo '<Div id = "productadditionalimages" class = "small_image"> ';
6 Foreach ( $ Small_pic_path As $ Value ){
7 Echo '<Div class = "additionalimages centeredcontent back small_image" style = "width: 25%;"> ';
8 $ Value = 'Images /'. $ Value ;
9 Echo '<A href = "'. $ Value . '"REV = "'.$ Value . '"Rel =" zoom1 "> $ Value . '"/> </A> ';
10 Echo '</Div> ';
11 }
12 Echo '</Div> ';
13 }

Steps:

    1. Edit the modules/additional_images.php file and put the above PHP code at the bottom of the file.
    2. Comment out the default search method.
    3. This must be used with"Improves the zencart batch upload plug-in and supports batch upload details.", Instructions and plug-ins for download

Effect:

OriginalArticle:Web development _ Xiaofei

Reprinted please indicate the source: http://www.cnblogs.com/hongfei/archive/2012/03/29/zencart-products-additional-imge.html

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.