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
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
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.
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
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]
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
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
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
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:
- Prints shipping labels. There is a new function available on the Order List page. If an order was placed using DHL (or in general, if a shipping module supporting print labels), you can click on a link to display a image of a DHL shipping label that you can then print and use.
- Voids shipping labels. Related to printing shipping labels. If you've created a label and then need to void it, you can do that.
- Tracking. You can track any labels you've created.
- Signature Retrieval. When you track a package, if it has been delivered, you'll also see the delivery signature. Or delivery codes if the package was left without a signature.
- Domestic and International. The DHL module supports both domestic (meaning US - the DHL API is US centric) and international shipping.
- Duty values that are different from the retail price of an order. International shipments require duties. Sometimes you are shipping an item that cost significantly more that the value of the tangible good. Software might be an example: you might charge a fair amount for software, but the value of the item you ship is just a burned CD-ROM, a printed manual and maybe a dongle or something. You might want to calculate duties on just the physical goods.
The duty value is calculated by defining a special Shopper Group for duty prices. The DHL module will look for a price using this group (which you can define) and use that price if found. If a special duty price is not found, it use the normal retail price.
- Insurance values. Similar to duty values. A special shopping group is used to hold the insurance value for a given item. If the sum of the insurance on all the goods is greater than the default insurance value (configurable) the insurance is used when generating the shipping label. This applies to both domestic and international.
- Too late. You can set a time at which it is too late for items to ship the same day. This also affects if Saturday Delivery is available as a shipping option. If it is too late to go out on a Thursday, the Saturday delivery option is listed just as if it were a Friday.
- Configurable list of shipping options. You can select which domestic and international shipping options are available. Express, Next Afternoon, Second Day, Ground, Express 10:30am, Saturday Delivery and International Express.
- Packaging weight. You can configure a value that is added to the weight of the individual items to cover the packaging weight.
mike
[attachment cleanup by admin]
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]
Durian,
You r the man!
Good to see coders actively working on expanding this project. :)
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]
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
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
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
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
The SQl changes and the directory files are easy but what is patch(1) ?
-holsum
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
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
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.
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
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.
I checked the database and the images are there.
Which file contains the commented out xml debuging lines?
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
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?
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.
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
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
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
Nevermind, I accidentally had written over the two classes files while trying to patch a CB2 intergration problem.
-Lary
Is there a final version with all the fixes that you can post here. Thanks.
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
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]
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?
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
I understand the time thing! Thanks for the help.
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
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
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
I wholeheartedly agree that the DHL module needs attention.
Don't make me go back to oscommerce!!!!!
Miracle of miracles .... DHL module is now working.....
That's good news. Can you provide details on how you fixed things, in case others run into the same problem?
mike
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
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
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
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
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
Thanks I appreciate it.
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
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
With VirtueMart 1.1. It's already available in the CVS repository.
ciao, Soeren
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
Holsum,
That's a great idea and I'm sure people will appreciate it.
mike
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
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
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.
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
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.
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
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
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
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.
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
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
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???
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"> </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 ?> </strong></td>
</tr>
<tr>
<td><?php
$details = explode( "|", $db->f("ship_method_id"));
echo $details[1];
?>
</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"> </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 ?> </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);
?> </td>
</tr><?php
}
?>
<tr>
<td colspan="4" align="right"> </td>
<td> </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) ?> </td>
</tr>
<?php
/* COUPON DISCOUNT */
$coupon_discount = $db->f("coupon_discount");
if( $coupon_discount > 0 ) {
$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 ); ?>
</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") > 0 )
echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
elseif ($db->f("order_discount") < 0 )
echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount"))); ?>
</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);
?> </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);
?> </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 } ?> </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") > 0 )
echo "- ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
elseif ($db->f("order_discount") < 0 )
echo "+ ".$CURRENCY_DISPLAY->getFullValue(abs($db->f("order_discount")));
?>
</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>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="4" align="right"> </td>
<td align="right"><strong><?php echo ps_checkout::show_tax_details( $db->f('order_tax_details') ); ?>
</strong>
</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"> </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 */
?>
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
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
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
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...
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
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"?
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
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?
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.
where?
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
hmmm....the words "DHL" don't appear anywhere, either on that page, or in the source of that page. Am I missing something?
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...
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
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
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.
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.
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.
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
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!!
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?
Santiago Berreta,
You need to make sure that you publish the module from the virtuemart administration folder.
-holsum
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
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
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
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?
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
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
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
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. :(
mos to jos, I will make sure that it is updated on the next DHL release.
-holsum
www.holsumstudios.com
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
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
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... :( :(
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
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).
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]
Did that error help with trying to solve the problem?
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?
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?
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
Is there any word on a fix for the DHL module for Virtuemart 1.0.12 . It currently does not work :-( despite every effort.
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?
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
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
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.
Only 12345678
Thanks!
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
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.
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!?
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?
is this module compliant with dhl's new xml-api?
As far as I know it is, I haven't changed anything since I first installed it and it is still working with DHL.
DHL cease business in USA domestic market
http://www.dhl-usa.com/about/pr/PRDetail.asp?nav=PressRoom/PressReleases&year=2008&seq=1246
Thanks for the information!
Well looks like it's time to move to FedEX, UPS OR USPS eh?