Forums / Templates, Stylesheets, Page Layout / How to detect file on server and add link to product page?

How to detect file on server and add link to product page?

Locked

Views: 1,016

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
30 Apr 2011, 5:59 PM
#1
siuda avatar

siuda

New Zenner

Join Date:
Nov 2009
Posts:
18
Plugin Contributions:
0

How to detect file on server and add link to product page?

Hi All,

I'm going to add 360 degree pictures for several products in my store. I would like to upload flash files manually to /images/360 folder and allow product page to detect if file with flash exist on the server. If file exist, so I want to add link at the end of the product description like "Click here for 360 degree photo". I gone trough few modules for pictures like this, but I finally decided to do it that way. It's working great for my, but I don't to add mentioned link every time I've to add new product. Any ideas??

Thanks in Advance,
Luke

1 May 2011, 2:08 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How to detect file on server and add link to product page?

I'm going to add 360 degree pictures for several products in my store.

I don't to add mentioned link every time I've to add new product
When adding the 360 image just add the link to the product description

Zen-Venom Get Bitten

1 May 2011, 5:50 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: How to detect file on server and add link to product page?

Or add custom code to output a link in your template for an link based on something like a swf file matching the product model number in a corresponding folder.
Similar logic exists for the built-in main product image handling via /includes/modules/main_product_image.php ... you could likely use stuff from that for inspiration.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

6 May 2011, 12:50 PM
#4
siuda avatar

siuda

New Zenner

Join Date:
Nov 2009
Posts:
18
Plugin Contributions:
0

Re: How to detect file on server and add link to product page?

DrByte:

Or add custom code to output a link in your template for an link based on something like a swf file matching the product model number in a corresponding folder.
Similar logic exists for the built-in main product image handling via /includes/modules/main_product_image.php ... you could likely use stuff from that for inspiration.

Hi DrByte,

Sorry for late reply, but I was away for a while. I'm going to do it by if(file_exist) statement inside of "productDescription" in tpl_product_info_display. Problem is that I have no idea how can I get file name which will be like "product model.swf". Any ideas how can I check that? How can I read ProductModel into variable?

Luke

6 May 2011, 3:16 PM
#5
siuda avatar

siuda

New Zenner

Join Date:
Nov 2009
Posts:
18
Plugin Contributions:
0

Re: How to detect file on server and add link to product page?

Hi,

Product model is kept in variable $products_model already. Problem sorted. Please close this thread.

Happy Friday!

Luke