Magento 2 : Shipping custom module doesn't workMagento Shipping estimate doesn't workProblem with custom...

Why would space fleets be aligned?

Is using an 'empty' metaphor considered bad style?

Does dispel magic end a master's control over their undead?

Python Pandas - difference between 'loc' and 'where'?

Do "fields" always combine by addition?

How do I append a character to the end of every line in an Excel cell?

How would an AI self awareness kill switch work?

Airplane generations - how does it work?

Why do cars have plastic shrouds over the engine?

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

How do I prevent a homebrew Grappling Hook feature from trivializing Tomb of Annihilation?

Ellipses aligned on the same boundary point

What is a good reason for every spaceship to carry a weapon on board?

Why avoid shared user accounts?

What makes papers publishable in top-tier journals?

Building an exterior wall within an exterior wall for insulation

Square Root Distance from Integers

Identify KNO3 and KH2PO4 at home

Why does magnet wire need to be insulated?

Is there a lava-breathing lizard creature (that could be worshipped by a cult) in 5e?

Avoid page break between paragraphs

Eww, those bytes are gross

Has any human ever had the choice to leave Earth permanently?

What happens when a creature with flying blocks my non-flying attacker?



Magento 2 : Shipping custom module doesn't work


Magento Shipping estimate doesn't workProblem with custom shipping moduleMagento 2.1.8 - Custom Online shipping module not displaying shipping methods on checkoutMagento 2 Retrive the Shipping method and shipping rates programmaticallyCustom Attribute Product - Checkout Page - Shipping Module - ObjectManager InstanceEstimate Shipping not work for registered addressMagento2 Frontend and backend doesn't work while executing commandsMagento 2 Custom module country change issueremove free shipping method from custom shipping module magento2Localized Exception Doesn't display erros in Magento 2 shipping plugin













0















I'm trying to extend shipping module of magento. I need to set shiping rate based on region.



The problem is I cannot find my shipping modules in admin panel in Stores > Configuration and it's not applied to storefront



here is system.xml:



<?xml version="1.0"?><config
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="vendor_id" translate="label" sortOrder="10">
<label>Vendor_Name</label>
</tab>
<section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
<class>separator-top</class>
<label>Zones Fixed Shipping</label>
<tab>vendor_id</tab>
<resource>Vendor_Module::moduleName</resource>
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
<label>General Configuration</label>
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Enabled</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
<field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Fixed Shipping</label>
</field>
<field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Module Enable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
<field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Display Text</label>
<comment>This text will display on the frontend.</comment>
</field>
<field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Title</label>
</field>
<field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Method Name</label>
</field>
<field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Price</label>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Calculate Handling Fee</label>
<source_model>MagentoShippingModelSourceHandlingType</source_model>
</field>
<field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Handling Fee</label>
<validate>validate-number validate-zero-or-greater</validate>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
</field>
<field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Ship to Applicable Countries</label>
<frontend_class>shipping-applicable-country</frontend_class>
<source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
</field>
<field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Ship to Specific Countries</label>
<source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
<can_be_empty>1</can_be_empty>
</field>
<field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Show Method if Not Applicable</label>
<source_model>MagentoConfigModelConfigSourceYesno</source_model>
</field>
<field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Displayed Error Message</label>
</field>
</group>
</section>
</system>




here is config.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<carriers>

<Vendor_ModuleName>

<active>1</active>
<sallowspecific>0</sallowspecific>

<model>VendorModuleNameModelCarrierFixedShipping</model>

<name>Fixed Shipping</name>

<title>Zoned fixed shipping</title>



</Vendor_ModuleName>

</carriers>

</default>




here is my model:



class FixedShipping extends AbstractCarrier implements CarrierInterface
{
/**
* @var string
*/
protected $_code = 'vendoe_moduleName';

/**
* @var bool
*/
protected $_isFixed = true;

/**
* @var MagentoShippingModelRateResultFactory
*/
protected $_rateResultFactory;

/**
* @var MagentoQuoteModelQuoteAddressRateResultMethodFactory
*/
protected $_rateMethodFactory;

/**
* @var MagentoCustomerModelSession
*/
protected $customerSession;


public function __construct(MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
MagentoQuoteModelQuoteAddressRateResultErrorFactory $rateErrorFactory,
PsrLogLoggerInterface $logger,
MagentoShippingModelRateResultFactory $rateResultFactory,
MagentoQuoteModelQuoteAddressRateResultMethodFactory $rateMethodFactory,
MagentoCustomerModelSession $customerSession,
array $data = []){

$this->_rateResultFactory = $rateResultFactory;
$this->_rateMethodFactory = $rateMethodFactory;
$this->customerSession = $customerSession;
parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
}

/**
* @return array
*/
public function getAllowedMethods(){

return [$this->getCarrierCode() => __($this->getConfigData('name'))];
}

public function collectRates(MagentoQuoteModelQuoteAddressRateRequest $request){

if (!$this->isActive()){

return false;
}



$result->append($method);
return $result;*/

$item = current($request->getAllItems());
$quote = null;
if ($item instanceof QuoteItem){
$quote = $item->getQuote();
}
if($quote){
$shippingAddress = $quote->getShippingAddress();
if($shippingAddress['region']['region_code'] == 'Cairo'){
$shippingPrice = 20;
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
}
elseif($shippingAddress['region']['region_code'] == 'Alexandria'){
$shippingPrice = 34;
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
}
//else{
$shippingPrice = 1600;
$method->setPrice($shippingPrice);
$method->setCost($shippingPrice);
//}

$method = $this->_rateMethodFactory->create();

$method->setCarrier($_code);
$method->setCarrierTitle($this->getConfigData('title'));

$method->setMethod($this->getCarrierCode());
$method->setMethodTitle($this->getConfigData('name'));
$result->append($method);
return $result;
}
return false;
}}









share|improve this question





























    0















    I'm trying to extend shipping module of magento. I need to set shiping rate based on region.



    The problem is I cannot find my shipping modules in admin panel in Stores > Configuration and it's not applied to storefront



    here is system.xml:



    <?xml version="1.0"?><config
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
    <tab id="vendor_id" translate="label" sortOrder="10">
    <label>Vendor_Name</label>
    </tab>
    <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
    <class>separator-top</class>
    <label>Zones Fixed Shipping</label>
    <tab>vendor_id</tab>
    <resource>Vendor_Module::moduleName</resource>
    <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
    <label>General Configuration</label>
    <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Enabled</label>
    <source_model>MagentoConfigModelConfigSourceYesno</source_model>
    </field>
    <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Fixed Shipping</label>
    </field>
    <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
    <label>Module Enable</label>
    <source_model>MagentoConfigModelConfigSourceYesno</source_model>
    </field>
    <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
    <label>Display Text</label>
    <comment>This text will display on the frontend.</comment>
    </field>
    <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Title</label>
    </field>
    <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Method Name</label>
    </field>
    <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Price</label>
    <validate>validate-number validate-zero-or-greater</validate>
    </field>
    <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Calculate Handling Fee</label>
    <source_model>MagentoShippingModelSourceHandlingType</source_model>
    </field>
    <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Handling Fee</label>
    <validate>validate-number validate-zero-or-greater</validate>
    </field>
    <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Sort Order</label>
    </field>
    <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Ship to Applicable Countries</label>
    <frontend_class>shipping-applicable-country</frontend_class>
    <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
    </field>
    <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Ship to Specific Countries</label>
    <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
    <can_be_empty>1</can_be_empty>
    </field>
    <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
    <label>Show Method if Not Applicable</label>
    <source_model>MagentoConfigModelConfigSourceYesno</source_model>
    </field>
    <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Displayed Error Message</label>
    </field>
    </group>
    </section>
    </system>




    here is config.xml



    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
    <carriers>

    <Vendor_ModuleName>

    <active>1</active>
    <sallowspecific>0</sallowspecific>

    <model>VendorModuleNameModelCarrierFixedShipping</model>

    <name>Fixed Shipping</name>

    <title>Zoned fixed shipping</title>



    </Vendor_ModuleName>

    </carriers>

    </default>




    here is my model:



    class FixedShipping extends AbstractCarrier implements CarrierInterface
    {
    /**
    * @var string
    */
    protected $_code = 'vendoe_moduleName';

    /**
    * @var bool
    */
    protected $_isFixed = true;

    /**
    * @var MagentoShippingModelRateResultFactory
    */
    protected $_rateResultFactory;

    /**
    * @var MagentoQuoteModelQuoteAddressRateResultMethodFactory
    */
    protected $_rateMethodFactory;

    /**
    * @var MagentoCustomerModelSession
    */
    protected $customerSession;


    public function __construct(MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
    MagentoQuoteModelQuoteAddressRateResultErrorFactory $rateErrorFactory,
    PsrLogLoggerInterface $logger,
    MagentoShippingModelRateResultFactory $rateResultFactory,
    MagentoQuoteModelQuoteAddressRateResultMethodFactory $rateMethodFactory,
    MagentoCustomerModelSession $customerSession,
    array $data = []){

    $this->_rateResultFactory = $rateResultFactory;
    $this->_rateMethodFactory = $rateMethodFactory;
    $this->customerSession = $customerSession;
    parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
    }

    /**
    * @return array
    */
    public function getAllowedMethods(){

    return [$this->getCarrierCode() => __($this->getConfigData('name'))];
    }

    public function collectRates(MagentoQuoteModelQuoteAddressRateRequest $request){

    if (!$this->isActive()){

    return false;
    }



    $result->append($method);
    return $result;*/

    $item = current($request->getAllItems());
    $quote = null;
    if ($item instanceof QuoteItem){
    $quote = $item->getQuote();
    }
    if($quote){
    $shippingAddress = $quote->getShippingAddress();
    if($shippingAddress['region']['region_code'] == 'Cairo'){
    $shippingPrice = 20;
    $method->setPrice($shippingPrice);
    $method->setCost($shippingPrice);
    }
    elseif($shippingAddress['region']['region_code'] == 'Alexandria'){
    $shippingPrice = 34;
    $method->setPrice($shippingPrice);
    $method->setCost($shippingPrice);
    }
    //else{
    $shippingPrice = 1600;
    $method->setPrice($shippingPrice);
    $method->setCost($shippingPrice);
    //}

    $method = $this->_rateMethodFactory->create();

    $method->setCarrier($_code);
    $method->setCarrierTitle($this->getConfigData('title'));

    $method->setMethod($this->getCarrierCode());
    $method->setMethodTitle($this->getConfigData('name'));
    $result->append($method);
    return $result;
    }
    return false;
    }}









    share|improve this question



























      0












      0








      0








      I'm trying to extend shipping module of magento. I need to set shiping rate based on region.



      The problem is I cannot find my shipping modules in admin panel in Stores > Configuration and it's not applied to storefront



      here is system.xml:



      <?xml version="1.0"?><config
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
      <system>
      <tab id="vendor_id" translate="label" sortOrder="10">
      <label>Vendor_Name</label>
      </tab>
      <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
      <class>separator-top</class>
      <label>Zones Fixed Shipping</label>
      <tab>vendor_id</tab>
      <resource>Vendor_Module::moduleName</resource>
      <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>General Configuration</label>
      <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Enabled</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Fixed Shipping</label>
      </field>
      <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>Module Enable</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>Display Text</label>
      <comment>This text will display on the frontend.</comment>
      </field>
      <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Title</label>
      </field>
      <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Method Name</label>
      </field>
      <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Price</label>
      <validate>validate-number validate-zero-or-greater</validate>
      </field>
      <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Calculate Handling Fee</label>
      <source_model>MagentoShippingModelSourceHandlingType</source_model>
      </field>
      <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Handling Fee</label>
      <validate>validate-number validate-zero-or-greater</validate>
      </field>
      <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Sort Order</label>
      </field>
      <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Ship to Applicable Countries</label>
      <frontend_class>shipping-applicable-country</frontend_class>
      <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
      </field>
      <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Ship to Specific Countries</label>
      <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
      <can_be_empty>1</can_be_empty>
      </field>
      <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Show Method if Not Applicable</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Displayed Error Message</label>
      </field>
      </group>
      </section>
      </system>




      here is config.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
      <default>
      <carriers>

      <Vendor_ModuleName>

      <active>1</active>
      <sallowspecific>0</sallowspecific>

      <model>VendorModuleNameModelCarrierFixedShipping</model>

      <name>Fixed Shipping</name>

      <title>Zoned fixed shipping</title>



      </Vendor_ModuleName>

      </carriers>

      </default>




      here is my model:



      class FixedShipping extends AbstractCarrier implements CarrierInterface
      {
      /**
      * @var string
      */
      protected $_code = 'vendoe_moduleName';

      /**
      * @var bool
      */
      protected $_isFixed = true;

      /**
      * @var MagentoShippingModelRateResultFactory
      */
      protected $_rateResultFactory;

      /**
      * @var MagentoQuoteModelQuoteAddressRateResultMethodFactory
      */
      protected $_rateMethodFactory;

      /**
      * @var MagentoCustomerModelSession
      */
      protected $customerSession;


      public function __construct(MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoQuoteModelQuoteAddressRateResultErrorFactory $rateErrorFactory,
      PsrLogLoggerInterface $logger,
      MagentoShippingModelRateResultFactory $rateResultFactory,
      MagentoQuoteModelQuoteAddressRateResultMethodFactory $rateMethodFactory,
      MagentoCustomerModelSession $customerSession,
      array $data = []){

      $this->_rateResultFactory = $rateResultFactory;
      $this->_rateMethodFactory = $rateMethodFactory;
      $this->customerSession = $customerSession;
      parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
      }

      /**
      * @return array
      */
      public function getAllowedMethods(){

      return [$this->getCarrierCode() => __($this->getConfigData('name'))];
      }

      public function collectRates(MagentoQuoteModelQuoteAddressRateRequest $request){

      if (!$this->isActive()){

      return false;
      }



      $result->append($method);
      return $result;*/

      $item = current($request->getAllItems());
      $quote = null;
      if ($item instanceof QuoteItem){
      $quote = $item->getQuote();
      }
      if($quote){
      $shippingAddress = $quote->getShippingAddress();
      if($shippingAddress['region']['region_code'] == 'Cairo'){
      $shippingPrice = 20;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      }
      elseif($shippingAddress['region']['region_code'] == 'Alexandria'){
      $shippingPrice = 34;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      }
      //else{
      $shippingPrice = 1600;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      //}

      $method = $this->_rateMethodFactory->create();

      $method->setCarrier($_code);
      $method->setCarrierTitle($this->getConfigData('title'));

      $method->setMethod($this->getCarrierCode());
      $method->setMethodTitle($this->getConfigData('name'));
      $result->append($method);
      return $result;
      }
      return false;
      }}









      share|improve this question
















      I'm trying to extend shipping module of magento. I need to set shiping rate based on region.



      The problem is I cannot find my shipping modules in admin panel in Stores > Configuration and it's not applied to storefront



      here is system.xml:



      <?xml version="1.0"?><config
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
      <system>
      <tab id="vendor_id" translate="label" sortOrder="10">
      <label>Vendor_Name</label>
      </tab>
      <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
      <class>separator-top</class>
      <label>Zones Fixed Shipping</label>
      <tab>vendor_id</tab>
      <resource>Vendor_Module::moduleName</resource>
      <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>General Configuration</label>
      <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Enabled</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Fixed Shipping</label>
      </field>
      <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>Module Enable</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
      <label>Display Text</label>
      <comment>This text will display on the frontend.</comment>
      </field>
      <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Title</label>
      </field>
      <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Method Name</label>
      </field>
      <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Price</label>
      <validate>validate-number validate-zero-or-greater</validate>
      </field>
      <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Calculate Handling Fee</label>
      <source_model>MagentoShippingModelSourceHandlingType</source_model>
      </field>
      <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Handling Fee</label>
      <validate>validate-number validate-zero-or-greater</validate>
      </field>
      <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Sort Order</label>
      </field>
      <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Ship to Applicable Countries</label>
      <frontend_class>shipping-applicable-country</frontend_class>
      <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
      </field>
      <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Ship to Specific Countries</label>
      <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
      <can_be_empty>1</can_be_empty>
      </field>
      <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
      <label>Show Method if Not Applicable</label>
      <source_model>MagentoConfigModelConfigSourceYesno</source_model>
      </field>
      <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
      <label>Displayed Error Message</label>
      </field>
      </group>
      </section>
      </system>




      here is config.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
      <default>
      <carriers>

      <Vendor_ModuleName>

      <active>1</active>
      <sallowspecific>0</sallowspecific>

      <model>VendorModuleNameModelCarrierFixedShipping</model>

      <name>Fixed Shipping</name>

      <title>Zoned fixed shipping</title>



      </Vendor_ModuleName>

      </carriers>

      </default>




      here is my model:



      class FixedShipping extends AbstractCarrier implements CarrierInterface
      {
      /**
      * @var string
      */
      protected $_code = 'vendoe_moduleName';

      /**
      * @var bool
      */
      protected $_isFixed = true;

      /**
      * @var MagentoShippingModelRateResultFactory
      */
      protected $_rateResultFactory;

      /**
      * @var MagentoQuoteModelQuoteAddressRateResultMethodFactory
      */
      protected $_rateMethodFactory;

      /**
      * @var MagentoCustomerModelSession
      */
      protected $customerSession;


      public function __construct(MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig,
      MagentoQuoteModelQuoteAddressRateResultErrorFactory $rateErrorFactory,
      PsrLogLoggerInterface $logger,
      MagentoShippingModelRateResultFactory $rateResultFactory,
      MagentoQuoteModelQuoteAddressRateResultMethodFactory $rateMethodFactory,
      MagentoCustomerModelSession $customerSession,
      array $data = []){

      $this->_rateResultFactory = $rateResultFactory;
      $this->_rateMethodFactory = $rateMethodFactory;
      $this->customerSession = $customerSession;
      parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
      }

      /**
      * @return array
      */
      public function getAllowedMethods(){

      return [$this->getCarrierCode() => __($this->getConfigData('name'))];
      }

      public function collectRates(MagentoQuoteModelQuoteAddressRateRequest $request){

      if (!$this->isActive()){

      return false;
      }



      $result->append($method);
      return $result;*/

      $item = current($request->getAllItems());
      $quote = null;
      if ($item instanceof QuoteItem){
      $quote = $item->getQuote();
      }
      if($quote){
      $shippingAddress = $quote->getShippingAddress();
      if($shippingAddress['region']['region_code'] == 'Cairo'){
      $shippingPrice = 20;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      }
      elseif($shippingAddress['region']['region_code'] == 'Alexandria'){
      $shippingPrice = 34;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      }
      //else{
      $shippingPrice = 1600;
      $method->setPrice($shippingPrice);
      $method->setCost($shippingPrice);
      //}

      $method = $this->_rateMethodFactory->create();

      $method->setCarrier($_code);
      $method->setCarrierTitle($this->getConfigData('title'));

      $method->setMethod($this->getCarrierCode());
      $method->setMethodTitle($this->getConfigData('name'));
      $result->append($method);
      return $result;
      }
      return false;
      }}






      shipping-methods magento-2.1.7






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 mins ago









      G Prathap

      594213




      594213










      asked 25 mins ago









      Yomna MansourYomna Mansour

      16910




      16910






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Change your system.xml by following code snippet:



          <?xml version="1.0"?>
          <config
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
          <system>
          <tab id="vendor_id" translate="label" sortOrder="10">
          <label>Vendor_Name</label>
          </tab>
          <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
          <class>separator-top</class>
          <label>Zones Fixed Shipping</label>
          <tab>vendor_id</tab>
          <resource>Vendor_Module::moduleName</resource>
          <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
          <label>General Configuration</label>
          <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Enabled</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>
          <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Fixed Shipping</label>
          </field>
          <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
          <label>Module Enable</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>
          <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
          <label>Display Text</label>
          <comment>This text will display on the frontend.</comment>
          </field>
          <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Title</label>
          </field>
          <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Price</label>
          <validate>validate-number validate-zero-or-greater</validate>
          </field>
          <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Calculate Handling Fee</label>
          <source_model>MagentoShippingModelSourceHandlingType</source_model>
          </field>
          <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Handling Fee</label>
          <validate>validate-number validate-zero-or-greater</validate>
          </field>
          <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Sort Order</label>
          </field>
          <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Ship to Applicable Countries</label>
          <frontend_class>shipping-applicable-country</frontend_class>
          <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
          </field>
          <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Ship to Specific Countries</label>
          <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
          <can_be_empty>1</can_be_empty>
          </field>
          <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
          <label>Show Method if Not Applicable</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>
          <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Displayed Error Message</label>
          </field>
          </group>
          </section>
          </system>
          </config>




          share























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f263706%2fmagento-2-shipping-custom-module-doesnt-work%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Change your system.xml by following code snippet:



            <?xml version="1.0"?>
            <config
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
            <system>
            <tab id="vendor_id" translate="label" sortOrder="10">
            <label>Vendor_Name</label>
            </tab>
            <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Zones Fixed Shipping</label>
            <tab>vendor_id</tab>
            <resource>Vendor_Module::moduleName</resource>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>General Configuration</label>
            <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Enabled</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>
            <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Fixed Shipping</label>
            </field>
            <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>Module Enable</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>
            <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
            <label>Display Text</label>
            <comment>This text will display on the frontend.</comment>
            </field>
            <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Title</label>
            </field>
            <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Price</label>
            <validate>validate-number validate-zero-or-greater</validate>
            </field>
            <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Calculate Handling Fee</label>
            <source_model>MagentoShippingModelSourceHandlingType</source_model>
            </field>
            <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Handling Fee</label>
            <validate>validate-number validate-zero-or-greater</validate>
            </field>
            <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Sort Order</label>
            </field>
            <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Ship to Applicable Countries</label>
            <frontend_class>shipping-applicable-country</frontend_class>
            <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
            </field>
            <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Ship to Specific Countries</label>
            <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
            <can_be_empty>1</can_be_empty>
            </field>
            <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
            <label>Show Method if Not Applicable</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>
            <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Displayed Error Message</label>
            </field>
            </group>
            </section>
            </system>
            </config>




            share




























              0














              Change your system.xml by following code snippet:



              <?xml version="1.0"?>
              <config
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
              <system>
              <tab id="vendor_id" translate="label" sortOrder="10">
              <label>Vendor_Name</label>
              </tab>
              <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
              <class>separator-top</class>
              <label>Zones Fixed Shipping</label>
              <tab>vendor_id</tab>
              <resource>Vendor_Module::moduleName</resource>
              <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
              <label>General Configuration</label>
              <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Enabled</label>
              <source_model>MagentoConfigModelConfigSourceYesno</source_model>
              </field>
              <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
              <label>Fixed Shipping</label>
              </field>
              <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
              <label>Module Enable</label>
              <source_model>MagentoConfigModelConfigSourceYesno</source_model>
              </field>
              <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
              <label>Display Text</label>
              <comment>This text will display on the frontend.</comment>
              </field>
              <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
              <label>Title</label>
              </field>
              <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Price</label>
              <validate>validate-number validate-zero-or-greater</validate>
              </field>
              <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Calculate Handling Fee</label>
              <source_model>MagentoShippingModelSourceHandlingType</source_model>
              </field>
              <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Handling Fee</label>
              <validate>validate-number validate-zero-or-greater</validate>
              </field>
              <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Sort Order</label>
              </field>
              <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Ship to Applicable Countries</label>
              <frontend_class>shipping-applicable-country</frontend_class>
              <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
              </field>
              <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Ship to Specific Countries</label>
              <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
              <can_be_empty>1</can_be_empty>
              </field>
              <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
              <label>Show Method if Not Applicable</label>
              <source_model>MagentoConfigModelConfigSourceYesno</source_model>
              </field>
              <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
              <label>Displayed Error Message</label>
              </field>
              </group>
              </section>
              </system>
              </config>




              share


























                0












                0








                0







                Change your system.xml by following code snippet:



                <?xml version="1.0"?>
                <config
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
                <system>
                <tab id="vendor_id" translate="label" sortOrder="10">
                <label>Vendor_Name</label>
                </tab>
                <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
                <class>separator-top</class>
                <label>Zones Fixed Shipping</label>
                <tab>vendor_id</tab>
                <resource>Vendor_Module::moduleName</resource>
                <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>General Configuration</label>
                <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Enabled</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Fixed Shipping</label>
                </field>
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Module Enable</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Display Text</label>
                <comment>This text will display on the frontend.</comment>
                </field>
                <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Title</label>
                </field>
                <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Price</label>
                <validate>validate-number validate-zero-or-greater</validate>
                </field>
                <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Calculate Handling Fee</label>
                <source_model>MagentoShippingModelSourceHandlingType</source_model>
                </field>
                <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Handling Fee</label>
                <validate>validate-number validate-zero-or-greater</validate>
                </field>
                <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Sort Order</label>
                </field>
                <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Ship to Applicable Countries</label>
                <frontend_class>shipping-applicable-country</frontend_class>
                <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
                </field>
                <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Ship to Specific Countries</label>
                <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
                <can_be_empty>1</can_be_empty>
                </field>
                <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Show Method if Not Applicable</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Displayed Error Message</label>
                </field>
                </group>
                </section>
                </system>
                </config>




                share













                Change your system.xml by following code snippet:



                <?xml version="1.0"?>
                <config
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
                <system>
                <tab id="vendor_id" translate="label" sortOrder="10">
                <label>Vendor_Name</label>
                </tab>
                <section id="zones_shipping" translate="label" sortOrder="130" showInDefault="1" showInWebsite="1" showInStore="1">
                <class>separator-top</class>
                <label>Zones Fixed Shipping</label>
                <tab>vendor_id</tab>
                <resource>Vendor_Module::moduleName</resource>
                <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>General Configuration</label>
                <field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Enabled</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="name" translate="label" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Fixed Shipping</label>
                </field>
                <field id="enable" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Module Enable</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="display_text" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0">
                <label>Display Text</label>
                <comment>This text will display on the frontend.</comment>
                </field>
                <field id="title" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Title</label>
                </field>
                <field id="price" translate="label" type="text" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Price</label>
                <validate>validate-number validate-zero-or-greater</validate>
                </field>
                <field id="handling_type" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Calculate Handling Fee</label>
                <source_model>MagentoShippingModelSourceHandlingType</source_model>
                </field>
                <field id="handling_fee" translate="label" type="text" sortOrder="8" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Handling Fee</label>
                <validate>validate-number validate-zero-or-greater</validate>
                </field>
                <field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Sort Order</label>
                </field>
                <field id="sallowspecific" translate="label" type="select" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Ship to Applicable Countries</label>
                <frontend_class>shipping-applicable-country</frontend_class>
                <source_model>MagentoShippingModelConfigSourceAllspecificcountries</source_model>
                </field>
                <field id="specificcountry" translate="label" type="multiselect" sortOrder="91" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Ship to Specific Countries</label>
                <source_model>MagentoDirectoryModelConfigSourceCountry</source_model>
                <can_be_empty>1</can_be_empty>
                </field>
                <field id="showmethod" translate="label" type="select" sortOrder="92" showInDefault="1" showInWebsite="1" showInStore="0">
                <label>Show Method if Not Applicable</label>
                <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="specificerrmsg" translate="label" type="textarea" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>Displayed Error Message</label>
                </field>
                </group>
                </section>
                </system>
                </config>





                share











                share


                share










                answered 6 secs ago









                Sohel RanaSohel Rana

                22k34460




                22k34460






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f263706%2fmagento-2-shipping-custom-module-doesnt-work%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    “%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

                    How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

                    夢乃愛華...