VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Shipping Modules => Topic started by: durian on January 04, 2006, 18:10:59 PM

Title: DHL Shipping and printing shipping labels
Post by: durian on January 04, 2006, 18:10:59 PM
I'm working on a DHL shipping module.  I've got the shipping rate estimates pretty much working (one
outstanding question regarding international shipments), but would like to extend things a bit.

The DHL XML API also provides a mechanism for printing shipping labels.  I thought it might be useful
to implement that too, but I think I'm going to need an extra database table to do it properly and
databases just aren't my thing.

In order to properly print a label, I need to record some information about the shipping rate selected
by the customer.  This way I'll be able to correctly print a label that matches the shipping estimate,
even if some configuration values change.  In particular, I need to track shipping method, special services,
duty rate, insurance rate, domestic/international (I could recompute this, but if I'm recording the other
information I might as well record this too).  The actual address I can pull out of _order_user_info.

I had initially though to stick this information into shipping_rate_id, but that's not persistant, is it?

Then I've got to figure out what to do with the label image that comes back from DHL.  Again, I think
I'll need to stick this in a database so it can be view and reprinted later if necessary.  I'll also need to
store the waybill number along with the image so the label can be voided.

So those are my database issues.  If anyone can provide any advice on how to set up the table and
populate it, I'd be much appreciative.  I think it would need to be done through some script so any
other VirtueMart user's wanting to use the DHL module could easily integrate it into their system.
Even better would be an "official" new database table for this sort of thing, as I wouldn't be surprised
if other shipping methods can be expanded to print shipping labels.

Then there are the user interface issues.  I think I'll need to add Print Label and Void Label actions
to the orderinformation screen.  I can probably muddle through this, but advice might help.

The last step will involve getting the image into a pop-up window so the browser can print it.  Like
my database skills, my HTML skills are lacking.  I do think the image data needs to be inlined somehow.
Or failing that, there needs to be a way to detect when the user is done viewing/printing the label
so the temporary file containing the image can be removed - even if the user's browser closes accidentally.
We don't want any image files slowly eating up disk space.  Inline data seems like the best bet to me,
but as I said, I don't really know the ins-and-outs of this type of HTML.

Thanks,
mike
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 05, 2006, 21:42:18 PM
Following up to my own post.

I have resolved most of my issues except one, so my question is a bit more focused.
I need a way of accessing an html/something.php file that will return raw PNG data.
I will be using it as the img src URL of the shipping label image.

If I try hardcoding the URL directly, I just get dumped at my site's home page.  I assume
this is because I'm missing session information or something.  So then I tried using
$sess->url() to generate my URL, but it throws a lot of extra HTML into the output before
my script even gets a chance to write the raw PNG data.

So, How do I generate a URL to my script that won't prepend any extraneous HTML
(or append either - I don't want the "Check for latest VirtueMart" stuff either)?

Thanks,
mike
Title: Re: DHL Shipping and printing shipping labels
Post by: antcomp on January 18, 2006, 01:23:06 AM
I'm just wondering. How will this work with the label printing? will it ask the customer to print the label or will it show up in the admin panel or in your account on DHL.com? If it shows up after the customer places an order and asks them to print it don't bother it makes no scence to do this. I think it may be for large companies with a DHL ship server so the can do it all automated.
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 18, 2006, 01:41:51 AM
You print a label from the administration area.  When you are viewing orders, if the customer selected DHL shipping for his order, you (as an administrator) will have the option of printing the DHL label.  You can then stick it on your package and either call DHL for pick-up or drop it in a DHL box somewhere.  You can also track shipments from the labels you create.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: deneb on January 18, 2006, 04:00:51 AM
Hey durian, have you found a solution yet? I'd like to see this mod in the next VM!

maybe this'l help...

Quote$sess->url() to generate my URL, but it throws a lot of extra HTML into the output before
my script even gets a chance to write the raw PNG data.

All $sess->url() does is append the "option=com_virtuemart" and "Itemid=X" to the supplied url. So, your code is probably not set up for the resulting output from that function.

Quote
So, How do I generate a URL to my script that won't prepend any extraneous HTML
(or append either - I don't want the "Check for latest VirtueMart" stuff either)?

I assume you want just a clean new window without any Joomla or VM headers/footers? make the link to the pop-up window (with just the label showing) by creating your html page that pulls the image out of your DB and displays it first.

then try using a java link to your script page (window.open)  and use index2.php as the main page. like so:
a href="javascript:void window.open(\'<?php echo $mosConfig_live_site."/index2.php?page=script_page...

**see attached file as an example of a full java link that I use in my custom mods/hacks.
(this forum chops html code...so i put in file)

Just substitute "script_page" in the "page=script_page" parameter to your file (without the suffix) in the /html folder for the VM component. Notice the "menubar=yes" param, so you can access your browser print menu stuff.

Also see my hack for a "Top Products" report. It has a java "Print View" link like the above...
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=14666.0

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 18, 2006, 16:23:39 PM
The code is mostly done.  I just need to do a bit more testing and finish the signature retrieval bit (part of tracking).  DHL doesn't have a test case for signature retrieval, so I'm waiting for an order to come in on our new site that uses DHL.  Once I get a real tracking number and the package gets delivered, I'll be able to finish the signature bit.

I've sent some preliminary code to Soeren, since there are a number of patches to the base system code and a new database.  I'll release the code to the general masses when I finish that signature stuff.

I did figure out my problem with pop-up windows and HTML-less data.  The trick to the later is to add no_html=1 to the URL and also tweak admin.virtuemart.php to observe the flag (without a patch it ignores the no_html setting and appends a footer).

mike

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Soeren on January 18, 2006, 20:35:12 PM
I'm sure that this module sets a new level for shipping modules in general for VirtueMart.
It's a good idea to implement the changes from durian's DHL implementation, so other shipping modules can be used that comfortable too.

ciao, Soeren
Title: Re: DHL Shipping and printing shipping labels
Post by: antcomp on January 19, 2006, 05:18:17 AM
Quote from: durian on January 18, 2006, 01:41:51 AM
You print a label from the administration area.  When you are viewing orders, if the customer selected DHL shipping for his order, you (as an administrator) will have the option of printing the DHL label.  You can then stick it on your package and either call DHL for pick-up or drop it in a DHL box somewhere.  You can also track shipments from the labels you create.

mike

Thats a nice feature! it will make it eaiser to process shippments (no more paperwork). Keep up the good work, I agree with Soren this would be great for the next release
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 24, 2006, 18:45:48 PM
Here's a starting point for the DHL module.  I have been testing with it and it seems to be working, but it is a bit more complex than other shipping modules and I'm sure there are still issues. Also, keep in mind that I implemented this DHL module to meet my needs.  My needs are almost certainly not the same as your needs. You might need to customize things a bit to meet your requirements.

There is a README inside that tarball that explains what the DHL module does and what the files in the tarball do.  It also covers the steps involved in getting certified by DHL.  I wish that process were simpler. To get certified, you will need to create test cases and make small modifications to the code (uncomment some debugging lines). You'll also need to manually adjust your database to insert special tracking numbers for testing.  I've found phpMyAdmin to be useful in this task.

Here's a portion of the README that covers what the DHL module does:


mike

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 25, 2006, 22:11:31 PM
Good news.  The DHL people say other users of this shipping module do not need to go through the certification process.  It is sufficient that you tell them you are using the "VirtueMart DHL shipping module originally authored by Mike Durian."  This will take a lot of the pain out of getting up and running.

I have also updated the tarball to include an ApplicationForm.doc file.  After creating a normal DHL shipping account on DHL's website, fill out this form and mail it to XMLRequests@dhl.com and mention you are using this shipping module.  They'll send you an ID, password and shipping keys.  Much less painful than sending them sample XML requests for each transaction type.

I have updated the README file to reflect the simplified procedure.

mike

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: deneb on January 26, 2006, 02:12:02 AM
Durian,
You r the man!

Good to see coders actively working on expanding this project. :)
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on January 27, 2006, 19:08:00 PM
DHL has provided an application form specific for VirtueMart users.  The form replaces the one in the tarball.

So, who ever is adding this DHL code to VirtueMart, can you please include this DHL application form, not the other one.  And for any of you who are already patching your own source tree to add DHL shipping, please use this application form.

Thanks,
mike

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 08, 2006, 18:20:22 PM
Mike,
   How difficult would it be to convert this into a Fedex ship and print module?  I have a very keen interest in getting this done and would be willing to "do my part" to get this feature implemented for Fedex. 

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 08, 2006, 18:35:50 PM
I don't have a clue what would be involved in adding similar features to the FedEx shipping module.  I have no knowledge of the FedEx API.  When I wrote the DHL module, I tried to generalize the label database such that other modules could also use it, but it's difficult to generalize from a single data point.  The label database might or might not meet your needs when you start modifying the FedEx module.  I also tried to create a structure for the label functions in the DHL so that their definition might translate to other modules.  But, as they say, your mileage may vary.  The README file with the DHL code might help explain what the DHL label functions do.

And, of course, a key factor in adding label support to the FedEx module will be what features FedEx makes available to you through their API.

I guess I'd recommend you get all the information you can from FedEx on their API and come up to speed on it.  Then start reading the DHL code and README file and see if there are any similarities.

While I can answer specific questions about the DHL code, I afraid you're on your own when it comes to adding new features to the FedEx module.  I'm pretty swamped with my normal work and don't really have need for a FedEx module myself since I have the DHL stuff.  But if you have questions regarding why I did something a certain way in the DHL module, I'll be glad to field them.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 14, 2006, 00:15:32 AM
Dorian,
   How do you instal your DHL shipping madule?  Is it a manual install or is there a UI within virtuemart that I am supposed to use?
-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 14, 2006, 01:18:09 AM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 22, 2006, 19:09:07 PM
The SQl changes and the directory files are easy but what is patch(1) ?   
-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 22, 2006, 20:18:32 PM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 22, 2006, 23:46:47 PM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 23, 2006, 00:06:44 AM
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.
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 23, 2006, 00:53:15 AM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 23, 2006, 01:01:31 AM
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.
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 23, 2006, 01:12:50 AM
I checked the database and the images are there.

Which file contains the commented out xml debuging lines? 
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 23, 2006, 01:41:48 AM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 23, 2006, 01:57:13 AM
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?
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 23, 2006, 03:24:15 AM
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.
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on February 23, 2006, 06:48:22 AM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on February 23, 2006, 17:39:04 PM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on March 07, 2006, 01:38:39 AM
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
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on March 07, 2006, 01:51:52 AM
Nevermind, I accidentally had written over the two classes files while trying to patch a CB2 intergration problem.
-Lary
Title: Re: DHL Shipping and printing shipping labels
Post by: fidel on March 08, 2006, 07:46:20 AM
Is there a final version with all the fixes that you can post here. Thanks.
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on March 08, 2006, 19:53:34 PM
Fidel,
There have been no code changes.  Until a VirtueMart maintainer integrates DHL into the main code
branch, use the tar ball from here:
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=14307.msg29600#msg29600

The only exception is to use the DHL API sign-up form included in this posting:
http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=14307.msg29836#msg29836

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on March 24, 2006, 20:02:46 PM
I just encountered a case where a tracking XML response did not included a field I had assumed was mandatory. The result was an empty tracking window.  This change fixes that problem.  I'm attaching both a dhl.php drop-in replacement as well as a diff so you can see what has changed.

mike

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: Phillip Wheat on May 18, 2006, 16:42:10 PM
durian, thanks for the hard work and for sharing this DHL module.

I did the manual install and have an issue you may can help with.

I know the module is being called at order processing because I can see the "It's too late to ship today" type message.

But I do not see any shipping options below that message at order processing.

I do have an "official" DHL key, userid and password.

I am in Test Mode.

Any suggestions?

Do you offer consulting services to fix this kind of thing?
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on May 18, 2006, 17:27:04 PM
Sorry, I don't have the time to do consulting, but here are some things you should look into.
First, make sure you have the various DHL shipping methods enabled.  For example, dhl.cfg.php should contain some lines like:

define ('DHL_EXPRESS_ENABLED', 'TRUE');
define ('DHL_NEXT_AFTERNOON_ENABLED', 'TRUE');
define ('DHL_SECOND_DAY_ENABLED', 'TRUE');
define ('DHL_GROUND_ENABLED', 'TRUE');
define ('DHL_1030_ENABLED', 'TRUE');
define ('DHL_SATURDAY_ENABLED', 'TRUE');
define ('DHL_INTERNATIONAL_ENABLED', 'TRUE');

If those values aren't TRUE, then they won't be presented as shipping options.

The next thing to do is check the XML requests and responses.  In dhl.php, around line 386, you will see,

                        $recv->appendChild($addr);
                        $shipment->appendChild($recv);
                        $root->appendChild($shipment);

//                      $vmLogger->err($xmlReq->toNormalizedString());

                        if (function_exists( "curl_init" )) {


Uncomment the debug line by removing the // from the $vmLogger line.  Do the same thing for the following code around line 419:

                                    '</span>';
                                continue;
                        }
//                      $vmLogger->err($xmlResp->toNormalizedString());

                        // Check for success or failure.
                        $result_code_list =& $xmlResp->getElementsByPath('//Result/Code');


By uncommenting those lines, you will be able to view the XML requests and responses, they might help in diagnosing the problem.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Phillip Wheat on May 18, 2006, 19:12:43 PM
I understand the time thing!   Thanks for the help.

Title: Re: DHL Shipping and printing shipping labels
Post by: durian on May 18, 2006, 19:37:13 PM
They will appear on the screen, though you might need to adjust the PHP configuration to display errors.
You enable this in php.ini (on my FreeBSD box, it is /usr/local/etc/php/php.ini). Set display_errors to On, ala:

display_errors = On


If your PHP is configured to display errors, then it is possible the rate listing function is returning before it even makes it to the debug lines.  For instance, line 112 of dhl.php checks the shipment weight. If the weight is 0, it returns without doing anything (if the weight is 0, then you don't really have anything to ship):

                if ($d['weight'] == 0)
                        return (true);

You can change that to

                if ($d['weight'] == 0) {
                        $vmLogger->err("Shipment has no weight");
                        return (true);
                }

to see if you are encountering that case.

I think that is the only return prior to displaying the XML request, but you should double-check as I only did a quick look through the code.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Phillip Wheat on May 19, 2006, 04:39:00 AM
Mike, thanks for your response and begging your indulgence.
I did find that the user_info_id field seems to be the culprit, but have been back through the mods and can't find how I missed this one.

FYI running Joomla 1.08 and current stable Virtuemart version VirtueMart 1.0.5 stable 


Here's the debug copy.  Any help appreciated.  You need a donation link!

Debug: Starting Shipping module: dhl



Notice: Unknown column 'user_info_id' in 'where clause' in /home/virtual/site94/fst/var/www/html/includes/database.php on line 282

/home/virtual/site94/fst/var/www/html/includes/database.php:473
/home/virtual/site94/fst/var/www/html/administrator/components/com_virtuemart/classes/ps_database.php:101
/home/virtual/site94/fst/var/www/html/administrator/components/com_virtuemart/classes/shipping/dhl.php:102
/home/virtual/site94/fst/var/www/html/administrator/components/com_virtuemart/html/checkout.index.php:175
/home/virtual/site94/fst/var/www/html/components/com_virtuemart/virtuemart.php:217
/home/virtual/site94/fst/var/www/html/components/com_virtuemart/virtuemart.php:262
/home/virtual/site94/fst/var/www/html/index.php:210
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on May 19, 2006, 05:09:57 AM
I'm not sure I can help you with this one.  You are running new versions of VirtueMart and Joomla than I am.  Apparently a change was made in VirtueMart affecting the user_info_id field.  Can a VirtueMart commiter comment?

Speaking of which, I released the DHL quite a few VirtueMart revisions ago.  Perhaps it is time for a VirtueMart commiter to finally integrate this code officially so it will stay synced with changes.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Phillip Wheat on May 19, 2006, 16:02:44 PM
I wholeheartedly agree that the DHL module needs attention.

Don't make me go back to oscommerce!!!!!
Title: Re: DHL Shipping and printing shipping labels
Post by: Phillip Wheat on May 22, 2006, 00:27:13 AM
Miracle of miracles .... DHL module is now working.....
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on May 22, 2006, 16:40:03 PM
That's good news.  Can you provide details on how you fixed things, in case others run into the same problem?

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: BruceW on May 31, 2006, 10:57:54 AM
Mike,
Very good work.  Thank you so much for doing this.

[snip]
Quote from: durian on February 22, 2006, 20:18:32 PM
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.

mike

I have a question on the patches.  I am familiar with using them but I am finding some anomolies in the patch.
First, here is the process I used to patch, it tells me:

# patch <order.order_list.php.patch
patching file order.order_list.php
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] y
Hunk #1 FAILED at 16.
Hunk #2 FAILED at 90.
Hunk #3 FAILED at 102.
Hunk #4 FAILED at 121.
4 out of 4 hunks FAILED -- saving rejects to file order.order_list.php.rej


Now, it seems that the file had already been patched when I installed it?  Is this true?
I even stepped up the fuzz factor to no avail.
I find that some of the patches are already there in the .orig file.

Also, this section keeps repeating itself like 3-4 times. Is that supposed to the be the case?

@@ -115,7 +121,91 @@
        $url = $_SERVER['PHP_SELF']."?page=$modulename.order_print&limitstart=$limitstart&$
        $tmp_cell = "<a href=\"" . $sess->url($url) . "\">".sprintf("%08d", $db->f("order_$
        $listObj->addCell( $tmp_cell );
-
+
+       // Look in #__{vm}_shipping_label for this order and extract the
+       // shipping class name.  Then check to see if the shipping module
+       // supports generating shipping labels.  If so, add a print icon
+       // button for printing the label, otherwise leave the column empty.
+       $lq = "SELECT shipper_class, label_is_generated ";


Can't figure out why without the original, original file.  I am prolly too stoopid  ???
Please advise.
Thanx again.
Bruce
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on June 08, 2006, 01:16:48 AM
Regarding the previously applied patch - I don't know.  I am not running the latest VM code myself (the
updates are a bit too frequent), but I doubt they applied the order_list patch with integrating the DHL.
More likely, you already applied that patch without realizing it.

If you are seeing code section from one of my patch appear multiple times, then you are probably
applying the same patch multiple times without realizing it.  At this point, maybe you want to start
from a clean slate and try again.  Overwrite the modified files with unpatched ones and try again.
Looking for files that end in .orig will help you figure out what files have been modified.

Perhaps it is time someone who wants to use the DHL shipping module open a VM bug report requesting
these changes be integrated into the stock VM code.  I had hoped a VM commiter would have done
this on their own by now, but maybe they are waiting for an official request in the form of a PR.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Soeren on June 20, 2006, 13:36:05 PM
Hello,

no - this is already implemented in the VirtueMart CVS code. The 1.0.x branch is a maintenance branch, so all updates and new features go into the 1.1.x branch (CVS HEAD).

ciao, Soeren
Title: Re: DHL Shipping and printing shipping labels
Post by: Jenny on June 28, 2006, 22:21:41 PM
Dear Mike,
How hard would it be to change your tool so that the printing is allowed on the purchaser's side. I am interested in using VirtueMart to sell DHL shipping labels. Please advise.
Jenny
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on June 29, 2006, 23:24:48 PM
Off the top of my head, I'd think the dhl shipping class wouldn't require many changes.  Most of your effort will go into adding new user interface elements that access the dhl shipping class methods.  Start experimenting with it.  You should get a feel how much work is involved when you start putting it together. The first step, studying and learning the (non-dhl) code that deals with the item definitions, listing and selection will probably take you the longest.

Good luck,
mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Jenny on June 30, 2006, 19:56:34 PM
Thanks I appreciate it.
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 06, 2006, 00:32:12 AM
Durian,
   Hey I have been using your DHL shipping & printing module successfully for a few months now, but somewhere in an update/patch things stopped working.  I reninstalled the files and pathces but I get this error code when a customer has to select a shipping option:

DHL XML Repsonse missing result code


Any clues?

Thanks for the best shipping module in VM!
-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 06, 2006, 00:51:38 AM
Durian,
   Nevermind I figured out that when I reninstalled the dhl.cfg.php file it wiped out all of my personal settings i.e.- account numbers, and options.  So I had to chsnge the CHMOD setting to make it writeable add my info and now it is working great again!

Soeren, when is this mod going to be part of the standard virtuemart component?

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Soeren on July 07, 2006, 20:13:38 PM
With VirtueMart 1.1. It's already available in the CVS repository.

ciao, Soeren
Title: Easy install- DHL Shipping and printing shipping labels
Post by: holsum on July 26, 2006, 22:34:32 PM
Durian,
    I wanted to make it easier for new users, as well as people who wanted to upgrade virtuemart, to install this shipping module.

So I went through the DHL module and made it compatible with virtuemart 1.0.6.  Now for anyone who doesn't want to use a "patch" program they can upload this to their existing administrator/component/com_virtuemart folder to install "DHL with printing shipping labels". 

I modified the read me instructions reflect the new procedures.

If anyone finds a mistake or wants to contribute please do!


http://holsumstudios.com/files/dhl.1.0.6.zip

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on July 27, 2006, 02:48:33 AM
Holsum,
That's a great idea and I'm sure people will appreciate it.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Soeren on August 12, 2006, 19:20:12 PM
Thank you holsum,

here's your official document download on virtuemart.net: http://virtuemart.net/index.php?option=com_docman&Itemid=66&task=doc_details&gid=228.

You're the maintainer of that entry ;)
I would like you to update this file if you released bug fixes.

Thanks!
ciao, Soeren
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 09, 2006, 10:40:04 AM
hi holsum,

thanks for packaging the DHL module.

i found a couple little errors:

in english.php you have "$_PHPSHOP_SHIPPING_METHOD_DHL_CONTENT_DESC_TOOLTIP" declared twice.  i removed the second declaration and it worked fine.

also, i don't know if you did this on purpose but in ps_checkout.php on line 885 you have:

$q .= "SELECT '', '$order_id', '".$auth['user_id']."', address_type, address_type_name, company, title, last_name, first_name, middle_name, phone_1, phone_2, fax, address_1, address_2, city, state, country, zip, user_email, extra_field_1, extra_field_2, extra_field_3, extra_field_4, extra_field_5,bank_account_nr,bank_name,bank_sort_code,bank_iban,bank_account_holder,bank_account_type FROM #__{vm}_user_info WHERE user_id='".$auth['user_id']."' AND user_info_id='".$d['ship_to_info_id']."' AND address_type='ST'"."' AND address_type='ST'";

i don't know if you wanted to have the "' AND address_type='ST'" twice at the end.

thanks,

miz
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 12, 2006, 02:50:24 AM
i don't know if anyone is still checking this thread, but if anyone was having trouble with printing labels in IE, i changed the <object> tag to an <img> tag and it seems to work.  so:

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

becomes:

echo "<img src='" .$image_url. "' border='0'>";

i am not sure if it is necessary to have it in an object tag or not.
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 12, 2006, 21:44:07 PM
I believe I had to use <object> because <img> didn't display properly under Firefox or Konqueror.
I'm not up on all the ins-and-outs, but the doing <object  ... /> might be incorrect.  Perhaps the code needs to be:

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

If it's not clear, I'm changing

<object ... />
to
<object ... > </object>


It's something you can try anyway.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 14, 2006, 03:55:41 AM
hi mike, just want to thank you for writing this component.  very good stuff.

curious, what was wrong when you used the <img> tag?  did it not display?  or was something else wrong?

i want to know specifically, just in case using the <img> tag messes up the label or something.

thanks.
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 14, 2006, 05:37:36 AM
It's been a long time, and I don't really remember.  I think without the explicit width and height, the image was not displayed with the proper dimensions.  I think <object> is the way to go.  If it's not working properly under IE, then I'm sure it's just a matter of correcting my malformed HTML.  Did the change I suggested make any difference?

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 16, 2006, 07:26:40 AM
hi mike,

no, it's not working with the suggested change.

why can't i just explicitly added the height and width in the <img> tag?  seems like it would work...

also, do i just print these labels on label paper and stick it on my package?

or do i need to get special dhl paper?

thanks,

miz
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 16, 2006, 18:32:23 PM
If <img> is working for you, then go ahead and use it.  That the nice thing about having the source, you can make adjustments.  Like I said before, I've forgotten the issues involved that forced me to use <object> instead of <img>, but they did exist.  If you really want to dig into this, try viewing with different browsers and see how they respond.  Try a mozilla based browser and a khtml based browser.  Check both the label image and the signature tracking image.

As for printing, you can print on anything.  Print on a sticky label or even plain paper and then tape to
a box.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 20, 2006, 00:44:12 AM
Just to confirm, I changed the code to use <img> instead of <object> and it is working fine on all browsers and platforms.

I also shipped my first package yesterday and everything went smoothly.  So, it looks like <img> tag works fine.


Also, I found a problem when shipping products that are bought by someone who is part of a shopping group.  When I checkout with a user that is part of a group that receives a 10% discount, it complains about the price being "non-numerical."

I am assuming that a number is getting turned into a character string somewhere during the discount process.

I will look for the fix to this and post it.
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 20, 2006, 01:07:11 AM
one more question.


Does the recipient see the tracking number at any point?

For instance, is it in their Orders section?


Or do I have to send it to them "manually".

Thanks,

Miz
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 20, 2006, 19:23:14 PM
No, the tracking number doesn't appear in anything the customer receives.  That would be a nice addition though.

There is a field in the HDL XML shipping request where you specify the receiver's email address.  In theory, they should receive an email with the shipping information, but I'm not sure it really works in practice.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 22, 2006, 04:30:50 AM
hi mike,

what i will do is on the order details screen, i will automatically populate a tracking number message in the comments section.  something like, "Hi Buddy, your package has been shipped.  Your tracking number is XXXXXXXXXXX."

that way, i don't need to worry about writing code that sends the email.  the info will already be there when i am sending the shipment confirmation.  this should be pretty easy, i think i'll put in the code this weekend and post it here.


BTW, on three of my shipments, when the user had received the items, the status changed from "shipped" to "confirmed."  is this a feature or am i going crazy?  so, the shipping module is smart enough to change the status when the shipment arrives???
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on September 23, 2006, 00:01:09 AM
I am trying to update the DHL.1.0.6 to DHL.1.0.7 and I have run into two snags.

1. When I click on the print view icon in the Order List I recieve an error.
2. When I click on the print label button I recieve this error:

Shipment not generated. [code 102]
A shipment date must fall between today and 9 days from now. [code 4100]

here is the order.order_printdetail.php file if anyone wants to take a look at it and help figure out why this is happening.
<?php
defined
'_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' ); 
/**
*
* @version $Id: order.order_printdetails.php,v 1.5.2.2 2006/03/10 15:55:15 soeren_nb Exp $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
mm_showMyFileName__FILE__ );

require_once(
CLASSPATH.'ps_checkout.php');
require_once(
CLASSPATH.'ps_product.php');
$ps_product= new ps_product;

$order_id mosgetparam$_REQUEST'order_id'null);
$dbc = new ps_DB;
if (!
is_numeric($order_id))
    die ('Please provide a valid Order ID!');

$q "SELECT * FROM #__{vm}_orders WHERE order_id='$order_id' and vendor_id = $ps_vendor_id"
$db->query($q);
$db->next_record();
// if ($db->next_record()) {
?>


<table width="100%" align="center" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td valign="top">
     <h2><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_LBL ?></h2>
     <p><?php
        
echo $vendor_name "<br />";
        echo $vendor_address "<br />";
        echo $vendor_city ", ";
        echo $vendor_state " ";
        echo $vendor_zip?>
</p>
    </td>
    <td valign="top" width="10%" align="right"><?php echo $vendor_image?></td>
  </tr>
</table>

<table border="0" cellspacing="0" cellpadding="2" width="100%">
  <!-- begin customer information -->
  <tr class="sectiontableheader">
    <th align="left" colspan="2"><?php echo $VM_LANG->_PHPSHOP_ACC_ORDER_INFO ?></th>
  </tr>
  <tr>
    <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_NUMBER?>:</td>
    <td><?php printf("%08d"$db->f("order_id")); ?></td>
  </tr>

  <tr>
    <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_DATE ?>:</td>
    <td><?php echo date("d-M-Y H:i"$db->f("cdate")); ?></td>
  </tr>
  <tr>
    <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PO_STATUS ?>:</td>
    <td><?php
         $q 
"SELECT order_status_name FROM #__{vm}_order_status WHERE ";
         $q .= "order_status_code = '" $db->f("order_status") . "'";
         $dbos = new ps_DB;
         $dbos->query($q);
         $dbos->next_record();
         echo $dbos->f("order_status_name");
         ?>


</td>
  </tr>
  <!-- End Customer Information -->
  <!-- Begin 2 column bill-ship to -->
  <tr class="sectiontableheader">
    <th align="left" colspan="2"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_CUST_INFO_LBL ?></th>
  </tr>
  <tr valign="top">
    <td width="50%"> <!-- Begin BillTo --><?php
    
// Get bill_to information
    $dbbt = new ps_DB;
    $q  "SELECT * FROM #__{vm}_order_user_info WHERE user_id='" $db->f("user_id") . "'  AND order_id='$order_id' AND address_type='BT'"
    $dbbt->query($q);
    $dbbt->next_record(); 
    $user $dbbt->record;
  ?>

      <table width="100%" cellspacing="0" cellpadding="2" border="0">
        <tr>
          <td colspan="2"><strong><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_BILL_TO_LBL ?></strong></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_COMPANY ?> :</td>
          <td><?php $dbbt->p("company"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_SHOPPER_LIST_NAME ?> :</td>
          <td><?php 
                $dbbt
->p("first_name"); 
                echo " ";
                $dbbt->p("middle_name"); 
                echo " ";
                $dbbt->p("last_name"); 
         ?>
</td>
        </tr>
        <tr valign="top">
          <td><?php echo $VM_LANG->_PHPSHOP_ADDRESS ?> :</td>
          <td><?php 
              $dbbt
->p("address_1"); 
              echo "<br />";
              $dbbt->p("address_2");    
         ?>
</td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_CITY ?> :</td>
          <td><?php $dbbt->p("city"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_STATE ?> :</td>
          <td><?php $dbbt->p("state"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_ZIP ?> :</td>
          <td><?php $dbbt->p("zip"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_COUNTRY ?> :</td>
          <td><?php 
$country $dbbt->f("country");
$dbbt->query"SELECT country_name FROM #__{vm}_country WHERE country_3_code = '$country'");
$dbbt->next_record();
$country_name $dbbt->f("country_name");
echo $country_name;
?>
</td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PHONE ?> :</td>
          <td><?php $dbbt->p("phone_1"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_FAX ?> :</td>
          <td><?php $dbbt->p("fax"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_EMAIL ?> :</td>
          <td><?php $dbbt->p("user_email"); ?></td>
        </tr>
      </table>
      <!-- End BillTo --> </td>
    <td width="50%"> <!-- Begin ShipTo --> <?php
    
// Get ship_to information
    $q  "SELECT * FROM #__{vm}_order_user_info WHERE user_id='" $db->f("user_id") . "'  AND order_id='$order_id' AND address_type='ST'"
    $dbst->query($q);
    $dbst->next_record();  
    ?>

<table width="100%" cellspacing="0" cellpadding="2" border="0">
        <tr>
          <td colspan="2"><strong><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SHIP_TO_LBL ?></strong></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_COMPANY ?> :</td>
          <td><?php $dbst->p("company"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_SHOPPER_LIST_NAME ?> :</td>
          <td><?php 
         $dbst
->p("first_name"); 
         echo " ";
         $dbst->p("middle_name"); 
         echo " ";
         $dbst->p("last_name"); 
         ?>
</td>
        </tr>
        <tr valign="top">
          <td><?php echo $VM_LANG->_PHPSHOP_ADDRESS ?> :</td>
          <td><?php 
          $dbst
->p("address_1"); 
          echo "<br />";
          $dbst->p("address_2");    
         ?>
</td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_CITY ?> :</td>
          <td><?php $dbst->p("city"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_STATE ?> :</td>
          <td><?php $dbst->p("state"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_ZIP ?> :</td>
          <td><?php $dbst->p("zip"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_COUNTRY ?> :</td>
          <td><?php 
if( $country != $dbst->f("country")) {
$country $dbst->f("country");
$dbst->query"SELECT country_name FROM #__{vm}_country WHERE country_3_code = '$country'");
$dbst->next_record();
$country_name $dbst->f("country_name");
}
echo $country_name;
?>
</td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PHONE ?> :</td>
          <td><?php $dbst->p("phone_1"); ?></td>
        </tr>
        <tr>
          <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_FAX ?> :</td>
          <td><?php $dbst->p("fax"); ?></td>
        </tr>
      </table>
      <!-- End ShipTo -->
      <!-- End Customer Information -->
    </td>
  </tr>
  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <?php if ($PSHOP_SHIPPING_MODULES[0] != "no_shipping" && $db->f("ship_method_id")) { ?>
  <tr>
    <td colspan="2">
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
       
        <tr class="sectiontableheader">
          <th align="left"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_CUST_SHIPPING_LBL ?></th>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><strong><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SHIPPING_CARRIER_LBL ?></strong></td>
                <td><strong><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SHIPPING_MODE_LBL ?></strong></td>
                <td><strong><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PRICE ?>&nbsp;</strong></td>
              </tr>
              <tr>
                <td><?php 
                    $details 
explode"|"$db->f("ship_method_id"));
                    echo $details[1];
                    ?>
&nbsp;
                </td>
                <td><?php 
                    
echo $details[2];
                    ?>

                </td>
                <td><?php 
                    
echo $CURRENCY_DISPLAY->getFullValue($details[3]); 
                    ?>

                </td>
              </tr>
            </table>
          </td>
        </tr>
       
      </table>
    </td>
  </tr><?php
     


  ?>

  <tr>
    <td colspan="2">&nbsp;</td>
  </tr>
  <!-- Begin Order Items Information -->
  <tr class="sectiontableheader">
    <th align="left" colspan="2"><?php echo $VM_LANG->_PHPSHOP_ORDER_ITEM ?></th>
  </tr>
  <tr>
    <td colspan="2">
      <table width="100%" cellspacing="0" cellpadding="2" border="0">
        <tr align="left">
          <th><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_QTY ?></th>
          <th><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_NAME ?></th>
          <th><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SKU ?></th>
          <th><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PRICE ?></th>
          <th align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_TOTAL ?>&nbsp;&nbsp;&nbsp;</th>
        </tr>
        <?php 
      $dbcart 
= new ps_DB;
      $q  "SELECT * FROM #__{vm}_order_item ";
      $q .= "WHERE #__{vm}_order_item.order_id='$order_id' ";
      $dbcart->query($q); 
      $subtotal 0;
      while ($dbcart->next_record()) {
?>

        <tr align="left">
          <td><?php $dbcart->p("product_quantity"); ?></td>
          <td><?php $dbcart->p("order_item_name"); echo " <font size=\"-2\">" $dbcart->f("product_attribute") . "</font>";?></td>
          <td><?php $dbcart->p("order_item_sku"); ?></td>
          <td><?php /*
                $price = $ps_product->get_price($dbcart->f("product_id"));
                $item_price = $price["product_price"]; */
                $item_price $dbcart->f("product_item_price");
               echo $CURRENCY_DISPLAY->getFullValue($item_price);
               
           ?>
</td>
          <td align="right"><?php $total $dbcart->f("product_quantity") * $item_price
                $subtotal += $total;
                echo $CURRENCY_DISPLAY->getFullValue($total);
           ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr><?php
      
}
?>

        <tr>
          <td colspan="4" align="right">&nbsp;&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SUBTOTAL ?> :</td>
          <td align="right"><?php echo $CURRENCY_DISPLAY->getFullValue($subtotal?>&nbsp;&nbsp;&nbsp;</td>
        </tr>
<?php 
      
/* COUPON DISCOUNT */
      $coupon_discount $db->f("coupon_discount");
      
      
if( $coupon_discount ) {
        $subtotal -= $coupon_discount;
      ?>

        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_COUPON_DISCOUNT ?>:
          </td>
          <td align="right"><?php
            
echo "- ".$CURRENCY_DISPLAY->getFullValue$coupon_discount ); ?>
&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
      <?php
      
}
      if (($db->f("order_discount") != 0) && (PAYMENT_DISCOUNT_BEFORE == '1')) { ?>

        <tr>
            <td colspan="4" align="right"><?php 
              
if( $db->f("order_discount") > 0)
                echo $VM_LANG->_PHPSHOP_PAYMENT_METHOD_LIST_DISCOUNT;
              else
                echo $VM_LANG->_PHPSHOP_FEE;
                ?>
:
            </td>
            <td align="right"><?php
          
if ($db->f("order_discount") > )
               echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
          elseif ($db->f("order_discount") < )
               echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount"))); ?>

            &nbsp;&nbsp;&nbsp;</td>
        </tr>
       
        <?php 
      
}
?>

       
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_SHIPPING ?> :</td>
          <td align="right"><?php 
            $shipping_total 
$db->f("order_shipping");
            echo $CURRENCY_DISPLAY->getFullValue($shipping_total);
            
            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
        <tr>
          <td colspan="4" align="right"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_TOTAL_TAX ?> :</td>
          <td align="right"><?php 
            $tax_total 
$db->f("order_tax")+ $db->f("order_shipping_tax");
            echo $CURRENCY_DISPLAY->getFullValue($tax_total);
            
            ?>
&nbsp;&nbsp;&nbsp;</td>
        </tr>
     
        <tr>
          <td colspan="4" align="right">
          <?php if (PAYMENT_DISCOUNT_BEFORE == '1') { ?><strong><?php 
          
          
echo $VM_LANG->_PHPSHOP_CART_TOTAL .":"; if (PAYMENT_DISCOUNT_BEFORE != '1') { ?>
</strong><?php ?></td>
         
          <td align="right"><?php 
          
if (PAYMENT_DISCOUNT_BEFORE == '1') { ?>
<strong><?php  
            $total = $db->f("order_total");
            echo $CURRENCY_DISPLAY->getFullValue($total);
          }
          else {
            $total = $db->f("order_subtotal") + $db->f("order_tax") + $db->f("order_shipping");
            echo $CURRENCY_DISPLAY->getFullValue($total);
          }
          if (PAYMENT_DISCOUNT_BEFORE == '1') { ?>
</strong><?php ?>&nbsp;&nbsp;&nbsp;</td>
        </tr>
        <?php 
        
if ($db->f("order_discount") != 0.00 && PAYMENT_DISCOUNT_BEFORE != '1') { ?>

        <tr>
        <td colspan="4" align="right"><?php 
              
if( $db->f("order_discount") > 0)
                echo $VM_LANG->_PHPSHOP_PAYMENT_METHOD_LIST_DISCOUNT;
              else
                echo $VM_LANG->_PHPSHOP_FEE;
                ?>
:
        </td>
        <td align="right"><?php
          
if ($db->f("order_discount") > )
               echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
          elseif ($db->f("order_discount") < )
               echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
               ?>
&nbsp;&nbsp;&nbsp;
        </td>
        </tr>
        <tr>
            <td colspan="4" align="right"><strong><?php echo $VM_LANG->_PHPSHOP_CART_TOTAL ?>: </strong></td>
        <td align="right"><strong><?php echo $CURRENCY_DISPLAY->getFullValue($db->f("order_total")); ?>
        </strong>&nbsp;&nbsp;&nbsp;
          </td>
        </tr>
        <?php
        

        ?>

        <tr>
            <td colspan="4" align="right">&nbsp;</td>
        <td align="right"><strong><?php echo ps_checkout::show_tax_details$db->f('order_tax_details') ); ?>
        </strong>&nbsp;&nbsp;&nbsp;
          </td>
        </tr>           
      </table>
    </td>
  </tr>
  <!-- End Order Items Information -->

<br />

  <!-- Begin Payment Information -->

      <table width="100%">
      <tr class="sectiontableheader">
        <th align="left" colspan="2"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PAYINFO_LBL ?></th>
      </tr>
          <?php
          
/** Retrieve Payment Info **/
          $dbpm = new ps_DB;
          $q  "SELECT * FROM #__{vm}_payment_method, #__{vm}_order_payment, #__{vm}_orders ";
          $q .= "WHERE #__{vm}_order_payment.order_id='$order_id' ";
          $q .= "AND #__{vm}_payment_method.payment_method_id=#__{vm}_order_payment.payment_method_id ";
          $q .= "AND #__{vm}_orders.user_id='" $db->f("user_id") . "' ";
          $q .= "AND #__{vm}_orders.order_id='$order_id' ";
          $dbpm->query($q);
          $dbpm->next_record(); ?>

      <tr>
        <td width="20%"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_PAYMENT_LBL ?> :</td>
        <td><?php $dbpm->p("payment_method_name"); ?> </td>
      </tr>
  <?php
          
require_once(CLASSPATH.'ps_payment_method.php');
          $ps_payment_method = new ps_payment_method;
          $payment $dbpm->f("payment_method_id");
          
          
if ($ps_payment_method->is_creditcard($payment)) { 
          
            
// DECODE Account Number
            $dbaccount = new ps_DB;
            $q "SELECT DECODE(\""$dbpm->f("order_payment_number")."\",\"".ENCODE_KEY."\") as account_number FROM #__{vm}_order_payment WHERE order_id='".$order_id."'";
            $dbaccount->query($q);
            $dbaccount->next_record(); ?>

      <tr>
        <td width="10%"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_ACCOUNT_NAME ?> :</td>
        <td><?php $dbpm->p("order_payment_name"); ?> </td>
      </tr>
      <tr>
        <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_ACCOUNT_NUMBER ?> :</td>
        <td><?php echo ps_checkout::asterisk_pad($dbaccount->f("account_number"),4);
    ?>
</td>
      </tr>
      <tr>
        <td><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_EXPIRE_DATE ?> :</td>
        <td><?php echo date("M-Y"$dbpm->f("order_payment_expire")); ?> </td>
      </tr>
  <?php ?>
      <!-- end payment information -->
      </table>
</center>
<?php // }
  
  
/** Print out the customer note **/
  if ( $db->f("customer_note") ) {
    ?>

    <table width="100%">
      <tr>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr class="sectiontableheader">
        <th align="left" colspan="2"><?php echo $VM_LANG->_PHPSHOP_ORDER_PRINT_CUSTOMER_NOTE ?></th>
      </tr>
      <tr>
        <td colspan="2">
         <?php echo nl2br($db->f("customer_note"))."<br />"?>
       </td>
      </tr>
    </table>
    <?php
  
}
  
// } /* End of security check */
?>

Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 23, 2006, 00:46:28 AM
mizanation,
No, the shipping module's not smart enough to periodically check the delivery status of all open shipments and adjust status when packages are delivered.  I don't know how to explain what you are seeing.

holsom,
Regarding the shipment date error.  The DHL server is returning that error.  It is saying the shipment date in the XML request is not valid (either in the past or too far in the future).  I recommend uncommenting the debugging line in the dhl.php generate_label function.  It's around line 947.  Then you'll be able to see what is being sent to the DHL server.  Look at the shipment date and see if you can figure out why DHL thinks it is invalid.  The date is in Shipment->ShipmentDetail->ShipDate.

Is it possible the order came in yesterday before the "too late" cut-off time and you are only printing the shipping label today?

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on September 23, 2006, 02:22:19 AM
Mike,
   How is it suppose to format the date? 
It currently is displaying like this
<ShipDate>2006-09-21</ShipDate>

Something is strange with the ship to function:  It is using the "Bill to"  as the ship to and in the print invoice window the ship to isn't giving an error now but it is not being populated with any information.  I wonder if both problems are somehow related?

What version of virtuemart are you running?  I want to get these files updated and packaged together so that we can continue to increase the awareness of the DHL module and hopefully get more people involved!

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on September 23, 2006, 10:21:51 AM
Mike and everyone else,

    When a customer tries to place an order when DHL is unavailable i.e.- a weekend,  it says that the service is unavialble and that it will ship on (the next date)... but it doesn't let you choose a shipping option.

Is there an option that overides the current availability of DHL?  A customer shouldn't have to wait until "business hours" before making a purchase from our site.  We shouldn't also have to wait until business hours to print a DHL label from the back-end.  Can this be changed?

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 23, 2006, 16:19:43 PM
holsum, i think it does let you choose.  it notifies the user that it will ship the next business day, but the user is able to choose the shipping option...
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on September 23, 2006, 18:55:58 PM
OK, it appears that everything is working great now!

I will be posting the new dhl.1.0.7 later today or tomorrow.  I just need to update the read me file.

Thanks everyone,

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on September 29, 2006, 20:11:10 PM
Hey guys.

I am getting the same error holsum was getting:

Shipment not generated. [code 102]
A shipment date must fall between today and 9 days from now. [code 4100]


This is because the orders were made last week, but for several reasons, they are to be shipped this week.

Is there a way to "reset" the ship date so that we can print a new label?

Can I just set the ship date to today whenever they click on "Print Label"?
Title: Re: DHL Shipping and printing shipping labels
Post by: durian on September 29, 2006, 21:19:01 PM
The shipping quotes presented to the customer are based on various information, like speed and delivery date.  This includes the ship date.  This same data is later used when printing the label to ensure the shipping cost accurately matches the quoted price.

If you can't ship on the scheduled date, you can at least generate the shipping labels on that date and then ship the package later.

mike
Title: Re: DHL Shipping and printing shipping labels
Post by: Ryan Gatewood on October 28, 2006, 10:01:07 AM
Quote from: holsum on September 23, 2006, 18:55:58 PM
OK, it appears that everything is working great now!

I will be posting the new dhl.1.0.7 later today or tomorrow.  I just need to update the read me file.

Thanks everyone,

-Holsum

Just curious if this is ever going to get posted?
Title: Re: DHL Shipping and printing shipping labels
Post by: Ryan Gatewood on October 30, 2006, 07:40:08 AM
I got everything working with VM 1.0.7 and submitted a new download package with easy to follow instructions. Hopefully I dont offend anyone by doing this, just figured it would help a lot of people.
Title: Re: DHL Shipping and printing shipping labels
Post by: r0tt3n on October 30, 2006, 21:49:37 PM
where?
Title: Re: DHL Shipping and printing shipping labels
Post by: Ryan Gatewood on November 08, 2006, 03:51:18 AM
Quote from: r0tt3n on October 30, 2006, 21:49:37 PM
where?

http://virtuemart.net/index.php?option=com_docman&task=cat_view&gid=103&Itemid=66
Title: Re: DHL Shipping and printing shipping labels
Post by: r0tt3n on November 08, 2006, 08:28:42 AM
hmmm....the words "DHL" don't appear anywhere, either on that page, or in the source of that page.  Am I missing something?
Title: Re: DHL Shipping and printing shipping labels
Post by: Ryan Gatewood on November 08, 2006, 17:22:49 PM
Quote from: r0tt3n on November 08, 2006, 08:28:42 AM
hmmm....the words "DHL" don't appear anywhere, either on that page, or in the source of that page.  Am I missing something?


Sorry, I had modified the package so it was gone for a moment... Its there now...

Title: Re: DHL Shipping and printing shipping labels
Post by: Frank Michels on February 15, 2007, 14:19:00 PM
Hi @ all,

did someone get this mod running for germany ?

Installed everything and get this error :

Fehler: error setting certificate verify locations:
CAfile: /usr/share/curl/curl-ca-bundle.crt
CApath: none

Maybe someone can help ?
Thx in advance

Regards
FraMic
Title: DHL and VM1.0.9 : FIXED
Post by: Buddy Glass on March 02, 2007, 07:20:01 AM
I am getting a "permission denied" error with my DHL-approved API Login, password, shipping keys, and account numbers. I triple checked them and they are correct and showing in the appropriate php files. I'm running VM 1.0.9. and the DHL for VM 1.0.9 mod. Am I missing something really simple?

Never mind. I just realized I didn't request all the services on the account. ;D
Title: international characters causing errors
Post by: mizanation on March 14, 2007, 03:58:59 AM
hi, i hope somebody is reading this thread.

i have been using this module for about 6 months and i love it.

the only problem i am having is that when a user puts in international characters (such as "ä") in their shipping information, it is returning an error:

Error Description: DHL XML Repsonse missing result code

so, i'm guessing that the DHL api doesn't accept any non-english characters.

does anyone have a suggestion to fix this?

thanks in advance.
Title: Re: DHL Shipping and printing shipping labels
Post by: Murat on March 23, 2007, 17:32:58 PM
hi, i need an urgent help.
my web site is running on solaris 10 and i'm getting "Error: Invalid DHL XML Repsonse" . I tried to copy all my files and db to a Windows web server and it worked fine.

does anyone have a suggestion?

thanks in advance.
Title: Re: DHL Shipping and printing shipping labels
Post by: Murat on March 28, 2007, 01:45:49 AM
Hi everbody,

Which libraries should be installed to make this DHL shipping module work? I need the list of php libraries for PHP 5.x. Please help! HEEEELP.

Thanks.
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on May 05, 2007, 07:31:33 AM
Hey everyone... I have been gone for sometime now.  I used to be very active on this thread back when Mike and I where talking through this system.  I have created an update to the DHL Ship and Print module for VirtueMart 1.0.10 and I have also created a patch for users who have already installed the DHL ship and Print module on their site.

http://holsumstudios.com/component/option,com_docman/Itemid,41/task,cat_view/gid,11/

-Holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Santiago Berreta on June 14, 2007, 20:46:47 PM
I've installed this module from holsumstudios.com but and followed the readme file, but I can not see this shipping method while posting a new order, and checking out. Is there anything else I have to do and I'm not doing???

thanks a lot!!
Title: Re: DHL Shipping and printing shipping labels
Post by: AmSt4ff on June 25, 2007, 08:52:17 AM
Is this module also working if you are living in Europe??????

But the other module is US only..... what about the VM users from Europe?
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on June 27, 2007, 04:35:19 AM
Santiago Berreta,
  You need to make sure that you publish the module from the virtuemart administration folder.

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on June 27, 2007, 05:51:42 AM
I just released the latest update to the DHL shipping module for Virtuemart 1.0.11

You can download it here:
http://holsumstudios.com/component/option,com_docman/Itemid,41/task,cat_view/gid,11/

This is just a patch for existing DHL ship and Print Module users.  I will package up the full install version next.

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 17:31:03 PM
I am having problems with installing this on our site. I am running Joomla 1.0.12, and VirtueMart 1.0.12. When I try to import the dhl_add_states.sql to the jos_vm_state table I keep recieving an error. I did change the create and counrty sql to jos_ instead of mos_, and they installed just fine. But when I get to the states, I keep reciving this error
QuoteError

SQL query:

INSERT INTO `jos_vm_state` ( country_id, state_name, state_3_code, state_2_code )
VALUES ( 104, 'Gaza Strip', 'GZS', 'GZ' ) , ( 104, 'West Bank', 'WBK', 'WB' ) , ( 104, 'Other', 'OTH', 'OT' ) , ( 151, 'St. Maarten', 'STM', 'SM' ) , ( 151, 'Bonaire', 'BNR', 'BN' ) , ( 151, 'Curacao', 'CUR', 'CR' )

MySQL said: Documentation
#1062 - Duplicate entry 'GZS-GZ' for key 2

Help please. I have searched google. These forums. I have found nothing.

Thanks,
Josh
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 17:52:29 PM
So the country codes were added back during Virtumart 1.0.5 and I am pretty sure Gaza strip was not in the default Virtuemart code at the time.  I am only guessing here but I would bet that it is now in version 1.0.12.  Just remove that Gaza valuses from your mySQL text before adding it to your database:

INSERT INTO `jos_vm_state` ( country_id, state_name, state_3_code, state_2_code )
VALUES ( 104, 'West Bank', 'WBK', 'WB' ) , ( 104, 'Other', 'OTH', 'OT' ) , ( 151, 'St. Maarten', 'STM', 'SM' ) , ( 151, 'Bonaire', 'BNR', 'BN' ) , ( 151, 'Curacao', 'CUR', 'CR' )



-holsum

www.holsumstudios.com
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 18:02:52 PM
I'm guessing you do not have to import the states sql with the new version because I got the some error when I deleted each value from the sql. Now when I try to submit an order my website times out.... I dont know what the problem could be. Any ideas?
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 18:09:00 PM
I would turn on debugging in virtuemarts administrator interface.  I am sure it would be throwing up errors if a necessary sql statement was missing. 

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 18:56:50 PM
Ok, I turned on my debuging mode, and furthest i can get is to the selecting my shipping address. After that point (moving to the "Ship Method') the website times out and i can't see and error or anything? And I really don't know exactly what I am looking for
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 19:12:21 PM
when you installed the dhl shipping module did you include the dhl_create_table.sql

Also, if you dissable the DHL shipping module from the admin section of virtuemart and use a defualt shipping mod does the front end still timeout?

-holsum
www.holsumstudios.com
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 19:33:04 PM
Ok, I disabled the module, and used the Standard Shipping module. That worked fine. I re-imported the dhl_create_tables.sql and changed the name CREATE TABLE IF NOT EXISTS `mos_vm_shipping_label` to CREATE TABLE IF NOT EXISTS `jos_vm_shipping_label`

But the DHL Module still does not work. :(
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 19:40:51 PM
mos to jos,  I will make sure that it is updated on the next DHL release.

-holsum
www.holsumstudios.com
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 20:27:38 PM
still I am having bad luck with this module. if any one can go to my site and take a look it is http://www.knucklesfirst.com/genwork/
the only product I have is in the Paintball/Gun(markes)/Smart Parts/Ion


Thanks a ton
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 20:38:31 PM
You have to stream line that checkout process for new users.  Turn of account validation by email and turn on "invisible registration."


You want people to be able to easily purchase from your site.  Not pass through multiple security checkpoints just to have the privilege of buying from you.

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 21:02:46 PM
I believe that I turn the "invusible registration" on (where it does not require then to activate email?).
But the shipping is still timing out... :( :(
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on July 19, 2007, 21:15:15 PM
no it still requires them to activate their account through their email.   trun it off in Joomla Configuration file. 

I believe it is timing out becuase of a non response from the DHL API.  Make sure that you have entered your Account information, your domestic and international DHL keys correctly and also make sure that all of the DHL modules have been uploaded completely.

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 19, 2007, 22:49:56 PM
In Joomla I have it set as

Allow User Registration:   Yes 
Use New Account Activation:  No   
Require Unique E-mail:  No 

and VirtueMart

Use silent (hidden) user registration?   checked
Joomla!: User registration allowed? Yes
Joomla!: New account activation necessary? No
 
**ADDED**
Re-Uploaded all files to the correct destination (/genwork/administrator/components/com_virtuemart (classes,html,langues)) with updated version (most recent).

Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 20, 2007, 16:27:01 PM
I am recieving a new error to my shipping.
QuoteError: Function Not Registered. checkoutProcess is not a valid MOS_com_phpShop function.
QuoteError: Module Not Registered."checkout" is not a valid VirtueMart module.

I attached the full error page that I recieved.

Hopefully this could fix the problem *crosses fingers*

*Update*
reinstalled Joomla and VirtueMart. Still same problem.

HELP!

[attachment cleanup by admin]
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 24, 2007, 21:00:37 PM
Did that error help with trying to solve the problem?
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on July 25, 2007, 20:13:35 PM
Please can anyone help me with this module. I can not get it to work. I've looked for the curl thing for godaddy. I have reinstalled and reinstalled and searched and searched. Please and anyone help with setting this module up?
Title: Re: DHL Shipping and printing shipping labels
Post by: Josh on August 02, 2007, 18:43:06 PM
Ok, so im no longer getting the errors that I was recieving before. Now I am just getting Error: Please select a Shipping Method.
Any ideas what I need to do this now?
Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on August 05, 2007, 18:45:29 PM
Latest version of DHL ship and Print Model has been released for Virtuemart 1.0.12
http://holsumstudios.com/component/option,com_docman/task,doc_details/gid,9/Itemid,47/
   

This is the FULL VERSION of the Virtuemart v.1.0.12 DHL ship & Print Module.

Features:

    * DHL application for DHL API (you will need a dhl account to use this module)
    * Automatic DHL rates for domestic and international customers.
    * From the virtumart administrator section:
          o One click auto generated labels
          o One click void shipment
          o One click tracking
Title: Re: DHL Shipping and printing shipping labels
Post by: tonertek on September 06, 2007, 15:43:10 PM
Is there any word on a fix for the DHL module for Virtuemart 1.0.12 . It currently does not work :-( despite every effort.
Title: Re: DHL Shipping and printing shipping labels
Post by: mr9sky on October 14, 2007, 19:48:45 PM
Guys, I think the link is down . I am gettingerros like this:

Parse error: syntax error, unexpected $end in /var/www/vhosts/holsumstudios.com/httpdocs/modules/mod_contentitem.php on line 124


ANyone has alternate download links?



Title: Re: DHL Shipping and printing shipping labels
Post by: holsum on January 04, 2008, 00:53:54 AM
The link is up but I do seem to see a bug in this version.  The "Print" feature doesn't seem to be working correctly.  If anyone has any ideas why or was able to get this work on in their version let me know.

I will try to investigate it as well.  Time permitting.

-holsum
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 17, 2008, 18:48:02 PM
Hi all, I'm a complete noob to this and would appreciate some help...

I'm on step 2 of the instructions for the installation of this module and keep getting errors on the import.

2. Update your database with the provided SQL updates located in the "sql" directory.
Import dhl_create_table.sql first. It will create a table to hold information for the labels.
Import dhl_add_countries.sql into the jos_vm_country table.
Import dhl_add_states.sql into the jos_vm_state table.


I'm using PHPMyAdmin/MySQL...so what I did was
1. Select the database to import these files to
2. Clicked on "Import" which takes me to the Import page:
    a. Browse to location of the file (selected the "dhl_create_table.sql" file)
    b. Unchecked the "Allow Interupt"
    c. Format of imported file SQL checked
    d. SQL compatibility mode: NONE
3. Clicked "Go"

Then I get Navigation to Page was Cancelled: Refresh
When I refresh I get this ERROR: Error
You probably tried to upload too large file. Please refer to documentation for ways to workaround this limit.

I know that the file is not too large...it's quite small :-)

So I opened the "dhl_create_table.sql" and changed the "mos_" to "jos_" because all my tables are jos_
I then tried to import via the SQL page querie...and recieved the same ERROR.

I was able to import the other 2 .sql files for countries and states (once I change the mos_ to jos_)

Can someone please help me to "dhl_create_table.sql" imported without ERROR?

Thanks,
TheWebGuy
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 17, 2008, 19:55:12 PM
Ok nevermind it appears that even though it threw the described ERROR the table was still created.

Next Question is:

When filling out the Shipping Module Configuration:

Quote"Click on the "Configure Ship Method" under The DHL Shipping Module. This should pull up a configuration page for the module. Fill in the values acordingly. You will need the information from step one for this. if you dont understand something hover over the help icon for an explanation."

The text boxes are already filled with: <? echo DHL_ID?>

Do I just replace the DHL_ID OR replace the entire text?

Should it be:

<? echo 12345678?> OR 12345678 in the text box?

I know this question will probably make most of you laugh, so after you have a good laugh
can you please reply with the correct answer  :D

Thanks.
Title: Re: DHL Shipping and printing shipping labels
Post by: aravot on January 17, 2008, 20:57:51 PM
Only 12345678
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 18, 2008, 18:45:53 PM
Thanks!
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 18, 2008, 19:10:18 PM
OK I'm getting Error: Invalid DHL XML Response.

Under the Shipping Module Configuration: dhl.php
Do all Items have to be filled in for this to work?

I don't need:
1. International Shippping
2. What is "Too late to ship"?
3. Shipping Contents can be anything right?
4. Weight of Packaging: One Product weighs 21oz. the Other 42oz. What if anything goes here?
5. I won't be using Duty since I'm not shipping International
6. I won' be using Insurance

(http://www.nutracea.com/images/samples/dhl.gif)

Any kind of more specific instructions and/or help is greatly appreciated.
Has anyone got this module to work for them?

Thanks,
The Web Guy
Title: Re: DHL Shipping and printing shipping labels
Post by: aravot on January 18, 2008, 19:49:01 PM
I have not tried this DHL shipping module, don't know if it works or not but I am sure the first 5 fields need to have value.
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 18, 2008, 19:56:23 PM
Yeah, I did fill in all the "necessary" boxes or the ones I think are "necessary"...ID LOGIN PW etc.

I'm just not too sure about the others.
I've tried a number of different combinations now with the same result.

Error: Invalid DHL XML Repsonse

I have no where else to go for help so I'll hope and wait someone responds  :)

I've also noticed that when I save this Config and then go back to change something none of my previous data is there?
I know I have all the correct permissions on the .php files so it's not a "writeable" "non-writeable" issue.

Someone help please!?
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on January 18, 2008, 21:12:13 PM
Ok...slowly but surely I'm getting somewhere

There was a "bad" line in my english.php file, once I fixed that it seems to be processing almost:
Now I get this:
It is too late for the DHL shipment to go out today. The order will ship on: Jan 21, 2008

Next Afternoon: The shipment could not be rated. [code 202]
This account can not be used for rate estimates. [code 4198]

Second Day: The shipment could not be rated. [code 202]
This account can not be used for rate estimates. [code 4198]

Ground: The shipment could not be rated. [code 202]
This account can not be used for rate estimates. [code 4198]

If anyone wants to know how to get rid of the "It is too late to ship today...etc."
In the dhl.php file starting at line 39 "$shipping_delayed = true;"

Change all these to: $shipping_delayed = false;

I've sent an email to DHL, I wonder who will respond first?
Title: Re: DHL Shipping and printing shipping labels
Post by: mizanation on November 09, 2008, 14:23:24 PM
is this module compliant with dhl's new xml-api?
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on November 10, 2008, 16:18:31 PM
As far as I know it is, I haven't changed anything since I first installed it and it is still working with DHL.
Title: Re: DHL Shipping and printing shipping labels
Post by: aravot on November 10, 2008, 20:16:46 PM
DHL cease business in USA domestic market
http://www.dhl-usa.com/about/pr/PRDetail.asp?nav=PressRoom/PressReleases&year=2008&seq=1246
Title: Re: DHL Shipping and printing shipping labels
Post by: TheWebGuy on November 10, 2008, 20:50:23 PM
Thanks for the information!
Well looks like it's time to move to FedEX, UPS OR USPS eh?