Skip to content

Commit

Permalink
Added small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
condor2 committed May 14, 2021
1 parent 65f9f8d commit 699cd85
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
17 changes: 11 additions & 6 deletions 3.0.x.x/install.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Munimal order amount</name>
<name>Minimal Order Amount</name>
<code>minimal_order_amount</code>
<version>0.3</version>
<version>3.0</version>
<author><![CDATA[loadkpi & xxvirusxx]]></author>

<file path="catalog/controller/checkout/checkout.php">
<operation>
Expand All @@ -12,10 +13,12 @@
<add position="before"><![CDATA[
//start module minimal_order_amount
$this->load->model('setting/setting');
$minimal_order_amount = $this->model_setting_setting->getSetting('module_minimal_order_amount');
if (@$minimal_order_amount['module_minimal_order_amount_value_amount_value'] && $this->cart->getSubtotal() < $minimal_order_amount['module_minimal_order_amount_value_amount_value']){
if ($minimal_order_amount['module_minimal_order_amount_value_amount_value'] && $this->cart->getSubtotal() < $minimal_order_amount['module_minimal_order_amount_value_amount_value']){
$this->session->data['error'] = str_replace('%s', $minimal_order_amount['module_minimal_order_amount_value_amount_value'], $minimal_order_amount['module_minimal_order_amount_value_error_msg']);
$this->response->redirect($this->url->link('checkout/cart'));
}
//end module minimal_order_amount
Expand All @@ -31,6 +34,7 @@
<add position="after"><![CDATA[
///start module minimal_order_amount
$this->load->model('setting/setting');
$minimal_order_amount = $this->model_setting_setting->getSetting('module_minimal_order_amount');
//end module minimal_order_amount
]]></add>
Expand All @@ -41,8 +45,9 @@
]]></search>
<add position="after"><![CDATA[
//start module minimal_order_amount
} elseif (@$minimal_order_amount['module_minimal_order_amount_value_amount_value'] && $this->cart->getSubtotal() < $minimal_order_amount['module_minimal_order_amount_value_amount_value']) {
$this->load->language('module/minimal_order_amount');
} elseif ($minimal_order_amount['module_minimal_order_amount_value_amount_value'] && $this->cart->getSubtotal() < $minimal_order_amount['module_minimal_order_amount_value_amount_value']) {
$this->load->language('extension/module/minimal_order_amount');
$data['error_warning'] = str_replace('%s', $minimal_order_amount['module_minimal_order_amount_value_amount_value'], $minimal_order_amount['module_minimal_order_amount_value_error_msg']);
//end module minimal_order_amount]]></add>
</operation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@ public function index() {
$this->document->setTitle($this->language->get('heading_title'));

if ($this->request->server['REQUEST_METHOD'] == 'POST') {

$data['value_amount_value'] = $this->request->post['module_minimal_order_amount_value_amount_value'];
$data['value_error_msg'] = $this->request->post['module_minimal_order_amount_value_error_msg'];

if ($this->validate()) {
$this->model_setting_setting->editSetting('module_minimal_order_amount', $this->request->post);

$this->session->data['success'] = $this->language->get('text_success');

$this->response->redirect($this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'], true));
}
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
<?php
// Heading
$_['heading_title'] = 'Minimal Order Amount';
$_['heading_label'] = 'Edit minimal amount for your orders';
$_['heading_title'] = 'Minimal Order Amount';

// Text
$_['text_extension'] = 'Extensions';
$_['text_success'] = 'Success: You have modified minimal order amount!';
$_['text_extension'] = 'Extensions';
$_['text_success'] = 'Success: You have modified minimal order amount!';
$_['text_edit'] = 'Edit Minimal Order Amount Module';

// Entry
$_['entry_currency'] = 'Store Currency:';
$_['entry_amount_value'] = 'Minimal order amount:';
$_['entry_error_msg'] = 'Warning message:';

//Button
$_['button_save'] = 'Save';
$_['button_cancel'] = 'Cancel';

//Other
$_['value_error_msg'] = 'You must have an order with a minimum of %s USD to place your order!';
$_['tip_error_msg'] = 'You can use "%s" as a placeholder for you minimal amount value';

// Errors
$_['error_permission'] = 'Warning: You do not have permission to change minimal order amount!';
$_['error_amount_value'] = 'Warning: "minimal order amount" is Required';
$_['error_int_amount_value'] = 'Warning: "minimal order amount" must be a Numeric';
$_['error_error_msg'] = 'Warning: "message" value is Required';
$_['entry_currency'] = 'Store Currency:';
$_['entry_amount_value'] = 'Minimal Order Amount:';
$_['entry_error_msg'] = 'Warning Message:';

// Help
$_['value_error_msg'] = 'You must have an order with a minimum of %s USD to place your order!';
$_['tip_error_msg'] = 'You can use "%s" as a placeholder for you minimal amount value';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify minimal order amount module!';
$_['error_amount_value'] = 'Warning: Minimal Order Amount is required';
$_['error_int_amount_value'] = 'Warning: Minimal Order Amount must be a numeric';
$_['error_error_msg'] = 'Warning: Message value is required';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% endif %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ heading_label }}</h3>
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_edit }}</h3>
</div>
<div class="panel-body">
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-module" class="form-horizontal">
Expand All @@ -31,7 +31,7 @@
<input type="text" disabled="disabled" value="{{ store_currency }}" class="form-control" />
</div>
</div>
<div class="form-group">
<div class="form-group required">
<label class="col-sm-2 control-label">{{ entry_amount_value }}</label>
<div class="col-sm-10">
<input type="text" value="{{ value_amount_value }}" class="form-control" name="module_minimal_order_amount_value_amount_value" />
Expand All @@ -40,14 +40,14 @@
{% endif %}
</div>
</div>
<div class="form-group">
<div class="form-group required">
<label class="col-sm-2 control-label">{{ entry_error_msg }}</label>
<div class="col-sm-10">
<textarea name="module_minimal_order_amount_value_error_msg" cols="40" rows="5" placeholder="{{ placeholder_error_msg }}" class="form-control">{{ value_error_msg }}</textarea>
<p>{{ tip_error_msg }}</p>
{% if error_msg %}
<div class="text-danger">{{ error_msg }}</div>
{% endif %}
<small class="form-text text-muted">{{ tip_error_msg }}</small>
</div>
</div>
</form>
Expand Down

0 comments on commit 699cd85

Please sign in to comment.