foreach ($array as $pid) { mslib_befe::deleteProduct($pid, $old_categories_id); } } break; case 'move': if (is_numeric($this->post['tx_multishop_pi1']['target_categories_id']) and mslib_befe::canContainProducts($this->post['tx_multishop_pi1']['target_categories_id'])) { foreach ($this->post['selectedProducts'] as $old_categories_id => $array) { foreach ($array as $pid) { $filter = array(); $filter[] = 'products_id=' . $pid; if (mslib_befe::ifExists('1', 'tx_multishop_products', 'imported_product', $filter)) { // lock changed columns mslib_befe::updateImportedProductsLockedFields($pid, 'tx_multishop_products_to_categories', array('categories_id' => $this->post['tx_multishop_pi1']['target_categories_id'])); } mslib_befe::moveProduct($pid, $this->post['tx_multishop_pi1']['target_categories_id'], $old_categories_id); } } } break; case 'duplicate': foreach ($this->post['selectedProducts'] as $old_categories_id => $array) { if ($this->post['tx_multishop_pi1']['target_categories_id'] > 0) { $target_cat_id = $this->post['tx_multishop_pi1']['target_categories_id']; } else { $target_cat_id = $old_categories_id; } foreach ($array as $pid) { mslib_befe::duplicateProduct($pid, $target_cat_id); } }