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


PHP TravelHelper::convert_money方法代码示例

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


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

示例1: _change_order_amount_total

 function _change_order_amount_total($total)
 {
     return TravelHelper::convert_money($total);
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:4,代码来源:class.woocommerce.php

示例2: check_completePurchase

 function check_completePurchase($order_id = false)
 {
     //Check cart is not empty
     if ($order_id and false !== get_post_status($order_id)) {
         $total = get_post_meta($order_id, 'total_price', true);
         $gateway = Omnipay::create('PayPal_Express');
         $gateway->setUsername($this->apiUserName);
         $gateway->setPassword($this->apiPass);
         $gateway->setSignature($this->apiSignature);
         $gateway->setTestMode(true);
         $amount = TravelHelper::convert_money($total);
         $order_token_code = get_post_meta($order_id, 'order_token_code', true);
         if (!$order_token_code) {
             $array = array('gateway_name' => 'st_paypal', 'order_code' => $order_id, 'status' => 'success');
             $array_error = array('gateway_name' => 'st_paypal', 'order_code' => $order_id, 'status' => 'error');
         } else {
             $array = array('gateway_name' => 'st_paypal', 'order_token_code' => $order_token_code, 'status' => 'success');
             $array_error = array('gateway_name' => 'st_paypal', 'order_token_code' => $order_token_code, 'status' => 'error');
         }
         $response = $gateway->completePurchase(array('amount' => (double) $amount, 'currency' => TravelHelper::get_current_currency('name'), 'description' => __('Traveler Booking', ST_TEXTDOMAIN), 'returnUrl' => add_query_arg($array, STCart::get_success_link()), 'cancelUrl' => add_query_arg($array_error, STCart::get_success_link())))->send();
         if ($response->isSuccessful()) {
             $data = $response->getData();
             $data2 = $gateway->fetchCheckout(array('transactionReference' => $data['TOKEN']))->send();
             $transaction_data = $data2->getData();
             //Try to create user and create new orders with paypal transaction detail
             return STGatewayPaypal::paypal_checkout($transaction_data, $order_id);
             //return true;
         } elseif ($response->isRedirect()) {
             //$response->redirect(); // this will automatically forward the customer
             return array('status' => false, 'redirect_url' => $response->getRedirectUrl(), 'func' => 'check_completePurchase');
             //                    return ;
         } else {
             // not successful
             return array('status' => false, 'message' => $response->getMessage());
         }
     } else {
         // not successful
         return array('status' => false, 'message' => __('Order Code is not exists', ST_TEXTDOMAIN));
     }
 }
开发者ID:HatchForce,项目名称:bachtraveller,代码行数:40,代码来源:class.paypal.php

示例3: __

        <?php 
if (isset($item_data['_st_infant_number']) and $infant = st_wc_parse_order_item_meta($item_data['_st_infant_number'])) {
    ?>
        <li>
            <span class="meta-label"><?php 
    echo __('Infant number:', ST_TEXTDOMAIN);
    ?>
</span>
            <span class="meta-data">
                <?php 
    echo esc_html($infant);
    ?>
                x
                <?php 
    if (isset($item_data['_st_infant_price']) and $infant_price = st_wc_parse_order_item_meta($item_data['_st_infant_price'])) {
        $infant_price = TravelHelper::convert_money($data_price['infant_price'] / $infant);
        ?>
                    <?php 
        echo TravelHelper::format_money_raw($infant_price);
        ?>
                <?php 
    }
    ?>
            </span>
        </li>
        <?php 
}
?>
        <?php 
if (isset($item_data['_st_discount_rate'])) {
    $data = st_wc_parse_order_item_meta($item_data['_st_discount_rate']);
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:wc_order_item_meta.php

示例4: foreach

                foreach ($list_item_equipment as $key => $value) {
                    if (!empty($value)) {
                        $title = explode('--', $value);
                    }
                    $mang_ss[] = $title[0];
                }
            }
        }
        $i = 0;
        foreach ($item_equipment as $key => $val) {
            $checked = null;
            $item = $val['title'] . '--' . $val['cars_equipment_list_price'];
            if (in_array($val['title'], $mang_ss)) {
                $checked = 'checked';
            }
            $cars_equipment_list_price = TravelHelper::convert_money($val['cars_equipment_list_price']);
            $cars_equipment_list_price = TravelHelper::format_money($cars_equipment_list_price, false);
            echo '<div class="form-group" style="margin-bottom: 10px">
                                                            <label for="item_equipment-' . $i . '"><input ' . $checked . ' id="item_equipment-' . $i . '" type="checkbox" name="item_equipment[]" value="' . $val['title'] . '--' . $cars_equipment_list_price . '">' . $val['title'] . '(' . $cars_equipment_list_price . ')</label>
                                                            </div>';
            $i++;
        }
    }
}
?>
                                        </div>
                                        <span class="spinner"></span>
                                    </div>
                                </div>
                                <?php 
if (st()->get_option('tax_enable', 'off') == 'on' && st()->get_option('st_tax_include_enable', 'off') == 'off') {
开发者ID:DaddyFool,项目名称:travelTest,代码行数:31,代码来源:booking_edit.php

示例5: getInfoCarPartner

 static function getInfoCarPartner()
 {
     $car_id = intval(STInput::request('car_id', ''));
     $data = array('price' => 'not infomation', 'item_equipment' => 'not infomation');
     if ($car_id <= 0 || get_post_type($car_id) != 'st_cars') {
         echo json_encode($data);
         die;
     } else {
         $price = floatval(get_post_meta($car_id, 'cars_price', true));
         $data['price'] = TravelHelper::format_money($price) . ' / ' . self::get_price_unit();
         $item_equipment = get_post_meta($car_id, 'cars_equipment_list', true);
         if (is_array($item_equipment) && count($item_equipment)) {
             $html = '<table class="table">';
             $i = 0;
             foreach ($item_equipment as $key => $val) {
                 $price_unit = isset($v['price_unit']) ? $v['price_unit'] : '';
                 $price_max = isset($v['cars_equipment_list_price_max']) ? $v['cars_equipment_list_price_max'] : '';
                 $cars_equipment_list_price = TravelHelper::convert_money($val['cars_equipment_list_price']);
                 $cars_equipment_list_price = TravelHelper::format_money($cars_equipment_list_price, false);
                 $html .= '
                     <tr>
                         <td>
                             <label for="item_equipment-' . $i . '" class="ml20"><input data-price="' . $cars_equipment_list_price . '" data-title="' . $val['title'] . '" data-price-max="' . $price_max . '" data-price-unit="' . $price_unit . '" class="i-check list_equipment" id="item_equipment-' . $i . '" type="checkbox" value="' . $val['title'] . '--' . $cars_equipment_list_price . '">' . $val['title'] . ' (' . TravelHelper::format_money($val['cars_equipment_list_price']) . ')</label>
                         </td>
                     </tr>
                 ';
                 $i++;
             }
             $html .= "</table>";
             $data['item_equipment'] = $html;
         }
         echo json_encode($data);
         die;
     }
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:35,代码来源:class.admin.cars.php

示例6: _change_order_amount_total

 function _change_order_amount_total($total)
 {
     $debug = debug_backtrace();
     //            foreach($debug as $k=> $key)
     //            {
     //                var_dump($key['function']);
     //            }
     if (isset($debug[4]['function']) and $debug[4]['function'] == 'get_formatted_order_total') {
         return $total;
     }
     return TravelHelper::convert_money($total);
 }
开发者ID:DaddyFool,项目名称:travelTest,代码行数:12,代码来源:class.woocommerce.php


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