Specifications in checkout and emails

  • Posts: 43
  • Thank you received: 0
9 years 10 months ago #218779

-- Joomla version -- : 3.4.5

Hi,

I was hoping you could just give me some quick help on what the correct code is to make the product specifications appear with the product in both the checkout and in the email that gets sent out.

I've looked at the tutorial http://www.hikashop.com/support/support/documentation/153-customize-the-display.html and understand what I need to do but just wanted to check with you what the correct code would be.

Thanks.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #218836

Hi,

The view to edit to display the informations in the cart of the checkout is "checkout / cart".
And for the emails, you can edit them directly via our menu System > Emails.

So the specifications on the product page are the product dimensions and custom product fields.
To display that you can use this kind of code:

echo $this->row->product_width;
echo $this->row->product_height;
echo $this->row->product_length;
echo $this->row->customfieldname;

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

  • Posts: 43
  • Thank you received: 0
9 years 10 months ago #218917

I've given that a try but with no luck.

I tried copying the code from the other parts of the site where the specifications do appear but with no luck.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #218922

Hi,

My bad, in the view "checkout / cart" the code to use is only:

echo $row->product_width;
echo $row->product_height;
echo $row->product_length;
echo $row->customfieldname;

And must be placed in the foreach listing the products, and of course the "customfieldname" must be replaced by your custom product field column name ;)

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

  • Posts: 43
  • Thank you received: 0
9 years 10 months ago #219114

Thanks for your help, that worked!

The only thing is that I'm still having a little trouble getting it to work in the emails.

I understand that I need to add in a "LINEVAR" in the HTML version to call up the <?php echo $row->packincludes; ?> code that is in the Preload version but I can't seem to get it working. could you please have a look at my code and let me know if it's correct?

HTML Version

<!--{START:PRODUCT_LINE}-->
	<tr>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;">
			{LINEVAR:PRODUCT_IMG}
			{LINEVAR:PRODUCT_NAME}<!--{IF:ORDER_PRODUCT_CODE}--> {LINEVAR:PRODUCT_CODE}<!--{ENDIF:ORDER_PRODUCT_CODE}-->
			{LINEVAR:PRODUCT_DOWNLOAD}
			{LINEVAR:PRODUCT_DETAILS}
          {LINEVAR:PRODUCT_SPECS}
		</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">{LINEVAR:PRODUCT_PRICE}</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">{LINEVAR:PRODUCT_QUANTITY}</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">{LINEVAR:PRODUCT_TOTAL}</td>
	</tr>
<!--{END:PRODUCT_LINE}-->

Preload Version
$cartProduct['PRODUCT_SPECS'] = $row->packincludes;
		$cartProduct['PRODUCT_PRICE'] = $unit_price;
		$cartProduct['PRODUCT_TOTAL'] = $total_price;

		$cartProducts[] = $cartProduct;

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219115

Hi,

If you look at the code in the preload before these lines, it's not $row that you need to use but $item instead.

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

  • Posts: 43
  • Thank you received: 0
9 years 10 months ago #219210

I've made the changes as you mentioned, but I still can't get it to work.

This is the code I'm using for the preloaded section, but I can't figure out what I'm doing wrong. Any Ideas?

$cartProduct = array(
			'PRODUCT_CODE' => $item->order_product_code,
			'PRODUCT_QUANTITY' => $item->order_product_quantity,
			'PRODUCT_IMG' => '',
			'item' => $item,
			'product' => $product,
			'PRODUCT_SPECS' => $item->packincludes,
		);

$cartProduct['PRODUCT_SPECS'] = $item->packincludes;

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

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 10 months ago #219239

Hi,

So it must be a problem with the custom field.
I thought it was a custom item field.
But maybe you're talking about a custom product field ?
In that case, you need to load the product data like that:

$class = hikashop_get('class.product');
$product = $class->get($item->product_id);
$cartProduct['PRODUCT_SPECS'] = $product->packincludes;

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

  • Posts: 43
  • Thank you received: 0
9 years 10 months ago #219312

That worked perfectly!

thank you so much for your help :)

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

Time to create page: 0.074 seconds
Powered by Kunena Forum