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


PHP Discount::storeCustomerGroup方法代码示例

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


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

示例1: view_customer_groups

 /**
  * Show the customer groups for editing
  * @return    boolean             True on success, false otherwise
  * @author    Reto Kohli <reto.kohli@comvation.com>
  */
 function view_customer_groups()
 {
     global $_ARRAYLANG;
     if (isset($_GET['delete'])) {
         Discount::deleteCustomerGroup($_GET['id']);
     }
     if (isset($_POST['store'])) {
         Discount::storeCustomerGroup($_POST['groupName'], $_POST['id']);
     }
     Discount::flush();
     self::$objTemplate->loadTemplateFile('module_shop_discount_groups_customer.html');
     // Group overview
     $arrGroups = Discount::getCustomerGroupArray();
     self::$objTemplate->setCurrentBlock('shopGroup');
     $i = 0;
     foreach ($arrGroups as $id => $arrGroup) {
         self::$objTemplate->setVariable(array('SHOP_GROUP_ID' => $id, 'SHOP_GROUP_NAME' => $arrGroup['name'], 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
         self::$objTemplate->parse('shopGroup');
     }
     // Add/edit Group
     $id = 0;
     if (!empty($_GET['edit'])) {
         $id = intval($_GET['id']);
         self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => 'active', 'SHOP_GROUP_EDIT_DISPLAY' => 'block', 'SHOP_GROUP_LIST_CLASS' => '', 'SHOP_GROUP_LIST_DISPLAY' => 'none', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_EDIT']));
     } else {
         self::$objTemplate->setGlobalVariable(array('SHOP_GROUP_EDIT_CLASS' => '', 'SHOP_GROUP_EDIT_DISPLAY' => 'none', 'SHOP_GROUP_LIST_CLASS' => 'active', 'SHOP_GROUP_LIST_DISPLAY' => 'block', 'TXT_ADD_OR_EDIT' => $_ARRAYLANG['TXT_ADD']));
     }
     self::$objTemplate->setCurrentBlock('shopGroupName');
     self::$objTemplate->setVariable(array('SHOP_GROUP_ID_EDIT' => $id, 'SHOP_ROW_STYLE' => 'row' . (++$i % 2 + 1)));
     if (isset($arrGroups[$id])) {
         self::$objTemplate->setVariable('SHOP_GROUP_NAME', $arrGroups[$id]['name']);
     }
     self::$objTemplate->parse('shopGroupName');
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:40,代码来源:ShopManager.class.php


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