AnswerBun.com

Get matrixrate config programatically

Magento Asked by pevik on December 14, 2020

I need to get shipping price programatically. I thought I’d use something like this (inspiration):

$scopeConfig = $objectManager->get('MagentoFrameworkAppConfigScopeConfigInterface');
$activeCarriers = $objectManager->create('MagentoShippingModelConfig')->getActiveCarriers();

foreach($activeCarriers as $carrierCode => $carrierModel) {
    $options = array();

    if ($carrierMethods = $carrierModel->getAllowedMethods()) {
        foreach ($carrierMethods as $methodCode => $method) {
            $code = $carrierCode.'_'.$methodCode;
            $options[] = array('value'=>$code,'label'=>$method);
        }
        $carrierTitle = $scopeConfig->getValue('carriers/' . $carrierCode . '/title');
    }

    $methods[] = array('value' => $options, 'label' => $carrierTitle);
}

But that does not help much, because I know which shipping methods I’m using. I just need to know details of WebShopApps Matrix Rate which has been saved in webshopapps_matrixrate table. I.E. I need just the content of the SQL:

select * from webshopapps_matrixrate where website_id = ID;

I also see records with path = carriers/matrixrate/import in core_config_data, but that does not help much (value = 1590180257,matrixrates.csv,text/csv,/tmp/php7BEvw0,0,361).

Add your own answers!

Related Questions

Add option to product in the cart progrmatically in magento 2

2  Asked on September 12, 2020 by anantchopra2007

 

Magento 2 Access-Control-Allow-Origin

2  Asked on September 9, 2020 by borche-glafche

   

Magento 2: what is the catalog_attributes.xml file?

2  Asked on September 7, 2020 by raphael-at-digital-pianism

       

magento 2 – modify db_schema.xml field length

1  Asked on September 4, 2020 by sairaj-gadekar

 

Magento 2.3.2 Upgrade to 2.4

2  Asked on September 4, 2020 by hatim

 

Magento 2: Make sales without stock

1  Asked on August 9, 2020 by hudson-alves-triunfante

     

Magento 2 : print_r or var_dump is not working

4  Asked on July 30, 2020 by zed-blackbeard

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP