if($this->shop_delivery_id == 2)
{
$Shop_Cart_Controller = Shop_Cart_Controller::instance();
$amount = 0;
$quantity = 0;
$weight = 0;
$aShop_Cart = $Shop_Cart_Controller->getAll($oShop);
foreach ($aShop_Cart as $oShop_Cart)
{
if ($oShop_Cart->Shop_Item->id)
{
if ($oShop_Cart->postpone == 0)
{
// Prices
$oShop_Item_Controller = new Shop_Item_Controller();
if (Core::moduleIsActive('siteuser'))
{
$oSiteuser = Core_Entity::factory('Siteuser')->getCurrent();
$oSiteuser && $oShop_Item_Controller->siteuser($oSiteuser);
}
$oShop_Item_Controller->count($oShop_Cart->quantity);
$aPrices = $oShop_Item_Controller->getPrices($oShop_Cart->Shop_Item);
$amount += $aPrices['price_discount'] * $oShop_Cart->quantity;
$quantity += $oShop_Cart->quantity;
$weight += $oShop_Cart->Shop_Item->weight * $oShop_Cart->quantity;
}
}
}
//print_r($_COOKIE);
$oShop_Controller = Shop_Controller::instance();
// Округляем значения, переводим с научной нотации 1Е+10 в десятичную
$price['tax'] = $oShop_Controller->round($price['tax']/100*$amount);
$price['price'] = $oShop_Controller->round($price['price']/100*$amount);
$price['price_discount'] = $oShop_Controller->round($price['price_discount']/100*$amount);
$price['price_tax'] = $oShop_Controller->round($price['price_tax']/100*$amount);
return $price;
}
else{
$oShop_Controller = Shop_Controller::instance();
// Округляем значения, переводим с научной нотации 1Е+10 в десятичную
$price['tax'] = $oShop_Controller->round($price['tax']);
$price['price'] = $oShop_Controller->round($price['price']);
$price['price_discount'] = $oShop_Controller->round($price['price_discount']);
$price['price_tax'] = $oShop_Controller->round($price['price_tax']);
return $price;
}
Вот это добавил в модель \modules\shop\delivery\condition При этом цена доставки считается правильно. Но не передает ее в заказ и не сохраняет куда копать дальше? Я уже не могу пойду посплю хоть пару часиков!