lightbox popup on pdf download....

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #165803


-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.0
-- PHP version -- : 5.4
-- Browser(s) name and version -- : firefox & chrome

Hi Guys,

I bought today the PDF extension to send the PDF invoice with email. I also set the parameters to override front end invoice print. Great. The invoice downloads ok but for some reason it triggers the lightbox window which is then empty. I would either
a) like the window not to popup
b) like to be able to add a message to the popup saying, 'your invoice (in this case it is a voucher and the order number is used as the code) has been downloaded'

Do you know why the window would still show even though the pdf should override?

Thanks

Alex

Attachments:

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #165809

Also i would like to know if i may how to add the product description the invoice, I used this on the email and it works but doesn't output the description on the pdf. Nothing at all shows.

<table width="100%" border="0">
  <tr>
             <td>         <h1 style="background-color:#333;font-size:14px;width:560px;padding:5px; text-align:center; color:#fff; font-family:Arial, Helvetica, sans-serif;">FULL DETAILS / T&C's / HOW TO REDEEM</h1>
        
               <p style="font-size:10px;"><br/>
  
<?php
$productClass = hikashop_get('class.product');
foreach($data->cart->products as $item){
   $product = $productClass->get($item->product_id);
  echo $item->order_product_name.'<strong></strong>';
   echo $product->product_description.'<br/><hr><br/>';

} ?>
                 </p>
               
               </td>
           </tr>
         </table>

Thanks

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #165984

Hi,

For your first issue, please add the code:

if(empty($_GET['redirect_popup'])){
				$url = hikashop_currentURL();
				if(strpos($url,'?')){
					$url .='&';
				}else{
					$url .='?';
				}
				$js = 'parent.window.location.href=\''.$url.'redirect_popup=1\';setTimeout(function(){window.top.hikashop.closeBox();},200);';
				echo '<html><head><script type="text/javascript">'.$js.'</script></head><body></body></html>';
				exit;
			}
after the line:
if($frontend && $ctrl == 'order' && JRequest::getString('task') == 'invoice' && !$app->isAdmin()){
in the file plugins/hikashop/attachinvoice/attachinvoice.php and that should fix it.

For your second question, you use $data->cart->products but this variable is actually called $order->products in the invoice PDF. Change it and it should work.

The following user(s) said Thank You: Dibben

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #165994

Hi Nicolas,
Thanks for that, your help is great, I would like to know if there is a way i can change the file name of the pdf? So it is called voucher.pdf rather than invoice.pdf when downloaded, otherwise every little detail makes it confusing for people.
Kind regards

Alex

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 3 months ago #165997

Hi,

The filename is based on a translation. The key is : "INVOICE".
So you can create an override of this translation to change the name of the generated file.
Otherwise, you can edit the plugin and change the code

JText::_('INVOICE')
in order to use another translation key.

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.
The following user(s) said Thank You: Dibben

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #166014

Thanks Jerome, I just saw that on line 163 of attachinvoice.php so I have now updated, kind regards.

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #166406

Hi Guys,

A new error has occured with this plugin, I don't believe I have changed anything but it is no longer attaching any pdf and when i click on download invoice it now does this:

I have no idea what is causing this as i haven't modified any files as far as i am aware..

Thanks

Alex

Attachments:

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #166410

Ok so it looks like this only happens on products that have variant options... if that helps? Do you think it might relate to the code i used to output the description?

<table width="100%" border="0">
  <tr>
             <td>         <h1 style="background-color:#333;font-size:14px;padding:5px; text-align:center; color:#fff; font-family:Arial, Helvetica, sans-serif;">Full Details / T&C's / How to Redeem...</h1>
        
               <p style="font-size:10px;"><br/>
  
<?php
$productClass = hikashop_get('class.product');
foreach($order->products as $item){
   $product = $productClass->get($item->product_id);
  echo $item->order_product_name.'<strong></strong>';
   echo $product->product_description.'<br/><hr><br/>';

} ?>
                 </p>
               
               </td>
           </tr>
         </table>

Thanks

Alex

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #166426

Hi,

It's indeed strange that it happens only for orders with variants. But I don't see really what could be the problem.
I see that you have the error number "4" which is apparently a specific error of the HTML2PDF library we're using for when the HTML is not valid: "HTML code invalid, the tags are not closed in an orderly fashion."
If you remove that code from the invoice, does it help ?
If you go back to the default invoice file, does it help ?
You need to proceed with dichotomy, by doing plenty of tests with the invoice file's code, in order to understand from where in the code is the problem coming.

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

  • Posts: 377
  • Thank you received: 7
10 years 3 months ago #166452

Hi Nicolas,

I should have stated that even if i remove my code or use your default php code it still doesn't work. Before I made my changes to invoice.php i made a copy of it and so i could revert back if i needed to, but by using the default php it still produces the problem on product variants. So in theory nothing i have done should have caused this issue.

Kind regards

Alex

Attachments:

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 3 months ago #166460

Let's continue on one thread only, shall we ?
www.hikashop.com/forum/4-how-to/870170-d...variants.html#166450

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

  • Posts: 20
  • Thank you received: 2
  • Hikashop Business
10 years 1 month ago #175537

I bought this pdf plugin in January this year, and are now working with this same issue with the lightbox popup on pdf download, and want to have this comfusing box removed when using this plugin, both back- and frontend.

In the reply #165984 from Nicolas regarding replacing some certain codes.

Nicolas says:
-.... please add the code:
(code from Nicolas)
- after the line:
(code from Nicolas)
- in the file plugins/hikashop/attachinvoice/attachinvoice.php and that should fix it.

This "after the line" code does not exist in my version of this plugin.
Is this plugin not automatically updated together with the issued updates of my Hikashop Business? I have recently updated to latest version 2.3.3.
When I bought this plugin it stated that it was for "no limit of time or usage". If it is not autmatically updated, this statement may be useless and not as given in the link for the product.
Is it some way to have this plugin updated, or do I have to buy a new one to have an updated version?

In another post #103758 - Jerome has given some more information regarding this pdf-plugin that does not function as it may be inteded to do. At least I can not find this to function in my Joomla 2.5.27.

Jerome says:
The PDF invoice uses a special "invoice.php" file that you can override by copying the file
plugins/hikashop/attachinvoice/attachinvoice/invoice.php
into
media/com_hikashop/pluginsinvoice.php
This new file will be used by the plugin you can edit it as you want.

Is it anything I can do to have this functionality from Jerome available or in function?

The issued invoices from the plugin is saved in the catalog of the plugin with the name "invoices" and the pdf-files are given a name with the order number followed by a long number string ... here is a sample from one of my saved invoices: Invoice-1536_1413149046.pdf

Is it possible to have some changes done here? To have the number to be the invoice number and not the order number, and also, is it possible to have the invoices saved to another catalog?

All the best,
--- Bengt ---

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
10 years 1 month ago #175561

Hi,

Indeed, the sale of this plugin is "as is". You can use it as much as you want as long as you want but there is no claim that we will provide any update for it to you after your purchase.
We cannot provide indefinite support for something with a one off fee.

Now it's true that the issue with the popup is something that shouldn't have been there from the beginning. So I'm ok to provide you with the latest version without any payment. Please use our contact form in order to request access to the update along with the order number of your purchase and we'll send the latest version.
It should solve all the issues with it.

Here is the link to our contact form: www.hikashop.com/support/contact-us.html

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

  • Posts: 20
  • Thank you received: 2
  • Hikashop Business
10 years 1 month ago #175630

Thank you Nicolas :)

As always - you are what I have experienced, in service for us all - all the time.

This may help me where I am now - developing my plugin to be according to my needs. But I do have a feeling that my questions may be for all the other users (Your faithful customers) as well.

I strongly suggest that you provide some information about what you have told me here in this reply, on all paid plugins that this goes for.

I will reply to your request to ask for an update through your generously offer this time, but will at the same time be aware of the limitiations given by this and other paid plugins.

Thank you Nicolas :)
All the best,
--- Bengt ---

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

Time to create page: 0.088 seconds
Powered by Kunena Forum