- Posts: 515
- Thank you received: 22
pdf attach invoice layout problem
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
5 years 8 months ago #327970
by jouwnaambord.nl
pdf attach invoice layout problem was created by jouwnaambord.nl
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4
Hi,
I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the "old" plugin I didn't have that problem. How can I solve this?
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4
Hi,
I just purchased the latest attach pdf invoice plugin. For some products (or options) the textline is longer. This breaks the pdf layout, see screenshot. In the "old" plugin I didn't have that problem. How can I solve this?
Please Log in or Create an account to join the conversation.
5 years 8 months ago #327974
by nicolas
Replied by nicolas on topic pdf attach invoice layout problem
Hi,
From what I can see, the issue comes from the name of the option which is too long.
There is already code to avoid that for the product name, but there is indeed no code to handle that for options.
However, that was never the case, so you must have had the same issue before but never noticed.
To fix that, change the code:
to:
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php
From what I can see, the issue comes from the name of the option which is too long.
There is already code to avoid that for the product name, but there is indeed no code to handle that for options.
However, that was never the case, so you must have had the same issue before but never noticed.
To fix that, change the code:
Code:
echo $optionElement->order_product_name;
if($optionElement->order_product_price>0 && !$this->shipping_invoice){
if($config->get('price_with_tax')){
echo ' ( + '.$currencyHelper->format($optionElement->order_product_price+$optionElement->order_product_tax,$order->order_currency_id).' )';
}else{
echo ' ( + '.$currencyHelper->format($optionElement->order_product_price,$order->order_currency_id).' )';
}
}
Code:
$option_name = $optionElement->order_product_name;
if($optionElement->order_product_price>0 && !$this->shipping_invoice){
if($config->get('price_with_tax')){
$option_name .= ' ( + '.$currencyHelper->format($optionElement->order_product_price+$optionElement->order_product_tax,$order->order_currency_id).' )';
}else{
$option_name .= ' ( + '.$currencyHelper->format($optionElement->order_product_price,$order->order_currency_id).' )';
}
}
echo '<p>'.implode('<br/>', $this->str_split_unicode(strip_tags($option_name),50));
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
5 years 8 months ago #327987
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic pdf attach invoice layout problem
Hi Nicolas,
Thanks for your solution. There must be some small mistake in the code, after changing I get the errormessage: "1 Tags are closed in a wrong order for [td]"
Thanks for your solution. There must be some small mistake in the code, after changing I get the errormessage: "1 Tags are closed in a wrong order for [td]"
Please Log in or Create an account to join the conversation.
5 years 8 months ago #327988
by nicolas
Replied by nicolas on topic pdf attach invoice layout problem
Hi,
Ah yes, the line :
echo '<p>'.implode('<br/>', $this->str_split_unicode(strip_tags($option_name),50));
should be:
echo '<p>'.implode('<br/>', $this->str_split_unicode(strip_tags($option_name),50)).'</p>';
Ah yes, the line :
echo '<p>'.implode('<br/>', $this->str_split_unicode(strip_tags($option_name),50));
should be:
echo '<p>'.implode('<br/>', $this->str_split_unicode(strip_tags($option_name),50)).'</p>';
The following user(s) said Thank You: jouwnaambord.nl
Please Log in or Create an account to join the conversation.
- jouwnaambord.nl
-
Topic Author
- Offline
Less
More
- Posts: 515
- Thank you received: 22
5 years 8 months ago #328032
by jouwnaambord.nl
Replied by jouwnaambord.nl on topic pdf attach invoice layout problem
Yes, thank you, this works fine!
Please Log in or Create an account to join the conversation.
Time to create page: 0.195 seconds