Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ocshop committed Nov 30, 2014
2 parents 1368b93 + b3970eb commit 8b291c6
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 58 deletions.
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# OpenCart 2.0 change log

## v2.0.1.0 (Pending - changed from 2.0.0.1)
## v2.0.1.0 (Release date: 30.11.2014)
#### Bugs fixed
* Changed namespace issues in DB driver files.
* Added missing text_edit string in the settings area.
Expand Down
22 changes: 20 additions & 2 deletions upload/admin/controller/extension/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,27 @@ public function ftp() {

if ($root) {
foreach ($files as $file) {
// Upload everything in the upload directory
$destination = substr($file, strlen($directory));


// Upload everything in the upload directory
// Many people rename their admin folder for security purposes which I believe should be an option during installation just like setting the db prefix.
// the following code would allow you to change the name of the following directories and any extensions installed will still go to the right directory.
if (substr($destination, 0, 5) == 'admin') {
$destination = basename(DIR_APPLICATION) . substr($destination, 5);
}

if (substr($destination, 0, 7) == 'catalog') {
$destination = basename(DIR_CATALOG) . substr($destination, 7);
}

if (substr($destination, 0, 5) == 'image') {
$destination = basename(DIR_IMAGE) . substr($destination, 5);
}

if (substr($destination, 0, 6) == 'system') {
$destination = basename(DIR_SYSTEM) . substr($destination, 6);
}

if (is_dir($file)) {
$list = ftp_nlist($connection, substr($destination, 0, strrpos($destination, '/')));

Expand Down
4 changes: 2 additions & 2 deletions upload/admin/controller/sale/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ public function getForm() {
$products = $this->model_sale_order->getOrderProducts($this->request->get['order_id']);

foreach ($products as $product) {
$data['products'][] = array(
$data['order_products'][] = array(
'product_id' => $product['product_id'],
'name' => $product['name'],
'model' => $product['model'],
Expand All @@ -763,7 +763,7 @@ public function getForm() {
}

// Add vouchers to the API
$data['vouchers'] = $this->model_sale_order->getOrderVouchers($this->request->get['order_id']);
$data['order_vouchers'] = $this->model_sale_order->getOrderVouchers($this->request->get['order_id']);

$data['coupon'] = '';
$data['voucher'] = '';
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Version
define('VERSION', '2.0.0.1b');
define('VERSION', '2.0.1.1_rc');

// Configuration
if (is_file('config.php')) {
Expand Down
3 changes: 1 addition & 2 deletions upload/admin/language/english/common/menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
$_['text_report_customer_reward'] = 'Reward Points';
$_['text_report_customer_credit'] = 'Credit';
$_['text_report_affiliate'] = 'Affiliates';
$_['text_report_affiliate'] = 'Commission';
$_['text_report_affiliate_activity'] = 'Affiliate Activity';
$_['text_review'] = 'Reviews';
$_['text_return'] = 'Returns';
Expand Down Expand Up @@ -96,4 +95,4 @@
$_['text_openbay_report_price'] = 'Pricing report';
$_['text_openbay_order_import'] = 'Order import';
$_['text_paypal_manage'] = 'PayPal';
$_['text_paypal_search'] = 'Search';
$_['text_paypal_search'] = 'Search';
3 changes: 1 addition & 2 deletions upload/admin/language/english/shipping/ups.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
$_['entry_length'] = 'Length';
$_['entry_height'] = 'Height';
$_['entry_width'] = 'Width';
$_['entry_height'] = 'Height';
$_['entry_tax_class'] = 'Tax Class';
$_['entry_geo_zone'] = 'Geo Zone';
$_['entry_status'] = 'Status';
Expand Down Expand Up @@ -113,4 +112,4 @@
$_['error_city'] = 'Origin City!';
$_['error_state'] = 'Origin State/Province Required!';
$_['error_country'] = 'Origin Country Required!';
$_['error_dimension'] = 'Average Dimensions Required!';
$_['error_dimension'] = 'Average Dimensions Required!';
2 changes: 1 addition & 1 deletion upload/admin/view/template/extension/installer.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function next() {
if (json['error']) {
$('#progress-bar').addClass('progress-bar-danger');
$('#progress-text').html('<div class="text-danger">' + json['error'] + '</div>');
$('.button-clear').prop('disabled', false);
$('#button-clear').prop('disabled', false);
}
if (json['success']) {
Expand Down
78 changes: 51 additions & 27 deletions upload/admin/view/template/sale/order_form.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@
</tr>
</thead>
<tbody id="cart">
<?php if ($products || $vouchers) { ?>
<?php if ($order_products || $order_vouchers) { ?>
<?php $product_row = 0; ?>
<?php foreach ($products as $product) { ?>
<tr id="product-row<?php echo $product_row; ?>">
<td class="text-left"><?php echo $product['name']; ?><br />
<input type="hidden" name="product[<?php echo $product_row; ?>][product_id]" value="<?php echo $product['product_id']; ?>" />
<?php foreach ($product['option'] as $option) { ?>
<?php foreach ($order_products as $order_product) { ?>
<tr>
<td class="text-left"><?php echo $order_product['name']; ?><br />
<input type="hidden" name="product[<?php echo $product_row; ?>][product_id]" value="<?php echo $order_product['product_id']; ?>" />
<?php foreach ($order_product['option'] as $option) { ?>
- <small><?php echo $option['name']; ?>: <?php echo $option['value']; ?></small><br />
<?php if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'image') { ?>
<input type="hidden" name="product[<?php echo $product_row; ?>][option][<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['product_option_value_id']; ?>" />
Expand All @@ -255,29 +255,29 @@
<input type="hidden" name="product[<?php echo $product_row; ?>][option][<?php echo $option['product_option_id']; ?>]" value="<?php echo $option['value']; ?>" />
<?php } ?>
<?php } ?></td>
<td class="text-left"><?php echo $product['model']; ?></td>
<td class="text-right"><?php echo $product['quantity']; ?>
<input type="hidden" name="product[<?php echo $product_row; ?>][quantity]" value="<?php echo $product['quantity']; ?>" /></td>
<td class="text-left"><?php echo $order_product['model']; ?></td>
<td class="text-right"><?php echo $order_product['quantity']; ?>
<input type="hidden" name="product[<?php echo $product_row; ?>][quantity]" value="<?php echo $order_product['quantity']; ?>" /></td>
<td class="text-right"></td>
<td class="text-right"></td>
<td class="text-center"></td>
</tr>
<?php $product_row++; ?>
<?php } ?>
<?php $voucher_row = 0; ?>
<?php foreach ($vouchers as $voucher) { ?>
<tr id="voucher-row<?php echo $voucher_row; ?>">
<?php foreach ($order_vouchers as $order_voucher) { ?>
<tr>
<td class="text-left"><?php echo $order_voucher['description']; ?>
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][voucher_id]" value="<?php echo $voucher['voucher_id']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][description]" value="<?php echo $voucher['description']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][code]" value="<?php echo $voucher['code']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][from_name]" value="<?php echo $voucher['from_name']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][from_email]" value="<?php echo $voucher['from_email']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][to_name]" value="<?php echo $voucher['to_name']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][to_email]" value="<?php echo $voucher['to_email']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][voucher_theme_id]" value="<?php echo $voucher['voucher_theme_id']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][message]" value="<?php echo $voucher['message']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][amount]" value="<?php echo $voucher['amount']; ?>" /></td>
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][voucher_id]" value="<?php echo $order_voucher['voucher_id']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][description]" value="<?php echo $order_voucher['description']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][code]" value="<?php echo $order_voucher['code']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][from_name]" value="<?php echo $order_voucher['from_name']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][from_email]" value="<?php echo $order_voucher['from_email']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][to_name]" value="<?php echo $order_voucher['to_name']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][to_email]" value="<?php echo $order_voucher['to_email']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][voucher_theme_id]" value="<?php echo $order_voucher['voucher_theme_id']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][message]" value="<?php echo $order_voucher['message']; ?>" />
<input type="hidden" name="voucher[<?php echo $voucher_row; ?>][amount]" value="<?php echo $order_voucher['amount']; ?>" /></td>
<td class="text-left"></td>
<td class="text-right">1</td>
<td class="text-right"></td>
Expand Down Expand Up @@ -974,17 +974,31 @@ $('#button-refresh').on('click', function() {
html += '<tr>';
html += ' <td class="text-left">' + product['name'] + ' ' + (!product['stock'] ? '<span class="text-danger">***</span>' : '') + '<br />';
html += ' <input type="hidden" name="product[' + i + '][product_id]" value="' + product['product_id'] + '" />';
if (product['option']) {
for (j = 0; j < product['option'].length; j++) {
html += ' - <small>' + product['option'][j]['name'] + ': ' + product['option'][j]['value'] + '</small><br />';
option = product['option'][j];
html += ' - <small>' + option['name'] + ': ' + option['value'] + '</small><br />';
if (option['type'] == 'select' || option['type'] == 'radio' || option['type'] == 'image') {
html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + ']" value="' + option['product_option_value_id'] + '" />';
}
if (option['type'] == 'checkbox') {
html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + '][]" value="' + option['product_option_value_id'] + '" />';
}
if (option['type'] == 'text' || option['type'] == 'textarea' || option['type'] == 'file' || option['type'] == 'date' || option['type'] == 'datetime' || option['type'] == 'time') {
html += '<input type="hidden" name="product[' + i + '][option][' + option['product_option_id'] + ']" value="' + option['value'] + '" />';
}
}
}
html += '</td>';
html += ' <td class="text-left">' + product['model'] + '</td>';
html += ' <td class="text-right">' + product['quantity'] + '</td>';
html += ' <td class="text-right">' + product['quantity'] + '<input type="hidden" name="product[' + i + '][quantity]" value="' + product['quantity'] + '" /></td>';
html += ' <td class="text-right">' + product['price'] + '</td>';
html += ' <td class="text-right">' + product['total'] + '</td>';
html += ' <td class="text-center" style="width: 3px;"><button type="button" value="' + product['key'] + '" data-toggle="tooltip" title="<?php echo $button_remove; ?>" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>';
Expand All @@ -1006,11 +1020,21 @@ $('#button-refresh').on('click', function() {
}
if (json['vouchers']) {
for (i in json['vouchers']) {
for (i in json['vouchers']) {
voucher = json['vouchers'][i];
html += '<tr>';
html += ' <td class="text-left">' + voucher['description'] + '</td>';
html += ' <td class="text-left">' + voucher['description'];
html += ' <input type="hidden" name="voucher[' + i + '][code]" value="' + voucher['code'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][description]" value="' + voucher['description'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][from_name]" value="' + voucher['from_name'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][from_email]" value="' + voucher['from_email'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][to_name]" value="' + voucher['to_name'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][to_email]" value="' + voucher['to_email'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][voucher_theme_id]" value="' + voucher['voucher_theme_id'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][message]" value="' + voucher['message'] + '" />';
html += ' <input type="hidden" name="voucher[' + i + '][amount]" value="' + voucher['amount'] + '" />';
html += ' </td>';
html += ' <td class="text-left"></td>';
html += ' <td class="text-right">1</td>';
html += ' <td class="text-right">' + voucher['amount'] + '</td>';
Expand Down
6 changes: 2 additions & 4 deletions upload/catalog/controller/api/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -649,10 +649,8 @@ public function delete() {
}
}

print_r($json);

//$this->response->addHeader('Content-Type: application/json');
//$this->response->setOutput(json_encode($json));
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}

public function history() {
Expand Down
26 changes: 13 additions & 13 deletions upload/catalog/controller/api/voucher.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@ public function add() {
$this->session->data['vouchers'] = array();

foreach ($this->request->post['voucher'] as $voucher) {
$code = mt_rand();

$this->session->data['vouchers'][$code] = array(
'code' => $code,
'description' => sprintf($this->language->get('text_for'), $this->currency->format($this->currency->convert($voucher['amount'], $this->currency->getCode(), $this->config->get('config_currency'))), $voucher['to_name']),
'to_name' => $voucher['to_name'],
'to_email' => $voucher['to_email'],
'from_name' => $voucher['from_name'],
'from_email' => $voucher['from_email'],
'voucher_theme_id' => $voucher['voucher_theme_id'],
'message' => $voucher['message'],
'amount' => $this->currency->convert($voucher['amount'], $this->currency->getCode(), $this->config->get('config_currency'))
);
if (isset($voucher['code']) && isset($voucher['to_name']) && isset($voucher['to_email']) && isset($voucher['from_name']) && isset($voucher['from_email']) && isset($voucher['voucher_theme_id']) && isset($voucher['message']) && isset($voucher['amount'])) {
$this->session->data['vouchers'][$voucher['code']] = array(
'code' => $voucher['code'],
'description' => sprintf($this->language->get('text_for'), $this->currency->format($this->currency->convert($voucher['amount'], $this->currency->getCode(), $this->config->get('config_currency'))), $voucher['to_name']),
'to_name' => $voucher['to_name'],
'to_email' => $voucher['to_email'],
'from_name' => $voucher['from_name'],
'from_email' => $voucher['from_email'],
'voucher_theme_id' => $voucher['voucher_theme_id'],
'message' => $voucher['message'],
'amount' => $this->currency->convert($voucher['amount'], $this->currency->getCode(), $this->config->get('config_currency'))
);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion upload/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Version
define('VERSION', '2.0.0.1b');
define('VERSION', '2.0.1.1_rc');

// Configuration
if (is_file('config.php')) {
Expand Down
8 changes: 6 additions & 2 deletions upload/install/opencart.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,9 @@ INSERT INTO `oc_layout` (`layout_id`, `name`) VALUES
(8, 'Contact'),
(9, 'Sitemap'),
(10, 'Affiliate'),
(11, 'Information');
(11, 'Information'),
(12, 'Compare'),
(13, 'Search');

-- --------------------------------------------------------

Expand Down Expand Up @@ -1625,7 +1627,9 @@ INSERT INTO `oc_layout_route` (`layout_route_id`, `layout_id`, `store_id`, `rout
(31, 8, 0, 'information/contact'),
(32, 9, 0, 'information/sitemap'),
(34, 4, 0, ''),
(45, 5, 0, 'product/manufacturer');
(45, 5, 0, 'product/manufacturer'),
(52, 12, 0, 'product/compare'),
(53, 13, 0, 'product/search');

-- --------------------------------------------------------

Expand Down

0 comments on commit 8b291c6

Please sign in to comment.