VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: meriturva on October 31, 2011, 09:12:46 AM

Title: virtuemart 1.9.8k -. Category template problems
Post by: meriturva on October 31, 2011, 09:12:46 AM
I have noted two different problems related to category template.

I have duplicated the default.php template into components\com_virtuemart\views\category\tmpl\ directory and i see the new template into the combo list of the admin pages but:

1) when i edit the category, select the new template and click on saved the new settings is discarted so i see always the "no override" option selected (without error report).
2) if i go to the main configuration -> templates-> "Category Layout" option is see the new template, select it and save the settings is saved correctly but on the front page the template used is always the default.php

thanks.
Meriturva
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on October 31, 2011, 13:33:47 PM
Quote from: meriturva on October 31, 2011, 09:12:46 AM
I have duplicated the default.php template into components\com_virtuemart\views\category\tmpl\ directory and i see the new template into the combo list of the admin pages but:
"default.php" is NOT a template, it is a layout!
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: PRO on October 31, 2011, 14:37:47 PM
why not use a template override?
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: meriturva on October 31, 2011, 14:38:28 PM
Sorry about the "name". yes it is the layout!

Anyway i have followed the instruction here: http://forum.virtuemart.net/index.php?topic=90935.0
and the problems i have posted are present on category layout.

Meriturva
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: PRO on October 31, 2011, 15:51:02 PM
Meriturva,

In your JOOMLA template folder /html

Create a folder called com_virtuemart
THEN each view you want to override create a folder for it.

Like for category you would have

templates/MY_TEMPLATE/html/com_virtuemart/category/default.php

THEN, edit THAT default.php file, and it will always work.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: meriturva on October 31, 2011, 16:22:07 PM
I know about the overrides.... but system permits to use the first approach...so i think the bugs has to be fixed.
Meriturva
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on October 31, 2011, 18:25:11 PM
Hmm, but it works for me for the category layout. I just tested it.
It works for the template override case (used milkyway). It showed the one in the template, then I just changed the standard joomla template to ja purity and it showed the one in the core. Everytime I used the test.php. Okey what I not tested yet is when you set that in per config, but you described your problem as using the override in the category edit.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on October 31, 2011, 19:43:49 PM
ah found it.

The value of the default category layout set in the config was not taken. Fixed and improved.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 02, 2011, 06:02:53 AM
I doubt this is a bug, but I've been pounding my head against the wall with a problem. I have a Joomla! theme I bought called "theme131". When I create:

/templates/theme131/html/com_virtuemart/category/default.php

and modify it, NOTHING happens. When I switch to the Beez template and have:

/templates/beez/html/com_virtuemart/category/default.php

it works as expected. Is there a reason overriding would work for Beez but not for theme131? Is there something I could look at to figure this out?
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: PRO on November 02, 2011, 11:32:28 AM
is it set to default template?

AND do you have it set for the virtuemart layout?
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on November 02, 2011, 12:21:29 PM
Quote from: BanquetTables.pro on November 02, 2011, 11:32:28 AM
is it set to default template?

AND do you have it set for the virtuemart layout?
The set for virtuemart standard layout shouldnt be used. Makes only sense in very rare cases. It is better to select the prefered template as joomla standard.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 02, 2011, 15:58:01 PM
Yes, I've set theme131 as the default Joomla! template, and I've tried both "Use joomla default" and "theme131" for the shop template in Virtuemart configuration. Can you think of anything else that would affect this? templateDetails.xml?
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 02, 2011, 16:09:48 PM
I have no idea what happened, but it's magically working now so all is well with the world. :) Thanks for your time. Great work so far! I've been very impressed with the new architecture as far as how the database is set up and the code now following more Joomla! standards.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 02, 2011, 23:26:43 PM
I ran into another issue. When overriding the productdetails, I discovered that instead of using default.php it's using pdf.php. Is there a setting for this somewhere or is this a bug?
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on November 03, 2011, 15:01:49 PM
Please explain more detailed
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 03, 2011, 16:15:54 PM
I finished overriding the category view, so I moved on to the productdetails view. I copied the productdetails default.php to

/templates/theme131/html/com_virtuemart/productdetails/default.php

Nothing happened, so I figured it was the same problem as earlier where it just wasn't taking effect. So I switched to the Beez template, copied default.php over and still nothing. I tried clearing cache, various settings, etc. and nothing worked. Finally, I switched back to my template, theme131, copied the productdetails pdf.php to

/templates/theme131/html/com_virtuemart/productdetails/pdf.php

and everything worked! The product details page seems to be using the pdf.php instead of default.php. I don't remember changing a setting for it anywhere. BTW, I'm running Joomla 1.5.24 with Virtuemart 1.9.8k.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: PRO on November 03, 2011, 16:45:30 PM
IN EACH category you choose what the default layout

see is some of them say PDF.

I do remember seeing someone with a problem where it said pdf with their install by default
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: PRO on November 03, 2011, 16:48:27 PM
if you have a lot of categories you can do it with sql

update jos_virtuemart_categories set category_product_layout = 0
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Milbo on November 03, 2011, 16:49:21 PM
Quote from: Milbo on October 31, 2011, 19:43:49 PM
ah found it.

The value of the default category layout set in the config was not taken. Fixed and improved.

The fix is in the svn!

The pdf as default should never happen, except you configure it that way, to help you further I need an admin account on your page.
Title: Re: virtuemart 1.9.8k -. Category template problems
Post by: Stephen Roberts on November 03, 2011, 18:59:25 PM
In the configuration or in each category, the templates are set to "No Override". In fact, no other options have ever shown up in those fields except "No Override". I checked the database and the category_layout and category_product_layout fields are empty. It's not a problem right now, I just wanted to make sure it's not something that should be fixed. Thanks!