Forums / Customization from the Admin / external product images

external product images

Started by chattunnel on 18 May 2014, 4:10 PM · Views: 14,117

Results 1 to 18 of 18
18 May 2014, 4:10 PM
#1
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

external product images

I would like to to use external product images to save bandwidth but zen cart is not set up to do so. I came across a supposed way which is to search for all files containing DIR_WS_IMAGES and change it to DIR_WS_HTTP which is suppose to tell zen cart to get external images opposed to internal. Is this supposed way even possible? I've been poking around in a lot of files and changing DIR_WS_IMAGES with no luck. I really don't want to change zen cart so much that it breaks. Is there another simpler way?

18 May 2014, 6:41 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: external product images

There's this:

http://www.zen-cart.com/downloads.php?do=file&id=1077

I haven't used it, and you'll have to test to see if it works with later versions of Zencart.

19 May 2014, 7:55 PM
#3
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

I clicked on your link and soon realized after I downloaded the file that it was not a plugin rather code and instructions that I had to mimic. I replaced all code mentioned and it still didnt work. Now, I have to go back and change everything as it was.

19 May 2014, 10:34 PM
#4
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

chattunnel:

I would like to to use external product images to save bandwidth but zen cart is not set up to do so. I came across a supposed way which is to search for all files containing DIR_WS_IMAGES and change it to DIR_WS_HTTP which is suppose to tell zen cart to get external images opposed to internal. Is this supposed way even possible? I've been poking around in a lot of files and changing DIR_WS_IMAGES with no luck. I really don't want to change zen cart so much that it breaks. Is there another simpler way?

Dunno since you didn't share all the details of this "supposed way" so a intelligent answer could be given..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

20 May 2014, 5:47 PM
#5
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

DivaVocals:

Dunno since you didn't share all the details of this "supposed way" so a intelligent answer could be given.. the method was posted by stevesh which I tryed and it did not work and actually messed up my images now I need a fix.

20 May 2014, 5:55 PM
#6
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

chattunnel:

the method was posted by stevesh which I tryed and it did not work and actually messed up my images now I need a fix.

Well it helps to post more details than what you have posted thus far.. "did not work" and "messed up my images" doesn't provided nearly enough information for anyone to give you any kind of help.. Describe what "did not work" and "messed up my images" means.. Post a link to your site to the specific URL so we can SEE what you see.. Post any on-screen error messages you are getting. Are you getting blank pages?? What error logs are you seeing?? (blank pages=error logs)

Details.. details.. details..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

21 May 2014, 4:47 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: external product images

Stevesh is experienced enough that I don't believe he would post a method that he didn't know to work correctly, when performed correctly. So the question is, what step did you miss/mess up, or how is your situation different to make his method not work? Linking to the original instructions would be helpful.

21 May 2014, 5:35 PM
#9
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: external product images

I pointed the OP to this:

http://www.zen-cart.com/downloads.php?do=file&id=1077

As I mentioned, I don't know if it works with later Zencart versions. I haven't tested it.

[Edit] I haven't used the mod, but I doubt very much if the image path is supposed to look like this:

<img src="DIR_WS_HTTParabbagreysilver (1).JPG"

so I would guess you didn't follow the directions exactly, or the mod doesn't work with your Zencart version.

22 May 2014, 12:23 AM
#10
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

the only changes I made through stevesh method was to "In all of these files found DIR_WS_IMAGES and replace with DIR_EXT_HTTP" well I did it and reversed it after it didnt work but I think I missed a file.

22 May 2014, 12:24 AM
#11
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

stevesh:

I pointed the OP to this:

http://www.zen-cart.com/downloads.php?do=file&id=1077

As I mentioned, I don't know if it works with later Zencart versions. I haven't tested it.

[Edit] I haven't used the mod, but I doubt very much if the image path is supposed to look like this:

<img src="DIR_WS_HTTParabbagreysilver (1).JPG"

so I would guess you didn't follow the directions exactly, or the mod doesn't work with your Zencart version. what file is this taking place in? I will change it back to DIR_WS_IMAGES

22 May 2014, 12:34 AM
#12
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

chattunnel:

the only changes I made through stevesh method was to "In all of these files found DIR_WS_IMAGES and replace with DIR_EXT_HTTP" well I did it and reversed it after it didnt work but I think I missed a file.

So let me get this straight.. there are THREE steps to the method stevesh posted a link to.. Am I misreading what you posted here.. Are you telling us that you only did STEP THREE and expected that it would work without following Step ONE and Step TWO or the "Module Use" section????????:shocking:

If this is the case, I'm not surprised you got the result you are reporting.. Suggest following ALL the steps.. and then reporting your result if you have issues after that.. Melanie is a Zen Cart VET, and I'm pretty sure that if you follow ALL of her steps, you will get the right result..

For the edification of everyone following this, I am posting Melanie's instructions.. I assume we all understand that Step Two implies that you will be putting in something like "http://yourdomain.com/images"

Installation

Step 1: Increase Data Image Field Characters:

In your Zen Cart admin, run the following SQL patch AFTER backing up your database.

ALTER TABLE products CHANGE products_image products_image VARCHAR( 150 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL;

Step 2:

Open includes/configure.php

On line 36 after this

define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

Add

// PRO-Webs Use External Images
define('DIR_EXT_HTTP', 'http://');

Step 3:

In all of these files find DIR_WS_IMAGES and replace with DIR_EXT_HTTP

includes/functions/functions_lookups.php
includes/modules/additional_images.php
includes/modules/also_purchased_products.php
includes/modules/attributes.php(Optional! Hand edit for attribute images)
includes/modules/featured_products.php
includes/modules/main_product_image.php
includes/modules/new_products.php
includes/modules/pages/popup_image/header_php.php
includes/modules/pages/shopping_cart/header_php.php
includes/modules/pages/specials/main_template_vars.php
includes/modules/product_listing.php
includes/modules/specials_index.php
includes/templates/your_template/popup_image_additional/tpl_main_page.php
includes/templates/template_default/sideboxes/tpl_featured.php
includes/templates/template_default/sideboxes/tpl_reviews_random.php
includes/templates/template_default/sideboxes/tpl_whats_new.php
includes/templates/template_default/templates/tpl_modules_products_all_listing.php
includes/templates/template_default/templates/tpl_modules_products_featured_listing.php
includes/templates/template_default/templates/tpl_modules_products_new_listing.php
includes/templates/template_default/templates/tpl_reviews_default.php

Module Use

This module will now expect you to add a filename path for your product images.
In your product data entry you will add images in the
"Or, select an existing image file from server, filename:" field. These images
will contain the full path to the image, less the http://.

For example: domain.com/images/1254785.jpg

Note that this module does not disallow the use of your own images, but they
now need to be added in the same manner.

For example: your_domain.com/images/1254785.jpg

The image uploader, while unharmed will no longer add a properly formatted
image reference for your products.

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

22 May 2014, 6:08 PM
#13
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

DivaVocals:

So let me get this straight.. there are THREE steps to the method stevesh posted a link to.. Am I misreading what you posted here.. Are you telling us that you only did STEP THREE and expected that it would work without following Step ONE and Step TWO or the "Module Use" section????????:shocking:

If this is the case, I'm not surprised you got the result you are reporting.. Suggest following ALL the steps.. and then reporting your result if you have issues after that.. Melanie is a Zen Cart VET, and I'm pretty sure that if you follow ALL of her steps, you will get the right result..

For the edification of everyone following this, I am posting Melanie's instructions.. I assume we all understand that Step Two implies that you will be putting in something like "http://yourdomain.com/images"

okay dude are you even helping? I have the latest version of zen cart I said the method here http://www.zen-cart.com/downloads.php?do=file&id=1077 does not work and is for older versions, stop posting methods that don't work, everyone will end up in my situation with all images not loading. After I followed all of the steps here http://www.zen-cart.com/downloads.php?do=file&id=1077 it didn't work so I tried to reverse the steps and was successful 99%. There's only one issue with the reversal to the original, the product page won't load the item image thats the only problem that won't go back to normal, stop side tracking your getting everything confused. I'm just trying to put everything back the way it was before I tried this method http://www.zen-cart.com/downloads.php?do=file&id=1077 .

I fixed everything but this issue: http://usacustomers.com/index.php?main_page=product_info&cPath=11&products_id=4 see how the product image won't load that's the 1% of the method reversal that didn't go back to the original.

22 May 2014, 8:29 PM
#14
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

chattunnel:

okay dude are you even helping? I have the latest version of zen cart I said the method here http://www.zen-cart.com/downloads.php?do=file&id=1077 does not work and is for older versions, stop posting methods that don't work, everyone will end up in my situation with all images not loading. After I followed all of the steps here http://www.zen-cart.com/downloads.php?do=file&id=1077 it didn't work so I tried to reverse the steps and was successful 99%. There's only one issue with the reversal to the original, the product page won't load the item image thats the only problem that won't go back to normal, stop side tracking your getting everything confused. I'm just trying to put everything back the way it was before I tried this method http://www.zen-cart.com/downloads.php?do=file&id=1077 .

I fixed everything but this issue: http://usacustomers.com/index.php?main_page=product_info&cPath=11&products_id=4 see how the product image won't load that's the 1% of the method reversal that didn't go back to the original.First.. not a dude.. IJS..

second.. I wasn't the ONLY PERSON who suggested here that perhaps you did not follow all of the instructions BTW.. I also wasn't the person who FIRST suggested the steps in the post you have now posted MULTIPLE times in your reply.. (or did you miss that on your way to flying off the handle here??)

Even IF if was for an older version of Zen Cart it does NOT mean it won't work for current versions which is probably why stevesh suggested to you it in the first place.. The folks here could probably help you to get it to work with the current version if only you'd post what happened after making the changes..

That said your posts have been so brief and lacking in details that it's hard to fully help you since no one who's replied here is sure what you've done, not done, etc.. You have not ONCE posted enough details for anyone to provide any level of assistance.. Did you backup before you made the changes you made?? If you did you could restore your store to the way it was before you applied the changes.. and while you're yelling at me while asking for help, keep in mind that you're asking for assistance to reverse what you did without anyone having SPECIFICS on what you did to begin with.. (part of the reason I posted the code you used here.. but oh yeah.. Here I was trying to NOT help and "sidetracking" and all.. SMH)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

22 May 2014, 8:55 PM
#15
chattunnel avatar

chattunnel

New Zenner

Join Date:
Aug 2012
Posts:
45
Plugin Contributions:
0

Re: external product images

DivaVocals:

First.. not a dude.. IJS..

second.. I wasn't the ONLY PERSON who suggested here that perhaps you did not follow all of the instructions BTW.. I also wasn't the person who FIRST suggested the steps in the post you have now posted MULTIPLE times in your reply.. (or did you miss that on your way to flying off the handle here??)

Even IF if was for an older version of Zen Cart it does NOT mean it won't work for current versions which is probably why stevesh suggested to you it in the first place.. The folks here could probably help you to get it to work with the current version if only you'd post what happened after making the changes..

That said your posts have been so brief and lacking in details that it's hard to fully help you since no one who's replied here is sure what you've done, not done, etc.. You have not ONCE posted enough details for anyone to provide any level of assistance.. Did you backup before you made the changes you made?? If you did you could restore your store to the way it was before you applied the changes.. and while you're yelling at me while asking for help, keep in mind that you're asking for assistance to reverse what you did without anyone having SPECIFICS on what you did to begin with.. (part of the reason I posted the code you used here.. but oh yeah.. Here I was trying to NOT help and "sidetracking" and all.. SMH)
if you dont get the issue please leave the topic because I explained myself more then 3 times and will not explain again.

22 May 2014, 9:04 PM
#16
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

chattunnel:

if you dont get the issue please leave the topic because I explained myself more then 3 times and will not explain again.
Leave eh?? for real?? :laugh: Yeah.. :laugh:

Look.. I understood your issue, and I was trying to help.. you on the other hand getting huffy with me isn't really helping now is it.. :no:

So let me add this..

the ONLY advice ANYONE can give you based on what you've posted is this: reverse EVERYTHING you did.. if you've done that and are still having issues your other option is to restore from a backup.. (I HOPE you backed your store up before making these changes..)

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

22 May 2014, 9:22 PM
#17
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: external product images

DivaVocals:

Leave eh?? for real?? :laugh: Yeah.. :laugh:

Look.. I understood your issue, and I was trying to help.. you on the other hand getting huffy with me isn't really helping now is it.. :no:

So let me add this..

the ONLY advice ANYONE can give you based on what you've posted is this: reverse EVERYTHING you did.. if you've done that and are still having issues your other option is to restore from a backup.. (I HOPE you backed your store up before making these changes..)
Oh yeah... one more thing you can try too if you're just stuck.. in the admin, the "Tools > Developers Tool Kit" might help you find the files where you still have leftover "DIR_EXT_HTTP" to remove/replace..

Yeah.. Look at me NOT helping..:laugh:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

10 Apr 2018, 6:53 AM
#18
icecold avatar

icecold

Zen Follower

Join Date:
Jul 2008
Posts:
360
Plugin Contributions:
0

Re: external product images

Going into REAL specifics, as I am having a nightmare trying to fix the code so it trims the http://..../images, so I can display all external images, that have been loaded as full urls http://.....com/externalimage.jpg

I think the culprit is IH4, because I already removed and replaced all instances of DIR_WS_IMAGES, the ones related to products of course, not the ones that use local ZC icons, or banners, etc ... just the products, and still I am getting two http s ... that's because the string is formed inside a function and even after removing the constant DIR_WS_IMAGES and replacing it by another constant, that's defined as null '', is still adding the path, that supposed to be removed so the img src ends up been completely WRONG!