ok, I make workaround, useing checkout.php file. Everything almost works fine, but I can't chose my shipping plugin in payment plugin when I use restrictions in payment plugin (I don;t see my shipping plugin on dropdown list in restrictions of payment)
I try to use ups plugin, but It still don’t work. I see that $main -> shipping_params->methodsList is empty. What should I do?
Thank You for help
I Add dthis to my shipping plugin:
var $inpost_methods = array(
array('key' => '1', 'code'=>'1', 'name' => 'Ground', 'countries' => 'POLAND'),
array('key' => '2', 'code'=>'2','name' => 'USA')
);
var $convertUnit=array(
'kg' => 'KGS',
'lb' => 'LBS',
'cm' => 'CM',
'in' => 'IN',
'kg2' => 'kg',
'lb2' => 'lb',
'cm2' => 'cm',
'in2' => 'in',
);
function shippingMethods(&$main) {
//var_dump($main -> shipping_params->methodsList);
$methods = array();
if (!empty($main -> shipping_params -> methodsList)) {
$main -> shipping_params -> methods = unserialize($main -> shipping_params -> methodsList);
}
if (!empty($main -> shipping_params -> methods)) {
foreach ($main->shipping_params->methods as $key => $value) {
$selected = null;
foreach ($this->canpar_methods as $canpar) {
if ($canpar['name'] == $key)
$selected = $canpar;
}
if ($selected) {
$methods[$main->shipping_id . '-' . $selected['key']] = $selected['name'];
}
}
}
return $methods;
}