Order ➜ Insert

You can insert any detail of order via function lsdcommerce_order_insert(), just passed the args, like this.

$args = array(
    'customer' => array(
        'name'  => "lasida",
        'phone' => '081212121212',
        'email' => '[email protected]'
    ),
    'shipping_digital' => array(
        'default' => array( // Digital Courrier ID
            'receiver' => '[email protected]'
        )
    ),
    'shipping_physical' => array(
        'rajaongkir_starter' => array( // Physical Courrier ID
            'state'     => 'BT',
            'city'      => '21',
            'district'  => '21',
            'address'   => 'Jl Desa Sindang Panon',
            'package'   => 'jne-yes' // 
        )
    ),
    'products' => array(
        array( // List Product
            'id'    => 94,
            'qty'   => 1,
        )
    ),
    'extras' => array(
        'unique_code'   => array( // Unique Code Support
            'type' => 'minus',
            'value' => 2,
        ),
        'coupon'        => 'DISKON100K' // Coupon Support
    ),
    'payment'   => 'bankbca' // payment ID

);  
lsdcommerce_order_insert( $args );

You can processing extra cost and calc with your own function

Order ➜ Insert with Extra Cost

Was this page helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *