Author Topic: Category pages intermittently show with no child categories  (Read 4188 times)

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10166
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Category pages intermittently show with no child categories
« Reply #15 on: July 08, 2020, 12:20:10 pm »
ah -- didn't read back far enough
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #16 on: July 08, 2020, 12:36:54 pm »
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.

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

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

}
}

enzo1

  • Beginner
  • *
  • Posts: 5
Re: Category pages intermittently show with no child categories
« Reply #17 on: August 19, 2020, 16:51:55 pm »
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3530
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Category pages intermittently show with no child categories
« Reply #18 on: August 19, 2020, 19:28:35 pm »
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

  • Beginner
  • *
  • Posts: 5
Re: Category pages intermittently show with no child categories
« Reply #19 on: August 20, 2020, 17:12:32 pm »
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

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 10166
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: Category pages intermittently show with no child categories
« Reply #20 on: August 20, 2020, 19:23:07 pm »
did u also try commenting out these parts in the template?

Code: [Select]
// 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 http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 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
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10428
  • VirtueMart Version: 3+
Re: Category pages intermittently show with no child categories
« Reply #21 on: August 20, 2020, 19:26:08 pm »
enzo1, are you using a 3rd party SEF plugin?

ste-jackson

  • Beginner
  • *
  • Posts: 22
  • A beginner
Re: Category pages intermittently show with no child categories
« Reply #22 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.

Code: [Select]
// 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

  • Beginner
  • *
  • Posts: 5
Re: Category pages intermittently show with no child categories
« Reply #23 on: August 23, 2020, 16:31:01 pm »
Thank you very much for your advice. I had to rewrite the template and it already works. Thanks a lot.

tonis

  • Beginner
  • *
  • Posts: 42
Re: Category pages intermittently show with no child categories
« Reply #24 on: April 30, 2021, 23:31:40 pm »
Hello,

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


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!

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

Code: [Select]
// 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));
# }
}