In my custom module I've created model/carrier.php
to add custom shipping method, one of my custom shipping method will show up if magento free shipping method is not active, is there a way to do this?
Model/carrier.php
public function collectRates(RateRequest $request)
{
$method = $this->_rateMethodFactory->create();
if($free_shipping_method != 'Active'){ //???
$method->setCarrier('test');
$method->setCarrierTitle('test');
/* Use method name */
$method->setMethod('test');
$method->setMethodTitle('England is My City');
$method->setCost('30');
$method->setPrice('30');
}
}