当前位置: 首页>>代码示例>>PHP>>正文


PHP CartRule::cleanProductRuleIntegrity方法代码示例

本文整理汇总了PHP中CartRule::cleanProductRuleIntegrity方法的典型用法代码示例。如果您正苦于以下问题:PHP CartRule::cleanProductRuleIntegrity方法的具体用法?PHP CartRule::cleanProductRuleIntegrity怎么用?PHP CartRule::cleanProductRuleIntegrity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CartRule的用法示例。


在下文中一共展示了CartRule::cleanProductRuleIntegrity方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: delete

 public function delete()
 {
     if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) {
         $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id);
         $products = array();
         foreach ($result as $row) {
             $combination = new Combination($row['id_product_attribute']);
             $new_request = Db::getInstance()->executeS('SELECT id_product, default_on FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product_attribute = ' . (int) $row['id_product_attribute']);
             foreach ($new_request as $value) {
                 if ($value['default_on'] == 1) {
                     $products[] = $value['id_product'];
                 }
             }
             $combination->delete();
         }
         foreach ($products as $product) {
             $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product = ' . (int) $product . ' LIMIT 1');
             foreach ($result as $row) {
                 if (Validate::isLoadedObject($product = new Product((int) $product))) {
                     $product->deleteDefaultAttributes();
                     $product->setDefaultAttribute($row['id_product_attribute']);
                 }
             }
         }
         // Delete associated restrictions on cart rules
         CartRule::cleanProductRuleIntegrity('attributes', $this->id);
         /* Reinitializing position */
         $this->cleanPositions((int) $this->id_attribute_group);
     }
     $return = parent::delete();
     if ($return) {
         Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
     }
     return $return;
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:35,代码来源:Attribute.php

示例2: delete

 public function delete()
 {
     $address = new Address($this->id_address);
     if (Validate::isLoadedObject($address) and !$address->delete()) {
         return false;
     }
     if (parent::delete()) {
         CartRule::cleanProductRuleIntegrity('manufacturers', $this->id);
         return $this->deleteImage();
     }
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:11,代码来源:Manufacturer.php

示例3: delete

 public function delete()
 {
     if (!$this->hasMultishopEntries()) {
         $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id);
         foreach ($result as $row) {
             $combination = new Combination($row['id_product_attribute']);
             $combination->delete();
         }
         // Delete associated restrictions on cart rules
         CartRule::cleanProductRuleIntegrity('attributes', $this->id);
         /* Reinitializing position */
         $this->cleanPositions((int) $this->id_attribute_group);
     }
     $return = parent::delete();
     if ($return) {
         Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id));
     }
     return $return;
 }
开发者ID:jicheng17,项目名称:pengwine,代码行数:19,代码来源:Attribute.php

示例4: delete

 /**
  * @see ObjectModel::delete()
  */
 public function delete()
 {
     if (parent::delete()) {
         CartRule::cleanProductRuleIntegrity('suppliers', $this->id);
         return $this->deleteImage();
     }
 }
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:10,代码来源:Supplier.php

示例5: delete

 public function delete()
 {
     if ((int) $this->id === 0 || (int) $this->id === (int) Configuration::get('PS_ROOT_CATEGORY')) {
         return false;
     }
     $this->clearCache();
     $deleted_children = $all_cat = $this->getAllChildren();
     $all_cat[] = $this;
     foreach ($all_cat as $cat) {
         /** @var Category $cat */
         $cat->deleteLite();
         if (!$this->hasMultishopEntries()) {
             $cat->deleteImage();
             $cat->cleanGroups();
             $cat->cleanAssoProducts();
             // Delete associated restrictions on cart rules
             CartRule::cleanProductRuleIntegrity('categories', array($cat->id));
             Category::cleanPositions($cat->id_parent);
             /* Delete Categories in GroupReduction */
             if (GroupReduction::getGroupsReductionByCategoryId((int) $cat->id)) {
                 GroupReduction::deleteCategory($cat->id);
             }
         }
     }
     /* Rebuild the nested tree */
     if (!$this->hasMultishopEntries() && (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree)) {
         Category::regenerateEntireNtree();
     }
     Hook::exec('actionCategoryDelete', array('category' => $this, 'deleted_children' => $deleted_children));
     return true;
 }
开发者ID:yewed,项目名称:share,代码行数:31,代码来源:Category.php

示例6: deleteFromCartRules

 public function deleteFromCartRules()
 {
     CartRule::cleanProductRuleIntegrity('products', $this->id);
     return true;
 }
开发者ID:jicheng17,项目名称:vipinsg,代码行数:5,代码来源:Product.php


注:本文中的CartRule::cleanProductRuleIntegrity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。