Custom Field Duplicated

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
3 years 2 months ago #330036

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.24

Hi

I added some custom code to user / cpanel_orders.php ref this post

<p>
              <b>ETA:</b> <?php $class = hikashop_get('class.product');
$data = $class->get($product->product_id);
echo $data->eta; ?>
              </p>

This works perfectly but it is displaying the information twice as per screenhot. Is there a way so this only displays once.

Thanks

David

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
3 years 2 months ago #330044

Hi,

There is no text "ETA:" in your screenshot.
So as far as I understand, your code is not run at all or you didn't provide the correct screenshot.
Also, it would help that you tell us where you added your code in the cpnal_orders.php file

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

  • Posts: 440
  • Thank you received: 20
  • Hikashop Essential
3 years 2 months ago #330074

Hi

Sorry I attached the wrong screenshot.

It is a product custom field

This message contains confidential information
which displays on the product page.
<p class="hika_cpanel_product_price">
					<span class="hika_cpanel_product_price_quantity">
						<?php echo  $product->order_product_quantity; ?>
					</span>
					<span class="hika_cpanel_product_price_times"> x
					</span>
					<span class="hika_cpanel_product_price_amount">
						<?php echo  $this->currencyClass->format( $product->order_product_price + $product->order_product_tax, $order->order_currency_id ); ?> 
					</span>
					
				</p>
<?php
		if(!empty($product->extraData))
			echo '<p class="hikashop_order_product_extra">' . (is_string($product->extraData) ? $product->extraData : implode('<br/>', $product->extraData)) . '</p>';
?><br /><p>
              <b>ETA:</b> <?php $class = hikashop_get('class.product');
$data = $class->get($product->product_id);
echo $data->eta; ?>
              </p>
				<div style="clear:both;"></div>

The code was added at around line 199.

Thanks

David

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
3 years 2 months ago #330077

Hi,

I don't think that the code you provided corresponds to the display on your screenshot.
You've added the code in the area displaying the listing of products of cpanel_orders.
But your screenshot doesn't contain that area. It only contains the "additional information" area which normally appear on the order / show.php view file.
So I can only think that you've added that code at another place, or again, the screenshot is not the correct one.
I suppose that's also why you're getting confused as to why it doesn't do what you want.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum