當前位置: 首頁>>代碼示例>>PHP>>正文


PHP products_minierp::autoUpdateSalesPartnerCatalog方法代碼示例

本文整理匯總了PHP中products_minierp::autoUpdateSalesPartnerCatalog方法的典型用法代碼示例。如果您正苦於以下問題:PHP products_minierp::autoUpdateSalesPartnerCatalog方法的具體用法?PHP products_minierp::autoUpdateSalesPartnerCatalog怎麽用?PHP products_minierp::autoUpdateSalesPartnerCatalog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在products_minierp的用法示例。


在下文中一共展示了products_minierp::autoUpdateSalesPartnerCatalog方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateProductBrand

 /**
  * Set brand of a specific product. This fnction will update brand for all families of the given products.
  * However, it will return only total successful products from the give products (updated familes are not included).
  * Updated products will also be automatically included in next catalog upload.
  * @param Int $products_id Product ID
  * @param Int $brand_id Brand ID
  * @return Int Total products updated
  */
 function updateProductBrand($products_id, $brand_id)
 {
     use_class('products_family');
     $pids = explode(',', $products_id);
     $n_pid = count($pids);
     $n_pid_success = 0;
     $break_the_rules = true;
     foreach ($pids as $products_id) {
         $obj_family = new products_family(null, $products_id);
         $is_family_locked = $obj_family->productIsFamilyLocked($products_id);
         if (!$is_family_locked || $break_the_rules) {
             $mother_is_locked = $obj_family->mother > 0 ? $obj_family->productIsFamilyLocked($obj_family->mother) : false;
             if (!$mother_is_locked || $break_the_rules) {
                 $members = $obj_family->retrieveMembers();
                 $sda = array('products_brand_id' => $brand_id);
                 $products_ids = is_array($members) && count($members) > 0 ? implode(',', $members) : $products_id;
                 tep_db_perform('products', $sda, 'update', "products_id IN ({$products_ids})");
                 //refresh family search key to all members
                 //we stop it since brand is already excluded from family search key
                 //                            $pids_m = explode(',', $products_ids);
                 //                            foreach($pids_m as $pid_m) $obj_family->refreshFamilyMatchKey($pid_m);
                 use_class('products_minierp');
                 $class_pm = new products_minierp();
                 $class_pm->autoUpdateSalesPartnerCatalog($products_id);
                 $n_pid_success++;
             }
         }
     }
     return $n_pid_success;
 }
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:38,代碼來源:products_brand.php

示例2: elseif

         $label_image = 'Main Image 1 (Default)';
         $png_uploaded = true;
     } elseif ($products_clear_image != '') {
         $label_image = 'mi2';
         $hidden_input = '<input type="hidden" name="pci_id" value="' . $pei_id . '"/>';
     } elseif ($products_pure_image != '') {
         $label_image = 'mi3';
     } else {
         $label_image = "Additional Image {$img_no}";
         $hidden_input = '<input type="hidden" name="pei_id" value="' . $pei_id . '"/>';
         $add_button = '<div style="margin:5px 0 5px 0;"><input id="rdo-ami-' . $pei_id . '" class="rdo_ami" type="radio" name="alternate-main-image" value="' . $pei_id . '" /> <label for="rdo-ami-' . $pei_id . '" class="red bold">Use as Zalando main image</label></div>';
     }
     $result = webImage($filename, IMAGE_SIZE_THUMBNAIL_2, '', 'Product', 'img-border');
     $product_image = webImageSource($filename, IMAGE_SIZE_BIG_1);
     if (!$png_uploaded) {
         $class_pm->autoUpdateSalesPartnerCatalog($products_id, true);
         $boximgpng = 'boximg-' . $img_name . '_png';
         $img_png = $old_image_filename != '' ? false : '';
         $boximg = createBoxImage($label_image, $img_name, $filename, $product_image, $img_png, '', $hidden_input, $add_button);
     } else {
         $class_pm->autoUpdateSalesPartnerCatalog($products_id);
         $boximgpng = 'boximg-' . $img_name;
         $boximg = createBoxImagePNG($label_image, $img_name, $filename, $product_image);
     }
 }
 $result = array();
 $result['error'] = $err_images_size;
 $result['boxid'] = "boximg-{$img_name}";
 $result['boxidpng'] = $boximgpng;
 $result['boximg'] = $boximg;
 $result['pngupload'] = $png_uploaded;
開發者ID:blasiuscosa,項目名稱:manobo-2008,代碼行數:31,代碼來源:product-detail-image.php


注:本文中的products_minierp::autoUpdateSalesPartnerCatalog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。