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

#   How to add branch conditions in product listing

##

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

Less More

- Posts: 107
- Thank you received: 1
-
-

13 years 2 months ago [\#117209](#117209) by [tinachou](/forum/user/11887-tinachou "View tinachou's Profile")  *[How to add branch conditions in product listing](/forum/4-how-to/860678-how-to-add-branch-conditions-in-product-listing#117209 "Hello there,  I have two questions relating to adding &quot;branch conditions&quot; (if, else) for the &quot;product listing page&quot; and &quot;product page&quot;.  (1) If the product's category is &quot;XXX&quot;, then the &quot;product listing page&quot; will be different, not showing product &quot;price&quot;,&quot;name&quot; , and &quot;add to cart&quot; and so on. (See the attached.) Can anyone tell me which file I should edit?  (2) If the product's category is &quot;XXX&quot;, then the &quot;product page&quot; will be different, not showing product &quot;price&quot;,&quot;name&quot; , and &quot;add to cart&quot; and so on. (See the attached.) Can anyone tell me which file I should edit?  I really do not know which file and which part should I insert a line &quot; If (product&#95;category&#95;name==&quot;XXX&quot;)....&quot; ( However, I am not sure HOW TO SPECIFY or CALL the product's category, is it &quot;product&#95;category&#95;id&quot; or &quot;product&#95;category&#95;name&quot; or??)  I appreciate your help sincerely. :)")* was created by *[tinachou](/forum/user/11887-tinachou "View tinachou's Profile")*

Hello there,

I have two questions relating to adding "branch conditions" (if, else) for the "product listing page" and "product page".

(1) If the product's category is "XXX", then the "product listing page" will be different, ***not showing*** product "price","name" , and "add to cart" and so on. (See the attached.) Can anyone tell me which file I should edit?

[ ![h3cc3315.jpg](/forum/attachment/11541) ](/forum/attachment/11541 "h3cc3315.jpg")

(2) If the product's category is "XXX", then the "product page" will be different, ***not showing*** product "price","name" , and "add to cart" and so on. (See the attached.) Can anyone tell me which file I should edit?

[ ![hb3305b8.jpg](/forum/attachment/11542) ](/forum/attachment/11542 "hb3305b8.jpg")

I really do not know which file and which part should I insert a line " If (product_category_name=="XXX")...." ( However, I am not sure HOW TO SPECIFY or CALL the product's category, is it "product_category_id" or "product_category_name" or??)

I appreciate your help sincerely. ![:)](/media/kunena/emoticons/3.png ":)")

- [ ![h3cc3315.jpg](/forum/attachment/11541) ](/forum/attachment/11541 "h3cc3315.jpg") [ ](/forum/attachment/11541?download=1 "h3cc3315.jpg")
- [ ![hb3305b8.jpg](/forum/attachment/11542) ](/forum/attachment/11542 "hb3305b8.jpg") [ ](/forum/attachment/11542?download=1 "hb3305b8.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MDY3OC1ob3ctdG8tYWRkLWJyYW5jaC1jb25kaXRpb25zLWluLXByb2R1Y3QtbGlzdGluZz90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 2 months ago -  13 years 2 months ago [\#117263](#117263) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[How to add branch conditions in product listing](/forum/4-how-to/860678-how-to-add-branch-conditions-in-product-listing#117263 "Hello there,  I have two questions relating to adding &quot;branch conditions&quot; (if, else) for the &quot;product listing page&quot; and &quot;product page&quot;.  (1) If the product's category is &quot;XXX&quot;, then the &quot;product listing page&quot; will be different, not showing product &quot;price&quot;,&quot;name&quot; , and &quot;add to cart&quot; and so on. (See the attached.) Can anyone tell me which file I should edit?  (2) If the product's category is &quot;XXX&quot;, then the &quot;product page&quot; will be different, not showing product &quot;price&quot;,&quot;name&quot; , and &quot;add to cart&quot; and so on. (See the attached.) Can anyone tell me which file I should edit?  I really do not know which file and which part should I insert a line &quot; If (product&#95;category&#95;name==&quot;XXX&quot;)....&quot; ( However, I am not sure HOW TO SPECIFY or CALL the product's category, is it &quot;product&#95;category&#95;id&quot; or &quot;product&#95;category&#95;name&quot; or??)  I appreciate your help sincerely. :)")*

Hi,

If you want your product listing to exactly react like you said, you'll have to do apply some code customization in several file of the product's view like :
- The "listing_price" file if you want to control the display of your prices.
- The "add_to_cart_listing" file if you want to control the display of your prices.
- etc..

Hope this will help you a little.

Last edit: 13 years 2 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MDY3OC1ob3ctdG8tYWRkLWJyYW5jaC1jb25kaXRpb25zLWluLXByb2R1Y3QtbGlzdGluZz90bXBsPW1hcmtkb3du) or [Create an account](/register) 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.043 seconds

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

[](#top)
