X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   get pics from product id (https://forum.x-cart.com/showthread.php?t=29681)

IconAdmin 03-14-2007 05:13 AM

get pics from product id
 
hi i have 9000 products with 9000 thumbnail pictures
the picture name is almost the same as my product id

E.G. prod Id =A-0020

the picture file is named a0020.jpg

i want to knock some code up in my templates to pick the picture path and name up
from the product id

I know how to string build in vb

i just need a bit of help getting rid of the "-" and lowering the case

in php....If this works then i can upload my 9000 picture files to the images dir
without editing every name individually........

hope this is clear enough ......Andy

inebriate 03-14-2007 11:02 AM

Re: get pics from product id
 
in the template within the productid braces put |lower|replace:"-":"" and add the jpg file extension as well as the file directory

ie. images/{$products[product].productid|lower|replace:"-":""}.jpg

icases 03-18-2007 02:07 PM

Re: get pics from product id
 
You can download a program that will go through each file and rename it to your choice, and also change the case. I use the program below and its free.

http://www.bulkrenameutility.co.uk


All times are GMT -8. The time now is 02:03 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.