Category pages intermittently show with no child categories

Started by ste-jackson, June 30, 2020, 18:25:13 PM

Previous topic - Next topic

GJC Web Design

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

ste-jackson

Quote from: AH on July 08, 2020, 11:05:32 AM
I think maybe this is the are for concern

&& $manu_id == 0


if ($this->showcategory and empty($this->keyword) && $manu_id == 0) {

vs the new

if ($this->showcategory and empty($this->keyword)) {

Hi AH and GJC

Thank you for your replies, i think it is the "if (!empty($this->category->haschildren))" as I do not have "&& $manu_id == 0" in my template code and also the does with Joomla default templates which uses the default VM template.  Below is the original code i have in the category template.  I have updated with GJC latest version and that seems to work so far including the VM search results.


if (VmConfig::get ('showCategory', 1) and empty($this->keyword)) {
if (!empty($this->category->haschildren)) {

echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children));

}
}

enzo1

Hi, I have the same problem. No code modifications, you said there, did not help. The problem is the same. Do you have any advice please?

Jörgen

If you have the "same" problem and the fixes given does not help, you need to give much more info.
VM version, Joomla new install, upgrade. Anything that could be of help.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

enzo1

I need to solve an annoying problem. The main menu is Megamenu and the E-shop menu item is the classic Joomla menu - a manually created Virtuemart category.

Left menu - Virtuemart category module.

After clicking on any item (category) that also contains subcategories, a page with all subcategories should appear. This will not happen after the first click. This will not happen until the page is refreshed or the menu item is clicked a second time.

This happens every time, especially when the cache is cleared.

I have settings according to your documentation and demo website.

Joomla 3.9.20
VirtueMart 3.8.4 10335
VP Smart 2.5 (Beez3 and Protostar)

I did everything according to your advice and switched the template to Protostar. The error appears again and again !!!
I switched to Beez3 and the error comes up again and again !!!

***I found that if I turn off SEO in the Virtuemart settings, everything works ok.

website: www.enzosoftware.cz/avhifi

Thank you very much for the advice.

GJC Web Design

did u also try commenting out these parts in the template?

// Show child categories
#if ($this->showcategory and empty($this->keyword) && $manu_id == 0) {
#if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
#}
#}
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

PRO


ste-jackson

Please find below the final version of the code that seems to be working.   This is in the category template file.


// Show child categories
if ($this->showcategory and empty($this->keyword)) {
# if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
# }
}


Hope this helps.

enzo1

Thank you very much for your advice. I had to rewrite the template and it already works. Thanks a lot.

tonis

Hello,

I had exact the same problem as enzo1.
My versions:
J 3.9.26
VM 3.8.8
Own custom template with overrides

Quote from: enzo1 on August 20, 2020, 17:12:32 PM

After clicking on any item (category) that also contains subcategories, a page with all subcategories should appear. This will not happen after the first click. This will not happen until the page is refreshed or the menu item is clicked a second time.

This happens every time, especially when the cache is cleared.

I have settings according to your documentation and demo website.

Joomla 3.9.20
VirtueMart 3.8.4 10335
VP Smart 2.5 (Beez3 and Protostar)

I did everything according to your advice and switched the template to Protostar. The error appears again and again !!!
I switched to Beez3 and the error comes up again and again !!!

***I found that if I turn off SEO in the Virtuemart settings, everything works ok.


This code override has solved the problem. Thanks!

Quote from: ste-jackson on August 21, 2020, 10:25:26 AM
Please find below the final version of the code that seems to be working.   This is in the category template file.


// Show child categories
if ($this->showcategory and empty($this->keyword)) {
# if (!empty($this->category->haschildren)) {
echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
# }
}