owebia / magento2-module-advanced-shipping

Other
90 stars 28 forks source link

Shipping method not showing #97

Closed Minirock closed 3 years ago

Minirock commented 3 years ago

Hi, I have been activating the module succesfully, but I'm struggling to get the method activated, so as it's appearing in the magento backend. I can't tell if this is a bug or not.

image

image

The issue being the method doesn't show in frontend cart, and if I try to log the list of shipping methods, it seems owebia is missing.

$methods = $this->shippingMethods->toOptionArray();
foreach ($methods as $k => $method){
    var_dump($k);
}

int(0) string(3) "dhl" string(5) "fedex" string(7) "instore" string(8) "flatrate" string(9) "tablerate" string(12) "freeshipping" string(3) "ups" string(4) "usps"

I'm wondering if this might be due to the fact I'm working with configuration

So as in my config.php the method is appearing this way; may be something is missing there ?

            'owsh1' => [
                'active' => '1',
                'model' => 'Owebia\\AdvancedShipping\\Model\\Carrier',
                'title' => 'Advanced Shipping by Owebia',
                'required_fields' => 'postcode,country_id',
                'config' => 'addMethod(\'id_001\',[
 \'title\'  => \'Livraison Colissimo 48h\',
 \'description\' => \'Livraison Colissimo 48h\',
 \'enabled\' => $quote->subtotal_with_discount < 50,
 \'price\' => 4,90 ])
->set(\'header\', "Livraison Colissimo 48h payante")
->set(\'popup\', "Livraison Colissimo 48h payante");

I think it might be possible that magento configuration dump isn't good with owebia rules ? But can't tell if this is really what is happening neither what could be missing there. Thanks for your assistance.

owebia commented 3 years ago

Hi, It seems you are using a comma instead of a dot for decimal separator. I think this is causing your issue. Best Regards, A.L.

Minirock commented 3 years ago

Hi ! indeed you got the sharp eyes for that one ;) Thanks !

I'm gonna modify all my rules and see if this is enough to get it fixed :)

Dumb question but...is there any location where this error might have been logged ? Cause I currently can't see nothing in my exception.log neither as my system.log. That's why an error in the method itself didn't event cross my mind. Thanks again !

owebia commented 3 years ago

You can enable the "Debug" option and click on the "Bug" icon to see how the configuration is evaluated during checkout. If there is a syntax error, you will see it.

The debug file can grow very quickly (located in var/log/owebia_advancedsettingcore.log), think to disable the option if you don't need it.

Best Regards, A.L.

Minirock commented 3 years ago

All good, I had an, extra syntax error, but it went much easier to debug with the tools ;)

Thanks again !