Вот код
public function initContent()
{
parent::initContent();
//Задаём список продуктов
self::$products = $this->context->cart->getProducts();
$cities = NP::getCities();
array_unshift($cities, array('id'=>0, 'name' => 'Не выбрано'));
$this->context->smarty->assign(array(
'payment_name' => Configuration::get('MOD_ATUTORIAL_NAME'),
'payment_color' => Configuration::get('MOD_ATUTORIAL_COLOR'),
'products' => self::$products,
'total_cart' => $this->context->cart->getOrderTotal(),
'default_currency' => Currency::getDefaultCurrency(),
'cities' => $cities,
'weight' => $this->context->cart->getTotalWeight(),
'paymentForms' => NP::getPaymentForms(),
'id_cart' => $this->context->cart->id
));
if(
isset($_REQUEST['addCounterparty']) &&
isset($_REQUEST['city']) &&
isset($_REQUEST['streets']) &&
isset($_REQUEST['HomeNumber']) &&
isset($_REQUEST['Flat']) &&
isset($_REQUEST['LastName']) &&
isset($_REQUEST['MiddleName']) &&
isset($_REQUEST['FirstName']) &&
isset($_REQUEST['tel']) //&&
//isset($_REQUEST['cost']) &&
//isset($_REQUEST['weight'])
)
{
/* ПРОВЕРКА ДАННЫХ */
global $cookie;
$cart = $this->context->cart;
$_REQUEST['cost'] = $cart->getOrderTotal();
$NP = new NP();
$Sender = NP::addCounterparty('Ирина','Николаевна', 'Деньгина' , '0675234133', 'db5c88f0-391c-11dd-90d9-001a92567626', 'Sender');
$NP->Sender = $Sender['CounterpartyRef'];
$NP->ContactSender = $Sender['ContactRef'];
$Recipient = NP::addCounterparty($_REQUEST['FirstName'], $_REQUEST['MiddleName'], $_REQUEST['LastName'], $_REQUEST['tel'], $_REQUEST['city'], 'Recipient');
$NP->Recipient = $Recipient['CounterpartyRef'];
$NP->ContactRecipient = $Recipient['ContactRef'];
$NP->RecipientAddress = NP::saveAddress($NP->Recipient, $_REQUEST['streets'], $_REQUEST['HomeNumber'], $_REQUEST['Flat']);
$NP->SenderAddress = NP::saveAddress($NP->Sender, 'e57e14fe-d532-11de-8cc8-000c2965ae0e', 3,4);
$data = array(
'PayerType' => 'Sender',
'PaymentMethod' => 'Cash',
'DateTime' => date('d.m.Y', time() + 86400),
'CargoType' => 'Cargo',
'VolumeGeneral' => '0.15',// Объём м. куб
'Weight' => $_REQUEST['weight'],
'ServiceType' => 'WarehouseWarehouse',
'SeatsAmount' => 1 ,//кол-во мест
'Description' => 'Аксессуары к одежде',
'Cost' => $_REQUEST['cost'],
'CitySender' => NP::$citySender,
'SendersPhone' => '+380675234133',
'CityRecipient' => $_REQUEST['city'],
'RecipientsPhone' => $_REQUEST['tel'],
'Warehouse' => $_REQUEST['warehouses']
);
$NP->saveInternetDocument($data);
//$payment = new MyPayment();
$state = OrderState::getOrderStates($cookie->id_lang);
$cart = $_REQUEST['id_cart'];
$p = $this->module->validateOrder((int)$cart, $state[0]['id_order_state'] ,(int) $_REQUEST['cost'], 'payment', NULL, array(), null, FALSE, Context::getContext()->customer->secure_key);
}
$this->setTemplate('order.tpl');
}