Skip to main content

How to get shipping ids

More
7 years 5 months ago #305964 by kyratn
Hi,

I am building custom page where it will show shipping details based on hikashop shipping zones.

How should i get all shipping ids/methods?

As example i do have this:
Code:
$id = '8'; $shippingClass = hikashop_get('class.shipping'); $shipping = $shippingClass->get($id); var_dump($shipping);

This will return all shipping details of shippig method with id '8'.

Should i run query or this can be done with hikashop code itself?

Thanks

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

More
7 years 5 months ago #305969 by nicolas
Replied by nicolas on topic How to get shipping ids
Hi,

You can use that code:
Code:
$pluginClass = hikashop_get('class.plugins'); $shippingMethods = $pluginClass->getMethods('shipping');
Note that this code will only load the data of the shipping methods you created from the database. It won't process them.
So for example, if you use a shipping method like UPS or Fedex, which calculates the shipping fees dynamically based on what is in the cart and the customer shipping address,
In that case you would need to use:
Code:
$shippingClass = hikashop_get('class.shipping'); $shipping = $shippingClass->getShippings($cart);
But in that case, you need to give it the full cart in $cart which is tricky to do as it needs a whole bunch of data loaded.
The following user(s) said Thank You: kyratn

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

Time to create page: 0.174 seconds
Powered by Kunena Forum