Modifying output from Product Tag plugin

  • Posts: 250
  • Thank you received: 7
6 years 4 months ago #283403

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.8.2
-- PHP version -- : 7.1.5

I am using the product tag plugin to insert product details in content. It works fine but doesn't have the option to include the product SKU, where would I need to look to add this to the display?

While I'm at it I would ideally like to add the product category and a custom field from the category ( in this case an image additional to the product image ). I'm not asking for a complete solution just need to know where to look to modify this.

Many thanks,

Ian

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #283411

Hi,

The best is to copy the file plugins/system/hikashopproductinsert/hikashopproductinsert_view.php to templates/YOUR_TEMPLATE/system/hikashopproductinsert_view.php and modify it there.

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

  • Posts: 70
  • Thank you received: 3
6 years 4 months ago #284231

I've tried adding the following to hikashopproductinsert_view.php:

<?php
		}

		if($this->code == 1) {
?>
			<!-- PRODUCT CODE -->
			<span class="hikashop_product_code"><?php
				echo $product->product_code;
			?></span>
			<!-- EO PRODUCT CODE -->

I assume it is not working because product_code is not part of the array.

How can I correct this?

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

  • Posts: 81515
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #284264

Hi,

No, product_code is in $product. Your issue is probably that $this->code doesn't exist.
Why have that if ?
I would recommend to add just:

			<span class="hikashop_product_code"><?php
				echo $product->product_code;
			?></span>

The following user(s) said Thank You: virusys

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

  • Posts: 70
  • Thank you received: 3
6 years 4 months ago #284352

Thank you very much - it is working now.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum