Post by nabsslo » Fri Jul 24, 2015 2:33 am

Hello,

we are currently developing a new design for our webstore, which is based on the current one, but we are expecting an interesting issue. All our modifications are stored in the custom.css file, which works well on the frontpage - http://www.avtomotive.si/V2/ , but when you try to visit any of the subpages (for example category page - http://www.avtomotive.si/V2/Podvozje-in ... pnevmatike), the custom.css doesn't load at all and it looks like the header gets loaded from the current webstore - http://www.avtomotive.si (accroding to base-href parameter in the <head> and no sign of custom.css reference).

I have tried adding custom.css to header.tpl and also added header.php the following code, but with no luck so far:

Code: Select all

	$route = empty($this->request->get['route']) ? 'common/home' : $this->request->get['route'];
    $css_file = str_replace('/', '_', $route) . '.css';

    if(file_exists(DIR_TEMPLATE . $this->config->get('OPC050106') . '/stylesheet/' . $css_file)) {
        $this->document->addStyle('catalog/view/theme/' . $this->config->get('OPC050106'). '/stylesheet/' . $css_file);
    }
Can you please help me or point me in the right direction regarding this issue?

Thank you very much for your help!

Newbie

Posts

Joined
Mon Dec 23, 2013 1:28 am

Post by nabsslo » Fri Jul 24, 2015 6:20 am

Please, move this topic to OPENCART 1.5+ SUPPORT ... Sorry for inconvenience, I totally missed these new 2.0+ forums.

Newbie

Posts

Joined
Mon Dec 23, 2013 1:28 am

Post by qahar » Fri Jul 24, 2015 6:41 am

moved to 1.5 template forum.

Based on your code, you are trying to load dynamic custom stylesheet based on route request if the file exist
- common_home.css
- catalog_product.css

When look at www.avtomotive.si/V2/ actualy you load two custom.css file
<link rel="stylesheet" type="text/css" href="catalog/view/theme/OPC050106/stylesheet/custom.css" />
<link rel="stylesheet" type="text/css" href="custom.css" media="screen" /> --> give me 404 not found

When look into http://www.avtomotive.si/V2/Podvozje-in ... pnevmatike it's indeed load your main site instead of V2.
Are you running different OpenCart installation for V2 or use multi store?
Neither of it, make sure the base site url is correctly configured. I think that is the cause.

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by nabsslo » Fri Jul 24, 2015 3:48 pm

qahar wrote: When look into http://www.avtomotive.si/V2/Podvozje-in ... pnevmatike it's indeed load your main site instead of V2.
Are you running different OpenCart installation for V2 or use multi store?
Neither of it, make sure the base site url is correctly configured. I think that is the cause.
Thank you for the move. I have just copied the existing store in the V2 folder and changed both config.php files to "point" in the new folder. I also think the issue is in the base site url, but I don't know where to change it?

Newbie

Posts

Joined
Mon Dec 23, 2013 1:28 am

Post by nabsslo » Sat Jul 25, 2015 11:07 pm

Anyone, please?

Newbie

Posts

Joined
Mon Dec 23, 2013 1:28 am
Who is online

Users browsing this forum: No registered users and 6 guests