From d796d7062590a6d20892cac0769fd796a230aa9f Mon Sep 17 00:00:00 2001 From: Lars Pinnow Date: Mon, 29 Sep 2025 22:20:47 +0200 Subject: [PATCH] add state for free orders --- system/modules/isotope/dca/tl_iso_config.php | 13 ++++++++++++- .../modules/isotope/languages/da/tl_iso_config.xlf | 8 +++++++- .../Isotope/Model/ProductCollection/Order.php | 6 +++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/system/modules/isotope/dca/tl_iso_config.php b/system/modules/isotope/dca/tl_iso_config.php index 3954218554..20488d11b1 100755 --- a/system/modules/isotope/dca/tl_iso_config.php +++ b/system/modules/isotope/dca/tl_iso_config.php @@ -104,7 +104,7 @@ {pricing_legend},priceDisplay,currencyFormat,priceRoundPrecision,priceRoundIncrement; {currency_legend},currency,currencyPosition,currencySymbol; {converter_legend:hide},priceCalculateFactor,priceCalculateMode,currencyAutomator; - {order_legend:hide},orderPrefix,orderDigits,orderstatus_new,orderstatus_error,orderDetailsModule; + {order_legend:hide},orderPrefix,orderDigits,orderstatus_new,orderstatus_error,orderstatus_no_payment,orderDetailsModule; {config_legend},templateGroup,cartMinSubtotal; {products_legend},newProductPeriod; {analytics_legend},ga_enable', @@ -560,6 +560,17 @@ 'sql' => "int(10) unsigned NOT NULL default '0'", 'relation' => array('type'=>'hasOne', 'load'=>'lazy'), ), + 'orderstatus_no_payment' => array + ( + 'exclude' => true, + 'filter' => true, + 'inputType' => 'select', + 'foreignKey' => \Isotope\Model\OrderStatus::getTable().'.name', + 'options_callback' => array('\Isotope\Backend', 'getOrderStatus'), + 'eval' => array('mandatory'=>true, 'includeBlankOption'=>true, 'tl_class'=>'w50'), + 'sql' => "int(10) unsigned NOT NULL default '0'", + 'relation' => array('type'=>'hasOne', 'load'=>'lazy'), + ), 'orderDetailsModule' => array ( 'exclude' => true, diff --git a/system/modules/isotope/languages/da/tl_iso_config.xlf b/system/modules/isotope/languages/da/tl_iso_config.xlf index cb79705713..d607bbe1b7 100644 --- a/system/modules/isotope/languages/da/tl_iso_config.xlf +++ b/system/modules/isotope/languages/da/tl_iso_config.xlf @@ -327,6 +327,12 @@ Select an order status if something goes wrong (e.g. payment). + + Status for free orders + + + Choose a matching status for free orders. A payment module can override this. + Module for backend view @@ -491,4 +497,4 @@ - \ No newline at end of file + diff --git a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php index 3ac7a4f2b9..fd12af6bfd 100644 --- a/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php +++ b/system/modules/isotope/library/Isotope/Model/ProductCollection/Order.php @@ -227,7 +227,11 @@ public function checkout() // Set order status only if a payment module has not already set it if ($this->order_status == 0) { - $this->updateOrderStatus($this->getRelated('config_id')->orderstatus_new); + if(parent::requiresPayment()) { + $this->updateOrderStatus($this->getRelated('config_id')->orderstatus_new); + } else { + $this->updateOrderStatus($this->getRelated('config_id')->orderstatus_no_payment); + } } // !HOOK: post-process checkout