Additional information of custom fields not added in e-mail to vendor.

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343762

-- HikaMarket version -- : 4.0.0
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.xx

Hello,
I opened this tread, because Jerome asked me in ticketnr.: #343221.

I tried the solution according to this toppic but ran in to some various things..
But this is the market mail we send out with modifications.
HTML version:

<?php
/**
 * @package    HikaMarket for Joomla!
 * @version    3.1.1
 * @author     Obsidev S.A.R.L.
 * @copyright  (C) 2011-2020 OBSIDEV. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php
$orderClass = hikamarket::get('class.order');
$first = reset($data->cart->products);
$vendorId = $orderClass->getVendorIdFromOrderProducts($first->order_product_id, $data->cart);
$vendorClass = hikamarket::get('class.vendor');
$vendor = $vendorClass->get($vendorId);?>
<style type="text/css">
body.hikashop_mail { background-color:#ffffff; color:#575757; }
.ReadMsgBody{width:100%;}
.ExternalClass{width:100%;}
div, p, a, li, td {-webkit-text-size-adjust:none;}
@media (min-width:600px){
	#hikamarket_mail {width:600px !important;margin:auto !important;}
	.pict img {max-width:500px !important;height:auto !important;}
}
@media (max-width:330px){
	#hikamarket_mail {width:300px !important; margin:auto !important;}
	table[class=w600], td[class=w600], table[class=w598], td[class=w598], table[class=w500], td[class=w500], img[class="w600"]{width:100% !important;}
	td[class="w49"] { width: 10px !important;}
	.pict img {max-width:278px; height:auto !important;}
}
@media (min-width:331px) and (max-width:480px){
	#hikamarket_mail {width:450px !important; margin:auto !important;}
	table[class=w600], td[class=w600], table[class=w598], td[class=w598], table[class=w500], td[class=w500], img[class="w600"]{width:100% !important;}
	td[class="w49"] { width: 20px !important;}
	.pict img {max-width:408px;  height:auto !important;}
}
h1{color:#1c8faf;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd; padding-bottom:10px;}
h2{color:#89a9c1;font-size:14px;font-weight:bold;margin-top:20px;margin-bottom:5px;padding-bottom:4px;}
a:visited{cursor:pointer;color:#2d9cbb;text-decoration:none;border:none;}
</style>

<div id="hikamarket_mail" style="font-family:Arial, Helvetica,sans-serif;font-size:12px;line-height:18px;width:100%;background-color:#ffffff;padding-bottom:20px;color:#5b5b5b;">
	<div class="hikashop_online" style="font-family:Arial, Helvetica,sans-serif;font-size:11px;line-height:18px;color:#6a5c6b;text-decoration:none;margin:10px;text-align:center;">
		<a style="cursor:pointer;color:#2d9cbb;text-decoration:none;border:none;" href="{VAR:URL}">
			<span class="hikashop_online" style="color:#6a5c6b;text-decoration:none;font-size:11px;margin-top:10px;margin-bottom:10px;text-align:center;">
				{TXT:MAIL_HEADER}
			</span>
		</a>
	</div>
	<table class="w600" style="font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;margin:auto;background-color:#ffffff;" border="0" cellspacing="0" cellpadding="0" width="600" align="center">
		<tr style="line-height: 0px;">
			<td class="w600" style="line-height:0px" width="600" valign="bottom">
				
			</td>
		</tr>
		<tr>
			<td class="w600" style="" width="600" align="center">
				<table class="w600" border="0" cellspacing="0" cellpadding="0" width="600" style="margin:0px;font-family: Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;">
					<tr>
						<td class="w20" width="20"></td>
						<td class="w560 pict" style="text-align:center; color:#575757" width="560">
							<div id="title" style="font-family: Arial, Helvetica, sans-serif;font-size:12px;line-height:18px; text-align:center;">
<img src="images/systeem/HalalTime_logo.png" border="0" alt="" style="float:center;margin-right:4px;margin-bottom:15px;text-align:center;"/>
							</div>
						</td>
						<td class="w20" width="20"></td>
					</tr>
					<tr>
						<td class="w20" width="20"></td>
						<td style="border:0px solid #adadad;background-color:#ffffff;">
							<div class="w550" width="550" id="content" style="font-family: Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;margin-left:5px;margin-right:5px;">
	<h2 style="color:#000000 !important;font-size:20px;font-weight:bold;padding-top:10px; padding-bottom:10px;border: 2px solid rgb(227, 30, 36);text-align:center;">
	{TXT:ORDER_CREATED}
</h2>

<!--{IF:acl.address}-->
<h1 style="color:#000000 !important;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd;padding-top:10px;padding-bottom:10px;">
	{TXT:SALE_CUSTOMER}
</h1>

<table class="w550" border="0" cellspacing="0" cellpadding="0" width="550" style="margin-top:10px;font-family: Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;">
	<tr>
<!--{IF:acl.billingaddress}-->
		<td style="color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:BILLING_ADDRESS}</td>
<!--{ENDIF:acl.billingaddress}-->
<!--{IF:acl.shippingaddress}-->
		<td style="color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:SHIPPING_ADDRESS}</td>
<!--{ENDIF:acl.shippingaddress}-->
	</tr>
	<tr>
<!--{IF:acl.billingaddress}-->
		<td>{VAR:shipping_address.address_firstname}<br>
{VAR:shipping_address.address_street}<br>
{VAR:shipping_address.address_post_code}
{VAR:shipping_address.address_city}<br>{VAR:shipping_address.address_country}<br>
Tel.:{VAR:shipping_address.address_telephone}</td>
<!--{ENDIF:acl.billingaddress}-->
<!--{IF:acl.shippingaddress}-->
		<td></td>
<!--{ENDIF:acl.shippingaddress}-->
	</tr>
</table>
<!--{ENDIF:acl.address}-->

<h1 style="color:#000000 !important;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd;padding-top:10px;padding-bottom:10px;">
	{TXT:SUMMARY_OF_YOUR_SALE}
</h1>

<table class="w550" border="0" cellspacing="0" cellpadding="0" width="550" style="margin-top:10px;margin-bottom:10px;font-family: Arial, Helvetica, sans-serif;font-size:12px;line-height:18px;">
	<tr>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:left;color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:PRODUCT_NAME}</td>
		{TXT:CUSTOMFIELD_NAME}
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right;color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:PRODUCT_PRICE}</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right;color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:PRODUCT_QUANTITY}</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right;color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:PRODUCT_TOTAL}</td>
	</tr>
<!--{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}-->
		</td>
		{LINEVAR:CUSTOMFIELD_VALUE}
		<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_QUANTIY}</td>
		<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">{LINEVAR:PRODUCT_TOTAL}</td>
	</tr>
<!--{END:PRODUCT_LINE}-->
<!--{START:ORDER_FOOTER}-->
	<tr>
		<td colspan="{TXT:FOOTER_COLSPAN}" style="text-align:right;color:#000000 !important;font-size:12px;font-weight:bold;">{LINEVAR:NAME}</td>
		<td style="text-align:right">{LINEVAR:VALUE}</td>
	</tr>
<!--{END:ORDER_FOOTER}-->
</table>
<!--{IF:PAYMENT}-->
<p>
	<span style="color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:VENDOR_NAME} :</span> {TXT:HI_VENDOR}<br/> 
	<span style="color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:PAYMENT_METHOD} :</span> {VAR:PAYMENT}<br/>

<!--{ENDIF:PAYMENT}-->
<!--{IF:SHIPPING}-->

	<span style="color:#000000 !important;font-size:12px;font-weight:bold;">{TXT:HIKASHOP_SHIPPING_METHOD} :</span> {VAR:SHIPPING}<br>
  <span style="color:#000000 !important;font-size:10px;font-weight:normal;">{TXT:ASTRIX}</span>
</p>
<!--{ENDIF:SHIPPING}-->
<!--{IF:ORDER_SUMMARY}-->
<h1 style="color:#000000 !important;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd;padding-top:10px;padding-bottom:10px;">
	{TXT:ADDITIONAL_INFORMATION}
</h1>
<p style="border-bottom:1px solid #ddd;padding-bottom:10px;">
	{VAR:ORDER_SUMMARY}
</p>
<!--{ENDIF:ORDER_SUMMARY}-->
<p>
    {TXT:LETOP}
	{TXT:SALE_END_MESSAGE}
</p>
							</div>
						</td>
						<td class="w20" width="20"></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr style="line-height: 0px;">
			<td class="w600" style="line-height:0px" width="600" valign="top">
				
			</td>
		</tr>
	</table>
</div>
PRELOAD VERSION
<?php
/**
 * @package    HikaMarket for Joomla!
 * @version    3.1.1
 * @author     Obsidev S.A.R.L.
 * @copyright  (C) 2011-2020 OBSIDEV. All rights reserved.
 * @license    GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?><?php

/* Preload code content */
But when i put it back to original then also the datepicker from the date picker will not be shown on the custom fields e-mail.

Please help.

Thanks
Mark

Last edit: 2 years 3 months ago by Jerome. Reason: [code] tag is really nice

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
2 years 3 months ago #343764

Hello,

In your HTML email you have some PHP content.

First, in your HTML, you should not have PHP content but only HTML content with tags.
The PHP should be in the preload part, where all the PHP is already.

Second, the nature of your issue is

0 - Call to private method hikamarketOrderClass::getVendorIdFromOrderProducts() from context 'hikashopMailClass'

And in the first lines of your HTML email we can see
$vendorId = $orderClass->getVendorIdFromOrderProducts($first->order_product_id, $data->cart);
That PHP code should not be called and, for what we can see of the rest of your HTML content, the "$vendor" is not used.
Thus, that code is doing nothing for your email (except generating the fatal error).

But when i put it back to original then also the datepicker from the date picker will not be shown on the custom fields e-mail.

When you put it back to original.. What exactly ? All emails ? Which files ?
The datepicker is not shown in the e-mail ? Can you please be more precise on what ?
You should not have an interactive datepicker in an email ; you must have some fixed content (thus a date).

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: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343797

Hello,

The php content i put in the html was to get vendor name etc.. into the output of the email. Your college Nicolas mentioned us to do this to get the info in the mail.
What i mean when i put it back is that when i delete all email overrides and it is like the original hikashop code then the datepicker is not working and is not in the email visible.

Regards,
Mark

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
2 years 3 months ago #343803

Hello,

Nicolas gave you a tip in order to retrieve a vendor, but by using a function which was internal and placed "private" afterwards.
But regarding the code of your email, I do think that some part of the code was missing since the vendor information was not used in the rest of the email.
Nevertheless, such kind of PHP code must be placed in the "preload" part where you can already have access to some specific HikaMarket details without the need of calling that function.

Regarding the datepicker, I'm afraid that I'm still unable to understand your issue.

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: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343828

Jerome,

Regarding the datepicker issue.
The given date is NOT displayed in the email to vendor.
Why is this not in the email and while the other custom fields are displayed correctly.

Regards,

Mark

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

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
2 years 3 months ago #343833

Hello,

The registration process that we have now is:
1. customer fills in registration form
2. customer receives email from hikashop to verify registration
3. admin receives mail from Joomla with username and email from customer with link to activate account. *
4. customer/user receives email notification that his/her account is activated

* At point 3 we want the address fields (and custom field) from hikashop to show in the mail.

If we use the hikashop admin mail, the admin recieves immediately the admin notification email before customer/user verify's its registration. This is not correct.

Please give us advise how to make this registration process properly.

Regards,
Mark

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
2 years 3 months ago #343837

Hello,

That part is handle by HikaShop and not HikaMarket.
Best would be to open a thread in the HikaShop section of the forum.
But I'm afraid that it would require some custom/specific development because the registration is not related to the checkout (so the cart) and the data you want to display is in the cart.

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.

Moderators: Obsidev
Time to create page: 0.068 seconds
Powered by Kunena Forum