Email product characteristics

  • Posts: 55
  • Thank you received: 0
10 years 6 months ago #193547

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.35
-- Browser(s) name and version -- : Crome last version

Good morning, I have included in the product characteristics of the custom fields that appear in the shopping cart when ordering, but I wish those fields ever burst even in the order confirmation email, administrator side, I do not understand programming, you can know how to make simple ?
Thank You

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #193552

Hi,

Sorry but I don't think I have understood correctly your needs.
You want to display the product custom field values in the order_admin_notification email ?

If it is, so via the menu System > Emails, edit the desired email and you can add a line like:

{LINEVAR:product.customfield_name}
After another linevar tag.

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

  • Posts: 55
  • Thank you received: 0
10 years 6 months ago #193863

Is the problem is just that! but my knowledge of computers will not let me change the email with so little info, I do not find any email in the line called "linevar" it would be possible to give info foolproof? thank you

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

  • Posts: 12953
  • Thank you received: 1778
10 years 6 months ago #193874

Hello,
Can you tell me which email do you want to change and how ? We'll need more information about what do you want to help you.
Note that you can edit your emails code via "Hikashop->System->Emails".

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

  • Posts: 55
  • Thank you received: 0
10 years 6 months ago #194040

Should I put the custom fields in the order confirmation email administration side, attach screenshots of the pages containing these data.
Screen 1 features present at time of order
Screen 2 features not found in the order confirmation email administrator side

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #195200

Hi,

In the HTML part of the email edition screen (System > Emails) you can add tags like:

{LINEVAR:product.custom_field1}
Where "custom_field1" needs to be replaced by the column name of the desired custom field.

You have to add these tags just before or after the other "linevar" tags.

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

  • Posts: 55
  • Thank you received: 0
10 years 5 months ago #195251

I have included the value of the column that interests me but I do not gives the required value in the mail value is NUMERO_PETTORALE_1

<!--{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.NUMERO_PETTORALE_1}
{LINEVAR:PRODUCT_DOWNLOAD}
{LINEVAR:PRODUCT_DETAILS}
</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>

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 5 months ago #195274

Hi,

The tags are case sensitive.
When we write "PRODUCT_IMG" in upper case, it's mostly because it's some kind of "constant" that the "preload" has generated.
When you using

{LINEVAR:product.NUMERO_PETTORALE_1}
you have to be sure that "product" is in lowercase and that your custom field namekey is right "NUMERO_PETTORALE_1" ; if the custom field is in lowercase, you should write it in lowercase too.

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: 55
  • Thank you received: 0
10 years 5 months ago #195351

I tried all versions below in either upper or lower case, but no I was successful. I enclose also the image of the DB.
{LINEVAR:PRODUCT.NUMERO_PETTORALE_1}
{LINEVAR:PRODUCT_NUMERO_PETTORALE_1}
{LINEVAR:product_numero_pettorale_1}
{LINEVAR:product.numero_pettorale_1}
{LINEVAR:numero_pettorale_1}
{LINEVAR:NUMERO_PETTORALE_1}
{LINEVAR:product.NUMERO_PETTORALE_1}
{LINEVAR:product_NUMERO_PETTORALE_1}
{LINEVAR:PRODUCT_numero_pettorale_1}
Then I saw that in the DB columns are all in lower case, because in the html code of the email are listed in all capital letters?

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 5 months ago #195407

Hi,

As explained in my previous message ; because your custom field is "numero_pettorale_1", the right one is

{LINEVAR:product.numero_pettorale_1}

BUT !
The product which have the value of the custom field is the main product ; and in your cart you have a variant.
Which means that "product.numero_pettorale_1" will display the value from the variant product and not the main product.
That is why you do not see any content.

So you should modify the "preload" part of the email in order to add the support of the main product.
$product = @$productClass->all_products[$item->product_id];
$parentproduct = @$productClass->all_products[$product ->product_parent_id];

$cartProduct = array(
	'PRODUCT_CODE' => $item->order_product_code,
	'PRODUCT_QUANTITY' => $item->order_product_quantity,
	'PRODUCT_IMG' => '',
	'item' => $item,
	'product' => $product,
	'parentproduct' => $parentproduct ,
);
And then you should be able to use
{LINEVAR:parentproduct.numero_pettorale_1}
to read the value from the parent product and not from the variant product.

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: 55
  • Thank you received: 0
10 years 5 months ago #195519

I did what you said but still I am not the required value.
I attach screenshots of the changes, maybe something wrong

Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
10 years 5 months ago #195522

Hi,

In the code given by Jerome a space has been introduced by mistake, so please change:

$parentproduct = @$productClass->all_products[$product ->product_parent_id];
To:
$parentproduct = @$productClass->all_products[$product->product_parent_id];

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

  • Posts: 55
  • Thank you received: 0
10 years 5 months ago #195671

I tried to edit the file you sent me the email yesterday, but olrte does not work I can not access the folders piùad image thumbnails hikahop. I state that I have all the privileges of writing enabled, the site now gives me all the photos of white, cossa can I do? if I send you the login information you can check?

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 5 months ago #195688

Hi,

This thread is about adding a custom field value in emails. Not about images or thumbnails so I don't see what you're talking about.

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

  • Posts: 55
  • Thank you received: 0
10 years 5 months ago #196390

That had happened at the exact moment that the changes except the server stopped working, and I asked if it was possible that there was a coincidence, but the problem is solved server. Returning to the problem custom field in the mail, I made all the changes that you have told me, but I can not see the data that I need in the mail. I attach screenshots of the codes, maybe something wrong. Alternatively, if you do your login you can see for themselves?

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

  • Posts: 55
  • Thank you received: 0
10 years 5 months ago #196391

file

Attachments:

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 5 months ago #196879

Hi,

Can you please send us some credentials to your backend ?
So we will be able to see your modification directly and test the email directly in the backend.
You can use the "contact us" form (with a link to that forum thread) to send us such kind of private information.

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: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 5 months ago #198139

Hi,

For a weird reason, the parent product wasn't loaded with the call of: $productClass->getProducts
I'm still investigating in HikaShop in order to fix that issue in the product class.
So, in the email, I forced the loading of the parent product using

$parentproduct = null;
if(!empty($product->product_parent_id))
  $parentproduct = $productClass->get((int)$product->product_parent_id;
and now the custom field of the parent product is displayed in the email.
I modified the email "order notification" so you can test it easily using the "email" button in the HikaShop backend (while editing an order).
I used the test order with id 145 for my tests.

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.
The following user(s) said Thank You: gioferrario@gmail.com

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

  • Posts: 55
  • Thank you received: 0
10 years 5 months ago #198329

OK perfect !! Sorry but I did not understand what you mean by order tests used id 145.

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

  • Posts: 26274
  • Thank you received: 4045
  • MODERATOR
10 years 5 months ago #198333

Hi,

In the backend, I listed your orders and I opened the order 145 (I do not remember the order number, just the order id).
Thanks to that email, I was able to test the email content using the "email" button.
The order with id 145 have the corresponding product (with the variant) needed for the test.

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.

Time to create page: 0.086 seconds
Powered by Kunena Forum