On the latest VM3 (3.0.6.2), when you add or edit some Product Categories and try to change settings for Category Template whatever you select it changes setting to last template option, so if I have those templates:
- tmp1
- tmp2
- tmp3
- tmp4
- tmp5
And I select "tmp2" for Category Template settings at one of my categories then after I click Save this setting is automatically set to tmp5. How can I fix this?
Tested VM3.0.6.7 on Joomla 3.4.1 with multiple category overrides and all saved exactly as required. Used Firefox37.0.1
I also use Firefox 37.0.1 and Joomla! version, 3.4.1 and I also noticed that I use VirtueMart 3.0.7 (which came with template), which is latest version and still has this bug.
I just noticed if I have more different themes, they are selected correctly, but if I have copy of some theme then this bug is active.
So If I have:
- Use shop default
- Theme 1
- Theme 1 (copy 1)
- Theme 1 (copy 2)
- Theme 2
I can select only Use shop default, Theme 1 (copy 2) (this is always selected if I chose "Theme 1" and "Theme 1 (copy 1)") and Theme 2.
So between those I can never select Theme 1 and Theme 1 (copy 1) (and if I would have more copies only last one would always be selected no matter which I select).
VM3.0.7 is a Release Candidate .. i.e. not intended as production
sounds a very odd problem - I can confirm no prob in J3.4/VM3.04
are the dropdowns properly rendered with the "chosen" replacement divs etc?
If I go to Product Categories and open some category, I have under Category Template dropdown menu all my themes listed and I can select any one of them. After I select some theme (which was duplicated) and when I click Save I get message "Product Category successfully saved" but when I look under Category Template the wrong theme is selected - the last one of those which are duplicated. And as I already wrote, this only happens at duplicated themes, if I select some other theme it works, just not those which I copied in Template Manager.
actually, you can use vm3.0.7.2 for live pages, just with a bit more attention. Should have less bugs than any previous version http://dev.virtuemart.net/attachments/download/939/com_virtuemart.3.0.7.2_extract_first.zip
what is the actual value="xxx" of the select dropdowns? Look at the html
The basic problem is that joomla created styles and there is no styleswitcher, just template switcher (for coders). I know it is on their list, so maybe our workaround has problems with j3.4.1
This is what I have in source code for Category Template selection:
<select id="category_template" name="category_template" class="vm-chzn-select">
<option value="0">Use shop default</option>
<option value="t3_bs3_blank" selected="selected">MyTheme</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (1)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (2)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (3)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (4)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (5)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (6)</option>
<option value="t3_bs3_blank" selected="selected">MyTheme (7)</option>
</select>
and there is the problem .. the values of the options are all identical...
so selection of clones doesn't work here..
on one of mine you see that different templates do work
<option value="0">Use shop default</option>
<option value="protostar">protostar - Default</option>
<option value="beez5">Beez 5 - Default</option>
this list is formed by function renderTemplateList() in administrator\components\com_virtuemart\helpers\shopfunctions.php
query is SELECT * FROM `#__template_styles` WHERE `client_id`="0"
look there for a fix I guess
Yes, different templates works, the problem is only with the ones which are duplicated in Template manager.
yes - the bug (or better said the problem) is the value is taken from the table "template" column - which is always the same for duplicated templates
it could/should be the "id" which is unique but I don't know what happens downstream when the template is attempted to be applied...
I guess here-> components\com_virtuemart\helpers\vmtemplate.php
A VM membership could probably get this recoded for you faster.. if it is possible to code it... ;) - as this code looks like it's been there a while I guess your the first one to require this..
I've never known anyone to clone a template without renaming. Certainly a new one!
It's simple,
Template can be switched with a value(you can simply try adding ?template=YOURTEMPLATE or &template=YOURTEMPLATE in your URL this work always , but not for a template style.
If you have 1 template with multiple styles, then you have to add menu for each style, to have the right association.(the subcategories and product inherit from this)
If you need only small changes and know a little PHP, You can add css on cheking for vm category for eg. and load a custom css.
Eg add 4 menu links for this main categories
baby >style1
children >style2
women >style3
men >style4
Now all subcategories and product inherit from this, but in this case use always default template in virtuemart
Quote from: GJC Web Design on April 12, 2015, 19:21:51 PM
yes - the bug (or better said the problem) is the value is taken from the table "template" column - which is always the same for duplicated templates
it could/should be the "id" which is unique but I don't know what happens downstream when the template is attempted to be applied...
Well inside Template Manager all (even duplicated) themes have unique ID (see attached image).
Quote from: Studio 42 on April 13, 2015, 00:51:49 AM
If you have 1 template with multiple styles, then you have to add menu for each style, to have the right association.(the subcategories and product inherit from this)
If you need only small changes and know a little PHP, You can add css on cheking for vm category for eg. and load a custom css.
Well I have now done that, I have selected template from menu item, but the problem is that this only works for category, but when I click some product it gets the default template instead of template of it's category.
Quote from: Milbo on April 12, 2015, 10:14:03 AM
The basic problem is that joomla created styles and there is no styleswitcher, just template switcher (for coders). I know it is on their list, so maybe our workaround has problems with j3.4.1
Quote from: GJC Web Design on April 12, 2015, 19:21:51 PM
yes - the bug (or better said the problem) is the value is taken from the table "template" column - which is always the same for duplicated templates
it could/should be the "id" which is unique but I don't know what happens downstream when the template is attempted to be applied...
Yepp, it was already written that way, it does not work, because we cannot set styles, just templates.
Quote from: GJC Web Design on April 12, 2015, 19:21:51 PM
A VM membership could probably get this recoded for you faster.. if it is possible to code it... ;) - as this code looks like it's been there a while I guess your the first one to require this..
Thank you, but I must admit in this case it is hard, because Joomla is lacking the functionality and as far as I know, it is on their list, or maybe not, but they know the problem.
Hm.. Since this won't be fixed anytime soon (and there isn't any temporary solution) I probably shouldn't copy themes (styles), but somehow upload them as separated template, right? But if I have 1 theme, how can I now modify it so that it will be uploaded as new theme, because every time I upload theme it is just replacing existing one?
If I change <name> in templateDetails.xml and rename folder theme is uploaded as new one but when I select it for some category when I go on website to that category I get white page with this error:
QuoteFatal error: Cannot redeclare modChrome_T3Xhtml() (previously declared in /usr/home/X/domains/mydomain.com/public_html/templates/test1/html/modules.php:35) in /usr/home/X/domains/mydomain.com/public_html/templates/t3_bs3_blank/html/modules.php on line 55.
In your situation renaming the template is an option (do you really need a full template change? All vm cat and prod templates can be over ridden and selected by cat)
for the modChrome_T3Xhtml() function find where it is declared each time and check first
in templates/your_template/html/modules.php
if(!function_exists('modChrome_T3Xhtml')){
function modChrome_T3Xhtml($xx,$yy)
{
//blah
}
}
I tried that but it still doesn't work. Theme is still not separated somehow, because things are mixing between them. I even tried to remove this function and page then shows but it's full of errors.
Maybe I don't need whole new theme for each category, but if there's no other solution I guess this is the only option at the moment.
QuoteMaybe I don't need whole new theme for each category, but if there's no other solution I guess this is the only option at the moment.
wrong -- every view in VM can be over ridden on a category basis - read the faqs..
http://docs.virtuemart.net/tutorials/templating-layouts.html
I know it can be, but if I select duplicated style/theme in VM Category template selection, it's bugged and wrong one is selected. So the only thing to fix this would be modifying VM core files, but I would probably have problems then when VM update would be out... That's why I reported this bug here, so that it can be fixed in VM component, because selecting duplicated theme works for example on Menu item, but not in VM, so it's definitely VM bug.
your just not getting it.....
the reason WHY YOUR way doesn't work has been twice explained to you in this thread by Max - a Joomla issue
Then you completely ignore perfectly valid alternatives even though you state yourself->
QuoteMaybe I don't need whole new theme for each category
I have built many, many Joomla/VM sites .. never have I found it necessary to have a separate JOOMLA template for different categories
OFTEN I have found it necessary to have separate VM TEMPLATE OVER RIDES for different cats
Did u even read the templating link I sent?
You can continue to moan about a core Joomla problem if you want .. but that isn't going to solve your perceived problem...
I have read and I don't know what does this have to do with this VM bug? Are you saying that this is not a bug? If I select something in VM settings and after I save something else is selected, this is normal behaviour?
Quote from: ExSpirit on April 13, 2015, 09:06:40 AM
Well I have now done that, I have selected template from menu item, but the problem is that this only works for category, but when I click some product it gets the default template instead of template of it's category.
Have you set the template to default in the products ?
If yes, then it's a bug
Absolutely my last attempt ... then I give up
use the GREEN ONE!!!!!!!!!!!!!
Quote from: Studio 42 on April 13, 2015, 13:15:32 PM
Have you set the template to default in the products ?
If yes, then it's a bug
Where in the products? In product settings? I can't find any settings for changing template for product (only category).
Quote from: GJC Web Design on April 13, 2015, 13:19:08 PM
Absolutely my last attempt ... then I give up
use the GREEN ONE!!!!!!!!!!!!!
And what should I select here? I have a few settings but none of them has any drastic changes which I need. I have to modify logo, menu code and background image (that's why I wanted to use Category Template function).
Quote
And what should I select here? I have a few settings but none of them has any drastic changes which I need. I have to modify logo, menu code and background image (that's why I wanted to use Category Template function).
set as in the image from GJC Web Design and all must work and do not change the layout in product, to be sure you use always same method.
When all work as you wish then you can change something.
But to find the right solution please follow the method given by me and the setting from GJC Web Design.