コード例 #1
0
    public function add_controls($wp_customize)
    {
        $this->controls = array('label-singular' => array('label' => __('Singular Label', 'listify')), 'label-plural' => array('label' => __('Plural Label', 'listify')), 'region-bias' => array('label' => __('Base Country', 'listify'), 'type' => 'select', 'description' => __('This controls autocomplete priority, distance units, and more.', 'listify'), 'choices' => function_exists('wc') ? array_merge(array('' => __('None', 'listify')), wc()->countries->get_countries()) : array()), 'social-association' => array('label' => __('Social Profiles', 'listify'), 'type' => 'select', 'description' => __('If associated with a listing the fields will appear on the submission form', 'listify'), 'choices' => array('listing' => __('Associate with listing', 'listify'), 'user' => __('Associate with user', 'listify'))), 'custom-submission' => array('label' => __('Use "directory" submission fields', 'listify'), 'type' => 'checkbox'), 'categories-only' => array('label' => __('Use categories only', 'listify'), 'type' => 'checkbox', 'description' => __('Categories will be used to create map markers, and types will
				be hidden from all other areas. Categories must be enabled in Listings > Settings.
				<br /><br />Refresh this page in your browser after saving.', 'listify')));
        return $wp_customize;
    }
コード例 #2
0
 /**
  * 주문 지불 페이지에서 사용자를 위한 설명 유도
  *
  * @action after_woocommerce_pay
  */
 public static function callback_after_woocommerce_pay()
 {
     if (!isset($_GET['key'])) {
         $order_key = wc_get_order()->order_key;
     } else {
         $order_key = esc_attr($_GET['key']);
     }
     wp_register_script('wskl-payapp-status-js', plugin_dir_url(WSKL_MAIN_FILE) . 'assets/js/payapp-status.js', array('jquery'), WSKL_VERSION, TRUE);
     wp_localize_script('wskl-payapp-status-js', 'payAppStatus', array('ajaxUrl' => add_query_arg(array('order_key' => $order_key, 'wc-ajax' => 'wskl-payapp-status'), home_url('/')), 'pollingRetryMax' => 60, 'failureRedirect' => wc()->cart->get_checkout_url()));
     wp_enqueue_script('wskl-payapp-status-js');
     // 결제 유도 안내 메시지.
     //		$status_check_message = $this->get_option( 'status_check_message' );
     //		if ( $status_check_message ) {
     //			echo wpautop( wptexturize( $status_check_message ) );
     //		}
     $screenshot_url = plugin_dir_url(WSKL_MAIN_FILE) . 'assets/image/payapp/payapp-screenshot.png';
     echo '<p>' . __('결제창 팝업은 아래 그림처럼 생성됩니다.', 'wskl') . '</p>';
     echo '<img src="' . esc_url($screenshot_url) . '" />';
 }
コード例 #3
0
ファイル: bz.php プロジェクト: booklein/wpbookle
        public function generate_ccavenue_form($order_id)
        {
            global $woocommerce;
            $order = new WC_Order($order_id);
            $order_id = $order_id . '_' . date("ymds");
            $ccavenue_args = array('merchant_id' => $this->merchant_id, 'amount' => $order->order_total, 'order_id' => $order_id, 'redirect_url' => $this->notify_url, 'cancel_url' => $this->notify_url, 'billing_name' => $order->billing_first_name . ' ' . $order->billing_last_name, 'billing_address' => trim($order->billing_address_1, ','), 'billing_country' => wc()->countries->countries[$order->billing_country], 'billing_state' => $order->billing_state, 'billing_city' => $order->billing_city, 'billing_zip' => $order->billing_postcode, 'billing_tel' => $order->billing_phone, 'billing_email' => $order->billing_email, 'delivery_name' => $order->shipping_first_name . ' ' . $order->shipping_last_name, 'delivery_address' => $order->shipping_address_1, 'delivery_country' => $order->shipping_country, 'delivery_state' => $order->shipping_state, 'delivery_tel' => '', 'delivery_city' => $order->shipping_city, 'delivery_zip' => $order->shipping_postcode, 'language' => 'EN', 'currency' => get_woocommerce_currency());
            foreach ($ccavenue_args as $param => $value) {
                $paramsJoined[] = "{$param}={$value}";
            }
            $merchant_data = implode('&', $paramsJoined);
            $encrypted_data = encrypt($merchant_data, $this->working_key);
            $ccavenue_args_array = array();
            $ccavenue_args_array[] = "<input type='hidden' name='encRequest' value='{$encrypted_data}'/>";
            $ccavenue_args_array[] = "<input type='hidden' name='access_code' value='{$this->access_code}'/>";
            wc_enqueue_js('
    $.blockUI({
        message: "' . esc_js(__('Thank you for your order. We are now redirecting you to CCAvenue MCPG to make payment.', 'woocommerce')) . '",
        baseZ: 99999,
        overlayCSS:
        {
            background: "#fff",
            opacity: 1.0
        },
        css: {
            padding:        "20px",
            zindex:         "9999999",
            textAlign:      "center",
            color:          "#555",
            border:         "3px solid #aaa",
            backgroundColor:"#fff",
            cursor:         "wait",
            lineHeight:     "24px",
        }
    });
jQuery("#submit_ccavenue_payment_form").click();
');
            $form = '<form action="' . esc_url($this->liveurl) . '" method="post" id="ccavenue_payment_form" target="_top">
' . implode('', $ccavenue_args_array) . '
<!-- Button Fallback -->
<div class="payment_buttons">
<input type="submit" class="button alt" id="submit_ccavenue_payment_form" value="' . __('Pay via CCAvenue', 'woocommerce') . '" /> <a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' . __('Cancel order &amp; restore cart', 'woocommerce') . '</a>
</div>
<script type="text/javascript">
jQuery(".payment_buttons").hide();
</script>
</form>';
            return $form;
        }
コード例 #4
0
ファイル: footer.php プロジェクト: sockol/3dcrestwhite.ru
    ?>
 
	    <a href="<?php 
    echo $value->url;
    ?>
"> 
	    	<?php 
    echo $value->title;
    ?>
 
	    </a>
	<?php 
}
?>
	<a href="<?php 
echo wc()->cart->get_cart_url();
?>
">корзина</a>
</div>
<div class="info">
	<h6>
	КОНТАКТЫ </h6>
	<a href="tel:<?php 
echo ot_get_option('whatsapp_phone');
?>
">
	<div class="left">
		<i class="fa fa-mobile"></i>
	</div>
	<div class="right">
		<div>
コード例 #5
0
ファイル: index.php プロジェクト: bailoo/10dollrWP
        /**
         * Generate CCAvenue button link
         **/
        public function generate_ccavenue_form($order_id)
        {
            global $woocommerce;
            $order = new WC_Order($order_id);
            $order_id = $order_id . '_' . date("ymds");
            $post_data = get_post_meta($order_id, '_post_data', true);
            update_post_meta($order_id, '_post_data', array());
            if ($order->billing_address_1 && $order->billing_country && $order->billing_state && $order->billing_city && $order->billing_postcode) {
                $country = wc()->countries->countries[$order->billing_country];
                $state = $order->billing_state;
                $city = $order->billing_city;
                $zip = $order->billing_postcode;
                $phone = $order->billing_phone;
                $billing_address_1 = trim($order->billing_address_1, ',');
            } else {
                $billing_address_1 = $this->default_add1;
                $country = $this->default_country;
                $state = $this->default_state;
                $city = $this->default_city;
                $zip = $this->default_zip;
                $phone = $this->default_phone;
            }
            $the_currency = get_woocommerce_currency();
            $the_order_total = $order->order_total;
            if ($this->enable_currency_conversion == 'yes') {
                $the_order_total = $this->currency_convert($the_currency, 'INR', $the_order_total);
                $the_display_msg = "<small> {$the_currency} has been converted to equivalent amount in INR for faster payment processing.</small><br />";
            }
            $ccavenue_args = array('merchant_id' => $this->merchant_id, 'amount' => $the_order_total, 'order_id' => $order_id, 'redirect_url' => $this->notify_url, 'cancel_url' => $this->notify_url, 'billing_name' => $order->billing_first_name . ' ' . $order->billing_last_name, 'billing_address' => $billing_address_1, 'billing_country' => $country, 'billing_state' => $state, 'billing_city' => $city, 'billing_zip' => $zip, 'billing_tel' => $phone, 'billing_email' => $order->billing_email, 'delivery_name' => $order->shipping_first_name . ' ' . $order->shipping_last_name, 'delivery_address' => $order->shipping_address_1, 'delivery_country' => $order->shipping_country, 'delivery_state' => $order->shipping_state, 'delivery_tel' => '', 'delivery_city' => $order->shipping_city, 'delivery_zip' => $order->shipping_postcode, 'language' => 'EN', 'currency' => $the_currency, 'payment_option' => $post_data['payment_option'], 'card_type' => $post_data['card_type'], 'card_name' => $post_data['card_name'], 'data_accept' => $post_data['data_accept'], 'card_number' => $post_data['card_number'], 'expiry_month' => $post_data['expiry_month'], 'expiry_year' => $post_data['expiry_year'], 'cvv_number' => $post_data['cvv_number'], 'issuing_bank' => $post_data['issuing_bank']);
            /*-------------------------------*/
            if ($this->iframemode == 'yes') {
                $ccavenue_args['integration_type'] = 'iframe_normal';
            }
            /*-------------------------------*/
            foreach ($ccavenue_args as $param => $value) {
                $paramsJoined[] = "{$param}={$value}";
            }
            $merchant_data = implode('&', $paramsJoined);
            //echo $merchant_data;
            $encrypted_data = nilesh_encrypt($merchant_data, $this->working_key);
            $form = '';
            if ($this->iframemode == 'yes') {
                $production_url = $this->liveurl . '&encRequest=' . $encrypted_data . '&access_code=' . $this->access_code;
                $form .= $the_display_msg . '<iframe src="' . $production_url . '" id="paymentFrame" name="paymentFrame"  height="800" width="600" frameborder="0" scrolling="No" ></iframe>
				
				<script type="text/javascript">
					jQuery(document).ready(function(){
						 window.addEventListener(\'message\', function(e) {
							 jQuery("#paymentFrame").css("height",e.data[\'newHeight\']+\'px\'); 	 
						 }, false);
						
					});
				</script>';
            } else {
                //redirect to CCAvenue site
                wc_enqueue_js('
					$.blockUI({
						message: "' . esc_js(__('Thank you for your order. We are now redirecting you to CcAvenue to make payment.', 'woocommerce')) . '",
						baseZ: 99999,
						overlayCSS:
						{
							background: "#fff",
							opacity: 0.6
						},
						css: {
							padding:        "20px",
							zindex:         "9999999",
							textAlign:      "center",
							color:          "#555",
							border:         "3px solid #aaa",
							backgroundColor:"#fff",
							cursor:         "wait",
							lineHeight:     "24px",
						}
					});
				jQuery("#submit_ccavenue_payment_form").click();
				');
                $targetto = 'target="_top"';
                //===================================
                $ccavenue_args_array = array();
                $ccavenue_args_array[] = "<input type='hidden' name='encRequest' value='{$encrypted_data}'/>";
                $ccavenue_args_array[] = "<input type='hidden' name='access_code' value='{$this->access_code}'/>";
                $form .= '<form action="' . esc_url($this->liveurl) . '" method="post" id="ccavenue_payment_form"  ' . $targetto . '>
				' . implode('', $ccavenue_args_array) . '
				<!-- Button Fallback -->
				<div class="payment_buttons">
				<input type="submit" class="button alt" id="submit_ccavenue_payment_form" value="' . __('Pay via CCAvenue', 'woocommerce') . '" /> <a class="button cancel" href="' . esc_url($order->get_cancel_order_url()) . '">' . __('Cancel order &amp; restore cart', 'woocommerce') . '</a>
				</div>
				<script type="text/javascript">
				jQuery(".payment_buttons").hide();
				</script>
				</form>';
            }
            return $form;
        }
コード例 #6
0
ファイル: wc-robokassa.php プロジェクト: Mofsy/wc-robokassa
function wc_robokassa_report_javascript()
{
    ?>
    <script type="text/javascript" >
        jQuery(document).ready(function($)
        {
            var data =
            {
                'action': 'send'
            };

            var wc_robokassa_url_callback = '<?php 
    echo wc()->api_request_url('wc_robokassa_send_report');
    ?>
';

                $('.robokassa-report a').click(function()
                {
                    $.post(wc_robokassa_url_callback, data, function(response)
                    {
                        if(response == 'ok')
                        {
                            $('.robokassa-report').html('<?php 
    _e('Report is sended! Thank you.', 'wc-robokassa');
    ?>
');
                        }
                        else if(response == 'fnf')
                        {
                            $('.robokassa-report').html('<?php 
    _e('Report file NOT found! Please activate DEBUG mode and reuse error situation.', 'wc-robokassa');
    ?>
');
                        }
                        else
                        {
                            $('.robokassa-report').html('<?php 
    _e('Report is NOT sended! Please reload page and resend.', 'wc-robokassa');
    ?>
');
                        }
                    });

                    return false;
                });

        });
    </script>
    <?php 
}
コード例 #7
0
function wpr_add_giftcard_discount($cart)
{
    $giftcard = new WPR_Giftcard();
    $giftcardDiscount = $giftcard->wpr_get_payment_amount();
    // Alter the cart discount total
    wc()->cart->discount_cart = (double) $giftcardDiscount;
}
コード例 #8
0
ファイル: wc.php プロジェクト: jenalgit/roadsend-php
<?php

/*
 $Id: wc.php,v 1.2 2004/02/16 15:11:12 tim Exp $
 http://www.bagley.org/~doug/shootout/
 
 TBD - this program should not assume lines are less than 10000 characters long
*/
wc();
function wc()
{
    $datafile = $_ENV["PCC_HOME"] . "/benchmarks/data/spellcheck";
    if (!file_exists($datafile)) {
        trigger_error("Couldn't find datafile {$datafile}.", E_USER_ERROR);
    }
    $fd = fopen($datafile, "r");
    $nl = $nw = $nc = 0;
    while (!feof($fd)) {
        if ($line = fgets($fd, 10000)) {
            ++$nl;
            $nc += strlen($line);
            $nw += count(preg_split("/\\s+/", $line, -1, PREG_SPLIT_NO_EMPTY));
        }
    }
    fclose($fd);
    print "{$nl} {$nw} {$nc}\n";
}
コード例 #9
0
    /**
     * Admin Panel Options
     **/
    public function admin_options()
    {
        ?>
        <h1><?php 
        _e('Webmoney', 'wc-webmoney');
        ?>
</h1><?php 
        $this->get_icon();
        ?>
        <p><?php 
        _e('Setting receiving payments through Webmoney Merchant. If the gateway is not working, you can turn error level DEBUG and send the report to the developer. Developer looks for errors and corrected.', 'wc-webmoney');
        ?>
</p>
        <div class="webmoney-report"><a style="color: red;" href="<?php 
        wc()->api_request_url('wc_webmoney_send_report');
        ?>
"><?php 
        _e('Send report to author. Do not press if no errors! ', 'wc-webmoney');
        ?>
</a> </div>
        <hr>
        <?php 
        if ($this->is_valid_for_use()) {
            ?>

            <table class="form-table">
                <?php 
            $this->generate_settings_html();
            ?>
            </table>

        <?php 
        } else {
            ?>
            <div class="inline error"><p><strong><?php 
            _e('Gateway offline', 'wc-webmoney');
            ?>
</strong>: <?php 
            _e('Webmoney does not support the currency your store.', 'wc-webmoney');
            ?>
</p></div>
            <?php 
        }
    }
コード例 #10
0
    /**
     * Admin Panel Options
     **/
    public function admin_options()
    {
        /**
         * Show debug notice
         */
        if ($this->get_option('logger') < '400') {
            $this->debug_notice();
        }
        /**
         * Show test notice
         */
        if ($this->test === 'yes') {
            $this->test_notice();
        }
        /**
         * Donate action
         */
        $donate_status = get_option('donate_wc_robokassa');
        if (array_key_exists('donate', $_POST)) {
            if ($_POST['donate'] === 'donation_send') {
                update_option('donate_wc_robokassa', 'send');
                $donate_status = 'send';
            } elseif ($_POST['donate'] === 'donation_wait') {
                update_option('donate_wc_robokassa', 'wait:' . time());
                $donate_status = 'wait:' . time();
            }
        }
        if ($donate_status !== 'send' && $donate_status !== false) {
            $donate_time_array = explode(':', $donate_status);
            $donate_time = $donate_time_array[1];
            if (time() > $donate_time + 604800) {
                delete_option('donate_wc_robokassa');
            }
        }
        ?>
        <h1><?php 
        _e('Robokassa', 'wc-robokassa');
        ?>
</h1><?php 
        $this->get_icon();
        ?>
        <div style="background-color: #ffffff;padding: 10px; line-height: 160%; margin-bottom: 5px;font-size: 16px;">
            <?php 
        _e('Universal solution to the problem of accepting payments from your customers. Started in 2003, ROBOKASSA has established itself as a highly reliable service for receiving payments. Our clients are more than 50 000 companies, including major Russian companies, small and medium-sized businesses, government agencies, as well as foreign companies.', 'wc-robokassa');
        ?>
            <br /><?php 
        _e('If the gateway is not working, you can turn error level DEBUG and send the report to the developer. Developer looks for errors and corrected.', 'wc-robokassa');
        ?>
        </div>
        <div class="robokassa-report" style="text-align: right;font-size: 14px;"><a style="color: orange;" href="<?php 
        wc()->api_request_url('wc_robokassa_send_report');
        ?>
"><?php 
        _e('Send report to author. Do not press if no errors! ', 'wc-robokassa');
        ?>
</a> </div>

        <hr>

        <?php 
        if ($donate_status === false) {
            $current_user = wp_get_current_user();
            ?>
        <div class="donation" style="font-size:16px;line-height:160%;background-color:#fff;border:gold 2px dashed;border-right:gold 5px solid;border-left:gold 5px solid;padding: 10px;margin-top:10px;margin-bottom: 10px;">

            <?php 
            echo sprintf(__('Hello %1$s, if the plugin useful and you have a little spare cash, please send them to me. This money allows me to support plugin on actual state and the surplus will help to produce new ones.', 'wc-robokassa'), $current_user->display_name);
            ?>
            <br>
            <?php 
            _e('Details on which you can send money are located at the end of the page:', 'wc-robokassa');
            ?>
 <a href="https://mofsy.ru/about/help" target="_blank">https://mofsy.ru/about/help</a><br>
            <?php 
            _e('Development takes a lot of time and health (vision, spine, sleepless nights). You sacrifice a little bit, I sacrifice to many - as a result get a great free product for all open source.', 'wc-robokassa');
            ?>
            <div class="robokassa-report" style="text-align: right;margin-top: 10px;font-size: 14px;">
                <button name="donate" value="donation_send" style="background-color: gainsboro;padding:5px;cursor: pointer;border: 0 solid #000;"><?php 
            _e('Thanks for the plugin, i am sent a little money', 'wc-robokassa');
            ?>
</button>
                <button name="donate" value="donation_wait" style="background-color: gainsboro;padding:5px;cursor: pointer;border: 0 solid #000;"><?php 
            _e('Little money now, remind me later', 'wc-robokassa');
            ?>
</button>
            </div>

        </div>

        <hr>
        <?php 
        }
        ?>

        <?php 
        if ($this->is_valid_for_use()) {
            ?>

        <table class="form-table">
            <?php 
            $this->generate_settings_html();
            ?>
        </table>

    <?php 
        } else {
            ?>
        <div class="inline error"><p><strong><?php 
            _e('Gateway offline', 'wc-robokassa');
            ?>
</strong>: <?php 
            _e('Robokassa does not support the currency your store.', 'wc-robokassa');
            ?>
</p></div>
        <?php 
        }
    }
コード例 #11
0
ファイル: wc-webmoney.php プロジェクト: Mofsy/wc-webmoney
function wc_webmoney_report_javascript()
{
    ?>
    <script type="text/javascript" >
        jQuery(document).ready(function($)
        {
            var data =
            {
                'action': 'send'
            };

            var wc_webmoney_url_callback = '<?php 
    echo wc()->api_request_url('wc_webmoney_send_report');
    ?>
';

            $('.webmoney-report a').click(function()
            {
                $.post(wc_webmoney_url_callback, data, function(response)
                {
                    if(response == 'ok')
                    {
                        $('.webmoney-report').html('<?php 
    _e('Report is sended! Thank you.', 'wc-webmoney');
    ?>
');
                    }
                    else
                    {
                        $('.webmoney-report').html('<?php 
    _e('Report is NOT sended! Please reload page and resend.', 'wc-webmoney');
    ?>
');
                    }
                });

                return false;
            });
        });
    </script>
    <?php 
}