Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Installing Zen Cart / Installing on a Windows Server / how to change links in product description after moving zencart site?

how to change links in product description after moving zencart site?

Locked

Started by baagimart on 5 Jul 2009, 10:34 AM · Views: 1,202

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
5 Jul 2009, 10:34 AM
#1
baagimart avatar

baagimart

New Zenner

Join Date:
Jul 2009
Posts:
3
Plugin Contributions:
0

Post #1 by baagimart

I moved my site from one domain to another. Under new domain all seem to be going right. But additional images disappeared.

Many products on our site had additional product images with url like the following, for example product "Shoe" had:

https://www.olddomain.com/shopsite/images/product_Shoe_image1.jpg
https://www.olddomain.com/shopsite/images/product_Shoe_image2.jpg
https://www.olddomain.com/shopsite/images/product_Shoe_image3.jpg

All these links were entered thru admin->catalog/product-> insert image function.

After moving the site, these additional images no longer appear. Because still old codes appear when products are shown ON NEW DOMAIN:

https://www.olddomain.com/shopsite/images/product_Shoe_image1.jpg
...
...

How can we change all these link references from old domain url to new one like this:
https://www.newdomain.com/images/product_Shoe_image1.jpg
https://www.newdomain.com/images/product_Shoe_image2.jpg
https://www.newdomain.com/images/product_Shoe_image3.jpg

Just going to each product and edit links by admin functions is very tedious since there are many products.

Is there a certain file which includes descriptions where I can find all old domain string and replace them with new and upload back?

Or is there any other way to do this?

5 Jul 2009, 3:21 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Post #2 by ajeh

To replace a word or peice of text in the products_description with something else you can use:

UPDATE products_description SET products_description = REPLACE(products_description, 'The OLD TEXT to be REPLACE', 'The NEW TEXT to be INSERTED');

Be sure to backup your database before using this in the Tools ... Install SQL Patches ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

6 Jul 2009, 12:35 AM
#3
baagimart avatar

baagimart

New Zenner

Join Date:
Jul 2009
Posts:
3
Plugin Contributions:
0

Post #3 by baagimart

Thank you for reply. It's not clear. Where's that file "products_description" or is it sql patch that i need to use in admin-tools-install sql patch? Thnak you again.

6 Jul 2009, 12:52 AM
#4
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #4 by steven300

It's an SQL patch to be run in Admin -> Tools -> Install SQL Patches.

However don't run it as-is because it needs to be customized first.

Just to be clear, were these old image URLs manually entered into your product descriptions, along with all the other information for the product? Because that's what Ajeh's SQL patch is assuming.

6 Jul 2009, 1:10 AM
#5
steven300 avatar

steven300

Totally Zenned

Join Date:
Jan 2008
Posts:
1,564
Plugin Contributions:
1

Post #5 by steven300

If so, you would run this SQL statement (first replacing the olddomain and newdomain references with the actual sites):

UPDATE products_description SET products_description = REPLACE(products_description, 'http://www.olddomain.com/shopsite/', 'www.newdomain.com/');