Woocommerce客户可以创建订单和结账

时间:2015-11-16 17:45:55

标签: php wordpress woocommerce

是否有任何方法可以创建一个包含2个字段的付款页面,一个区域供客户支付总额,另一个区域供客户添加订单,例如订单。然后它进入结账页面供他们付款。

function custom_cart_shortcode(){
    global $woocommerce, $product;

    $checkout_url = WC()->cart->get_checkout_url(); 

    $custom_cart_input = '<form action="'.$checkout_ur.'" method="post">

            <table class="shop_table shop_table_responsive cart" cellspacing="0">
                <tbody>
                    <tr>
                        <td class="product-price"> Amount to Pay(USD): </td>
                        <td class="product-price"> <input class="wc_input_price" id="_order_total" name="_order_total" placeholder="0" value="" type="text"></td>
                    </tr>
                    <tr>
                        <td class="product-price">Order Note :</td>
                        <td class="product-subtotal"><textarea type="text" name="order_note" id="add_order_note" class="input-text" cols="20" rows="5"></textarea></td>
                    </tr>
                </tbody>
            </table>';
            $cart_button = '<p class="buttons"><a href="'.$checkout_url.'" type="submit" class="button checkout">Checkout</a></p></form>';
    $cart_controller = do_action( 'woocommerce_after_cart' );
    $new_cart = $custom_cart_input.$cart_button.$cart_controller;
    return $new_cart;
}
add_shortcode('custom_cart', 'custom_cart_shortcode');

有可能吗?请给我一些建议。或者想法我怎么能继续前进?

enter image description here

0 个答案:

没有答案