insanebear Developer Lähettäjä Poland Jäsen alkaen lokak. 2014 insanebear 21 marrask. 2014 09:18 Hi, How to pass cart total (with tax) and currency_code to shipping module? I've tried to do this the same way as in payment modules (global $order; $order->data['order_total'] ...) but it seems it does not work :/ I would like to get something like this: $cost = $this->settings['weight_rate_table_1']; // this is only price if(($order->data['currency_code']=='PLN')&&($order->data['order_total']>100)) $cost = 0; Greetings, ins
litecart Main Crew Lähettäjä Sweden Jäsen alkaen helmik. 2013 litecart 21 marrask. 2014 16:28 This is how the method is called: $module->options($items, $subtotal, $tax, $currency_code, $customer); This is how it is declared: public function options($items, $subtotal, $tax, $currency_code, $customer) { The order, including payment fees is yet not created in the shipping select process. However, the order object is defined in after_process() by $GLOBALS['order']->data['param']. Will be changed in the future.
insanebear Developer Lähettäjä Poland Jäsen alkaen lokak. 2014 insanebear 26 marrask. 2014 14:38 My solution: $str = currency::format(cart::$data['total']['value'] + cart::$data['total']['tax']); $var = filter_var($str,FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION); if($var > 100) { $cost = 0; } else { $cost = $this->settings['weight_rate_table_1']; } ...i put this code in desired shipping module, right before: $options[] = array(... ...and then in this options i put 'cost' => $cost instead 'cost' => $this->settings['weight_rate_table_1']