onlygoodness LiteCart Fan Depuis Netherlands Membre depuis nov. 2020 onlygoodness 18 janv. 2025 13:08 Is there a way to check which payment module is chosen (id) at the checkout so I can use that information to give an error for a minimum subtotal depending on the module?
tim Founder Depuis Sweden Membre depuis mai 2013 tim 19 janv. 2025 02:41 In module options(), add the condition: if ($subtotal < 100) { $error = 'Minimum subtotal not reached'; } And return the error with the option: return [ ... 'options' => [ [ .. 'error' => $error, ] ] ]; https://www.litecart.net/en/wiki/how_to_create_a_payment_module
onlygoodness LiteCart Fan Depuis Netherlands Membre depuis nov. 2020 onlygoodness 19 janv. 2025 12:16 Thanks Tim, works Perfect! $fee= 0; if ($subtotal < $this->settings['minorder']) { $fee = $this->settings['fee']; } $method = [ 'title' => $this->name, 'description' => language::translate(__CLASS__.':description', ''), 'options' => [ [ 'id' => 'por', 'icon' => $this->settings['icon'], 'name' => reference::country($country_code)->name, 'description' => '', 'fields' => '', 'minorder' => $this->settings['minorder'], 'cost' => $fee, 'tax_class_id' => $this->settings['tax_class_id'], 'confirm' => language::translate(__CLASS__.':title_confirm_order', 'Confirm Order'), ], ] ];