News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Category Template bug

Started by ExSpirit, April 10, 2015, 22:57:44 PM

Previous topic - Next topic

ExSpirit

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?

jenkinhill

Tested VM3.0.6.7 on Joomla 3.4.1 with multiple category overrides and all saved exactly as required. Used Firefox37.0.1
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

ExSpirit

#2
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).

GJC Web Design

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?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ExSpirit

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.

Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

GJC Web Design

what is the actual value="xxx" of the select dropdowns?  Look at the html
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Milbo

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
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

ExSpirit

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>

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ExSpirit

Yes, different templates works, the problem is only with the ones which are duplicated in Template manager.

GJC Web Design

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.. 
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

jenkinhill

I've never known anyone to clone a template without renaming. Certainly a new one!
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Studio 42

#13
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

ExSpirit

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.