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

No Products to Display in Sub Categories

Started by jchungerford, May 06, 2015, 23:57:47 PM

Previous topic - Next topic

jchungerford

Hi,

I am attempting to build a multi-vendor marketplace and there will be many times where products will not be listed within end-level sub-categories.  Currently, I have 3 category levels and am trying to figure out how I can list the phrase "There are currently no products to display within this category" on the frontend in bold font instead of just a blank area.  This should occur in the END-LEVEL sub category ONLY and not in any other upper categories.

Has anyone been successful in doing this?  Any advice would be most welcomed!


J3.4.1  VM3.0.8


GJC Web Design

something like


elseif (empty($this->products)&& empty($this->category->haschildren) ){

echo 'Nothing';


added after the

} elseif (!empty($this->keyword)) {
echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}


added in the category view template

untested
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

jchungerford

This works, kind of.   :o

There are three Levels to the VM Store.

1)  Homepage which has main categories

2) Sub Category of the Main Categories

3) Sub-sub categories of the 2nd Level Categories which contain products when these containers are selected.


NOW, with this code in place the "No Result" message shows like it is supposed to but unfortunately it shows in both 2) the 2nd level sub-categories, and 3) End level sub-sub categories.  I just need this message to show in the 3rd level sub-sub categories only as there will never be any products located within the 2nd level so that level should remain blank.

Any thoughts?

GJC Web Design

this is wrong->  empty($this->category->haschildren)

you need to check for products

perhaps  $this->showproducts   - look in the html.php of the view to see how this is deduced
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