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


PHP CartRule::getCartsRuleByCode方法代码示例

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


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

示例1: displayAjaxSearchCartRuleVouchers

 public function displayAjaxSearchCartRuleVouchers()
 {
     $found = false;
     if ($vouchers = CartRule::getCartsRuleByCode(Tools::getValue('q'), (int) $this->context->language->id, true)) {
         $found = true;
     }
     echo Tools::jsonEncode(array('found' => $found, 'vouchers' => $vouchers));
 }
开发者ID:toufikadfab,项目名称:PrestaShop-1.5,代码行数:8,代码来源:AdminCartRulesController.php

示例2: create_split_discount

 private static function create_split_discount($amount, $id_customer, $id_currency, $id_carts)
 {
     ${"GLOBALS"}["lpfswanqwex"] = "code";
     ${"GLOBALS"}["iuztfsobjr"] = "id_customer";
     $ezdxpbfeg = "languages";
     ${"GLOBALS"}["rnwtmfeg"] = "amount";
     $wbglpjrhabt = "id_carts";
     $wvwcmnzwlplf = "id_currency";
     global $cookie;
     ${${"GLOBALS"}["lpfswanqwex"]} = "split discount-" . ${${"GLOBALS"}["qnutktejfsm"]};
     ${"GLOBALS"}["rommybk"] = "languages";
     ${"GLOBALS"}["pjlvntsji"] = "discount";
     $zwjuqmhrgn = "timeinfo";
     if (CartRule::cartRuleExists(${${"GLOBALS"}["thjhsxt"]})) {
         ${"GLOBALS"}["mutlcfyzn"] = "cartRuleInfo";
         $efjrrcbmmc = "code";
         ${"GLOBALS"}["dvulqgqhgy"] = "cartRuleInfo";
         ${${"GLOBALS"}["dvulqgqhgy"]} = CartRule::getCartsRuleByCode(${$efjrrcbmmc}, $cookie->id_lang);
         if (!empty(${${"GLOBALS"}["mutlcfyzn"]})) {
             ${"GLOBALS"}["dutusymn"] = "id_currency";
             $ugjhbkcy = "id_customer";
             $vhkwbuk = "discount";
             ${"GLOBALS"}["wtngbnwjou"] = "amount";
             ${$vhkwbuk} = new CartRule((int) ${${"GLOBALS"}["exnqrgnk"]}[0]["id_cart_rule"]);
             $discount->reduction_amount = Tools::ps_round(abs(${${"GLOBALS"}["wtngbnwjou"]}), 2);
             $discount->id_customer = ${$ugjhbkcy};
             $discount->reduction_currency = ${${"GLOBALS"}["dutusymn"]};
             ${"GLOBALS"}["lftybruvzf"] = "discount";
             $discount->save();
             return ${${"GLOBALS"}["lftybruvzf"]};
         }
     }
     ${$zwjuqmhrgn} = AgileHelper::getDbDateTime(1, "DAY");
     ${${"GLOBALS"}["rommybk"]} = Language::getLanguages();
     ${${"GLOBALS"}["pjlvntsji"]} = new CartRule();
     $discount->code = "split discount-" . ${$wbglpjrhabt};
     $discount->description = $discount->code;
     $discount->id_customer = ${${"GLOBALS"}["iuztfsobjr"]};
     $discount->id_group = 0;
     $discount->reduction_currency = ${${"GLOBALS"}["lppjvltcyn"]};
     $discount->reduction_amount = Tools::ps_round(abs(${${"GLOBALS"}["rnwtmfeg"]}), 2);
     $discount->minimum_amount_currency = ${$wvwcmnzwlplf};
     $discount->quantity = 1;
     $discount->quantity_per_user = 1;
     $discount->date_from = ${${"GLOBALS"}["vwwosyf"]}["timenow"];
     $discount->date_to = ${${"GLOBALS"}["vwwosyf"]}["newtime"];
     $discount->partial_use = 0;
     $discount->include_tax = 1;
     $discount->active = 1;
     $discount->cart_display = 0;
     $discount->date_add = ${${"GLOBALS"}["vwwosyf"]}["timenow"];
     $discount->date_upd = ${${"GLOBALS"}["vwwosyf"]}["timenow"];
     foreach (${$ezdxpbfeg} as ${${"GLOBALS"}["ehrifiqsh"]}) {
         $edrgrgkvw = "fields";
         $hfpvhmutci = "field";
         ${${"GLOBALS"}["samttghly"]} = array("name");
         $gigicrqhcvtw = "language";
         $vuqkbfsbtw = "field";
         foreach (${$edrgrgkvw} as ${$vuqkbfsbtw}) {
             $discount->{${$hfpvhmutci}}[intval(${$gigicrqhcvtw}["id_lang"])] = $discount->code;
         }
     }
     $discount->save();
     return ${${"GLOBALS"}["gwtztyfxho"]};
 }
开发者ID:sho5kubota,项目名称:guidingyou2,代码行数:65,代码来源:AgileMultipleSellerBase.php


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