Specifications, info disappears when selecting variants

  • Posts: 4
  • Thank you received: 0
  • Hikaserial Standard Hikashop Business
3 months 3 weeks ago #328495

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24
-- PHP version -- : 7.4.11
-- Browser(s) name and version -- : Chrome 88.0.4324.96
-- Error-message(debug-mod must be tuned on) -- : no message

Hi
I have some issues with my product layout. I have products with variants where I want some important info shown under specifications but when customers select their required variants the important info under specifications disappears can you help me out ?

Thanks in advance
Buby

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

  • Posts: 72763
  • Thank you received: 11096
  • MODERATOR
3 months 2 weeks ago #328507

Hi,

A simple solution will be to remove the block of code:

if(!empty($this->fields)) {
?>
	<div id="hikashop_product_custom_info_<?php echo $variant_name; ?>" style="display:none;">
		<h4><?php echo JText::_('SPECIFICATIONS'); ?></h4>
		<table class="hikashop_product_custom_info_<?php echo $variant_name; ?>">
<?php

			$this->fieldsClass->prefix = '';
			foreach($this->fields as $fieldName => $oneExtraField) {
				if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)) {
					$variant->$fieldName = $this->element->main->$fieldName;
				}
				if(!empty($variant->$fieldName))
					$variant->$fieldName = trim($variant->$fieldName);

				if(!empty($variant->$fieldName) || (isset($variant->$fieldName) && $variant->$fieldName === '0')) {
?>
			<tr class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey; ?>_line">
				<td class="key">
					<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id; ?>_<?php echo $variant_name; ?>" class="hikashop_product_custom_name"><?php echo $this->fieldsClass->getFieldName($oneExtraField); ?></span>
				</td>
				<td>
					<span id="hikashop_product_custom_value_<?php echo $oneExtraField->field_id; ?>_<?php echo $variant_name; ?>" class="hikashop_product_custom_value"><?php echo $this->fieldsClass->show($oneExtraField,$variant->$fieldName); ?></span>
				</td>
			</tr>
<?php
				}
			}
?>
		</table>
	</div>
<?php
		}
from the file product / show.php for your frontend template via the menu Display>Views.
The modification will be saved as a template override and will remove the HTML of the specifications for each variant and thus it will keep the specifications area as you see it by default, even after you change the selected variant.

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

  • Posts: 4
  • Thank you received: 0
  • Hikaserial Standard Hikashop Business
3 months 2 weeks ago #328510

Hi Nicolas

Thx I'll try that and update you of the result

Buby

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

Time to create page: 0.049 seconds
Powered by Kunena Forum