In the Confirm Order template:
Code: Select all
{view_shipping_total billing_info=$order.billing items=$order.shipping.0.items shipping_dest=$order.shipping}
<p>Shipping total: ${$shipping_cost|number_format:2}</p>
Code: Select all
global $gCms;
$smarty = &$gCms->GetSmarty();
$order = &$gCms->modules['Orders']['object'];
$shipping_cost = 0;
$items = $params['items'];
$shipping_dest = $params['shipping_dest'];
$billing_info = $params['billing_info'];
$shipping_cost = $order->GetShippingForBasket($billing_info,$shipping_dest,$items);
$smarty->assign('shipping_cost', $shipping_cost);
Code: Select all
function GetShippingForBasket($billing_info,$shipping_dest,$items)
{
// code .....
// test to see if amount is correct
print_r($shipping_cost);
exit;
//comment out above to return result to UDT/Invoice
return $shipping_cost;
}
When I complete the order and the calculation is applied to the invoice via the normal Orders/Payment/Shipping/Invoice process, the correct amount displays.
It was working in a previous version but it required a small hack to the Orders module. On Calguy's advice, I now use the GetShippingForBasket method. The UDT has not worked since making these changes.
The thing that has me confounded is that the methods are working - it's just not returning the result to the UDT. Why????
Would really appreciate advice on where I'm going wrong with this.
thx
psy
Cms Version: 1.6.3
Installed Modules:
CMSMailer: 1.73.14
FileManager: 1.0
MenuManager: 1.6.1
ModuleManager: 1.3.1
News: 2.10.2
nuSOAP: 1.0.1
Printing: 1.0.1
Search: 1.6.1
ThemeManager: 1.1.1
TinyMCE: 2.5.1
CGExtensions: 1.16.2
FormBuilder: 0.5.5
FrontEndUsers: 1.6.9
CGSimpleSmarty: 1.4.3
Products: 2.4
JQueryTools: 1.0.3
SelfRegistration: 1.2.2
CGUserDirectory: 1.0
Orders: 1.4
FRTaxes: 1.0.1
Cart: 1.4.2
CGPaymentGatewayBase: 1.0
AustraliaPost: 1.0.1
PaypalGateway: 2.0
Uploads: 1.6
CustomContent: 1.5.2
Config Information:
php_memory_limit:
process_whole_template: true
max_upload_size: 2000000
default_upload_permission: 664
assume_mod_rewrite: false
page_extension:
internal_pretty_urls: false
use_hierarchy: false
Php Information:
phpversion: 5.2.9-2
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
memory_limit: 128M
max_execution_time: 30
safe_mode: Off (False)
session_save_path: c:/wamp/tmp (0777)
Server Information:
Server Api: apache2handler
Server Db Type: MySQL (mysql)
Server Db Version: 5.1.33