Affiliate payment email problem with display custom fields

  • Posts: 59
  • Thank you received: 9
3 years 5 days ago #327010

Hi Hikateam,

I hope you can help me because I'm about to pull my hair out on this problem.

On three particular products I have two custom fields; 1 textfield, en 1 dropdown field
Product 1 is custom dropdown field 1, product 2 is custom dropdown field 2, and product 3 is custom dropdown field 3

This message contains confidential information

Setting up affiliate was pretty simple and works like a charm.
The problem is that when I pay the affiliate all three of these custom field labels are showing in the payment email.
I have tried every email settings of this particular fields but either the custom fields are not displayed in the affiliate payment email but than also not in the order notification emails.
Strange thing is that it only happens with these three custom fields. The text field who is assigned to all three products also is not visible in the affiliate payment email while every email setting of that field is set to YES.

Also the fields are not only displaying when purchasing one of this three products but also when other products are ordered who have no custom fields at all.

I have already deleted all my email customizations but that didn't help either.
How can I get rid of this three custom fields but keep them in the customer and admin order creation email?

Also I would like very much to know where to place the code in the preload part of the email as shown in this topic:

I think it's strange to have the same email and subject as the customer "Confirmed" email. ("Your order is Confirmed") and "Thank you for your purchase".

Please help me because setting up affiliate cost me no more than five minutes and meanwhile I've been struggling with this email problem for hours.

Thanks in advance!

Last edit: 3 years 5 days ago by HSD.

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

  • Posts: 80522
  • Thank you received: 12834
3 years 4 days ago #327067


I see 3 possibilities for this to happen:
- You have a mass action to auto fill this value and this leads to the value being filled for other products than the one the field is assigned to.
- You have modified the default value of the column corresponding to the custom field in either the table hikashop_cart_product or the table hikashop_order_product so that the default value is not "null" anymore and thus the custom field is filled for products who don't have that custom field assigned to them
- You have a plugin which fills that custom field for some reason.
In any case, I don't see how to be able to get that issue without one of these.

One solution you can try is to disable these fields, and create new fields for them. Since they'll have a new column name, all three cases won't be able to interfere and thus they will work properly.

2. If you want to change the subject of the email dynamically, it doesn't matter where you place your code in the email.
However, I would recommend after the load of the order in $data->cart
That way, you can use such code to change the subject:

if($data->cart->order_type != 'sale')
 $data->mail->subject = 'Subject for affiliate payouts';

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

Time to create page: 0.059 seconds
Powered by Kunena Forum