Post by 2dawgs » Tue Dec 06, 2011 7:56 am

Version: 1.5.1.3 (upgraded from 1.5.0)

I have created a new theme folder, placed template files in it, and changed system settings to use the new theme.

Most of the templates I have created are working beautifully, but I have a couple that have no effect at all. The system doesn't seem to "know" that the new templates exists, even though my custom template files have exactly the same path and file name (other than the different theme folder) as the default.

The downloads page is one, and now I've discovered the template I've created for the cart page also seems not to be recognized by the system.
  • Other templates in the ../theme/<theme_name>/checkout and ../theme/<theme_name>/account folders are working, so I'm pretty sure the paths are not the problem.
  • I've confirmed the files actually did get uploaded to the server in the correct location.
  • I've confirmed the file names of the custom templates match the file names of the default templates they're supposed to replace or override.
Can anyone tell me what else can prevent a custom template from overriding the default one? Is there something inside the template file that can cause it to be ignored?

I'd be very grateful for any insight you can render.

Thanks! ;D
Last edited by 2dawgs on Fri Dec 09, 2011 10:42 am, edited 1 time in total.

New member

Posts

Joined
Sat Jun 11, 2011 5:26 am

Post by JasonF » Tue Dec 06, 2011 10:10 am

I've just noticed the same thing. Can't get the "Your shopping cart is empty!" page to use my theme.

Mainly I'm trying to change the breadcrumb code that's in use to match my other pages but no matter what I do (I even experimented with editing the default theme files) the template on that page stays the same.

New member

Posts

Joined
Sat Oct 01, 2011 12:46 am

Post by OpenCart Addons » Tue Dec 06, 2011 10:22 am

Have you checked all of the information in the header.tpl file to make sure it points all the proper stylesheets, etc. to the right location?

Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by qahar » Tue Dec 06, 2011 6:33 pm

2dawgs wrote:Can anyone tell me what else can prevent a custom template from overriding the default one? Is there something inside the template file that can cause it to be ignored?
Honestly I don't know if such a thing exists.

If you use vQmod, try to check the vQmod cache related to the tpl controller. And make sure the fallback code is similiar to this (I copy this code from the default controller):

Code: Select all

if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
    $this->template = $this->config->get('config_template') . '/template/product/category.tpl';
} else {
    $this->template = 'default/template/product/category.tpl';
} 

User avatar
Expert Member

Posts

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

Post by 2dawgs » Fri Dec 09, 2011 7:50 am

Here's what I noticed about the cart page: the system does recognize my cart page template file when there are items in the cart, but does not when the cart has no items in it.

The checkout page does exactly the same thing, except when I load the page, for just a split second, it appears with my template, then quickly changes to the default one. Pretty strange... :-\

Looking through the controller (which I have not applied any mods to of any kind), I see the fallback code. I don't see any logic branches (yet) for an empty cart, but that's what I'm zeroing in on now.

Thanks for the responses, guys! I will keep digging and let you know what I find, but if this lights a bulb in anyone's brain, please feel free to chime in.


Thanks,
Kate

New member

Posts

Joined
Sat Jun 11, 2011 5:26 am

Post by 2dawgs » Fri Dec 09, 2011 8:13 am

Yup, yup, yup... I'm an idiot, just shoot me! :laugh:

If there are no items in the cart, the system regards that as an error, and displays the cart and checkout pages using the /error/not_found.tpl template. Once I made the same changes to this file that I'm making to all the other ones, my pages showing my empty cart straightened right up. Go figure.

Same thing with the Downloads page.

Problem solved - at least the more immediate problem. Might take a lobotomy to fix the real problem. :crazy:


Kate

New member

Posts

Joined
Sat Jun 11, 2011 5:26 am
Who is online

Users browsing this forum: No registered users and 8 guests