From f9050f240aa4d2db745fbb111bea67ed541203dd Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer <reinhold@kainhofer.com> Date: Sat, 13 Aug 2016 15:33:01 +0200 Subject: [PATCH] Add API doc --- ShippingByRules_Framework_API.txt | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 ShippingByRules_Framework_API.txt diff --git a/ShippingByRules_Framework_API.txt b/ShippingByRules_Framework_API.txt new file mode 100644 index 0000000..4ff9034 --- /dev/null +++ b/ShippingByRules_Framework_API.txt @@ -0,0 +1,52 @@ +RulesShippingFramework: +======================= + + +API functions: +~~~~~~~~~~~~~~ + -) setup() // Used in the plugin's constructor + -) registerCallback($callback, $func) + -) warning($text, $args...) + -) debug($text) + + -) parseRuleSyntax($rulestring, $countries, $ruleinfo) + -) checkConditions ($cart, $method) + -) getCosts($cart, $method) // The central function to calculate the shipping cost + -) getRuleName($methodid) + -) getRuleVariables($methodid) + + -) filterProducts($products, $conditions) // Used in the Rule's evaluateScoping + + -) registerScopings($scopings) + -) getScopings() + +E-commerce specific functions (to be overridden in child classes!): +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + -) printWarning($message) // $message already translated! + -) debug($message) + -) __($string) // or use the translate callback for your own function! + -) getCustomFunctions() + -) addPluginCartValues($cart, $products, $method, &$values) + + -) getOrderArticles($cart, $products, $method) + -) getOrderProducts ($cart, $products, $method) + -) getOrderDimensions ($cart, $products, $method) + -) getOrderWeights ($cart, $products, $method) + -) getOrderListProperties ($cart, $products, $method) + -) getOrderAddress ($cart, $method) + -) getOrderPrices ($cart, $products, $method) + + -) filterProducts($products, $conditions) // Used in the Rule's evaluateScoping + -) getMethodId ($method) + -) getMethodName ($method) + + -) setMethodCosts($cart, $method, $match, $costs) // Potentially assign system-specific variables to the $method + + + +Callback functions: +~~~~~~~~~~~~~~~~~~~ + -) translate($message) + -) initRule($framework, $rulestring, $countries, $ruleinfo) + -) addCustomCartValues ($cart, $products, $method, &$values) + -- GitLab