PDF Plugin - Userpoints

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
8 years 1 month ago #251340

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6

Hi,

I use the Attachinvoice PDF Plugin and Hikashop Userpoints.
When someone pay with userpoints you see this in the backend invoice.
The userpoints don't appear on the PDF invoice.
Is it possible to add it to the plugin or guide us how to add it.

Besides this i would like to show the total collected userpoints on the invoice, is this possible?

Thank you!

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 1 month ago #251373

Hi,

The PDF invoice does display the user points used for the payment like in the backend invoice on my end.
It's done thanks to the code:

if(!empty($order->additional)) {
			$exclude_additionnal = explode(',', $config->get('order_additional_hide', ''));
			foreach($order->additional as $additional) {
				if(in_array(@$additional->name, $exclude_additionnal)) continue;
				echo '<tr><td colspan="3" class="newarea">'. JText::_($additional->order_product_name).'</td><td  class="price">';
				if(!empty($additional->order_product_price) || empty($additionaltionnal->order_product_options)) {
					if($config->get('price_with_tax')){
						echo $currencyHelper->format($additional->order_product_price+@$additional->order_product_tax, $order->order_currency_id);
					}else{
						echo $currencyHelper->format($additional->order_product_price, $order->order_currency_id);
					}
				} else {
					echo $additional->order_product_options;
				}
				echo '</td></tr>';
			}
		}
in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php
So make sure that you have that code in your PDF invoice file. If you do then either we're talking about something else or you're in a particular case where it's not working properly. So please provide a screenshot of the PDF invoice and of the backend invoice so that we can see the difference.

Regarding the collected amount of points, you should be able to find them in the variable $order->order_payment_params->userpoints->earn_points in that file. so you could just echo it there.

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

  • Posts: 206
  • Thank you received: 10
  • Hikashop Multisite
8 years 1 month ago #251802

I checked it and the code is indeed in the invoice.php

hereby the screenshots


Attachments:

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 1 month ago #251895

Hi,

I'm not able to reproduce the problem. Do you have it displaying properly if you deactivate the PDF plugin ?
Also, It seems that you customized the invoice.php
Did you make an override of the file ? In that case, you would need to look for the code of my previous message in the override invoice.php file and not the default one.

If that doesn't help either, then we'll have to have a FTP and backend access in order to look deeper into it.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum