How to show a custom field in listing_img_title.php

  • Posts: 81
  • Thank you received: 2
8 years 4 months ago #260142

-- HikaShop version -- : 3.0.0
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0
-- Browser(s) name and version -- : Chrome

Hi
I'm confused - but then, what's new :-)

I've created a custom text field for products called "shortinfo"

I see that there is a section in this file called "product custom fields".
I would like the short decsription to appear there but I don't know how to deal with the code that's there:

	<!-- PRODUCT CUSTOM FIELDS -->

<?php
if(!empty($this->productFields)) {
	foreach($this->productFields as $fieldName => $oneExtraField) {
		if(empty($this->row->$fieldName) && (!isset($this->row->$fieldName) || $this->row->$fieldName !== '0'))
			continue;

		if(!empty($oneExtraField->field_products)) {
			$field_products = is_string($oneExtraField->field_products) ? explode(',', trim($oneExtraField->field_products, ',')) : $oneExtraField->field_products;
			if(!in_array($this->row->product_id, $field_products))
				continue;
		}
?>
	<dl class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line">
		<dt class="hikashop_product_custom_name">
			<?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
		</dt>
		<dd class="hikashop_product_custom_value">
			<?php echo $this->fieldsClass->show($oneExtraField,$this->row->$fieldName); ?>
		</dd>
	</dl>
<?php
	}
}
?>

	<!-- EO PRODUCT CUSTOM FIELDS -->
Where would I place the field name so that the content is shown on the product listing pages?

Thanks for your help
Regards
David

Last edit: 8 years 4 months ago by Jerome. Reason: [quote] is not made for [code] !!

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

  • Posts: 26253
  • Thank you received: 4040
  • MODERATOR
8 years 4 months ago #260172

Hi,

Simply edit your product custom field in the HikaShop backend in order to see what you can do with the display of the custom field.
www.hikashop.com/support/documentation/1...shop-field-form.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 18
  • Thank you received: 0
  • Hikashop Business
8 years 4 months ago #260258

Aha! I had not spotted the setting for "Frontend Listing"!

Thanks - you made me look properly :-)

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

Time to create page: 0.065 seconds
Powered by Kunena Forum