Hi,
I'm trying to modify the ecommerce/shipcalc .inc "module"
to avoid javascript, and have a hardcoded list of various countries
that would not be contigous in the javascript pulldown.
I've excerpted (below) the file that I save as weight.inc, and have just a few questions.
At line 18 I define
function weight_get_rates($txn)
which is getting called.
However, I can't get the country check to work properly
if (in_array($ctry, $usa)) { $flat_rate = 12.3; $per_pound_cost = 1.4732; }
despite a variety of syntax experiments:
$usa = array( "United States");
$usa1 = array( 'US' => t('United States'));
$usa2 = array(t('United States'));
If someone could
1) show me a simple example of how to check which country is being set by the customer
and/or
2) show me how to display/debug variables on screen (the php equivalent to printf . )
I'd be a good bit closer,
Thank you,
==============================
<?php
// custom weight module for 4 region flat rate
function weight_shipping_methods($type = 'domestic') {
// TODO: Add descriptions of various shipping methods.
$methods = array();
$methods['weight'] = array( '#title' => t('weight'), '#description' => t('Weight Based Shipping.'), );
switch ($type) {
case 'domestic':
default:
$methods['weight']['Flat Rate & Weight Based'] = array( '#title' => t('Flat Rate & Weight Based'), );