VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: mhans on October 03, 2008, 23:46:57 pm

Title: generic label printing extension
Post by: mhans on October 03, 2008, 23:46:57 pm
I've created a small extension for printing labels for those of us that don't use one of those fancy shipping modules that support this. It does two things:


It's pretty configurable, so you can use just one or the other of the features. The output is in PDF.

Give it a go and let me know what you think. The extension is attached to this post.

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mart3223 on October 05, 2008, 13:44:05 pm
Dear Martin,

Thnx for youre hack. Installation was simple, but as PDF export i only get empty PDF file's. No text ore something els. Waths goes wrong?

Martijn
Title: Re: generic label printing extension
Post by: mhans on October 05, 2008, 21:32:12 pm
Hi Martijn,
good question. I just tried to install my hack on a completely fresh Joomla 1.5.7 with a VirtueMart 1.1.2 and it works. Which versions are you using? Which browser do you use? I tried with Firefox 3, IE 7 and the latest Chrome.

If you run Firefox, could you try installing the "web developer" addon? That gives you an option to view the source code - even for PDFs. I'd like to see what that looks like.

I did find one bug, though, so here is an updated version. The first version always picked the billing address even though there was a shipping address.

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mart3223 on October 06, 2008, 10:27:20 am
Martin,

I have install the new version, but it still doesn't work. The source code that i get: 

Code: [Select]
%PDF-1.3
3 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 19>>
stream
x�3R��2�35W(�� �
endstream
endobj
5 0 obj
<</Type /Page
/Parent 1 0 R
/Resources 2 0 R
/Contents 6 0 R>>
endobj
6 0 obj
<</Filter /FlateDecode /Length 19>>
stream
x�3R��2�35W(�� �
endstream
endobj
1 0 obj
<</Type /Pages
/Kids [3 0 R 5 0 R ]
/Count 2
/MediaBox [0 0 226.77 141.73]
>>
endobj
2 0 obj
<</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
/Font <<
>>
>>
endobj
7 0 obj
<<
/Producer (FPDF 1.52)
/Title (Order no 20080193 to Abdet  -)
/Subject (Labels for order no 20080193)
/Author (generic_label_printing extension for VirtueMart by Martin Hans \(mhans at gmx dot net\))
/Creator (generic_label_printing extension for VirtueMart by Martin Hans \(mhans at gmx dot net\))
/CreationDate (D:20081006082126)
>>
endobj
8 0 obj

<<
/Type /Catalog
/Pages 1 0 R
/OpenAction [3 0 R /FitH null]
/PageLayout /OneColumn
>>
endobj
xref
0 9
0000000000 65535 f
0000000341 00000 n
0000000434 00000 n
0000000009 00000 n
0000000087 00000 n
0000000175 00000 n
0000000253 00000 n
0000000512 00000 n
0000000864 00000 n
trailer
<<
/Size 9
/Root 8 0 R
/Info 7 0 R
>>
startxref
967
%%EOF
Title: Re: generic label printing extension
Post by: mhans on October 06, 2008, 13:53:24 pm
Martijn,
Hmm. So it is a PDf that you get - without error messages. Could you try to attach the configuration file that you use - if you modified the one from the distribution? Which version of Joomla/Virtuemart are you using?

Martin

Title: Re: generic label printing extension
Post by: mart3223 on October 06, 2008, 14:04:48 pm
Dear Martin,

I use the standard config file, without any changes. File is attached. I use VM1.1.2 and Joomla! 1.5.6



[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mhans on October 06, 2008, 16:36:42 pm
Martijn,
I've attached a new version. In this version I have added a new option which turns on some debug output. Please install it, turn on VM_GLP_DEBUG, generate a PDF and send me the PDF.

Note that the PDF will expose details of your order, so you may want to use a sample order or email the PDF directly to me (mhans at gmx dot net).

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mart3223 on October 06, 2008, 17:03:55 pm
Hello Martin,

As attachment the PDF export from a order in the shop.

Greets, Martijn

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mhans on October 09, 2008, 22:25:25 pm
Hi Martijn,
I haven't forgotten about you. I've just been too busy to put more work into this this week. I expect to get back to you next week.

Martin
Title: Re: generic label printing extension
Post by: manouch on October 15, 2008, 11:32:08 am
hi
thank you for your hack
maybe something new
it's working for me when i am in the backend administration
but it's not working when i am in the frontend admin (i've the same answer than Martin mart3223)...
maybe something related to the path or index index2 index3 use in order.order_label_generic_print.php...?
Title: Re: generic label printing extension
Post by: mhans on October 15, 2008, 15:19:52 pm
Hi Manouch,
Thanks for the tip. You are right that it does not work in the frontend admin. I just tried to make it work in frontend also, but it's not so easy. Grr. Virtuemart thinks that everything must be HTML. I hope VM 2.0 will improve this and also add a decent plugin system so we don't need to hack the source in order to add functionality.

Can you confirm this, martijn? Does it work in the backend admin for you?

Martin
Title: Re: generic label printing extension
Post by: mart3223 on October 15, 2008, 15:28:20 pm
Hello Martin,

Is all the way into the front end it does not work. But unfortunately in back to me yet. So I get the PDFs with BUG-Report but no other information.

Greetings Martijn

Sorry for my minimum english
Title: Re: generic label printing extension
Post by: mhans on October 15, 2008, 22:36:41 pm
Hi Martijn,
Okay. I'll need you to make another debug-PDF for me. The previous did not contain enough information for me to track this down.

New version is attached.

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mhans on October 15, 2008, 23:34:45 pm
Hi Manouch,
I've made it work in the frontend admin as well. New version attached. Notice that the installation procedure has changed. There is another file you'll need to edit now.

Manouch do you get content in your PDFs or are they empty like Martijns are?

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: manouch on October 16, 2008, 03:51:15 am
hi guys
this is now working very well for me in both modes frontend and backend admin...
I have a pdf with 2 pages. First page the name and the adress, second page the product title, product attributes and product weight...

(thank you very much)
good luck Martijn
Title: Re: generic label printing extension
Post by: moriarty on December 01, 2008, 23:07:53 pm
Hi Martin,

Thanx for the great extention! Works great for me!
The only weird thing is that in the backend the table creates one extra column! The headings and te informations in the rows don't correspond anymore...

I use VM 1.1.2 and JL 1.0.15

Thanx, Patrick
Title: Re: generic label printing extension
Post by: mhans on December 18, 2008, 15:27:42 pm
Hi all,
Version 2.0 is out! This time, you can design your labels in SVG (for example using http://www.inkscape.org). You can then add tags like {product_name} and {address_1} etc. and they will be replaced by the extension before creating the PDF. See the example PDF attached to this message.

Enjoy!

Martin

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: sham on December 19, 2008, 12:20:51 pm
Hi,
this label thing is great, Thanks for your effort.

I got only one error, there are function missing

Array (
Fatal error: Call to undefined function: date_create() in /home/sites/crownaceuk.com/public_html/administrator/components/com_virtuemart/html/order.order_label_generic_print.php on line 105

Could you have a look ?

Thanks in advance.
Title: Re: generic label printing extension
Post by: mhans on December 20, 2008, 15:41:49 pm
Hi sham,
oops. Looks like that function only exists in newer versions of PHP. Which version are you using?

Until I get around to fixing it, a workaround is to remove the {now ...} tag from the item.svg template file.

Please let me know if this works for you.

Martin
Title: Re: generic label printing extension
Post by: investigacion on December 27, 2008, 23:27:58 pm
Joomla 1.5.8
Virtuermart 1.1.2

When press print label, have this error.

Fatal error: Class 'PDF_SVG' not found in C:\Archivos de programa\EasyPHP 2.0b1\www\administrator\components\com_virtuemart\html\order.order_label_generic_print.php on line 49


Please help me.

Thanks,

and this error use generic_label_printing_1.0b.zip


[attachment deleted by admin]

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: mhans on December 28, 2008, 20:54:45 pm
Hi investigacion,
ah I see what's going on. The install procedure in the README file is not complete. It should have asked you to install the file svg2pdf.php in administrator/components/com_virtuemart/classes/pdf.

The extension is now hosted at http://www.bitbucket.org/mhans/generic_label_printing/

Here you'll find the current development version which has many bugfixes and improvements compared to 2.0. sham, I've also fixed your issue there.

Martin
Title: Re: generic label printing extension
Post by: investigacion on December 29, 2008, 13:58:27 pm
Hi mhans,

Its same error, with generic_label_printing_1.0e and generic_label_printing_2.0.zip  andgeneric_label_printing-1414d4333e46

Please send me all instruccions or file copy

my e-mail tur_jose@hotmail.com

Joomla 1.5.8
Virtuemart 1.1.2

Thanks,
???

Hi investigacion,
ah I see what's going on. The install procedure in the README file is not complete. It should have asked you to install the file svg2pdf.php in administrator/components/com_virtuemart/classes/pdf.
The extension is now hosted at http://www.bitbucket.org/mhans/generic_label_printing/
Here you'll find the current development version which has many bugfixes and improvements compared to 2.0. sham, I've also fixed your issue there.
Martin
Title: Re: generic label printing extension
Post by: mhans on December 30, 2008, 08:33:40 am
Hi investigatcion,
I currently recommend generic_label-printing-6911c3c995e6, since tip is not working right now (I'm in the middle of refactoring something). And you need to copy *all* the files below administrator/ and components/ to the corresponding place in your joomla-installation.

Martin
Title: Re: generic label printing extension
Post by: investigacion on December 30, 2008, 15:28:46 pm
I copy all files administrator/components
 include in zip generic_label_printing-6911c3c995e6.zip

and edit this files:

2. insert the link into the order list
--------------------------------------

Edit

administrator/components/com_virtuemart/html/order.order_list.php

and replace
 
    if (!$display_print_label) {
       $listObj->addCell("");
    } else {
 
with
    if (!$display_print_label) {
           require("order.order_label_generic_print_icon.php");
       // $listObj->addCell("");
    } else {

3. fix frontend administration
--------------------------------------
Edit

components/com_virtuemart/virtuemart.php

and replace

   replace
 
    echo PSHOP_OFFLINE_MESSAGE;
} else {
 
   with

    echo PSHOP_OFFLINE_MESSAGE;
} elseif (vmRequest::getVar('format', 'html' )=='raw') {
    require('order.order_label_generic_print_icon_fe.php');
} else {

the image of the error, there are the first line of the error and the last lines of the error.

When I give him to print label this mistake goes out (see image attach)

That I file do I lack?

Do I need some file more not included in the zip?

That I am doing badly?

Joomla 1.5.8
Virtuemart 1.1.2

Where to install the file .Hg_archival.txt? directory copy what?

Where to install the file test.php ? directory copy what?

two files is not copied, is important???

were encoded in UTF-8 or ISO-8859-15?  This possible problem ?????





[attachment deleted by admin]
Title: Re: generic label printing extension
Post by: investigacion on January 01, 2009, 15:55:48 pm
Does not work. After many attempts have only worked generic_label_printing_1.0e version.

The version generic_label_printing-6911c3c995e6.zip does not work in any way.

Some files are missing or there is something wrong.

I copied all the folders in the same order as in zip file.

Any solution?

My Joomla 1.5.8
Virtuemart 1.1.2

I just need to address label.

HAPPY NEW YEAR 2009
Title: Re: generic label printing extension
Post by: mmarfy on January 02, 2009, 16:55:15 pm
Hi, payment method? it's possible to add to it?
Title: Re: generic label printing extension
Post by: investigacion on January 02, 2009, 18:00:15 pm
you will run the label?

which version?

Tell me if you have modified any files more.

see the previous post, because I do not work for me?

Thanks,
jose
Title: Re: generic label printing extension
Post by: JamesW on March 14, 2009, 18:42:32 pm
I have setup the generic_label_printing_2.0.zip but i recieve the error 'font has not been set' in adobe acrobat when i click the print icon. Any ideas on how to fix this?
Title: Re: generic label printing extension
Post by: investigacion on March 14, 2009, 20:24:45 pm
Since you have formed it?

It gives the mistake of the post to my me:

Re: generic label printing extension " Reply *23 on: December 30, 2008, 15:28:46 pm "


Generic label printing, work on Joomla 1.5 and Virtuemart 1.1.2 ??????
that is the cuestion ????
Title: Re: generic label printing extension
Post by: JamesW on March 22, 2009, 23:10:38 pm
I downloaded the generic label printing extension v2. When I click the icon that appears in the print label field for an order a blank PDF opens up and I recieve the message 'Font has not been set'. Is there a fix for this?

I am using Joomla 1.5.8 and Virtuemart 1.1.3.
Title: Re: generic label printing extension
Post by: investigacion on March 22, 2009, 23:12:55 pm
Not, to it my me does not work.

Is it necessary setup something?

administrator/components/com_virtuemart/html/order.order_list.php

and replace
 
    if (!$display_print_label) {
       $listObj->addCell("");
    } else {
 
with
    if (!$display_print_label) {
           require("order.order_label_generic_print_icon.php");
       // $listObj->addCell("");
    } else {

3. fix frontend administration
--------------------------------------
Edit

components/com_virtuemart/virtuemart.php

and replace

   replace
 
    echo PSHOP_OFFLINE_MESSAGE;
} else {
 
   with

    echo PSHOP_OFFLINE_MESSAGE;
} elseif (vmRequest::getVar('format', 'html' )=='raw') {
    require('order.order_label_generic_print_icon_fe.php');
} else {
Title: Re: generic label printing extension
Post by: clivemorley on March 27, 2009, 11:02:06 am

Fatal error: Cannot redeclare class PDF_SVG in /homepages/13/d108320490/htdocs/keytrader/administrator/components/com_virtuemart/classes/pdf/svg2pdf.php on line 1754

I get the above error when trying to view the PDF address label
Joomla 1.5.9
Virtuemart 1.1.3
Using latest version of Address Label

Any ideas??
Title: Re: generic label printing extension
Post by: tyffany999 on April 29, 2009, 02:25:46 am
Hi!!!
I have installed the file "generic_label_printing_2.0"
And I have a problem.
When I do click on the icon to print labels, it opens a new window and put a message:
<The file does not begin with "%PDF-"> or or see the code.
How fix this?
I use VM 1.1.3
(http://www.notecortesavila.com/imagen1.jpg)
(http://www.notecortesavila.com/imagen2.jpg)
(http://www.notecortesavila.com/imagen3.jpg)


[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: ganzziani on December 05, 2010, 03:52:42 am
The latest zip file on http://bitbucket.org/mhans/generic_label_printing/
does not seem to be working, I think it's missing some files. I tried copying the files from previous version but it didn't work.
Also, on the readme file, the specified paths are not the same as on the structure in the zip file.

Has anyone got this to work?
Title: Re: generic label printing extension
Post by: ganzziani on December 05, 2010, 07:53:13 am
I managed to take version 1.e and modified it to my needs.
The label now show the virtuemart's store name and address at the top left, and the customer's name and address below and centered. Attached is a label example and the files.

[attachment cleanup by admin]
Title: Re: generic label printing extension
Post by: webbits on February 13, 2011, 14:56:03 pm
Thank you Ganzziani - been look off and on for two months for a solution...this did it!  Easy follow directions etc.
Title: Re: generic label printing extension
Post by: elvisesteban on February 24, 2011, 16:57:47 pm
I tried the "generic_label_printing_1.0e" and It works fine. Thanks a lot for that job !

I just have a quick question :

How can I change the customer address alignment in the label ? It's centered and I want to align it to the left.

I really hope somebody will help me ! Have a nice day everybody !
Title: Re: generic label printing extension
Post by: LeonaMonn on October 31, 2011, 14:23:47 pm
Virtuemart thinks that everything must be HTML. I hope VM 2.0 will improve this and also add a decent plugin system so we don't need to hack the source in order to add functionality. label printing (http://www.progressiveint.com)
Title: Re: generic label printing extension
Post by: jfdutoit on October 09, 2012, 13:06:10 pm
Hi,

Did anyone fixed this label printer for VM 2? 

I'm using Joomla 2.5 and VM 2.0.09.

After I tried a few things, I couldn't get it to work.

Title: Re: generic label printing extension
Post by: maxxer on November 07, 2012, 17:34:08 pm
Did anyone fixed this label printer for VM 2? 
I was looking for something similar as well. If anyone comes up with this or another solution it will be great! thanks!