function getTotalPaidAsMoney() { return EcommerceCurrency::get_money_object_from_order_currency($this->TotalPaid(), $this); }
function getCalculatedTotalAsMoney() { return EcommerceCurrency::get_money_object_from_order_currency($this->CalculatedTotal, $this->Order()); }
function getCalculatedPriceAsMoney() { return EcommerceCurrency::get_money_object_from_order_currency($this->CalculatedPrice()); }
public function getTotalAsMoney($recalculate = false) { return EcommerceCurrency::get_money_object_from_order_currency($this->getTotal($recalculate), $this->Order()); }
function getTableValueAsMoney() { return EcommerceCurrency::get_money_object_from_order_currency($this->TableValue, $this->Order()); }
/** * @see self::LowestVariationPrice * @return Money */ public function LowestVariationPriceAsMoney() { return EcommerceCurrency::get_money_object_from_order_currency($this->LowestVariationPrice()); }
function __construct($optionalController = null, $name, FieldList $fields, FieldList $actions, $optionalValidator = null, $recommendedBuyables) { $fieldsArray = new FieldList(array(new HeaderField($this->config()->get("something_recommended_text")))); $productFieldList = new FieldList(); foreach ($recommendedBuyables as $buyable) { $template = Config::inst()->get("RecommendedProductsModifier_Form", "product_template"); if ($template) { $checkboxID = $buyable->ClassName . "|" . $buyable->ID; $arrayData = new ArrayData(array("Buyable" => $buyable, "CheckboxID" => $checkboxID, "Checkbox" => new CheckboxField($checkboxID, _t("RecommendedProductsModifier_Form.ADD", "add")))); $productFieldList->push(new LiteralField("Buyable_" . $buyable->ID, $arrayData->renderWith($template))); } else { //foreach product in cart get recommended products $imageID = $buyable->ImageID; $imagePart = ''; if ($buyable && $buyable->ImageID > 0) { $resizedImage = $buyable->Image()->SetWidth($this->Config()->get("image_width")); if (is_object($resizedImage) && $resizedImage) { $imageLink = $resizedImage->Filename; $imagePart = '<span class="secondPart"><img src="' . $imageLink . '" alt="' . Convert::raw2att($buyable->Title) . '" /></span>'; } } if (!$imagePart) { $imagePart = '<span class="secondPart noImage">[no image available for ' . $buyable->Title . ']</span>'; } $priceAsMoney = EcommerceCurrency::get_money_object_from_order_currency($buyable->calculatedPrice()); $pricePart = '<span class="firstPart">' . $priceAsMoney->NiceLongSymbol() . '</span>'; $title = '<a href="' . $buyable->Link() . '">' . $buyable->Title . '</a>' . $pricePart . $imagePart . ''; $newField = new CheckboxField($buyable->ClassName . "|" . $buyable->ID, $title); $fieldsArray->push($newField); } } $fieldsArray->push(new CompositeField($productFieldList)); $actions = new FieldList(new FormAction('processOrderModifier', $this->config()->get("add_button_text"))); // 6) Form construction parent::__construct($optionalController, $name, $fieldsArray, $actions, $optionalValidator); Requirements::javascript(THIRDPARTY_DIR . "/jquery/jquery.js"); //Requirements::block(THIRDPARTY_DIR."/jquery/jquery.js"); //Requirements::javascript(Director::protocol()."ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"); Requirements::javascript("ecommerce_alsorecommended/javascript/RecommendedProductsModifier.js"); Requirements::themedCSS("RecommendedProductsModifier", "ecommerce_alsrecommended"); }