Giter Site home page Giter Site logo

criteriasearch's Introduction

Criteria Search

This module add a search engine to your categories page. With it you can search by some feature or attribute (defined in category edition), by brand, new, promo, stock and price (only TTC for now)

Installation

Manually

  • Copy the module into <thelia_root>/local/modules/ directory and be sure that the name of the module is CriteriaSearch.
  • Activate it in your thelia administration panel

Composer

Add it in your main thelia composer.json file

composer thelia/criteria-search-module ~1.0.0

Usage

Simple filter :

The simple filter are 'new','promo','filter','price' and 'brand'. Theses filter are configurable only globally for all categories in CriteriaSearch module config.

Complexe filter :

Two others kind of filter is by features and by attributes. For theses filter you have to enabled it by category in category config page under tab modules.

Hook

3 hooks are created with this module : 1 for search engine css 1 for search engine page 1 for search engine javascript

Loop

search_attribute and search_feature

Extends the Thelia loop : Attribute and Feature Used to know which attributes is available for search

Additional input arguments

Argument Description
category The category id or list of ids

Additional output arguments

Variable Description
SEARCHABLE Attribute is 'searchable' or not

Exemple

    {loop type="search_attribute" name="search_attribute_loop" category=$category_id}
        {if $SEARCHABLE}
            ### Display the attribute
        {/if}
    {/loop}

search_attribute_av and search_feature_av

Extends the Thelia loop : Attribute and Feature availability Used to filter attribute_availability by category only if at least one product in this category have this attribute_availability

Additional input arguments

Argument Description
category The category id or list of ids

Additional output arguments

No

Exemple

    {loop type="search_attribute" name="search_attribute_loop" category=$category_id}
        {if $SEARCHABLE}
            {$attributeId = $ID}
            ### IF ATTRIBUTE IS SEARCHABLE
            {ifloop rel="search_attribute_av_loop"}
                <section id="search-attribute" class="block block-nav col-md-3" role="navigation" aria-labelledby="categories-label">
                        <h4  id="categories-label">{$TITLE}</h4>
                        <select class="select-search" id="attribute-{$attributeId}" name="attributes[{$attributeId}][]" multiple="multiple">
                            {loop type="search_attribute_av" name="search_attribute_av_loop" attribute=$ID category=$category_id return_empty=false force_return=true}
                                ### ADD SEARCH INPUT ONLY FOR ATTRIBUTE AVAILABLE IN THIS CATEGORY
                            {/loop}
                        </select>
                </section>
            {/ifloop}
        {/if}
    {/loop}

criteriasearch's People

Contributors

lopes-vincent avatar julescournut avatar thomasdasilva avatar

Watchers

James Cloos avatar Julien avatar  avatar Gilles Bourgeat avatar  avatar  avatar

criteriasearch's Issues

Not working on 2.5 : Some issues founded

Hi,
i'm not able to use the main version for 2.5,
i've found some issues that i've explain here https://forum.thelia.net/viewtopic.php?id=13798
Apologize, it's in french, but if needed, i can try to explain here in English.
As said on the forum, it appears that array $searches does not contain the expected values.

So to be sure with this fouded issues, I've tried to install this module in another fresh dev environnement, but another message come :

Warning: Undefined array key "taxe_rule_id"
in[ var/cache/dev/smarty/compile/df2840ca56d83729e761c8a97fe5e94ab4a51d2a_0.file.category-edit.html.php ](https://domaine.tld/index_dev.php/_profiler/open?file=var/cache/dev/smarty/compile/df2840ca56d83729e761c8a97fe5e94ab4a51d2a_0.file.category-edit.html.php&line=142#line142)(line 142)

Tax rules are defined on my conf.
I've investigated about this new issue, and it's come from backOffice/default/includes/module-tab-content.html, line 1 to 7

Thanks by advance

Error in price slider

Fatal error: Uncaught Error: Call to a member function joinProductSaleElements() on null in ...\local\modules\CriteriaSearch\Loop\CriteriaSearchProductLoop.php on line 169

variable $search not defined on method buildModelCriteria()

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.