Order statuses and invoicing

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #157276

-- url of the page with the problem -- : local dev server
-- HikaShop version -- : 2.3.1 Biz
-- Joomla version -- : 3.3

Dear Gents in Support,

I fear I'm having some confusion with order statuses and invoicing which I'm unable to solve without your gracious help.

The other day I purchased the plugin for attaching PDF invoices to order status notification email, and it basically works, other than the PDF needing a major style makeover (ok ok, my job), and the timing being wrong in terms of which order status mail it is getting attached to.

It boils down to the question: where and how do I modify, so the PDF invoice gets attached to a different order status notification mail?
I reckon it's in the file plugins/hikashop/attachinvoice/attachinvoice.php, but again, where and how?
(I've been messing a tiny little bit with line 129 already - "$confirmed = $config->get('order_confirmed_status','confirmed');" - but without success.)

In case you need to know more, here's why I'm asking:
The plugin's name seems to impliy that it's determined to attach the invoice to the (default) order confirmation. But that doesn't happen in my case. Which is (a) good, because it would one status too early for me, and (b) bad, because it's getting attached one status too late. And whatever I do with commonly accessible parameters in the backend won't change a thing.

For whatever it's worth, I'm attaching here snaps of my order statuses and the "Order" config.

  • You can tell, the core "confirmed" status still exists, but for my workflow it has now become "confirmed by the Seller". No invoice gets attached there, and for me that's actually good! Even if you had intended for it to be attached there.
  • You might guess correctly that "pending payment" is the status where the invoice shall be attached (because in my case it's a proforma invoice). But I can't get that to work... :(
  • You might be just as surprised as me that "paid" is the status where the PDF invoice gets emailed, finally. But that's too late = bad. Only, I can't change it.
  • (Seemingly irrelevant, but as a little side info, "paid" is also set in HikaMarket config as "Order notification status filter", leading correctly to the first email to the vendor going out at this status, though unnecessarily (!) with the PDF invoice attached. So, I thought there's an erratic connection, but even if I change that setting in HM, the PDF invoice keeps stubbornly sticking to the "paid" notification for the customer.)

Back to my question, plus 2 more additional ones in the same context:
  1. How can I convince the PDF invoice to join the email which goes out to the customer on "pending payment"? I don't care what it takes, but it must go out with THAT status, no other one.
  2. Can I somehow prevent the PDF invoice being sent to the vendor with his status mail? He really must not have it... all other info is enough for him.
  3. I understand that the PDF invoice is downloadable in the frontend, except I can't find it anywhere. (Is it in the CPanel, which I'm not using?) I only have - unfortunately, because the result it's darn ugly - the "Print invoice" button in the order view... strangely a status too early... but I know how to completely and for all times get rid of it, hehe...

Many thanks in advance for some wise words on these questions - and if only briefly.

P.S.: Hope you had tons of fun in Paris! Tried to jump in a tiny bit on the support side, meanwhile... ;)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Attachments:
Last edit: 9 years 10 months ago by lousyfool. Reason: Files attached!

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #157570

Hi,

It seems indeed that you will have to edit the plugin directly.
In the function onBeforeMailSend(), in your case changing "order_confirmed_status" by "invoice_order_statuses" in order to attach only on emails with "pending payment" order status.

To not send it to the vendor, you can potentially add a check on "$data->mail_subject".

ps: thanks a lot for your help on the forum :)

Last edit: 9 years 10 months ago by Xavier.
The following user(s) said Thank You: lousyfool

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #157615

Thanks for helping out again, Xavier.

The change in the plugin went well - it works perfectly! No tweak necessary to prevent the invoice being sent to the vendor, because the PDF goes out only with the "pending payment" mail to the customer (which the vendor doesn't get), and not anymore with the "paid" mail (which is the first the vendor gets).

Regarding my question #3, I can see that it's way more extra hassle to make the PDF invoice downloadable for the customer per button in the frontend, e.g. by replacing the horrid "print order" thingy (which I got rid of by now), or in the order listing. But you have to admit, it'd be nice... after all, the PDF file is sitting on the server.

Well, more important stuff to do: now I got to fumble the vendor contact details into the "paid" email to the customer, etc etc etc. Wish me luck... :)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #157649

Hi,

Yes having a pdf button to directly download the invoice from the order view or from the listing could be a nice thing.
Actually it is the print button which is displayed, it generally allow to save as pdf thanks to a popup displayed by the OS.

The PDF file is not on the server, it is dynamically created thanks to the pdf library in the plugin. ;)

I will talk about the button design to our designer, to see if it can be improved :)

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #157681

Xavier wrote: Yes having a pdf button to directly download the invoice from the order view or from the listing could be a nice thing.


Thanks for going along with me that way! But it's got to be a pretty PDF, more like a screenshot or so, hehe.

Xavier wrote: Actually it is the print button which is displayed, it generally allow to save as pdf thanks to a popup displayed by the OS.


That's not pretty. It'd be like a lottery win if that were pretty. Or you got to 'bend' the view (on the screen) to something darn ugly...

Xavier wrote: The PDF file is not on the server, it is dynamically created thanks to the pdf library in the plugin. ;)


Why, I have the PDF file, which the 10€ plugin generated, in the folder plugins/hikashop/attachinvoice/attachinvoice/invoices. Not sure when it'll vanish, but for now it's there, and I'm already some order statuses beyond "payment pending"... ;)

Xavier wrote: I will talk about the button design to our designer, to see if it can be improved


There's another gold medal in reach for you! But it's not so much the button itself, but what's behind (as if you didn't know, haha). I can send you three docs, (1) a screenshot of order view, (2) a decently styled (matching?) PDF from the plugin, and (3) a PDF as result from the print button as is. Just let me know how. Anyway, day and day and night. No, the last is hell! And boy, it'll take some magic to turn hell into paradise, doesn't it...

Cheers!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 13201
  • Thank you received: 2322
9 years 10 months ago #157694

Good news, having a PDF button is definitely a good idea, and we will potentially add it for the next release.
And we will too have more beautiful icons.

Isn't it wonderful ? ;)

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

  • Posts: 2143
  • Thank you received: 747
9 years 10 months ago #157795

Yoh, it is a wonderful thing, indeed! Will be a challenge, though, to get a PDF looking alright if generated from the page content.

More icons? Or new icons? What type?

Can't wait to see it all! Nothing much to argue there since it's all matters of taste, but I've been through heavy style editing everywhere, as mentioned here with PDF plugin, with emails, and I've even replaced all current icons in toolbars and everywhere... don't take me too serious, but I have no more plushy icons from the Shrek era... :lol:

Let's see what you come up with, it can hardly be wrong!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 26000
  • Thank you received: 4004
  • MODERATOR
9 years 10 months ago #157923

lousyfool wrote: More icons? Or new icons? What type?

We have to keep some surprises !

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.

Time to create page: 0.086 seconds
Powered by Kunena Forum