johnny_v Developer Od Netherlands Členem od kvě 2016 johnny_v 21 úno 2020 15:43 Hi, When a customer wants to print an order copy through the front-end of the store, it will get a page with a pagetitle that has the order number (in the <title> tags in the header). However, when you do it through the admin-area, it gets overridden by something else and will only display the store name in the title. Is this something that's being overridden on purpose or can it be adjusted? And if it can be adjusted, where should I look? I believe, by looking at the code, it should just be the same as at the front-end, or am I mistaken?
tim Founder Od Sweden Členem od kvě 2013 tim 21 úno 2020 17:21 My first question is, why are you printing the header with title url etc? There is a javascript that injects the h1 for head title. Its going for removal in a future version.
johnny_v Developer Od Netherlands Členem od kvě 2016 johnny_v 21 úno 2020 17:53 Oh, I didn't make myself entirely clear, sorry. I meant to 'print to PDF', and then the default/suggested filename will be the pagetitle that's in the title tags. Is it a part of javascript that can safely be turned off?
tim Founder Od Sweden Členem od kvě 2013 tim 21 úno 2020 21:40 Is this a question for the PDF invoice add-on?
johnny_v Developer Od Netherlands Členem od kvě 2016 johnny_v 22 úno 2020 00:38 No, this is something for the PHP order copy. I'm currently wrapping up something based on the order copy that will generate an invoice with proper headers/footers without overlapping areas, but to save something as PDF, it would be beneficial if it would have a logical title :)
tim Founder Od Sweden Členem od kvě 2013 tim 24 úno 2020 01:18 I understand perfection is key. Use this to set a logical title: document.title = 'My new title'; </script>```
johnny_v Developer Od Netherlands Členem od kvě 2016 johnny_v 25 úno 2020 00:40 Thanks! Now I only have to figure out how to combine that with PHP so that I can fetch the order ID and use that as a title :)
tim Founder Od Sweden Členem od kvě 2013 tim 25 úno 2020 00:44 document.title = 'Order <?php echo $order['id']; ?>'; </script>
johnny_v Developer Od Netherlands Členem od kvě 2016 johnny_v 25 úno 2020 00:55 I thought I had tried that but I must've made a typo or so, and then got confused. This works perfectly, thanks for the swift response! I'll send you a 'cleaned' or more or less 'defaulted' file for this invoice type later on once it's further perfected. Maybe you could/want to use it :) What I have now is something that displays the header and footer on each page of the invoice. Looks pretty sweet. There's a few more things I want/need to adjust and add, but once that's done I'll send it over for you to check out :)