當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WC_Payment_Gateways::payment_gateways方法代碼示例

本文整理匯總了PHP中WC_Payment_Gateways::payment_gateways方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Payment_Gateways::payment_gateways方法的具體用法?PHP WC_Payment_Gateways::payment_gateways怎麽用?PHP WC_Payment_Gateways::payment_gateways使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WC_Payment_Gateways的用法示例。


在下文中一共展示了WC_Payment_Gateways::payment_gateways方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

        function wcpgsk_payments_form()
        {
            global $post;
            //, $woo;
            $postPayments = get_metadata('post', $post->ID, 'payment_gateways', false);
            $woogate = new WC_Payment_Gateways();
            $payments = $woogate->payment_gateways();
            //get_available_payment_gateways();
            foreach ($payments as $pay) {
                $checked = '';
                if (in_array($pay->id, $postPayments)) {
                    $checked = ' checked="yes" ';
                }
                ?>
  
				<input type="checkbox" <?php 
                echo $checked;
                ?>
 value="<?php 
                echo $pay->id;
                ?>
" name="pays[]" id="payments" />
				<label for="payment_gateway_meta_box_text"><?php 
                echo $pay->title;
                ?>
</label>  
				<br />  
			<?php 
            }
        }
開發者ID:WP-Panda,項目名稱:allergenics,代碼行數:30,代碼來源:wcpgsk-af.php

示例2: explode

                    </tr>

                    <!------------------------------------------------------------------ Payment Mapping Wc_to_Vend---------------------------------------->
                    <tr valign="top">
                        <th  class="titledesc">Payment mapping<a href="https://www.linksync.com/help/woocommerce"><img title="When syncing orders, both Vend and WooCommerce have their own payment methods - use these Payment Mapping settings to 'map' the Vend payment methods with those in your WooCommerce store." style="margin-bottom: -4px;margin-left: 4px;" src="../wp-content/plugins/linksync/img/help.png" height="16" width="16"></a> </th>
                        <td class="forminp forminp-checkbox">
                            <?php 
#Check for the Payment
if (isset($payment) && !empty($payment)) {
    if (!isset($payment['errorCode'])) {
        if (isset($payment['paymentTypes'])) {
            ?>
                                        <?php 
            $payment_wc_to_vend = get_option('wc_to_vend_payment');
            $wc_to_vend_payment = explode(',', $payment_wc_to_vend);
            $payment_gatways = $gatway->payment_gateways();
            ?>
<ul><legend style="display: inline-block;width: 20em; float: left"> <b>WooCommerce Payment Gateways</b></legend>   <legend style="display: inline-block;width: 3em; float: left">=></legend>  <legend style="display: inline-block;width: 25em; "><b>Vend Payment</b></legend><br>
                                        <?php 
            foreach ($payment_gatways as $gatways) {
                if ($gatways->enabled == 'yes') {
                    ?>
 <li> <legend style="display: inline-block;width: 20em; float: left">
                                                        <?php 
                    echo $gatways->title;
                    ?>
</legend>    <legend style="display: inline-block;width: 3em; float: left">=></legend> 
                                                    <legend style="display: inline-block;width: 25em; "><select style="margin-top: -5px" name="wc_to_vend_payment[]">
                                                            <?php 
                    foreach ($payment['paymentTypes'] as $payment_mapping) {
                        if (in_array($payment_mapping['name'] . "%%" . $payment_mapping['id'] . '|' . $gatways->title . '|' . $gatways->id, $wc_to_vend_payment)) {
開發者ID:amanpreet8333,項目名稱:linksync,代碼行數:31,代碼來源:vend_order_config.php


注:本文中的WC_Payment_Gateways::payment_gateways方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。