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

#   The price is not displayed in show\_default.php

##

- **[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")**
- [![neo191987's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35364.jpg)](/forum/user/35364-neo191987 "View neo191987's Profile") Topic Author
- [ Offline](/forum/user/35364-neo191987)

Less More

- Posts: 431
- Thank you received: 19
-
-

7 years 1 month ago -  7 years 1 month ago [\#310525](#310525) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  *[The price is not displayed in show\_default.php](/forum/2-general-talk-about-hikashop/898218-the-price-is-not-displayed-in-show-default-php#310525 "-- HikaShop version -- : 4.2.1  Hi, I'm having trouble displaying the price in show&#95;default.php when there are variants. I realized that the problem comes from the method I use: Characteristics selection method: List In listing&#95;img&#95;title.php shows the lowest price as it should be, but show&#95;default.php shows empty value. How do I fix this problem?  This is the default code:")* was created by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")*

-- HikaShop version -- : 4.2.1

Hi, I'm having trouble displaying the price in show_default.php when there are variants.
I realized that the problem comes from the method I use: Characteristics selection method: List
In listing_img_title.php shows the lowest price as it should be, but show_default.php shows empty value. How do I fix this problem?

This is the default code: Code:

&lt;?php $itemprop_offer = ''; if (!empty($this-&gt;element-&gt;prices)) $itemprop_offer = 'itemprop="offers" itemscope itemtype="https://schema.org/Offer"'; ?&gt; &lt;span id="hikashop_product_price_main" class="hikashop_product_price_main" &lt;?php echo $itemprop_offer; ?&gt;&gt; &lt;?php $main =&amp; $this-&gt;element; if(!empty($this-&gt;element-&gt;main)) $main =&amp; $this-&gt;element-&gt;main; if(!empty($main-&gt;product_condition) &amp;&amp; !empty($this-&gt;element-&gt;prices)) { ?&gt; &lt;meta itemprop="itemCondition" itemtype="https://schema.org/OfferItemCondition" content="https://schema.org/&lt;?php echo $main-&gt;product_condition; ?&gt;" /&gt; &lt;?php } if($this-&gt;params-&gt;get('show_price') &amp;&amp; (empty($this-&gt;displayVariants['prices']) &#124;&#124; $this-&gt;params-&gt;get('characteristic_display') != 'list')) { $this-&gt;row =&amp; $this-&gt;element; $this-&gt;setLayout('listing_price'); echo $this-&gt;loadTemplate(); if (!empty($this-&gt;element-&gt;prices)) { ?&gt; &lt;meta itemprop="availability" content="https://schema.org/&lt;?php echo ($this-&gt;row-&gt;product_quantity != 0) ? 'InStock' : 'OutOfstock' ;?&gt;" /&gt; &lt;meta itemprop="priceCurrency" content="&lt;?php echo $this-&gt;currency-&gt;currency_code; ?&gt;" /&gt; &lt;?php } } ?&gt; &lt;/span&gt;

Last edit: 7 years 1 month ago by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg5ODIxOC10aGUtcHJpY2UtaXMtbm90LWRpc3BsYXllZC1pbi1zaG93LWRlZmF1bHQtcGhwP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

7 years 1 month ago [\#310533](#310533) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[The price is not displayed in show\_default.php](/forum/2-general-talk-about-hikashop/898218-the-price-is-not-displayed-in-show-default-php#310533 "-- HikaShop version -- : 4.2.1  Hi, I'm having trouble displaying the price in show&#95;default.php when there are variants. I realized that the problem comes from the method I use: Characteristics selection method: List In listing&#95;img&#95;title.php shows the lowest price as it should be, but show&#95;default.php shows empty value. How do I fix this problem?  This is the default code:")*

Hi,

On the product page, in "list" mode, the price of the main product is not displayed if variants have their own price. Instead, the price is displayed for each variant in the table listing the variants on the page.
If you still want to display the price of the main product, you can remove the code: Code:

&#124;&#124; $this-&gt;params-&gt;get('characteristic_display') != 'list')

from the code you copy/pasted.

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

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

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