Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Update Entire Sites Image From Absolute To Relative? Rate Topic   - - - - -

 
  • IsItFast
  • Senior Member
  • Members
  • Join Date: 16-Sep 08
  • 479 posts

Posted 25 July 2018 - 09:18 PM #1

So I'm wanting to make the switch over to full site HTTPS but all my categories (thousands) have an absolute link to an image that is on each category page 5 times (icon for bulleted text).  So right now I am going in and manually changing them all from absolute to relative links to the image.  This will end up taking my weeks to do.  There has got to be a better way right?  I know if these were all simply HTML pages saved on my computer I could easily "find and replace" in the files.  But not sure how to do this in CS?


V4.3.1 with about 10,000 highly customizable products. Several mods done....some of which now come standard with CS now. (Started with V1.3.5)

V3.0 in a few other small stores.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3640 posts

Posted 25 July 2018 - 11:19 PM #2

I'm not sure where/how you added the images but they are probably stored in the database.  After you find out where they are being stored, you can run a query to find and replace.



 
  • IsItFast
  • Senior Member
  • Members
  • Join Date: 16-Sep 08
  • 479 posts

Posted 25 July 2018 - 11:31 PM #3

I'm not sure where/how you added the images but they are probably stored in the database.  After you find out where they are being stored, you can run a query to find and replace.

Not really looking to change the image or location (the image is stored in the parent folder outside of my CS installation folder and just linked to it).  I need to change the location LINK SOURCE TO THE IMAGE to a relative link on all of my category pages.  Right now on all of my pages I have something like this for the image source:  src="http://www.mysite.co...om/myimage.png  I need to change that to src="/myimage.png


V4.3.1 with about 10,000 highly customizable products. Several mods done....some of which now come standard with CS now. (Started with V1.3.5)

V3.0 in a few other small stores.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3640 posts

Posted 25 July 2018 - 11:35 PM #4

Where exactly is the Image source input on the category page?  Description?
 
If they are in the description then run this query...

UPDATE cscart_category_descriptions SET description = REPLACE(description, 'http://www.mysite.com', '');

Backup the table before running the query.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 17833 posts

Posted 26 July 2018 - 06:19 AM #5

As alternative, you can check hooks in the blocks render manager and change content with the My changes module


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.