hide option block

  • Posts: 179
  • Thank you received: 0
4 years 2 months ago #323969

-- HikaShop version -- : 4.3
-- Joomla version -- : 3.9.21
-- PHP version -- : 7.2

hello i have a litle problem ...
i have production caractéristique, in catregory view all is good
in product view it render options div
i have this code

<?php
	if($this->params->get('characteristic_display') != 'list') {
		$this->setLayout('show_block_characteristic');
echo '<div class="options">'.JText::_(OPTIONS_PRODUCT_TITLE);
echo $this->loadTemplate().'</div>';
?>
		<br />
<?php } ?>
how to check if characteristic is empty ?
regards

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
4 years 2 months ago #323979

Hi,

I'm sorry but I don't understand what you're trying to do.
We'll need more information on the situation to be able to help you.

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

  • Posts: 179
  • Thank you received: 0
4 years 2 months ago #323984

hello
if product doens't any characteristic the code bellow diplay

<div class="option"></div>
how to display nothing ?
regards

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
4 years 2 months ago #323993

Hello,

Can you provide an Url link ? We aren't sure to understand the situation because in our mind the HikaShop's default behavior isn't to display anything at all in the product page if it haven't any Characteristics value.
On your side, you can check that you don't have any override on your product/show_default or product/show_block_characteristic
Awaiting elements from you to be able to better understand the situation.

Regards

Last edit: 4 years 2 months ago by Philip.

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

  • Posts: 179
  • Thank you received: 0
4 years 2 months ago #324017

here the category view , no option direct cart link

This message contains confidential information

and if you open product view
This message contains confidential information

it display "vos options"
the code above is the view

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

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
4 years 2 months ago #324020

Hi,

You want to add an additional check:

if(!empty($this->element->characteristics)) {

....

}

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

  • Posts: 179
  • Thank you received: 0
4 years 2 months ago #324045

Merci c'est parfait !

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

Time to create page: 0.067 seconds
Powered by Kunena Forum