The price is not displayed in show_default.php

  • Posts: 386
  • Thank you received: 14
2 years 8 months ago #310525

-- 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:

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

Last edit: 2 years 8 months ago by neo191987.

Please Log in or Create an account to join the conversation.

  • Posts: 75481
  • Thank you received: 11749
2 years 8 months ago #310533


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:

|| $this->params->get('characteristic_display') != 'list')
from the code you copy/pasted.

The following user(s) said Thank You: neo191987

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum