Pregunta

I want to change URL structure of images in opencart. Which files must be changed? I am tried search but I can't find. I searched below folders:

/catalog
/catalog/controller
/catalog/model
¿Fue útil?

Solución

I found answer. New OpenCart Versions Image Structure:

catalog/model/tool/image.php
Replace this: return $this->config->get('config_ssl') . 'image/' . $new_image;
To This: return 'https://cdn1.yoursite.com/' . $new_image;

AND

Replace this: return $this->config->get('config_url') . 'image/' . $new_image;
To This: return 'http://cdn1.yoursite.com/' . $new_image;

Otros consejos

I will try and make this like a guide.

To change the base url of the images while keeping everything in the same way they were you simply have to go to the root of your website (where index.php can be found) there is a config.php file there locate it, this is the one we will edit.

From : define('HTTP_IMAGE', 'http://old_domain/image/');

To : define('HTTP_IMAGE', 'http://new_domain/image/');

From : define('HTTPS_IMAGE', 'https://old_domain/image/');

To : define('HTTPS_IMAGE', 'https://new_domain/image/');

that is all you have to do and everything will work accordingly on their own.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top