- Posts: 3
- Thank you received: 0
How to get shipping price
14 years 6 months ago #42235
by crinch
How to get shipping price was created by crinch
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.
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.
14 years 6 months ago #42402
by nicolas
Replied by nicolas on topic Re: How to get shipping price
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:
Code:
$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.144 seconds