How to get shipping price

  • Posts: 3
  • Thank you received: 0
12 years 2 months ago #42235

Hi,

I have developed and configured a payment method which has a shipping method name. So I have a payment_shipping_methods as input and some cart values which file/function I should used to get the shipping price against this payment_shipping_method value. I am very much thankful to you for any suggestion/help. Thanks in advance.

Please Log in or Create an account to join the conversation.

  • Posts: 81677
  • Thank you received: 13100
  • MODERATOR
12 years 2 months ago #42402

You will need first to get the $cat object with the content of the whole cart and the $payment_shipping_method string with the name of your shipping method ("manual" for example). Then, you can do like that:

$shippingClass = hikashop_get('class.shipping');
$shippingMethods = $shippingClass->getMethods($cart);

foreach($shippingMethods as $shippingMethod){
 if($shippingMethod->shipping_type==$payment_shipping_method){
   echo $shippingMethod->shipping_price;
   break;
  }
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum