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:
- Edit the modules/additional_images.php file and put the above PHP code at the bottom of the file.
- Comment out the default search method.
- 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