Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how to extract and change all image url from .csv file to images folder


Recommended Posts

i work on Os commerce and i face problem that

How to change all image url in .csv file and show new url in website. i also put code to change url but how to change all url from .csv file. 

i have dropshiper and they give .csv file and in this .csv file all image url is same like this ""http://website/images/xctmpvfHmhD.png".

 

 

code is like:

 

 
Link to comment
Share on other sites

If I understand you, you are being given a CSV file that contains image URLs which are incorrect for you. Are you using Easy Populate? One solution might be to build a "filter" that modifies the CSV file in a batch operation, and be run either on your PC or on your host server, before the CSV is used by Easy Populate. Another solution would be to modify Easy Populate's PHP code to modify the image URL field, say from /T/ to /image/, on the fly. Is that specifically what you were asking to do? If you know the URL field to change ($old_src), that shouldn't be too hard with a preg_replace() call.

Link to comment
Share on other sites

i have many CSV file in that i have to change image url to $new_src.

yes i know the $old_src and i change it to $new_src, so how can i  use this preg_replace() function? 

No another way to change image url directly in CSV file?

Link to comment
Share on other sites

@@katrinamonarco

 

You could probably do this as well using Excel or whatever spreadsheet you use, using a simple search and replace.

 

Dan

Link to comment
Share on other sites

I use this " $new_src = preg_replace("#$old_url#", $new_url, $old_src); " but still in .CSV file image URL is not change.

I have some many image in CSV file so i change all IMAGE URL in .CSV file and that all images is store into a folder so what can i do?

Link to comment
Share on other sites

@@katrinamonarco

 

If you managed to change the URL in the CSV file I assume that you can then import the CSV file as you have been (or if this is your first attempt to do so have a look the Easy Populate contribtion mentioned previously) and upload the images to the directory you changed the URL to.   If you've done these things you should be good to go....after that, if it is still not working, tell us what the issue seems to be ie where you ended up and how you got there.

 

Dan

Link to comment
Share on other sites

I assume you're using Easy Populate to import the CSV file data and update your database. If not, what are you doing?

 

The preg_replace() code would be a modification to the Easy Populate code -- after the line from the file has been read in and split up into fields, and before it starts modifying the database with those fields. Of course it would not modify the CSV file itself, only the data internally, on the fly.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...