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

#   Category displays price when variants are present

##

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

Less More

- Posts: 15
- Thank you received: 0
-
-

14 years 1 week ago [\#71690](#71690) by [keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")  *[Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#71690 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")* was created by *[keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")*

The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being defined by variant. However, when the sub-category to which the product belongs is displayed, it shows a price of '£20 each' (the lowest price defined by variant). This is misleading, as the price is variant depending on size. How can I prevent the display of the price when the sub-category is displayed? Please see the image attached - the '£20 each' should not be there. Thanks.
[ ![price&#95;displayed.gif](/forum/attachment/6435) ](/forum/attachment/6435 "...&#95;displayed.gif")

- [ ![price&#95;displayed.gif](/forum/attachment/6435) ](/forum/attachment/6435 "...&#95;displayed.gif") [ ](/forum/attachment/6435?download=1 "...&#95;displayed.gif")

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

- **[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)
-

14 years 1 week ago [\#71863](#71863) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#71863 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")*

Hi,

One solution could be to create a custom field on the table product and with the label "displayprice" in HikaShop &gt; Display &gt; Custom fields, then edit the view "product / listing_img_title" in HikaShop &gt; Display &gt; Views.

In this view replace the code: Code:

if($this-&gt;params-&gt;get('show_price','-1')=='-1'){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('show_price',$config-&gt;get('show_price')); } if($this-&gt;params-&gt;get('show_price')){ $this-&gt;setLayout('listing_price'); echo $this-&gt;loadTemplate(); }

By: Code:

if(isset($this-&gt;row-&gt;displayprice) &amp;&amp; $this-&gt;row-&gt;displayprice == 'no'){ if($this-&gt;params-&gt;get('show_price','-1')=='-1'){ $config =&amp; hikashop_config(); $this-&gt;params-&gt;set('show_price',$config-&gt;get('show_price')); } if($this-&gt;params-&gt;get('show_price')){ $this-&gt;setLayout('listing_price'); echo $this-&gt;loadTemplate(); } }

Then in the product edition page, just set "no" in the custom field for the products with variants.

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

14 years 1 week ago [\#71933](#71933) by [keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")  Replied by *[keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")* on topic *[Re: Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#71933 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")*

Thanks - I'll try this in the next day or two. It does seem a bit user-unfriendly to need to amend core code to overcome what seems to be a flaw in the system. Perhaps you could take this on board for future versions? I'll report back on how I get on with your solution.

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

14 years 1 week ago [\#71973](#71973) by [keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")  Replied by *[keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")* on topic *[Re: Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#71973 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")*

I am unable to add a custom field to table 'product' via back-end: if I click New, the table selected is Address and is not a drop-down menu to be able to select Product table. So, I tried adding the new field via phpmyAdmin (displayprice, varchar(255)). I amended the code in listing_img_title as you specify (do you need 2 curly brackets at the end of the revised code?) However, I don't see anywhere the new field to input 'no' - what do you mean by the 'product edition'? I assume you mean the page to create/amend product details? Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzcxNjkwLWNhdGVnb3J5LWRpc3BsYXlzLXByaWNlLXdoZW4tdmFyaWFudHMtYXJlLXByZXNlbnQ/dG1wbD1tYXJrZG93bg==) 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: 86320
- Thank you received: 14279
-
-

14 years 1 week ago [\#71994](#71994) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#71994 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")*

The "table" dropdown is only available in commercial editions of HikaShop. You must be using the Starter edition which does not allow for that.
You can't just add the field via the database as it's more complex to do.

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

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

Less More

- Posts: 15
- Thank you received: 0
-
-

14 years 1 week ago -  14 years 1 week ago [\#72107](#72107) by [keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")  Replied by *[keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile")* on topic *[Re: Category displays price when variants are present](/forum/2-general-talk-about-hikashop/71690-category-displays-price-when-variants-are-present#72107 "The shop has a product, within a sub-category, that has 2 characteristics (size and style) and variants - price (per size) and quantity (per style). The main product has no price defined, price being...")*

Yes, I'm using the Starter edition, so I guess this solution can not now be applied.

Last edit: 14 years 1 week ago by [keithyoung89](/forum/user/4928-keithyoung89 "View keithyoung89's Profile"). Reason: I confused the issue!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzcxNjkwLWNhdGVnb3J5LWRpc3BsYXlzLXByaWNlLXdoZW4tdmFyaWFudHMtYXJlLXByZXNlbnQ/dG1wbD1tYXJrZG93bg==) 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.085 seconds

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

[](#top)
