No specification displayed for variants

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
9 years 1 month ago #247342

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.6.0

Hi

Could you help me with a modification please?

I have rearranged the product display to look like this:



But when a variant is selected none of the specifications are displayed:



If I switch to the Protostar template the specifications are displayed for the variant so obviously it is something I have done incorrectly :oops:

I have moved a block of code out of the product show_default and inserted it into the end of show_block_custom_main:
}
$specifFields = ob_get_clean();
if(true){     //MODIFIED
?>

<div id="hikashop_product_custom_info_main" class="hikashop_product_custom_info_main">
	<h4><?php echo JText::_('SPECIFICATIONS');?></h4>
	<table width="100%">
      <?php     //MODIFIED
        //LAYOUT show_block_dimensions     //MODIFIED
        $this->setLayout('show_block_dimensions');     //MODIFIED
        echo $this->loadTemplate();     // MODIFIED
      ?>     
		<?php echo $specifFields; ?>
	</table>
</div>
<?php }
echo '<p>{hikashop_social}</p>';     //MODIFIED

What do I need to do to get it to display the dimensions and weight for the variants?

Thanks
Trevor

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
9 years 1 month ago #247348

Hello Trevor,

It will probably be a better idea if you directly show us how you exactly want to customize your product page, because if you want other custom fields to be properly displayed for other variants, you'll just have to directly add a value for these custom fields through your product variant configuration page.

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
9 years 1 month ago #247413

Hi Mohamed

The custom fields are showing correctly (Lead time is a custom field). The fields that are not showing are: weight, width, length and height. These fields are displayed correctly on the main product but disappear when a variant is selected.

Best regards
Trevor

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
9 years 1 month ago #247419

Hi,

You need to understand how the swapping mechanism work when you select a variant.
The system takes all the _main divs, and replace their content by the content of the same div for the corresponding selected variant.
So your problem is that you now have the hikashop_product_width_main, hikashop_product_length_main, etc divs inside the hikashop_product_custom_info_main div.
But in the variants hidden data divs, that's not the case because you didn't do the same modification in the "show" file of the "product" view.
So there are several solutions here:
- you can do a similar change in the product/show view file
- you can remove the hikashop_product_custom_info div from the product/show view file. That way the swapping system won't find the variant hidden div and thus won't do the replacing
- you can modify your show_block_custom_main to have the hikashop_product_width_main, hikashop_product_length_main, etc divs outside of the hikashop_product_custom_info_main div.

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
9 years 1 month ago #247469

Thanks for that Nicolas, plenty of tips to work with there.

Best regards
Trevor

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

  • Posts: 2
  • Thank you received: 0
9 years 5 days ago #249743

Hi Trevsmiff.

Have you managed to resolve this issue? I'm having the same issues.

Thank you.

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

  • Posts: 306
  • Thank you received: 42
  • Hikamarket Multivendor Hikashop Business
8 years 11 months ago #251292

Hi Zoline

No sorry, I have a couple of large projects that are consuming most of my time at the moment - and the wife has a few more domestic ones lined up for me afterwards!!

Best regards
Trevor

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

  • Posts: 84313
  • Thank you received: 13705
  • MODERATOR
8 years 11 months ago #251330

Hi,

@zoline
As we said earlier, the problem comes from the customization of the view.
So if you remove the customization of the corresponding view, you won't have the problem.
If it's a customization added by yourself, then you'll have to correct them with the tips provided in www.hikashop.com/forum/product-category-...variants.html#247419
and if it's something included in your template, you can contact your template provider so that they fix the customization of the views so that it works properly with products with variants.

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

Time to create page: 0.110 seconds
Powered by Kunena Forum