Giter Site home page Giter Site logo

super-filter's People

Contributors

gwillz avatar pdaleramirez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

super-filter's Issues

Snappy response with large data sets (like algolia)

While I understand that this plugin is not at the same level, complexity or price as Algolia, I wonder what you plan for the plugin for the future.

I am currently building an e-commerce site that eventually will contain about 10k products. There are about 20 product types that have their own sets of attributes, some for filtering, some not. And I wonder what path to choose. I have integrated the site with Algolia and tested their filtering. If you've tried it, you know it's very snappy in the response.

However, it's a bit complicated to set up- and I believe it's quite pricey.

I believe they create separate tables (probably mongodb, firebase or similar) where they pre-chew the data, so they can give the snappy response. Some of the features I notice are:

  • Instant response
  • Filters adapted to the currently visible product types. It's not bound to assuming there is only one visible product type
  • Ability to prioritize product sorting
  • Fuzzy logic search
  • Summation of number of products that will be visible when each filter is clicked

Here is a video where I explain what I found in Algolia, and my questions to your plugin:
https://youtu.be/yQIC5KWPcsg

Move "Install example data" to settings page

It's great that you have included the ability to add example data. But the button that lets you install example data is a little too available, in my opinion.

image

In my head it would make sense to move this button to the plugin's settings page (ie: /admin/settings/plugins/super-filter) so users don't accidentially add the example data.

Disable filter that has no results?

Hello,

Is there a way to disable a filter if it has no results, or would return nothing?

So to prevent people from filtering right down to a "no results", the filters would be disabled.

Many thanks for this great plugin

Can I use this with users?

Hi mate,
This looks really awesome! Can this be used with users? Or anyway to allow it to be used with users?

The use case would be to have a page that returns all users and allows you to to filter users by their custom fields such as, skill, location etc

Many thanks
Tom

EDIT:

Doesn't look like it's possible, I've just been playing with it but can only access entries and categories, I can't select users as the element?

Anyway to easily include this? The rest of the plugin looks great but I would really need to use this for users.

Option not load app.css

Is there an option not to load app.css for the plain" template or is still it needed for functionality purposes? I don't need bootstrap and it's interfering with my styles. I have commented the file out in VueAsset.php but it will get overwritten when an update is released.

Cannot find template after calling craft.superFilter.setup

Craft is not able to find referenced templates after craft.superFIlter.setup("...") is called.

I have one defined search setup called kompressorer:

image

It references this template:

image

This is the setup (I haven't done anything here):

image

As far as I understand, it seems that searchTypes.php:599 with the following code is causing the error:
Craft::$app->getView()->setTemplatesPath($builtin);, because when I add _blocks\footer.twig to the vendor\pdaleramirez\super-filter\templates-folder, the template is found and everything is golden:

image

Settings page is empty

Just installed plugin, settings page is completly empty.

Plugin version: 1.7.0

System info:
PHP version 8.1.2
OS version WINNT 10.0
Database driver & version MySQL 5.5.5
Image driver & version GD 8.1.2
Craft edition & version Craft Pro 4.0.4
Yii version 2.0.45
Twig version v3.3.10
Guzzle version 7.4.4

Custom Fields not showing in Sort Fields

None of my custom fields are showing up in the Sort Fields section when creating a new filter. In the example attached I would like to both filter and sort by bedrooms and bathrooms. I've tried a few different field types (radio buttons, dropdown, number) and nothing seems to show up in the sort column. Am I missing something?

Screen Shot 2020-05-15 at 11 52 50 AM

Heavy bandwidth usage from `filter` and `fields` requests

I notice that the filter and fields replies are very large.

For example, this reply only contains about 40 new items, and still is 1,7 mb:

image

When I inspect the response, I see it contains the entire objects (assets, variants) and not just specific attributes (specifically variants are cracy loaded with data):

image

I tried the following code to unset() the data I don't want in the response, but alas, it didn't work. I assume this event happens before variants and productImages are populated. And to be honest, I should not query all that data in the first place.

// Create image transformations for images delivered to the Super Filter plugin
Event::on(SearchTypes::class, SearchTypes::EVENT_ITEM_ARRAY, function (ItemArrayEvent $event) {
    if (Craft::$app->getPlugins()->isPluginEnabled('commerce') == true) {
        $srcImage = $event->element->productImage->one();

        // found any?
        $imageUrl = "";
        if ($srcImage){

            // get focalpoint
            $focalPoint = $srcImage->getFocalPoint();
            if (!$focalPoint) {
                $focalPoint = "50% 50%";
            }

            // transform with imager
            $image = Imager::getInstance()->imager->transformImage($srcImage, [
                'width' => 400,
                'format' => 'jpg',
                'ratio' => 1/1,
                'allowUpscale' => false,
                'jpegQuality' => 90,
                'position' => $focalPoint,
                'interlace' => true
            ], null, null);
            $imageUrl = $image->url;                            
        }
        else {
            $imageUrl = "https://via.placeholder.com/400x400.png?text=Placeholder";
        }

        $event->item['productImageTransform'] = $imageUrl;

    }

    // remove some unnecessary data
    // doesn't work
    unset($event->item['variants']);
    unset($event->item['productImage']);
});

What is your suggestion in this case?

OR as logic when filtering on categories

How can I setup a superFilter with OR as logic?

In this example, SuperFilter shows all products that have both productFamily 19806 and 22905. I want it to show the products that have the productFamily category 19806 or 22905:

craft.superFilter.setup(superFilterSetup, 
{
    filter: {
        productFamily: [19806, 22905]
    }
}) 

If form validation fails, all changes are lost

If you create a new super filter and then forget one of the required fields (like items per page), all the fields you've added to sort and filter disappear after you click save, and the validation message is shown.

It's a bit annoying.

Bug: Category filter field displays all categories from all category groups

So I have added a category field to the "Search Fields" list, now when i open the frontend, the field will appear in the filters section, but it will have all categories i have defined in the admin panel, regardless of the actual category field source.

The issue is with this line:

$find = ElementHelper::findSource($elementType, $source);

It does not provide the third parameter to the findSource call, this results in using the default CONTEXT_INDEX context.

Call stack:

https://github.com/craftcms/cms/blob/2eac9249964ccc553bf841c79b9ee44d58f16b61/src/helpers/ElementHelper.php#L562

https://github.com/craftcms/cms/blob/71aac29fa480dd3b09a72c4fa54a5fd4976b4dd4/src/services/ElementSources.php#L76

https://github.com/craftcms/cms/blob/71aac29fa480dd3b09a72c4fa54a5fd4976b4dd4/src/services/ElementSources.php#L341

https://github.com/craftcms/cms/blob/71aac29fa480dd3b09a72c4fa54a5fd4976b4dd4/src/base/Element.php#L795

https://github.com/craftcms/cms/blob/71aac29fa480dd3b09a72c4fa54a5fd4976b4dd4/src/elements/Category.php#L190

https://github.com/craftcms/cms/blob/71aac29fa480dd3b09a72c4fa54a5fd4976b4dd4/src/services/Categories.php#L160

getEditableGroups has this check:

if (Craft::$app->getRequest()->getIsConsoleRequest()) {
    return $this->getAllGroups();
}

$user = Craft::$app->getUser()->getIdentity();

if (!$user) {
    return [];
}

So if you are not authenticated, then you will get empty sources, this results in $criteria = $find['criteria'] ?? null; being null, so no criteria filtering gets applied to the Category element find query.

Fix: Add third parameter to the findSource call, for example this one: \craft\services\ElementSources::CONTEXT_FIELD

If you change your site's data structure, without changing your filter set up, the field types change

Hi, it's me again, hoping you can help.

There's no way to specify which field types (checkboxes, dropdowns etc..) are for which category/categories or tag.


The site originally has two categories, Type and Brand and no tags.
Type was a checkbox list and Brand was a dropdown. I didn't specify this but I worked with it and it was fine.

I added tags to blog posts---this is entirely removed from anything to do with the Super Filter. I did not change the Super filter settings.

But seemingly just adding tags anywhere on the site changed the Super Filter: my second category (Brand) from a dropdown to a checkbox list, which isn't what I want.
I built everything based on the assumption you could only filter for one brand at a time (dropdown), and a checkbox list means that's no longer the case and things are broken.


Is there anyway to specify which field type a given selected search field uses?

Cheers,
Lucy

Dropdown default is "none". Need a way to make it non-specified / all / any.

We've set your Super Filter plugin up to use an "and" relationship between two category fields.

All our items have values for categories 1 and 2 set.

Our category 1 renders as a checkbox list, and category 2 as a dropdown.

"None" is the default value for the dropdowns, it lists the actual category values beneath "none".

The issue is: if you're looking for something specific in category 1, but you don't mind / set which value you want for category 2, the search will always return nothing, because the dropdown is specifically requesting a none or null value for category 2 but all out items have values for category 2.

Basically, we'd like to know how to change the default "none" value in the dropdown to an "all" value or an "any".

Screen Shot 2020-10-29 at 9 48 44 am

Cheers

Matrix field support

Would it be possible to add Matrix field support?

I have a matrix field with several groups(tabs) with multiple fields inside. This is used for product properties/attributes like size, color, model, material, etc. The need is to be able to filter based on these fields.

Error while setting up search

I'm not able to setup a search. Only half of the screen seems visible. When I hit the save button the errors appear. (see screenshot)
Schermafbeelding 2020-03-16 om 14 16 12 (2)

The install "example data" also don't seem to work.

Craft: 3.4.9
Super-filter: 1.0.6

How to associate certain setup with category

Is it possible to associate a certain setup with a category? In my case, I have a productFamily category. Every product is associated with at least one productFamily category.

I create a nav from the productFamily items, and allow the user to click one of the nav items to pre-filter which products should be displayed.

image

It would be nice to be able to associate a filter setup with a certain category (perhaps by exposing super filter setups as a field type?)

Range filtering

Most of webshops have some kind of range filters, usually price range.

Such feature is must have for such plugin :)

Server Error when loading /admin/super-filter/setup-search

500 error when it tries to load/reach:
index.php?p=admin/actions/element-indexes/get-elements&v=1583947315067

Everything else seems to work, but I can see saved searches there either.

Any ideas?

I've tried uninstalling/re-installing but it didn't do anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.