Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/order_items/order_items_tag_processor.php
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | |||||
$block_params['pass_params'] = 'true'; | $block_params['pass_params'] = 'true'; | ||||
$product_object = $this->Application->recallObject('p', 'p', Array ('skip_autoload' => true)); | $product_object = $this->Application->recallObject('p', 'p', Array ('skip_autoload' => true)); | ||||
/* @var $product_object kCatDBItem */ | /* @var $product_object kCatDBItem */ | ||||
$i = 0; | $i = 0; | ||||
$product_id = $product_object->GetID(); | $product_id = $product_object->GetID(); | ||||
$product_id_get = $this->Application->GetVar('p_id'); | $product_id_get = $this->Application->GetVar('p_id'); | ||||
$category_id_backup = $this->Application->GetVar('m_cat_id'); | |||||
while (!$list->EOL()) { | while (!$list->EOL()) { | ||||
// load product used in orderitem | // load product used in orderitem | ||||
$this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); // for edit/delete links using GET | $this->Application->SetVar($this->getPrefixSpecial() . '_id', $list->GetDBField($id_field)); // for edit/delete links using GET | ||||
$this->Application->SetVar('p_id', $list->GetDBField('ProductId')); | $this->Application->SetVar('p_id', $list->GetDBField('ProductId')); | ||||
$product_object->Load($list->GetDBField('ProductId')); // correct product load | $product_object->Load($list->GetDBField('ProductId')); // correct product load | ||||
$this->Application->SetVar('m_cat_id', $product_object->GetDBField('CategoryId')); | $this->Application->SetVar('m_cat_id', $product_object->GetDBField('CategoryId')); | ||||
$block_params['is_last'] = ($i == $list->GetSelectedCount() - 1); | $block_params['is_last'] = ($i == $list->GetSelectedCount() - 1); | ||||
$o .= $this->Application->ParseBlock($block_params, 1); | $o .= $this->Application->ParseBlock($block_params, 1); | ||||
$list->GoNext(); | $list->GoNext(); | ||||
$i++; | $i++; | ||||
} | } | ||||
// restore IDs used in cycle | // restore IDs used in cycle | ||||
$this->Application->SetVar('p_id', $product_id_get); | $this->Application->SetVar('p_id', $product_id_get); | ||||
$this->Application->SetVar('m_cat_id', $category_id_backup); | |||||
$this->Application->DeleteVar($this->getPrefixSpecial() . '_id'); | $this->Application->DeleteVar($this->getPrefixSpecial() . '_id'); | ||||
if ( $product_id ) { | if ( $product_id ) { | ||||
$product_object->Load($product_id); | $product_object->Load($product_id); | ||||
} | } | ||||
return $o; | return $o; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |