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
  • 524 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) https://fastdecals.com

V3.0 in a few other small stores.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3733 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
  • 524 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) https://fastdecals.com

V3.0 in a few other small stores.


 
  • The Tool
  • Been Here Way Too Long Member
  • Members
  • Join Date: 30-Mar 07
  • 3733 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
  • 18934 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 руб.


 
  • kaavain
  • Senior Member
  • Members
  • Join Date: 22-Nov 14
  • 1128 posts

Posted 28 December 2018 - 02:32 PM #6

Hi all
Is it any solution which could be described in simple words? Have no ide what are "hooks" and how to use it, but I can manage everything wia MySQL.
Just moved to HTTPS but images at the text pages still http, it seems not an relative paths.
All automated images like on product pages are https.

 
  • poppedweb
  • Authorized Reseller
  • Members
  • Join Date: 02-Aug 16
  • 476 posts

Posted 28 December 2018 - 03:42 PM #7

Hi all
Is it any solution which could be described in simple words? Have no ide what are "hooks" and how to use it, but I can manage everything wia MySQL.
Just moved to HTTPS but images at the text pages still http, it seems not an relative paths.
All automated images like on product pages are https.

 

We could write a simple script that will iterate over the DB which contains http links and replace them with https links, contact us if you are interested: sales@poppedweb.com 


PoppedWeb | sales@poppedweb.com | https://poppedweb.com
TurnKey Website Design | Add-Ons | Performance Audits | Dedicated Server Management
24/7 Support | Response within an hour (during working hours).

 
  • kaavain
  • Senior Member
  • Members
  • Join Date: 22-Nov 14
  • 1128 posts

Posted 28 December 2018 - 05:15 PM #8

It would be enough is somebody tell me where the page contents are located in MySQL... I have not so many pages.

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

Posted 28 December 2018 - 05:50 PM #9

If you don't have that many pages then why not edit the pages manually instead of messing with the database directly?
 
Page descriptions are located in table cscart_page_descriptions.



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

Posted 28 December 2018 - 09:26 PM #10

If you don't have that many pages then why not edit the pages manually instead of messing with the database directly?
 
Page descriptions are located in table cscart_page_descriptions.

That's what I ended up doing....I just went through and deleted that row of bullets (since it was in a table) on all the pages that had it.  Was time consuming but not to the point where it was too much of a job to do once I just figured that deleting that table row would be the simplest solution in my case.


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) https://fastdecals.com

V3.0 in a few other small stores.


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

Posted 04 January 2019 - 06:37 AM #11

You can also try to run

UPDATE cscart_page_descriptions SET description = REPLACE(description, 'http://', 'https://');

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 руб.