Problems, need help? Have a tip or advice? Post it here.
2 posts Page 1 of 1
Sorry for my money questions. This is my very first time using the couch art system.
My problem: at the cart.php page I want customers to be able to choose between bank transfer or mobile money transfer. If mobile money transfer I want the total cost to include the shipping fee or 1% of the total cost which I have set inside the cart config. If via bank transfer then there should be no shipping fee. I tried following this tutorial but I'm not a php person so found it difficult understanding the process.
Code: Select all
function get_shipping(){
    global $KSESSION;
   
    $cost = 0;
    $items = $this->count_shippable_items;
    if( !$items ) return 0; // No item in the cart that needs shipping
   
    // First check if a discount coupon provides free shipping
    if( $KSESSION->get_var('coupon_found') &&
        $this->sub_total > $KSESSION->get_var('coupon_min_amount') &&
        $KSESSION->get_var('coupon_free_shipping') ){
       
            $KSESSION->set_var( 'free_shipping_applied', 1 );
            return 0;
    }
    else{
        $KSESSION->set_var( 'free_shipping_applied', 0 );
    }
    ..
    ..
}


Any help will be greatly appreciated.
Perhaps, you could try using existing Cart's php code which works with coupons and apply a coupon (=set variable in session) if user chooses payment via bank transfer. Set up the shipping fee 1% by default (if user did not specifically choose mobile money transfer). Maybe even go public the coupon code for users to enter if they want to pay via mobile and shave off the 1% fee.
2 posts Page 1 of 1