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

#   Vente au mètre

##

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 8 months ago [\#147945](#147945) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Vente au mètre](/forum/5-support-en-francais-french-support-/84778-vente-au-metre?start=20#147945 "Bonjour,  J'ai un seul article qui se vend au mètre, comment le paramétrer et remplacer dans la vue produit &quot;à l'unité&quot; par &quot;le mètre&quot;?  Cordialement")*

Bonjour,

Pour trier par catégorie, il faut utiliser: Code:

$productClass = hikashop_get('class.product'); $categories = $productClass-&gt;getCategories($this-&gt;row-&gt;product_id); if(!empty($price-&gt;price_product_id) &amp;&amp; in_array('VOTRE_ID_DE_CATEGORIE',$categories){

A la place de: Code:

if(!empty($price-&gt;price_product_id) &amp;&amp; ($price-&gt;price_product_id == VOTRE_ID_DE_PRODUIT &#124;&#124; $price-&gt;price_product_id == VOTRE_SECOND_ID_DE_PRODUIT)){

En ce qui concerne l'autre partie, les quantités sont des "int" ce qui veut dire des nombres entiers, c'est géré comme cela dans tout HikaShop, donc pour changer cela il y aurait pas mal de choses à faire.

Le plus simple à mon avis est de créer un custom field dans la table "produit" et le nommer longueur par exemple.
Ensuite l'utilisateur saisi sa longueur en mètre, et à l'aide d'un plugin qui sera a faire changer dynamiquement le prix du produit.
Cela nécessite des connaissances PHP.

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

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

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

Less More

- Posts: 108
- Thank you received: 1
-
-

12 years 8 months ago [\#148047](#148047) by [nozz](/forum/user/29353-nozz "View nozz's Profile")  Replied by *[nozz](/forum/user/29353-nozz "View nozz's Profile")* on topic *[Vente au mètre](/forum/5-support-en-francais-french-support-/84778-vente-au-metre?start=20#148047 "Bonjour,  J'ai un seul article qui se vend au mètre, comment le paramétrer et remplacer dans la vue produit &quot;à l'unité&quot; par &quot;le mètre&quot;?  Cordialement")*

Bonjour Xavier,
Merci pour ta réponse rapide. J'ai essayé le code mais j'obtiens une page blanche avec juste la photo d'un produit de la catégorie.
je mets en PJ le fichier modifié j'ai surement dû faire une erreur(s)
Merci pour ton aide

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

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

Less More

- Posts: 108
- Thank you received: 1
-
-

12 years 8 months ago [\#148120](#148120) by [nozz](/forum/user/29353-nozz "View nozz's Profile")  Replied by *[nozz](/forum/user/29353-nozz "View nozz's Profile")* on topic *[Vente au mètre](/forum/5-support-en-francais-french-support-/84778-vente-au-metre?start=20#148120 "Bonjour,  J'ai un seul article qui se vend au mètre, comment le paramétrer et remplacer dans la vue produit &quot;à l'unité&quot; par &quot;le mètre&quot;?  Cordialement")*

j'ai trouvé le problème, il manquait juste une parenthèse à la fin du code.
Merci pour la solution

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODQ3NzgtdmVudGUtYXUtbWV0cmU/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) 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.047 seconds

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