小编Dei*_*mos的帖子

如果我在输入类型文本中写入内容,请选中复选框

我正在尝试制作一个看起来像这样的表单:

如果在输入类型="text"内部是一个像数字自动检查CHECKBOX,是jquery?或简单的PHP.

啊,更重要的是,我正在使用woocommerce,所以我做了这样的功能.

add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');


function my_custom_checkout_field( $checkout ) {




    woocommerce_form_field( 'losung', array( 
        'type'          => 'text', 
        'class'         => array('my-field-class'), 

        'label'         => __('titel'), 
        'placeholder'   => __('Enter a number'),
        ), $checkout->get_value( 'my_field_name' ));
        echo '<div class="spiele-container">';
        echo '<input class="input-checkbox pull-left" id="" type="checkbox" name="ter">';
        echo '<div id="text-container-spiele">text ';
    echo '</div>';
    echo '</div>';

}
Run Code Online (Sandbox Code Playgroud)

javascript php wordpress jquery woocommerce

3
推荐指数
1
解决办法
5743
查看次数

从每个订单Woocommerce获取sku

我想从Woocoomerce的订单中获取sku(来自Wordpress电子商务的插件)我需要输入产品订单的名称,(但是我现在拥有它,只有sku是问题)这是我的代码,

<?php 
//query
        global $woocommerce; 
        global $wpdb; 
        global $product;
        $args = array(
            'post_type'         => 'shop_order',
            'orderby' => 'ID',
            'post_status'       => 'publish',
            'posts_per_page' => -1,
            'tax_query' => array(array(
                            'taxonomy' => 'shop_order_status',
                            'field' => 'slug',
                            'terms' => array('processing'))));
        $loop = new WP_Query( $args );

        while ( $loop->have_posts() ) : $loop->the_post();

        $order_id = $loop->post->ID;
        $order = new WC_Order($order_id); 
        $product = new WC_Product($order_id);

// Getting names of items and quantity throught foreach
foreach($order->get_items() as $item) 
{
 $item['name']; 
 $item['qty'];
 }

//Email verificacion if is suscribed …
Run Code Online (Sandbox Code Playgroud)

php wordpress woocommerce

2
推荐指数
1
解决办法
9235
查看次数

按时间和日期获取 WordPress 帖子

我正在尝试按日期和时间获取 WordPress 帖子,例如从 02/01/2014 到 02/05/2014 和时间 17:10,有人知道吗?

谢谢您的帮助

php wordpress wordpress-theming

1
推荐指数
1
解决办法
2317
查看次数

Json_encode变音符输出

我想用德语变音符号显示输出,例如Fu009 \这样的输出,但我需要这样的“fü”。

<?php
$json = (object) array(
    "salutation" = > ''.$order - > order_custom_fields['_billing_anrede'][0].
    '',
    "title" = > ''.$order - > order_custom_fields['_billing_titel'][0].
    '',
    "first_name" = > ''.$order - > order_custom_fields['_billing_first_name'][0].
    '',
    "last_name" = > ''.$order - > order_custom_fields['_billing_last_name'][0].
    '',
    "street" = > ''.$order - > order_custom_fields['_billing_address_1'][0].
    '',
    "street_number" = > ''.$order - > order_custom_fields['_billing_address_2'][0].
    '',
    "address_supplement" = > ''.$order - > order_custom_fields['_billing_company'][0].
    '',
    "zipcode" = > ''.$order - > order_custom_fields['_billing_postcode'][0].
    '',
    "city" = > ''.$order - > order_custom_fields['_billing_city'][0].
    '',
    "country" …
Run Code Online (Sandbox Code Playgroud)

javascript php json jsonp wordpress-plugin

0
推荐指数
1
解决办法
4106
查看次数