Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default Using hosted images via urls, mysite.uk/images/url of hosted image

    ok so I am currently experiencing a slight issue with adding some new products. i've uploaded them using easy populate 4 and when i go to look at the new items i get just a broken image icon and some text that appears to be a link, i click this link and it gives me a pop up saying this file is not available. Before I type anymore i must stress that These images are provided for the purpose of listing items via a supplier that has given me permission to use these and a the ability to create a product feed including image urls.

    Upon diagnosing the issue with the aid of another zencart forum member in the following thread... https://www.zen-cart.com/showthread....p&goto=newpost

    it was noticed that the url's had been inserted to the products image section in the database, however, sadly zen is setup to use pictures in the form of uploads that reside in the home/images folder so when it is trying to display these images it is infact replacing the https with /images so it is trying to load
    Code:
    crazygamer.uk/images/www.pictureserver.co.uk/image1.jpg
    for the picture which results in no image being displayed.

    After some searching in the forums i came across something that was wrote many years ago. 2006 i believe?

    I'm not sure if this fix would still be valid for use on 1.57c using php 7.4 though. The "fix" comes in the form of a module, well it is a plugin contribution for download here listed for 1.38, that comprises of a license.txt and an "install.txt", its more of instructions rather than a module and not being a php expert and just a novice i have no way to tell if the php is still valid or deprecated, maybe perhaps there is an easier method available also as there is the downside of then having to go through my catalogue and adjust the paths for images i've uploaded myself for listings i've not made using easy populate with some 300 items before adding these that isn't a job i wish to undertake unless absolutly necessary. so the "fix" is provided quoted below. is there a better option and if not is this upto date? can anyone assist in getting these images to load correctly?

    This is something that has been answered previously but that long ago that the answers no longer potentially work?

    Code:
    Module Name
    ============
    External Product Images
    
    Description
    ===========
    Ported from OSC commerce script, author and specific contribution unknown.
    
    This module is released for use with Zen Cart 1.3.8a 3/15/2010 by PRO-Webs.net
    
    This release is considered beta, as while tested the testing is short at 
    1 week.
    
    Version Date
    ============
    Beta 1.0 3/15/2010
    
    Author
    ======
    Melanie Prough, PRO-Webs, Inc.
    
    Report Bugs
    ===========
    [email protected]
    
    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.
    i'm sure this is a problem many have or will have with the upgrade of zen to a new version and php change so it would be great to not only solve this for my site but give a working solution to other zencart site owners :)

  2. #2
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default Re: Using hosted images via urls, mysite.uk/images/url of hosted image

    found a short term solution in the form of a torrent program that allowed me to quite easily import the list of urls from a file and press download.

    by using my head i actually figured if i set the folder it sent them to to have the same structure as what comes up on the product images.

    as you can see in the screenshot provided. not automated but every so often i can repeat this step if i see an item with no image out of all of them i could just manually update that one. more than one rerunning this process would solve this issue. maybe every week i can run this on a set day until i can figure out an alternative :)

  3. #3
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default Re: Using hosted images via urls, mysite.uk/images/url of hosted image

    Name:  2021-09-25.jpg
Views: 64
Size:  57.6 KB

    forgot the screenshot lol

  4. #4
    Join Date
    Nov 2020
    Posts
    226
    Plugin Contributions
    1

    Default Re: Using hosted images via urls, mysite.uk/images/url of hosted image

    ok so this idea was a fail, the filename according to zen starts with https:// its impossible to replicate with folder structures ect "/" and ":" cant go in a file title either. i now need to remove the web urls as i have the images on my server or....

    edit code as in the install guide above but need help on that part, is it the best way? is it still accurate in php language and what files need changing that are new to zen since 2006 that wasnt included in this old guide? any help would be greatly appreciatted

 

 

Similar Threads

  1. v153 Redirecting problems for images hosted elsewhere
    By icecold in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Sep 2021, 12:29 AM
  2. v155 Redirection to hosted site from locally-hosted test-bed after upgrade
    By lat9 in forum Installing on a Windows Server
    Replies: 1
    Last Post: 14 Nov 2016, 05:52 PM
  3. Merchant Hosted versus Bank Hosted - ANZ
    By wotnow in forum Addon Payment Modules
    Replies: 0
    Last Post: 29 Apr 2010, 05:37 AM
  4. Display product images that are hosted on other servers?
    By Claire88 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 30 Jan 2010, 08:01 AM
  5. easy populate uploading hosted images
    By smjones316 in forum All Other Contributions/Addons
    Replies: 5
    Last Post: 16 Mar 2009, 06:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR