I have a rare problem. In my shop all the images for the backend show, but in the frontend images with whitespaces '+' (special charachters) won't show unless they are renamed.
I searched the forum but can't find what to do or change. Has someone a suggestion on what to change or add?
Hope someone has an idea.
Regards
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
TVS-KN-CC110A WITH SIZE.JPG
DISPLEX TOUCH_ART+BL.JPG
50279887009_ART+BOX.JPG
I rahther have them named otherwise but this is a CSV of 25000 products wich is automated. Very hard to rename the everyday updates. So if there is a way to rewrite spaces and special characters I would be happy.
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
If this is already loaded into your database you can bulk update the names with the following SQL queries in phpmyadmin:
Code: Select all
UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');
-Ryan
rph wrote:That's really the perfect example of how not to name images. Always use lowercase and only use letters a-z, numbers 0-9, underscore, and dash.
If this is already loaded into your database you can bulk update the names with the following SQL queries in phpmyadmin:
Code: Select all
UPDATE product SET image = REPLACE(image, ' ', '_'); UPDATE product_image SET image = REPLACE(image, ' ', '_');
And after that you might as well do:
Code: Select all
UPDATE product SET image = REPLACE(image, '+', '_');
UPDATE product_image SET image = REPLACE(image, '+', '_');
For a once replacement of image names and urls that's an ok solution. My wholeseller is delivering the csv to me with those special characters. That's my biggest problem. Every day when the update is done there are new products written with those characters. The only, not so nice, solution i can think of is to write a file with update statements for the db and run that cronjob. I rather have an opencart solution that rewrites when or before data is imported. That way i don't have to run a script every day, but it's a one step solution.
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
First, tell your whole sellers to stop formatting the images that way.bertjebel wrote:thanks for the reply and solution.
For a once replacement of image names and urls that's an ok solution. My wholeseller is delivering the csv to me with those special characters. That's my biggest problem. Every day when the update is done there are new products written with those characters. The only, not so nice, solution i can think of is to write a file with update statements for the db and run that cronjob. I rather have an opencart solution that rewrites when or before data is imported. That way i don't have to run a script every day, but it's a one step solution.
Second, feel free to hire someone to write some code that will tweak the image title strings upon import with your current script. Until then just use the above query to update everything after csv import.
-Ryan
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
http://luci.criosweb.ro/riot/
For renaming the files i had a lot support from Karapuz http://www.opencart.com/index.php?route ... me=karapuz
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
I am using an extension (pdf catalog) and it seems to be fine with white spaces in image names, however my images are in image subdirectories with white spaces - now it doesn't like that!
So if, for example I have images stored in: /image/data/new directory (note the white space between new and directory), assuming that I do what is suggested with the images above, what would that sql command be please to add _ between each word in subdirectory name?
Many thanks if someone can assist with this.
Robster
I know my place...!
removing the whitespace solved my image errors. So that should solve your problem also.
I think you should rename the directory wit a _ (underscore) en than also use the same sql commando
UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');
good luck
My shops running Opencart Multistore:
Koptelefoon, audio kabels en speakers kopen
Led lampen en verlichting
Alle kabels- audiokabel, computerkabel, stroomkabel
Koptelefoon en In ear oordopjes / oortjes Apple iPhone, Samsung Smartphone
Smartphone hoesjes en oordopjes Apple iPhone en Samsung
Online Aanbiedingen en Sales
Hoesjes, Covers en accessoires Tablet en smartphone
I have lots of pictures with spaces and - in them
This prevents Facebook from displaying images with your links in a facebook post.
I would like to rename all images, but dont know what Database to edit in MyPHPAdmin
What Database do i select to enter the following code
Code: Select all
UPDATE product SET image = REPLACE(image, ' ', '_');
UPDATE product_image SET image = REPLACE(image, ' ', '_');
Users browsing this forum: Google [Bot] and 19 guests