3

I am using the WebShopApps MatrixRate – #1 Multiple Table Rates Extension for User Selection of courier service. I need to get this table Values by API. how do I get to Magento table value using API? Actually, I need this values for my DotNet Platform.

Extension Url : https://goo.gl/Lj3P3u

1

I cannot provide API access, although I am loading the matrix rate shipping rates in a completely custom way - I have rewritten checkout entirely. If you are interested in loading shipping rates for a quote generated by the matrix rate module then I could answer that?

Edit with method for retrieving matrix rates:

Required: 1. Checkout Session Quote must have a shipping address that has been saved so it has an id. 2. This may be partially redundant but I set collect shipping rates on the quote. 3. I load the shipping rate from the shippingRatesCollection (on the shipping address from the quote, and I take the first item since we are only enabling matrix rate), I retrieve the code for that shipping rate (which has been generated based on the quote contents and price) I then set that shipping method code on the shipping address as this is how the quote calculates overall totals and shipping prices (based on shipping by default).

Here is a segment of the code:

    // Hoping saving the cart (and therefore both address values will allow estimating methods)
    $this->_cart->save();

    $delivery->setCollectShippingRates(true)->collectShippingRates();
    $delivery->save();

    // dev
    // error handling for no delivery method available
    $method = $delivery->getShippingRatesCollection()->getFirstItem();
    $delivery->setShippingMethod($method->getCode());
    $delivery->save();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy