Jump to content

When I upload store logo the image file name is changed


markthedoc

Recommended Posts

Hi

 

When I upload an image as a logo on my store, the image file name is changed.

 

This usually wouldn't be a problem but it's being changed to the name of what the store used to be called (we've recently changed server, store name, domain name and rebranded).

 

So the image was called:

 

my-logo.jpg

 

But when I upload it it's being changed to:

 

my-old-store-name-1488284549.jpg

 

What I need to know is where it's pulling the old store name from so I can change it.

 

I'm using Prestahop 1.6.0.9

 

Any help gratefully received!

Link to comment
Share on other sites

I searched for the code that does this and found the following on lines 2667-2674 (in PrestaShop v1.6.1.11) of controllers/admin/AdminThemesController.php:

            $logo_name = Tools::link_rewrite(Context::getContext()->shop->name).'-'
                .$logo_prefix.'-'.(int)Configuration::get('PS_IMG_UPDATE_TIME').(int)$id_shop.$ext;

            if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0
                || Shop::isFeatureActive() == false) {
                $logo_name = Tools::link_rewrite(Context::getContext()->shop->name).'-'
                .$logo_prefix.'-'.(int)Configuration::get('PS_IMG_UPDATE_TIME').$ext;
            }

The code Context::getContext()->shop->name is always used to get the shop name.

 

I suggest that you check the ps_shop table in your database using phpMyAdmin and make sure the old name of the shop isn't there.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...