Skip to content

Commit a89a84e

Browse files
committed
Merge remote-tracking branch 'origin/1.4.4' into 1.4.4
2 parents ff560f7 + daee8e8 commit a89a84e

File tree

16 files changed

+773
-705
lines changed

16 files changed

+773
-705
lines changed

public_html/core/engine/promotion.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ public function getProductSpecial($product_id)
309309
* @return array
310310
* @throws AException
311311
* @deprecated since 1.2.7
312+
* @see \ModelCatalogProduct::getSpecialProducts
312313
*
313314
*/
314315
public function getProductSpecials($sort = 'p.sort_order', $order = 'ASC', $start = 0, $limit = 20)

public_html/extensions/novator/storefront/view/novator/template/pages/content/contact.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ if ($error_warning) { ?>
3636
<a href="tel:<?php echo $telephone; ?>"><?php echo $telephone; ?></a><br/>
3737
<br/>
3838
<?php }
39+
echo $this->getHookVar('after_telephone');
3940
if ($fax) { ?>
4041
<b class="mb-2"><?php echo $text_fax; ?></b><br/>
4142
<?php echo $fax;

public_html/storefront/controller/blocks/bestseller.php

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
<?php
2-
/*------------------------------------------------------------------------------
3-
$Id$
2+
/*
3+
* $Id$
4+
*
5+
* AbanteCart, Ideal OpenSource Ecommerce Solution
6+
* http://www.AbanteCart.com
7+
*
8+
* Copyright © 2011-2026 Belavier Commerce LLC
9+
*
10+
* This source file is subject to Open Software License (OSL 3.0)
11+
* License details are bundled with this package in the file LICENSE.txt.
12+
* It is also available at this URL:
13+
* <http://www.opensource.org/licenses/OSL-3.0>
14+
*
15+
* UPGRADE NOTE:
16+
* Do not edit or add to this file if you wish to upgrade AbanteCart to newer
17+
* versions in the future. If you wish to customize AbanteCart for your
18+
* needs, please refer to http://www.AbanteCart.com for more information.
19+
*/
20+
/** @noinspection PhpUnused */
21+
/** @noinspection PhpMultipleClassDeclarationsInspection */
422

5-
AbanteCart, Ideal OpenSource Ecommerce Solution
6-
http://www.AbanteCart.com
7-
8-
Copyright © 2011-2020 Belavier Commerce LLC
9-
10-
This source file is subject to Open Software License (OSL 3.0)
11-
License details is bundled with this package in the file LICENSE.txt.
12-
It is also available at this URL:
13-
<http://www.opensource.org/licenses/OSL-3.0>
14-
15-
UPGRADE NOTE:
16-
Do not edit or add to this file if you wish to upgrade AbanteCart to newer
17-
versions in the future. If you wish to customize AbanteCart for your
18-
needs please refer to http://www.AbanteCart.com for more information.
19-
------------------------------------------------------------------------------*/
2023
if (!defined('DIR_CORE')) {
2124
header('Location: static_pages/');
2225
}
@@ -32,23 +35,22 @@ public function __construct($registry, $instance_id, $controller, $parent_contro
3235

3336
public function main()
3437
{
35-
3638
//init controller data
3739
$this->extensions->hk_InitData($this, __FUNCTION__);
3840

3941
$this->data['heading_title'] = $this->language->get('heading_title', 'blocks/bestseller');
4042

41-
$this->loadModel('catalog/product');
43+
/** @var ModelCatalogProduct $pMdl */
44+
$pMdl = $this->loadModel('catalog/product');
4245
$this->loadModel('catalog/review');
4346
$this->loadModel('tool/image');
4447

4548
$this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');
46-
4749
$this->data['products'] = [];
4850

49-
$results = $this->model_catalog_product->getBestSellerProducts($this->config->get('config_bestseller_limit'));
51+
$results = $pMdl->getBestSellerProducts($this->config->get('config_bestseller_limit'));
5052
$product_ids = array_column($results, 'product_id');
51-
$products_info = $this->model_catalog_product->getProductsAllInfo($product_ids);
53+
$products_info = $pMdl->getProductsAllInfo($product_ids);
5254

5355
//get thumbnails by one pass
5456
$resource = new AResource('image');
@@ -60,51 +62,41 @@ public function main()
6062
$this->config->get('config_image_product_height')
6163
)
6264
: [];
63-
$stock_info = $this->model_catalog_product->getProductsStockInfo($product_ids);
65+
$stock_info = $pMdl->getProductsStockInfo($product_ids);
6466

6567
foreach ($results as $result) {
66-
$thumbnail = $thumbnails[$result['product_id']];
67-
$rating = $products_info[$result['product_id']]['rating'];
68-
$special = false;
69-
$discount = $products_info[$result['product_id']]['discount'];
68+
$productId = $result['product_id'];
69+
$thumbnail = $thumbnails[$productId];
70+
$rating = $products_info[$productId]['rating'];
71+
$special = $specialNum = false;
72+
$discount = $products_info[$productId]['discount'];
7073

7174
if ($discount) {
72-
$price = $this->currency->format(
73-
$this->tax->calculate(
74-
$discount,
75-
$result['tax_class_id'],
76-
$this->config->get('config_tax')
77-
)
78-
);
75+
$priceNum = $discount;
7976
} else {
80-
$price = $this->currency->format(
81-
$this->tax->calculate(
82-
$result['price'],
77+
$priceNum = $result['price'];
78+
$special = $products_info[$productId]['special'];
79+
if ($special) {
80+
$specialNum = $this->tax->calculate(
81+
$special,
8382
$result['tax_class_id'],
8483
$this->config->get('config_tax')
85-
)
86-
);
87-
$special = $products_info[$result['product_id']]['special'];
88-
if ($special) {
89-
$special = $this->currency->format(
90-
$this->tax->calculate(
91-
$special,
92-
$result['tax_class_id'],
93-
$this->config->get('config_tax')
94-
)
9584
);
85+
$special = $this->currency->format($specialNum);
9686
}
9787
}
88+
$priceNum = $this->tax->calculate($priceNum, $result['tax_class_id'], $this->config->get('config_tax'));
89+
$price = $this->currency->format($priceNum);
9890

99-
$options = $products_info[$result['product_id']]['options'];
91+
$options = $products_info[$productId]['options'];
10092

10193
if ($options) {
102-
$add = $this->html->getSEOURL('product/product', '&product_id='.$result['product_id'], '&encode');
94+
$add = $this->html->getSEOURL('product/product', '&product_id='.$productId, '&encode');
10395
} else {
10496
if ($this->config->get('config_cart_ajax')) {
10597
$add = '#';
10698
} else {
107-
$add = $this->html->getSecureURL('checkout/cart', '&product_id='.$result['product_id'], '&encode');
99+
$add = $this->html->getSecureURL('checkout/cart', '&product_id='.$productId, '&encode');
108100
}
109101
}
110102

@@ -113,11 +105,13 @@ public function main()
113105
$in_stock = false;
114106
$no_stock_text = $this->language->get('text_out_of_stock');
115107
$total_quantity = 0;
116-
$stock_checkout = $result['stock_checkout'] === '' ? $this->config->get('config_stock_checkout') : $result['stock_checkout'];
117-
if ($stock_info[$result['product_id']]['subtract']) {
108+
$stock_checkout = $result['stock_checkout'] === ''
109+
? $this->config->get('config_stock_checkout')
110+
: $result['stock_checkout'];
111+
if ($stock_info[$productId]['subtract']) {
118112
$track_stock = true;
119-
$total_quantity = $this->model_catalog_product->hasAnyStock( $result['product_id'] );
120-
//we have stock or out of stock checkout is allowed
113+
$total_quantity = $pMdl->hasAnyStock( $productId );
114+
//we have stock or out-of-stock checkout is allowed
121115
if ($total_quantity > 0 || $stock_checkout) {
122116
$in_stock = true;
123117
}
@@ -128,13 +122,17 @@ public function main()
128122
$result,
129123
[
130124
'rating' => $rating,
131-
'stars' => sprintf($this->language->get('text_stars'), $rating),
125+
'stars' => $this->language->getAndReplace('text_stars', replaces: $rating),
132126
'price' => $price,
127+
'price_num' => $priceNum,
133128
'options' => $options,
134129
'special' => $special,
130+
'special_num' => $specialNum,
135131
'thumb' => $thumbnail,
136132
'href' => $this->html->getSEOURL(
137-
'product/product', '&product_id='.$result['product_id'], '&encode'
133+
'product/product',
134+
'&product_id='.$productId,
135+
true
138136
),
139137
'add' => $add,
140138
'track_stock' => $track_stock,

public_html/storefront/controller/blocks/featured.php

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
<?php
22

3-
/*------------------------------------------------------------------------------
4-
$Id$
5-
6-
AbanteCart, Ideal OpenSource Ecommerce Solution
7-
http://www.AbanteCart.com
8-
9-
Copyright © 2011-2021 Belavier Commerce LLC
10-
11-
This source file is subject to Open Software License (OSL 3.0)
12-
License details is bundled with this package in the file LICENSE.txt.
13-
It is also available at this URL:
14-
<http://www.opensource.org/licenses/OSL-3.0>
15-
16-
UPGRADE NOTE:
17-
Do not edit or add to this file if you wish to upgrade AbanteCart to newer
18-
versions in the future. If you wish to customize AbanteCart for your
19-
needs please refer to http://www.AbanteCart.com for more information.
20-
------------------------------------------------------------------------------*/
3+
/*
4+
* $Id$
5+
*
6+
* AbanteCart, Ideal OpenSource Ecommerce Solution
7+
* http://www.AbanteCart.com
8+
*
9+
* Copyright © 2011-2026 Belavier Commerce LLC
10+
*
11+
* This source file is subject to Open Software License (OSL 3.0)
12+
* License details are bundled with this package in the file LICENSE.txt.
13+
* It is also available at this URL:
14+
* <http://www.opensource.org/licenses/OSL-3.0>
15+
*
16+
* UPGRADE NOTE:
17+
* Do not edit or add to this file if you wish to upgrade AbanteCart to newer
18+
* versions in the future. If you wish to customize AbanteCart for your
19+
* needs, please refer to http://www.AbanteCart.com for more information.
20+
*/
2121
if (!defined('DIR_CORE')) {
2222
header('Location: static_pages/');
2323
}
@@ -33,21 +33,20 @@ public function __construct($registry, $instance_id, $controller, $parent_contro
3333

3434
public function main()
3535
{
36-
3736
//init controller data
3837
$this->extensions->hk_InitData($this, __FUNCTION__);
3938

4039
$this->data['heading_title'] = $this->language->get('heading_title', 'blocks/featured');
41-
42-
$this->loadModel('catalog/product');
40+
/** @var ModelCatalogProduct $pMdl */
41+
$pMdl = $this->loadModel('catalog/product');
4342
$this->loadModel('catalog/review');
4443
$this->loadModel('tool/image');
4544
$this->data['button_add_to_cart'] = $this->language->get('button_add_to_cart');
4645
$this->data['products'] = [];
47-
$results = $this->model_catalog_product->getfeaturedProducts($this->config->get('config_featured_limit'));
46+
$results = $pMdl->getfeaturedProducts($this->config->get('config_featured_limit'));
4847
$product_ids = array_column($results, 'product_id');
4948

50-
$products_info = $this->model_catalog_product->getProductsAllInfo($product_ids);
49+
$products_info = $pMdl->getProductsAllInfo($product_ids);
5150
//get thumbnails by one pass
5251
$resource = new AResource('image');
5352
$thumbnails = $results
@@ -58,49 +57,39 @@ public function main()
5857
$this->config->get('config_image_product_height')
5958
)
6059
: [];
61-
$stock_info = $this->model_catalog_product->getProductsStockInfo($product_ids);
60+
$stock_info = $pMdl->getProductsStockInfo($product_ids);
6261

6362
foreach ($results as $result) {
64-
$thumbnail = $thumbnails[$result['product_id']];
65-
$rating = $products_info[$result['product_id']]['rating'];
66-
$special = false;
67-
$discount = $products_info[$result['product_id']]['discount'];
63+
$productId = $result['product_id'];
64+
$thumbnail = $thumbnails[$productId];
65+
$rating = $products_info[$productId]['rating'];
66+
$special = $specialNum = false;
67+
$discount = $products_info[$productId]['discount'];
6868
if ($discount) {
69-
$price = $this->currency->format(
70-
$this->tax->calculate(
71-
$discount,
72-
$result['tax_class_id'],
73-
$this->config->get('config_tax')
74-
)
75-
);
69+
$priceNum = $discount;
7670
} else {
77-
$price = $this->currency->format(
78-
$this->tax->calculate(
79-
$result['price'],
71+
$priceNum = $result['price'];
72+
$special = $products_info[$productId]['special'];
73+
if ($special) {
74+
$specialNum = $this->tax->calculate(
75+
$special,
8076
$result['tax_class_id'],
8177
$this->config->get('config_tax')
82-
)
83-
);
84-
$special = $products_info[$result['product_id']]['special'];
85-
if ($special) {
86-
$special = $this->currency->format(
87-
$this->tax->calculate(
88-
$special,
89-
$result['tax_class_id'],
90-
$this->config->get('config_tax')
91-
)
9278
);
79+
$special = $this->currency->format($specialNum);
9380
}
9481
}
82+
$priceNum = $this->tax->calculate($priceNum, $result['tax_class_id'], $this->config->get('config_tax'));
83+
$price = $this->currency->format($priceNum);
9584

96-
$options = $products_info[$result['product_id']]['options'];
85+
$options = $products_info[$productId]['options'];
9786
if ($options) {
98-
$add = $this->html->getSEOURL('product/product', '&product_id='.$result['product_id'], '&encode');
87+
$add = $this->html->getSEOURL('product/product', '&product_id='.$productId, '&encode');
9988
} else {
10089
if ($this->config->get('config_cart_ajax')) {
10190
$add = '#';
10291
} else {
103-
$add = $this->html->getSecureURL('checkout/cart', '&product_id='.$result['product_id'], '&encode');
92+
$add = $this->html->getSecureURL('checkout/cart', '&product_id='.$productId, '&encode');
10493
}
10594
}
10695

@@ -112,10 +101,10 @@ public function main()
112101
$stock_checkout = $result['stock_checkout'] === ''
113102
? $this->config->get('config_stock_checkout')
114103
: $result['stock_checkout'];
115-
if ($stock_info[$result['product_id']]['subtract']) {
104+
if ($stock_info[$productId]['subtract']) {
116105
$track_stock = true;
117-
$total_quantity = $this->model_catalog_product->hasAnyStock($result['product_id']);
118-
//we have stock or out of stock checkout is allowed
106+
$total_quantity = $pMdl->hasAnyStock($productId);
107+
//we have stock or out-of-stock checkout is allowed
119108
if ($total_quantity > 0 || $stock_checkout) {
120109
$in_stock = true;
121110
}
@@ -126,14 +115,16 @@ public function main()
126115
$result,
127116
[
128117
'rating' => $rating,
129-
'stars' => sprintf($this->language->get('text_stars'), $rating),
118+
'stars' => $this->language->getAndReplace('text_stars', replaces: $rating),
130119
'price' => $price,
120+
'price_num' => $priceNum,
131121
'options' => $options,
132122
'special' => $special,
123+
'special_num' => $specialNum,
133124
'thumb' => $thumbnail,
134125
'href' => $this->html->getSEOURL(
135126
'product/product',
136-
'&product_id='.$result['product_id'],
127+
'&product_id='.$productId,
137128
'&encode'
138129
),
139130
'add' => $add,

0 commit comments

Comments
 (0)