News:

Support the VirtueMart project and become a member

Main Menu

Page Not Displaying if no Products in Category

Started by fastpat27, June 04, 2016, 14:14:52 PM

Previous topic - Next topic

fastpat27

Hi All

Would anyone have any ideas on what would cause this? I have a subcategory linked from a sub menu but when clicked I get a blank page with an http error 500 message (basically nothing there, see attached). There are no products in this subcategory, but if I add this category to another product the page displays fine with this one product listed.

Also if I go into the menu and select "Show Products" as "no" the page will display ok but without the products.

How do I get empty categories to display the page but just say something like "No Products in this Category"? Is there a setting needs changed?

Thanks for any help

Regards
FP

All software and extensions are the latest versions and up to date.

GJC Web Design

all errors are logged somewhere.. a screenshot of a 500 error tells nobody anything

find the error or test on the Protostar template.. very likely to be a template issue
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

fastpat27

Thanks for reply GJC, the screenshot was just to explain the blank page as in absolutely nothing displayed rather than a blank website page  i.e. logo and navigation show only.

I will check the logs but I'm not good at reading them, and unfortunately there are no other templates (even protostar) installed, so that's not an easy quick test. (it was a purchased quickstart template)

I'll investigate more and try and install protostar template to test.

Thanks
FP

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

fastpat27

GJC

Thanks for the pligin, I can see this will be helpful.

This is the email result from the plugin:
Error message data:
1 Class 'CurrencyDisplay' not found in file: /home/userdh63072/public_html/components/com_virtuemart/views/category/view.html.php line: 160


line 159: if ($this->products) {
               $this->currency = CurrencyDisplay::getInstance( );
               $display_stock = VmConfig::get('display_stock',1);
               $showCustoms = VmConfig::get('show_pcustoms',1);
               if($display_stock or $showCustoms){

                  if(!$showCustoms){
                     foreach($this->products as $pType => $productSeries){
                        foreach($productSeries as $i => $productItem){
                           $this->products[$pType][$i]->stock = $productModel->getStockIndicator($productItem);
                        }
                     }
                  } else {
                     if (!class_exists ('vmCustomPlugin')) {
                        require(JPATH_VM_PLUGINS . DS . 'vmcustomplugin.php');
                     }
                     foreach($this->products as $pType => $productSeries) {
                        shopFunctionsF::sortLoadProductCustomsStockInd($this->products[$pType],$productModel);
                     }
                  }
               }
            }

My problem now is PHP but I'll see what the same file in other sites say here and compare.

Thanks again for the plugin and the help

FP

jenkinhill

I have only got VM3.0.17 on this PC, and there /components/com_virtuemart/views/category/view.html.php has the class declared:

if (!class_exists('CurrencyDisplay'))
         require(VMPATH_ADMIN . DS . 'helpers' . DS . 'currencydisplay.php');
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

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

fastpat27

Hi Guys

Jenkinhill, I didn't know 3.0.17 was out yet, it doesn't show as an update in the backend. I did a restore of an old version of the site, back to 3.0.14 and everything worked fine. I then updated all extensions except VM, everything still working ok, so I then updated to VM 3.0.16 again and this caused the error again. It do however throw up a different error as in "Fatal error: Class 'CurrencyDisplay' not found ".

Just as I went to look for this error GJC gave me the most amazing post referral.  ;D Thanks so much

Thanks to both of you guys, this has solved the issue.

FP

GJC Web Design

odd numbered versions e.g 3.0.15, 3.0.17 etc are intended for experienced users and are not generally publicised thru the update system.

When testers have proven them then the changes are brought forward to an even (so the next 3.0.18) and then added to the update system
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

fastpat27

Ah, good to know GJC, I'll leave those updates to you's guys then, I'll stick to the evens for now until I get my PHP degree lol

Thanks again you pair!