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


PHP Widgets::displaySpicyIconByID方法代码示例

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


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

示例1: displayOrderHTML

    public function displayOrderHTML($data = '', $cart_item = '', $receipt = false, $new_order_id = '')
    {
        $item_array = '';
        $this->code = 2;
        $htm = '';
        $subtotal = 0;
        $mid = isset($data['merchant_id']) ? $data['merchant_id'] : '';
        if (empty($mid)) {
            $this->msg = Yii::t("default", "Merchant ID is empty");
            return;
        }
        Yii::app()->functions->data = "list";
        $food_item = Yii::app()->functions->getFoodItemLists($mid);
        $subcat_list = Yii::app()->functions->getAddOnLists($mid);
        //dump($cart_item);
        //dump($food_item);
        if (isset($cart_item)) {
            if (is_array($cart_item) && count($cart_item) >= 1) {
                $x = 0;
                foreach ($cart_item as $key => $val) {
                    $val['notes'] = isset($val['notes']) ? $val['notes'] : "";
                    $size_words = '';
                    $t = !empty($val['price']) ? explode("|", $val['price']) : '';
                    if (is_array($t) && count($t) >= 1) {
                        $val['price'] = $t[0];
                        $size_words = $t[1];
                    }
                    $price = cleanNumber(unPrettyPrice($val['price']));
                    if (!empty($val['discount'])) {
                        $val['discount'] = unPrettyPrice($val['discount']);
                        $price = $price - $val['discount'];
                    }
                    $qty = $val['qty'];
                    /** fixed addon qty */
                    $total_price = $val['qty'] * $price;
                    /** check if item is taxable*/
                    //dump($val);
                    $food_taxable = true;
                    if (isset($val['non_taxable'])) {
                        if ($val['non_taxable'] == 2) {
                            $food_taxable = false;
                        }
                    }
                    $subtotal = $subtotal + $total_price;
                    if ($food_taxable == false) {
                        $subtotal_non = $subtotal_non + $total_price;
                    }
                    /*$size_words='';
                    		if ( $price_size=explodeData($val['price'])){	    					
                    			if (isset($price_size[1])){
                    			    $size_words=$price_size[1];
                    			}
                    		}	*/
                    /** Translation */
                    $food_infos = '';
                    $size_info_trans = '';
                    $cooking_ref_trans = '';
                    if ($this->getOptionAdmin("enabled_multiple_translation") == 2) {
                        $food_info = $this->getFoodItem($val['item_id']);
                        $food_infos['item_name_trans'] = !empty($food_info['item_name_trans']) ? json_decode($food_info['item_name_trans'], true) : '';
                        if (!empty($size_words)) {
                            $size_info_trans = $this->getSizeTranslation($size_words, $mid);
                        }
                        if (!empty($val['cooking_ref'])) {
                            $cooking_ref_trans = $this->getCookingTranslation($val['cooking_ref'], $mid);
                        }
                    }
                    $htm .= '<div class="item-order-list item-row">';
                    $htm .= '<div class="a">' . $val['qty'] . '</div>';
                    $htm .= '<div class="b">' . qTranslate($food_item[$val['item_id']], 'item_name', $food_infos);
                    if (!empty($size_words)) {
                        $htm .= "(" . ucwords(qTranslate($size_words, 'size_name', $size_info_trans)) . ")";
                    }
                    // array value
                    $item_array[$key] = array('item_id' => $val['item_id'], 'item_name' => $food_item[$val['item_id']], 'size_words' => $size_words, 'qty' => $val['qty'], 'normal_price' => prettyFormat($val['price']), 'discounted_price' => $price, 'order_notes' => isset($val['notes']) ? $val['notes'] : '', 'cooking_ref' => isset($val['cooking_ref']) ? $val['cooking_ref'] : '', 'ingredients' => isset($val['ingredients']) ? $val['ingredients'] : '', 'non_taxable' => isset($val['non_taxable']) ? $val['non_taxable'] : 1);
                    $htm .= Widgets::displaySpicyIconByID($val['item_id']);
                    if (!empty($val['discount'])) {
                        $htm .= "<p class=\"uk-text-small\">" . "<span class=\"normal-price\">" . displayPrice(baseCurrency(), prettyFormat($val['price'])) . " </span>" . "<span class=\"sale-price\">" . displayPrice(baseCurrency(), prettyFormat($price)) . "</span>" . "</p>";
                    } else {
                        $htm .= "<p class=\"uk-text-small\">" . "<span class=\"base-price\">" . displayPrice(baseCurrency(), prettyFormat($val['price'])) . "</span>" . "</p>";
                    }
                    if (!empty($val['cooking_ref'])) {
                        $htm .= "<p class=\"uk-text-small\">" . qTranslate($val['cooking_ref'], 'cooking_name', $cooking_ref_trans) . "</p>";
                    }
                    if (!empty($val['notes'])) {
                        $htm .= "<p class=\"uk-text-small\">" . $val['notes'] . "</p>";
                    }
                    /*ingredients*/
                    if (isset($val['ingredients'])) {
                        if (!empty($val['ingredients'])) {
                            if (is_array($val['ingredients']) && count($val['ingredients']) >= 1) {
                                $htm .= "<p class=\"uk-text-small ingredients-label\">" . t("Ingredients") . ":</p>";
                                foreach ($val['ingredients'] as $val_ingred) {
                                    $htm .= "<p class=\"uk-text-small\">" . $val_ingred . "</p>";
                                }
                            }
                        }
                    }
                    $htm .= '</div>';
                    $htm .= '<div class="manage">';
//.........这里部分代码省略.........
开发者ID:ashishvazirani,项目名称:food,代码行数:101,代码来源:Functions.php


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