<commit_before><?php
/**
 * SubTotal modifier provides a way to display subtotal within the list of modifiers.
 * @package ecommerce
 * @authors: Silverstripe, <NAME>
 **/

class SubTotalModifier extends OrderModifier {

// ######################################## *** model defining static variables (e.g. $db, $has_one)

	public static $defaults = array(
		"Type" => "NoChange"
	);

// ######################################## *** cms variables + functions (e.g. getCMSFields, $searchableFields)
// ######################################## *** other (non) static variables (e.g. protected static $special_name_for_something, protected $order)

// ######################################## *** CRUD functions (e.g. canEdit)
// ######################################## *** init and update functions

// ######################################## *** form functions (e. g. showform and getform)
// ######################################## *** template functions (e.g. ShowInTable, TableTitle, etc...) ... USES DB VALUES

	/**
	 * This overrides the table value to show the subtotal, but the LiveAmount is always 0 (see below)
	 */
	public function TableValue() {
		$order = $this->Order();
		return $order->SubTotal() + $order->ModifiersSubTotal($this->class,true);
	}

	public function CanRemove(){
		return false;
	}

	public function TableTitle(){
		return _t("SubtTotalModifier.SUBTOTAL", "Sub Total");
	}



// ######################################## ***  inner calculations ... USED CALCULATED VALUES
// ######################################## *** calculate database fields: protected function Live[field name] ... USED CALCULATED VALUES


	protected function LiveAmount(){
		return 0;
	}

// ######################################## *** Type Functions (IsChargeable, IsDeductable, IsNoChange, IsRemoved)

	protected function IsNoChange() {
		return true;
	}


// ######################################## *** standard database related functions (e.g. onBeforeWrite, onAfterWrite, etc...)
// ######################################## *** AJAX related functions
// ######################################## *** debug functions

}
<commit_msg>SubTotalModifier.php: added comments, added method: LiveCalculationValue<commit_after><?php
/**
 * SubTotal modifier provides a way to display subtotal within the list of modifiers.
 *
 * @authors: Silverstripe, Jeremy, Nicolaas
 *
 * @package: ecommerce
 * @sub-package: modifiers
 *

 **/

class SubTotalModifier extends OrderModifier {

// ######################################## *** model defining static variables (e.g. $db, $has_one)

	public static $defaults = array(
		"Type" => "NoChange"
	);

// ######################################## *** cms variables + functions (e.g. getCMSFields, $searchableFields)
// ######################################## *** other (non) static variables (e.g. protected static $special_name_for_something, protected $order)

// ######################################## *** CRUD functions (e.g. canEdit)
// ######################################## *** init and update functions

// ######################################## *** form functions (e. g. showform and getform)
// ######################################## *** template functions (e.g. ShowInTable, TableTitle, etc...) ... USES DB VALUES

	/**
	 * This overrides the table value to show the subtotal, but the LiveCalculationValue is always 0 (see below)
	 */
	public function TableValue() {
		$order = $this->Order();
		return $order->SubTotal() + $order->ModifiersSubTotal($this->class,true);
	}

	public function CanBeRemoved(){
		return false;
	}

	public function TableTitle(){
		return _t("SubtTotalModifier.SUBTOTAL", "Sub Total");
	}



// ######################################## ***  inner calculations ... USED CALCULATED VALUES
// ######################################## *** calculate database fields: protected function Live[field name] ... USED CALCULATED VALUES


	protected function LiveCalculationValue(){
		return 0;
	}

// ######################################## *** Type Functions (IsChargeable, IsDeductable, IsNoChange, IsRemoved)
// ######################################## *** standard database related functions (e.g. onBeforeWrite, onAfterWrite, etc...)
// ######################################## *** AJAX related functions
// ######################################## *** debug functions

}

{'fraction_non_alphanumeric': 0.3455713630105553, 'fraction_numerical': 0.0009178522257916476, 'mean_word_length': 5.317391304347826, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2869272', 'n_tokens_mistral': 1159, 'n_tokens_neox': 1052, 'n_words': 317}