Author Topic: How does Category override work?  (Read 3706 times)

whoami

  • Beginner
  • *
  • Posts: 7
How does Category override work?
« on: December 11, 2011, 22:08:15 pm »
Maybe I'm doing something wrong. I've created a category override in my template HTML dir with a different name then default.php. It's called lesson.php

template_dir/html/com_virtuemart/productdetails/lessons.php

In the config of Virtuemart I've selected in the template area "no override" for the product template. In the Category I've selected "lesson.php" as override. Doesn't work. When I select default.php as override it works for the change default.php. Everything else with a different name then default.php do not work.

What I'm doing wrong?

JtouchMobile.com

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 96
  • Mobile Solutions for VirtueMart 2
    • JtouchMobile.com
Re: How does Category override work?
« Reply #1 on: December 12, 2011, 06:10:27 am »
You are doing a template overwrite, so why not make it easy by changing the lessons.php to default.php ?

(template_dir/html/com_virtuemart/productdetails/default.php)
Author of Jtouch - Mobile solution for Joomla & VirtueMart
http://www.jtouchmobile.com

whoami

  • Beginner
  • *
  • Posts: 7
Re: How does Category override work?
« Reply #2 on: December 12, 2011, 08:59:03 am »
I need two different layouts for different productcategories.

BTW, why have an option choosing your layout when this option doesn't work?

JtouchMobile.com

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 96
  • Mobile Solutions for VirtueMart 2
    • JtouchMobile.com
Re: How does Category override work?
« Reply #3 on: December 13, 2011, 03:49:00 am »
It works with my RC2 J (K now :( )
Here is what I have done:
- From components/com_virtuemart/views/category/tmpl
 creata a copy of default.php -> extra.php
 modify extra.php to what I want to

- From backend -> Products menu ->Product Categories
 edit the category I want to apply this extra template
 set "extra" for "Category Browse Page" -> save it (see my screenshot)

- Browse the category on frontend, attached file is what I'm seeing


[attachment cleanup by admin]
Author of Jtouch - Mobile solution for Joomla & VirtueMart
http://www.jtouchmobile.com

whoami

  • Beginner
  • *
  • Posts: 7
Re: How does Category override work?
« Reply #4 on: December 13, 2011, 10:08:13 am »
@MobileMeWs: Thanks I've tried the category override and it did work BUT try the same with a productdetail override (that is what I initialty ment, my wrong). The productdetail override doesn't work.

carlos.alonso

  • Beginner
  • *
  • Posts: 7
Re: How does Category override work?
« Reply #5 on: January 04, 2012, 18:59:38 pm »
Hi,

I was having the same problem, then i realized i had an Uppercase letter in the name of the view, i changed to lower case and now i can override without any problem.

It was silly of me but this was my problem, hope it is useful.