@ecartz Now the amount for free shipping is showing but without currency. I would like to show with currency and convert the amount to whatever currency is selected.
The code that I used as below:
Main File: /includes/modules/content/header/cm_header_mond_ups.php
Code: Select all
class cm_header_mond_ups extends abstract_executable_module {
const CONFIG_KEY_BASE = 'MODULE_CONTENT_HEADER_MOND_UPS_';
public function __construct() {
parent::__construct(__FILE__);
}
public function execute() {
$tpl_data = [ 'group' => $this->group, 'file' => __FILE__ ];
include 'includes/modules/content/cm_template.php';
}
protected function get_parameters() {
return [
'MODULE_CONTENT_HEADER_MOND_UPS_STATUS' => [
'title' => 'Enable Header UPS Free Shipping Banner Module',
'value' => 'True',
'desc' => 'Do you want to enable the UPS Free Shipping Banner content module?',
'set_func' => "Config::select_one(['True', 'False'], ",
],
'MODULE_CONTENT_HEADER_MOND_UPS_CONTENT_WIDTH' => [
'title' => 'Content Width',
'value' => '4',
'desc' => 'What width container should the content be shown in?',
'set_func' => "Config::select_one(['12', '11', '10', '9', '8', '7', '6', '5', '4', '3', '2', '1'], ",
],
'MODULE_CONTENT_HEADER_MOND_UPS_FREE_SHIPPING_OVER' => [
'title' => 'Free Shipping For Orders Over',
'value' => '50',
'desc' => 'Provide free shipping for orders over the set amount.',
'use_func' => 'currencies->format',
],
'MODULE_CONTENT_HEADER_MOND_UPS_SORT_ORDER' => [
'title' => 'Sort Order',
'value' => '20',
'desc' => 'Sort order of display. Lowest is displayed first.',
],
];
}
}
Template File: /includes/modules/content/header/templates/tpl_cm_header_mond_ups.php
Code: Select all
<div class="col-md-12 col-lg-6 col-xl-<?= (int)MODULE_CONTENT_HEADER_MOND_UPS_CONTENT_WIDTH ?> cm-header-ups" style="margin-bottom:8px; text-align:center;">
<text style="display:inline-block; vertical-align:middle; text-align:center"><?=MODULE_CONTENT_HEADER_MOND_UPS_TEXT?>
<?=MODULE_CONTENT_HEADER_MOND_UPS_FREE_SHIPPING_OVER?></text>
</div>
Languages File: /includes/languages/english/modules/content/header/cm_header_mond_ups.php
Code: Select all
define('MODULE_CONTENT_HEADER_MOND_UPS_TITLE', 'Mond UPS Free Shipping Banner');
define('MODULE_CONTENT_HEADER_MOND_UPS_DESCRIPTION', 'Adds UPS Free Shipping Banner into the Header Area of your site.');
define('MODULE_CONTENT_HEADER_MOND_UPS_TEXT', '<b>FREE SHIPPING! </b><br>UPS Express on orders over');