News:

Support the VirtueMart project and become a member

Main Menu

Category Template bug

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

Previous topic - Next topic

Milbo

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.
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

#16
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.

GJC Web Design

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
        }
      }
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

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.

GJC Web Design

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

#20
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.

GJC Web Design

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...
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

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?

Studio 42

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

GJC Web Design

Absolutely my last attempt ...  then I give up

use the GREEN ONE!!!!!!!!!!!!!
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

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

Studio 42

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.