本文整理匯總了PHP中categories::move_product方法的典型用法代碼示例。如果您正苦於以下問題:PHP categories::move_product方法的具體用法?PHP categories::move_product怎麽用?PHP categories::move_product使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類categories
的用法示例。
在下文中一共展示了categories::move_product方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: foreach
//move multi_categories
if (is_array($_POST['multi_categories']) && vam_not_null($_POST['move_to_category_id'])) {
foreach ($_POST['multi_categories'] as $category_id) {
$dest_category_id = vam_db_prepare_input($_POST['move_to_category_id']);
if ($category_id != $dest_category_id) {
$catfunc->move_category($category_id, $dest_category_id);
}
}
}
//move multi_products
if (is_array($_POST['multi_products']) && vam_not_null($_POST['move_to_category_id']) && vam_not_null($_POST['src_category_id'])) {
foreach ($_POST['multi_products'] as $product_id) {
$product_id = vam_db_prepare_input($product_id);
$src_category_id = vam_db_prepare_input($_POST['src_category_id']);
$dest_category_id = vam_db_prepare_input($_POST['move_to_category_id']);
$catfunc->move_product($product_id, $src_category_id, $dest_category_id);
}
}
vam_redirect(vam_href_link(FILENAME_CATEGORIES, 'cPath=' . $dest_category_id . '&' . vam_get_all_get_params(array('cPath', 'action', 'pID', 'cID'))));
}
// --- MULTI MOVE ENDS ---
// --- MULTI COPY ---
if (isset($_POST['multi_copy_confirm'])) {
//copy multi_categories
if (is_array($_POST['multi_categories']) && (is_array($_POST['dest_cat_ids']) || vam_not_null($_POST['dest_category_id']))) {
$_SESSION['copied'] = array();
foreach ($_POST['multi_categories'] as $category_id) {
if (is_array($_POST['dest_cat_ids'])) {
foreach ($_POST['dest_cat_ids'] as $dest_category_id) {
if ($_POST['copy_as'] == 'link') {
$catfunc->copy_category($category_id, $dest_category_id, 'link');