[Skip to main content](#vessel-content)

#   savoir qu'un filtre a ete selectionne

##

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 1 month ago [\#175061](#175061) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  *[savoir qu'un filtre a ete selectionne](/forum/5-support-en-francais-french-support-/872223-savoir-quun-filtre-a-ete-selectionne#175061 "-- HikaShop version -- : 233 -- Joomla version -- : 336  Bonjour  Dans la view product/filter.php je n'ai pas trouver d'autre methode pour savoir si un filtre a ete selectionne ou pas  j'utilise  mais c'est bon uniquement car ma selection se faite sur des boutons radio (donc 1 seul)  avez vous une variable pour savoir si un filtre est applique ou pas ?  merci")* was created by *[erickb](/forum/user/4069-erickb "View erickb's Profile")*

-- HikaShop version -- : 233
-- Joomla version -- : 336

Bonjour

Dans la view product/filter.php je n'ai pas trouver d'autre methode pour savoir si un filtre a ete selectionne ou pas

j'utilise Code:

if(is_array($data)==1){ $class_selected = ''; }else{ $class_selected = ' hk-filter-selected'; }

mais c'est bon uniquement car ma selection se faite sur des boutons radio (donc 1 seul)

avez vous une variable pour savoir si un filtre est applique ou pas ?

merci

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODcyMjIzLXNhdm9pci1xdXVuLWZpbHRyZS1hLWV0ZS1zZWxlY3Rpb25uZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 1 month ago [\#175074](#175074) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[savoir qu'un filtre a ete selectionne](/forum/5-support-en-francais-french-support-/872223-savoir-quun-filtre-a-ete-selectionne#175074 "-- HikaShop version -- : 233 -- Joomla version -- : 336  Bonjour  Dans la view product/filter.php je n'ai pas trouver d'autre methode pour savoir si un filtre a ete selectionne ou pas  j'utilise  mais c'est bon uniquement car ma selection se faite sur des boutons radio (donc 1 seul)  avez vous une variable pour savoir si un filtre est applique ou pas ?  merci")*

Bonjour,

Vous pouvez faire comme cela: Code:

$app = JFactory::getApplication(); $cid = JRequest::getInt("cid",'itemid_'.JRequest::getInt("Itemid",0)); $infoGet = $app-&gt;getUserStateFromRequest( 'com_hikashop.'.$cid.'_filter_'.$filter_namekey, 'filter_'.$filter_namekey);

et cela va vous retourner la valeur sélectionnée par l'utilisateur.
Notez que pour que ce code fonctionne, il faut que la variable $filter_namekey contienne le namekey du filtre dont vous souhaitez connaître la valeur.
Dans cette vue, $this-&gt;filters contient un array de vos filtres et chaque objet de filtre dans cet array a un attribut filter_namekey qui vous permettra de connaître cela.

The following user(s) said Thank You: [erickb](/forum/user/4069-erickb "View erickb's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODcyMjIzLXNhdm9pci1xdXVuLWZpbHRyZS1hLWV0ZS1zZWxlY3Rpb25uZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2705
- Thank you received: 74
-
-

12 years 1 month ago [\#175173](#175173) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[savoir qu'un filtre a ete selectionne](/forum/5-support-en-francais-french-support-/872223-savoir-quun-filtre-a-ete-selectionne#175173 "-- HikaShop version -- : 233 -- Joomla version -- : 336  Bonjour  Dans la view product/filter.php je n'ai pas trouver d'autre methode pour savoir si un filtre a ete selectionne ou pas  j'utilise  mais c'est bon uniquement car ma selection se faite sur des boutons radio (donc 1 seul)  avez vous une variable pour savoir si un filtre est applique ou pas ?  merci")*

merci Nicolas

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODcyMjIzLXNhdm9pci1xdXVuLWZpbHRyZS1hLWV0ZS1zZWxlY3Rpb25uZT90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.068 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
