How to put a space between QTY and PRICE in emails

  • Posts: 12
  • Thank you received: 0
8 years 2 months ago #248545

-- HikaShop version -- : HikaShop Business 2.6.3 [1605112330]
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.4.45

Is there a way to put a space between the product count ordered and the cost of the product?

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 2 months ago #248557

Hi,

Regarding your screenshot, it looks like the product name is really long so it make the first column very large.
Because that first column is very large, the other columns are as thin as possible that's why there is no space between their content.
The content is just an HTML table ; by editing the email you can see to force some width but if the content in the first column is still large, it won't help much.
So I will more suggest you to modify the email to truncate the content in the first column (or add some line breaks).

www.hikashop.com/support/documentation/i...p-email-listing.html
www.hikashop.com/support/documentation/i...shop-email-form.html
( Note that the email edition is only available in HikaShop Business )

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: 12
  • Thank you received: 0
8 years 2 months ago #248834

Thank you for your help. It's really useful.
Where in the order creation email code would you add few </br> to put a space between the QTY and PRICE ?

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

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 2 months ago #248837

Hi,

Actually, I wouldn't add any br.
I would simply add a line of CSS to the email HTML template so that the text after the : in the products name goes to the next line.
Such CSS should do the job:
.hikashop_product_variant_subname{ display: block; }

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

  • Posts: 12
  • Thank you received: 0
8 years 2 months ago #248913

I think this is the code you are talking about. Please show me.

HTML VERSION BELOW
<h1 style="color:#1c8faf !important;font-size:16px;font-weight:bold;border-bottom:1px solid #ddd;padding-top:10px;padding-bottom:10px;">
{TXT:SUMMARY_OF_YOUR_ORDER}
</h1>
<!--{START:VENDOR_LINE}-->
<!--{IF:VENDOR_CONTENT}-->{VAR:VENDOR_CONTENT}<!--{ENDIF:VENDOR_CONTENT}-->
<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:#1c8faf !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:#1c8faf !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:#1c8faf !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:#1c8faf !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}-->
{LINEVAR:PRODUCT_DOWNLOAD}
{LINEVAR:PRODUCT_DETAILS}
</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_QUANTITY}</td>
<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:right">{LINEVAR:PRODUCT_TOTAL}</td>
</tr>
<!--{END:PRODUCT_LINE}-->

TEXT VERSION BELOW
<?php echo JText::_('SUMMARY_OF_YOUR_ORDER');?>



<?php echo JText::_('CART_PRODUCT_NAME')."\t".JText::_('CART_PRODUCT_UNIT_PRICE')."\t".JText::_('CART_PRODUCT_QUANTITY')."\t".JText::_('HIKASHOP_TOTAL');?>

<?php
foreach($data->cart->products as $item){
$price = $item->order_product_price*$item->order_product_quantity;
echo strip_tags($item->order_product_name) . "\t" . $currencyHelper->format($item->order_product_price,$data->order_currency_id)."\t".$item->order_product_quantity."\t".$currencyHelper->format($price,$data->order_currency_id)."\n";
}

Last edit: 8 years 2 months ago by seanm.

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
8 years 2 months ago #248915

Hello,

You can add on your product name this Css property

white-space: normal
.
More precisely, in your HTML version, around line 90, replace this :
...
<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:left;color:#1c8faf !important;font-size:12px;font-weight:bold;">{TXT:PRODUCT_NAME}</td>
...
For this :
...
<td style="border-bottom:1px solid #ddd;padding-bottom:3px;text-align:left;color:#1c8faf !important;font-size:12px;font-weight:bold;white-space: normal">{TXT:PRODUCT_NAME}</td>
...

Hope that will solve your issue, and we are are awaiting news from you.

Regards

Last edit: 8 years 2 months ago by Philip.
The following user(s) said Thank You: seanm

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

Time to create page: 0.059 seconds
Powered by Kunena Forum