X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   UPS XML Tracking Integration (https://forum.x-cart.com/showthread.php?t=8190)

firecompanies 06-21-2004 12:17 PM

UPS XML Tracking Integration
 
I was able to get my hands on a PHP script which will allow customers to track their UPS packages directly through the site. This does not redirect the customer to UPS, but instead returns the tracking information to the script.

My question is... can anyone shed any light on how to "embed" this PHP script within the store so that the normal layout flows around the output of the script??? I notice during the patch/upgrade process, X-cart kind of does something to this effect.

Any ideas?

Craig Elliott
FireCompanies.com

B00MER 06-24-2004 04:03 AM

Code:

require "./auth.php";

// API Code

$smarty->assign("trackingnum",$trackingnum);
$smarty->assign("main","trackingnum");


Edit common_templates.tpl and add a new {elseif $main eq "trackingnum"} and include your new .tpl that outputs the $trackingnum values you passed from the php.

hth. ;)

firecompanies 06-24-2004 05:44 AM

Boomer,

Thanks for the point in the right direction... but... should my API code shouldn't actually do any output. Am I correct? I'm a little confused about how to actually do the output still.

Craig Elliott
FireCompanies.com

B00MER 06-24-2004 11:05 AM

Quote:

Originally Posted by firecompanies
I'm a little confused about how to actually do the output still.


Code:

# example of results from API
$trackingnum = $api->query("blah");
$smarty->assign("trackingnum",$trackingnum);


Using $smarty->assign(); will pass the variable/array to smarty so that you may use it in your .tpl however you need.

Lets just display the results:

Code:

Tracking Number: {$trackingnum}

;)


All times are GMT -8. The time now is 06:04 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.