News:

Support the VirtueMart project and become a member

Main Menu

DHL Shipping and printing shipping labels

Started by durian, January 04, 2006, 18:10:59 PM

Previous topic - Next topic

durian

Holsum,
It is very much a manual install.  The README file should tell you which files are patches and
which files are new.  It should also show you the directories contains the files.  Patches are
applied using patch(1).  New files are copied into the appropriate directory.  There is also
an SQL script you'll need to run to create the shipping label database table.  That script will
need to be tweaked to use the table prefix appropriate for your installation (either mos_
or jos_).

If you don't have access to a command line prompt to do this or my instructions seem too
vague for you, then I recommend you do not try to install this shipping module.  Wait until it becomes
an official part of VirtueMart.

mike

holsum

The SQl changes and the directory files are easy but what is patch(1) ?   
-holsum

durian

patch(1) is the patch program.  (1) is unix syntax for "manual section 1" - as in "man 1 patch" will
explain the usage of the patch program.  Manual section 1 contains the commands that make up
the unix user environment.

Patch takes diffs as input, in this case I created unified diffs (using diff(1)), and applies them to text files.
Patch takes the base file, applies the changes in the diff and produce a modified file.

If you aren't on unix and can't find a version of patch for your OS of choice, you should be
able to apply the patches by hand.  That's the nice thing with working with diffs and patch.
You can tell exactly what has changed in a file and adjust the changes if necessary.  The alternative,
dropping a completely new file on top of an old version, makes you do extra work to see what
has changed and if the changes are safe.

mike

holsum

Yes, I did it by hand.  Everything is up but on the Shipping Module Configuration: dhl.php page I think something isn't showing up right.  All of the info bubbles just say "tip" inside of them and the field forms do not have any titles next to them.   Any idea?
-holsum

durian

Did the text strings defined in lang.dhl.php get added to language/english.php?  I didn't do
lang.dhl.php as a diff.  It is list a list of everything that needs to be added to the english
language file.

Make sure they get added to the construct:
        class vmLanguage extends vmAbstractLanguage {
                ...
        }
not past the closing curly brace.

holsum

Thanks  Durian,

  It is totally working now...well except for the image that is supposed to be the printable dhl shipping label.  But I swear I am going to figure it out.
-holsum

durian

If you are comfortable digging around the databases, you can check to see if the label has been
inserted in to the shipping_label database.  That will at least tell you if the label was retrieved
properly (meaning the bug is in the display code).

There are also commented out debugging lines for every XML request and response.  The comments
are in the first column to make them stand out.  If you uncomment the debugging lines, you
can trace the XML exchanges.

holsum

I checked the database and the images are there.

Which file contains the commented out xml debuging lines? 

durian

classes/shipping/dhl.php contains the debugging lines.  Look for lines similar to:
        //          $vmLogger->err($xmlReq->toNormalizedString());
There will be many, some for requests, some for responses.

If the image has made it into the database, then the query and response worked properly.  One
of the trickier bits I had to figure out was the patch to admin.virtuemart.php.  Without this
patch, Virtuemart ignores the no_html directive and includes some HTML code boilerplate
(such as a link for checking for updates).  This boilerplate will corrupt the raw image data
returned by html/order.label_image.php.

When viewing the label (or rather trying to view the label), view the page source.  You'll
find an object element that is the link to the label image.  Cut and paste the link from the
HTML source into the browser location area.  See what you get.  It should be raw binary
data.  If you see anything that smack of HTML, then admin.virtuemart.php probably isn't patched
correctly.

mike

holsum

Strange,  The pop-up window doesn't display the shipping image.

But, I veiw the source file.
Copy the url and paste it into a new browser window.
It displays the missing dhl shipping lablel. 

So the question is why can't  html/order.label_image.php display the same thing?

durian

Maybe my HTML isn't quite right.  In order.label_print.php, I've got:

echo '<object data="' . $image_url . '", type="' . $image_type . '", height="' .
    $dim_y . '", width="' . $dim_x . '" />' . "\n";

near the bottom.  Does an object element need an explicit close tag?  You could try:

echo '<object data="' . $image_url . '", type="' . $image_type . '", height="' .
    $dim_y . '", width="' . $dim_x . '">' . "\n";
echo "</object>\n";

I've changed
'" />' to '">' in the first part and then added the second.

holsum

Hey, I decided to check this in Netscape and Firefox.  It works!!!  IE has failed me again, what a Suprise!!!

Thanks for all of your help Durian!

-Holsum

durian

I must have an error in the simple HTML code.  I don't really know HTML.  Perhaps someone who
does know can take a look in html/order.label_print.php.

mike

holsum

Durian,
   I will take a look at the HTML next.  Can you give me an idea why my print lable in admin function has stoped working?  It seemed to be working just fine, I upgraded to Joomla 1.0.8 but that wouldn't change any virtuemart files.  I am stumped!
-Holsum

holsum

Nevermind, I accidentally had written over the two classes files while trying to patch a CB2 intergration problem.
-Lary