News:

Looking for documentation? Take a look on our wiki

Main Menu

Add stock filter to category view

Started by sandomatyas, January 25, 2022, 16:39:17 PM

Previous topic - Next topic

sandomatyas

When I open a category page I can filter for manufacturer and set the ordering. Is there a method to add a new filter which shows the products currenty in stock? I'm sure it could be done with modifying the model but I was wondering if there is an other solution for that?

balai


sandomatyas

Yes I know but how do you integrate it to the category layout? It has an own result page and category page has manufacturer filtering, ordering, pagination, nice url etc

GJC Web Design

I did it this way for a client that didn't want to modify any core and had only a few products..

In the display loop test for in stock and apply a class to the product display.
Then a bit of js and a form to show/hide that class with a hide out of stock button

the site didn't have many products and this method of course buggers up the pagination if used
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

pinochico

#4
Quote from: sandomatyas on January 25, 2022, 18:12:31 PM
Yes I know but how do you integrate it to the category layout? It has an own result page and category page has manufacturer filtering, ordering, pagination, nice url etc

I don't understand.
Do you tried modul CFiltering == do you know demo an documentation or not?

Look at this:

https://www.kolo-park.cz/obchod/kola-a-elektrokola

Modul CF is above VM category and yes, checkbox for product in stock (Skladem) is created by custom develop

You can custom develop for core VM too, without CF, but I think is harder and why?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

sandomatyas

yes, I use CF Filter for years, moreover I have some custom modified instances since breakdesigns isn't interested in some changes we need :)

I like your shop and template, it realy inspired me in my next projects :)

You use cf filter as a module (same way as we use it), but the customer asked to add as buttons next to the manufaturer filter, something like this: https://snipboard.io/dih5Rn.jpg
Sure, I can embed a module there, so I was just wondering if the webshop component allready has ability to show only the stocked products.
So far I see VirtueMart can't do it without 3rd party extension. No problem, just try to use core methods if it is available.

Studio 42

You have this trigger in product model
      if ($this->searchplugin !== 0) {
         JPluginHelper::importPlugin('vmcustom');
         $dispatcher = JDispatcher::getInstance();
         $dispatcher->trigger('plgVmBeforeProductSearch', array(&$select, &$joinedTables, &$where, &$groupBy, &$orderBy,&$joinLang));
      }
searchplugin is set using
$this->searchplugin = vRequest::getInt ('custom_parent_id', 0);
But in wonder why ?
If the team remove the need of custom_parent_id, you can then set yourself the search query in the core
The only problem is that the $group is not send to the plugin. So the trigger sould have this parameter to know the context
$dispatcher->trigger('plgVmBeforeProductSearch', array(&$select, &$joinedTables, &$where, &$groupBy, &$orderBy,&$joinLang,$group));

sandomatyas

Quote from: pinochico on January 25, 2022, 19:12:15 PM
https://www.kolo-park.cz/obchod/kola-a-elektrokola

Hi
I noticed you have SEF urls for CF Filter results
https://www.kolo-park.cz/vysledky-vyhledavani/kola-a-elektrokola/skladem/akce/cena-od-8705/cena-do-67094
I've asked for this maybe a year or two back from breakdesigns but there was no core solution for that. Do you have a hint maybe how it could be done? Also like your dropdown/kind of megamenu solution for the parameters :)