owebia / magento2-module-advanced-shipping

Other
90 stars 28 forks source link

Writing any code in this function #76

Closed ducvu91 closed 3 years ago

ducvu91 commented 4 years ago

i have some function get shipping address to calculate if near by my store, i will delivery in 1 hours. but with your module, i can't code by my ideal. Can i writing anything i want ? Thanks. Screenshot_4

owebia commented 4 years ago

Hi,

For security purpose, only some php functions are allowed. Here is the list of functions available: https://owebia.com/doc/en/magento2-module-advanced-shipping#formulas_functions

Best Regards, A.L.

ducvu91 commented 4 years ago

thanks but can i override your module or this function, i need edit a litte code ?

owebia commented 4 years ago

Allowed functions are defined here: https://github.com/owebia/magento2-module-advanced-setting-core/blob/master/Helper/Evaluator.php#L45-L87

You can override this Helper like any other Magento class by creating your own module. Explanation here: https://www.fmeextensions.com/blog/override-magento-2-helper-block-model-and-controller/

loppp commented 4 years ago

Just wondering if it is possible to define my variables like the following?

$base_price1 = 5;

addMethod('method1', [ 'title' => "Standard Shipping", 'price' => $base_price1, ]);

owebia commented 4 years ago

Yes you can.

Best Regards, A.L.