Can I put a content module into the product tabule

  • Posts: 252
  • Thank you received: 1
9 years 3 months ago #241407

-- HikaShop version -- : HikaShop Business 2.6.3,
-- Joomla version -- : 3.5
-- PHP version -- : 5.5.12

Hi,
I set my product layout to be tabular, and add some new tabs into it.
I have two questions about the tabular setting :
1. Can I apply a content module into it ? and How ?
2. Some of the product don't have specification and some do. How to set the specification tab hidden when the product doesn't have spec?

Thanks

Best Regards

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #241420

Hi,

1. Sure. You can use a modules anywhere tag in the content of your tab in order to do that:
extensions.joomla.org/extension/modules-anywhere

2. There actually already is code in the tabular view file to automatically remove the specifications tab if there is nothing in it.
It's done by the code:

$hide_specs = 1;
if($this->element->product_manufacturer_id != 0 || $this->element->product_weight != 0 || $this->element->product_width != 0 || $this->element->product_height != 0 || $this->element->product_length != 0 || @$this->element->main->product_weight != 0 || @$this->element->main->product_width != 0 || @$this->element->main->product_height != 0 || @$this->element->main->product_length != 0)
	$hide_specs = 0;
foreach ($this->fields as $fieldName => $oneExtraField) {
	$value = '';
	if(empty($this->element->$fieldName) && !empty($this->element->main->$fieldName))$this->element->$fieldName = $this->element->main->$fieldName;
	if(isset($this->element->$fieldName))
		$value = trim($this->element->$fieldName);
	if(!empty($value)){
		$hide_specs = 0;
		break;
	}
}
and then:
<?php if($hide_specs == 0){ ?>
			<li id="hikashop_show_tabular_specification_li" class="hikashop_tabs_li ui-corner-top"><?php echo JText::_('SPECIFICATIONS');?></li>
			<?php }
in the tabular view file.
So I suppose that the tabular view file must have been modified on your end or by your template provider and doesn't include these pieces.

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

  • Posts: 252
  • Thank you received: 1
9 years 3 months ago #241646

Hi,
I wanted to put the content module in to my product page, and I've installed the modules_anywhere, but I could't find the content module in my modules folder, I guess it might be mod_hikashop.
But in mod_hikashop.xml I didn't see any parameter for category, Was I dealing with the right module?


Best Regards
Scott

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #241658

Hi,

Yes you're dealing with the correct module.
You can see that in the XML:

<fields name="params" addfieldpath="/components/com_hikashop/fields">
			<fieldset name="basic">
				<field
					name="moduleclass_sfx"
					type="text"
					label="COM_MODULES_FIELD_MODULECLASS_SFX_LABEL"
					description="COM_MODULES_FIELD_MODULECLASS_SFX_DESC" />
			</fieldset>
			<fieldset name="hk_options" label="Hikashop Options">
				<field
					id="hikashopmodule"
					name="hikashopmodule"
					multiple="true"
					type="hikashopmodule"
					label="HikaShop"
					description="HikaShop options"
				/>
			</fieldset>
		</fields>
Which means that there is an option of the type hikashopmodule in the module. That is a custom type which doesn't exists in Joomla by default and as the XML says, you can find custom option types in the folder /components/com_hikashop/fields
So there, you can open the file hikashopmodule.php and you'll see that it's loading the file 'options' of the view 'modules' with this line:
$content = hikashop_getLayout($layout,'options',$params,$js,true);
And if you look for that view file via the menu Display>Views, you'll find that this view file contains all the options of a HikaShop content module.
Why not directly having the options in the XML ? Because doing it the way we do allows for much more flexibility for us. We can have our own design for the options tab, we can have advanced options with complex dependencies with other options (which wouldn't be possible with Joomla), third party extensions can add their own options dynamically to the view (like HikaMarket does), and the view can even be overridden by the marchants if necessary.

The following user(s) said Thank You: twscott

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

Time to create page: 0.058 seconds
Powered by Kunena Forum