Source of file CheckoutControllerExtension.php
Size: 1,349 Bytes - Last Modified: 2021-12-24T05:16:24+00:00
/var/www/docs.ssmods.com/process/src/code/extensions/CheckoutControllerExtension.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 | <?php /** * Extension for Content Controller that provide methods such as cart link and category list * to templates * * @author i-lateral (http://www.i-lateral.com) * @package checkout */ class CheckoutControllerExtension extends Extension { /** * Get the current shoppingcart * * @return ShoppingCart */ public function getShoppingCart() { return ShoppingCart::get(); } /** * Get the checkout config * * @return ShoppingCart */ public function getCheckout() { return Checkout::create(); } public function onBeforeInit() { $controller = $this->owner->request->param("Controller"); $action = $this->owner->request->param("Action"); if ($controller != "DevelopmentAdmin" && $action != "build") { $config = SiteConfig::current_site_config(); // Set the default currency symbol for this site Currency::config()->currency_symbol = Checkout::config()->currency_symbol; // Auto inject the order prefix to the orders module if it exists if (class_exists("Order") && class_exists("SiteConfig") && $config) { Order::config()->order_prefix = $config->PaymentNumberPrefix; } } } } |