Jump to content

worldprosoft

Members
  • Content count

    5
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Dan
  1. worldprosoft

    [Contribution] UPS XML Tracking

    Ok I have revised the code to initialize the form variables now for both /catalog/tracking.php and the popup-tracker.php files. On /includes/classes/tracking.php place the following code right under the opening <?php ---------------------------------------------------------- $tracknum=$_POST['tracknum']; $action=$_POST['action']; $show=$_POST['show']; $p=$_POST['p']; if (isset($tracknum)) { // print "Method: POST<br>"; // foreach($_POST as $name => $value) { // print "$name : $value<br>"; // } } else { $tracknum=$_GET['tracknum']; $action=$_GET['action']; $show=$_GET['show']; $p=$_GET['p']; // print "Method: GET<br>"; // foreach($_GET as $name => $value) { // print "$name : $value<br>"; // } } -------------------------------------------------------------- Do not copy my ----- lines they are there for comment purposes only. Feel free to remove my debug commented out lines starting with // Feel free to optimize. This fixed all the issues, it took a while but it now works perfectly.
  2. worldprosoft

    [Contribution] UPS XML Tracking

    For those of you who are getting the error: 10002 Failure Hard The xml document is well formed but is not valid: ----------- In /includes/classes/tracking.php replace: ------- $accessRequestHeader = "<?xml version=\"1.0\"?>\n". "<AccessRequest xml:lang=\"en-US\">\n". " <AccessLicenseNumber>". $access_key ."</AccessLicenseNumber>\n". " <UserId>". $userid ."</UserId>\n". " <Password>". $pass ."</Password>\n". "</AccessRequest>\n"; $trackingServiceSelectionRequestHeader = "<?xml version=\"1.0\"?>\n". "<TrackRequest xml:lang=\"en-US\">\n". " <Request>\n". " <TransactionReference>\n". " <CustomerContext>UPS Package Tracking</CustomerContext>\n". " <XpciVersion>1.0001</XpciVersion>\n". " </TransactionReference>\n". " <RequestAction>Track</RequestAction>\n". " <RequestOption>" . $activity . "</RequestOption>\n". " </Request>\n"; if (isset($show) && $show == 'detail' || $c == '1') { $trackingServiceSelectionRequestHeader .= " <TrackingNumber>" . $tracknum . "</TrackingNumber>\n" . "</TrackRequest>\n"; } else { $shipID = 1; $trackingServiceSelectionRequestHeader .= " <ShipmentIdentificationNumber>" . $tracknum . "</ShipmentIdentificationNumber>\n" . "</TrackRequest>\n"; } ------- with: ------- $accessRequestHeader = "<?xml version=\"1.0\"?>\n". "<AccessRequest xml:lang=\"en-US\">\n". " <AccessLicenseNumber>". $access_key ."</AccessLicenseNumber>\n". " <UserId>". $userid ."</UserId>\n". " <Password>". $pass ."</Password>\n". "</AccessRequest>\n"; $trackingServiceSelectionRequestHeader = "<?xml version=\"1.0\"?>\n". "<TrackRequest xml:lang=\"en-US\">\n". " <Request>\n". " <TransactionReference>\n". " <CustomerContext>UPS Package Tracking</CustomerContext>\n". " <XpciVersion>1.0001</XpciVersion>\n". " </TransactionReference>\n". " <RequestAction>Track</RequestAction>\n". " <RequestOption>" . $activity . "</RequestOption>\n". " </Request>\n"; if (isset($show) && $show == 'detail' || $c == '1') { $trackingServiceSelectionRequestHeader .= " <TrackingNumber>" . $tracknum . "</TrackingNumber>\n" . "</TrackRequest>\n"; } else { $shipID = 1; $trackingServiceSelectionRequestHeader .= " <ShipmentIdentificationNumber>" . $tracknum . "</ShipmentIdentificationNumber>\n" . "</TrackRequest>\n"; } ------- This fixed the issue for me.
  3. worldprosoft

    [Contribution] UPS XML Tracking

    This only works so far for /catalog/tracking.php and not the pop-up links from account_history sections. I suspect the same will need to done for them, but since it is not posting using a form we'll have to parse the URL into variables and then initialize them properly.
  4. worldprosoft

    [Contribution] UPS XML Tracking

    I had this issue as well, I traced it back to the fact that the form variables from the post were not being initialized in the /includes/classes/tracking.php file To solve it I added the following 2 lines to /includes/classes/tracking.php right at the top under the <?php $tracknum=$_POST['tracknum']; $action=$_POST['action']; This will tell the classes tracking php script to initialize the tracknum and action post variables in the script.
×