Skip to content

Commit a02ddea

Browse files
committed
Merge branch 'develop'
2 parents 2db3628 + ca7abd6 commit a02ddea

7 files changed

+1462
-834
lines changed

controllers/AbstractCartRESTController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ abstract class AbstractCartRESTController extends CartControllerCore {
88
public function init()
99
{
1010
header('Content-Type: ' . "application/json");
11+
12+
if (Tools::getValue('iso_currency')){
13+
$_GET['id_currency'] = (string)Currency::getIdByIsoCode(Tools::getValue('currency'));
14+
$_GET['SubmitCurrency'] = "1";
15+
}
16+
1117
parent::init();
18+
1219
switch ($_SERVER['REQUEST_METHOD']) {
1320
case 'GET':
1421
$this->processGetRequest();

controllers/AbstractPaymentRESTController.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ abstract class AbstractPaymentRESTController extends ModuleFrontController
2020
public function init()
2121
{
2222
header('Content-Type: ' . "application/json");
23+
24+
if (Tools::getValue('iso_currency')){
25+
$_GET['id_currency'] = (string)Currency::getIdByIsoCode(Tools::getValue('currency'));
26+
$_GET['SubmitCurrency'] = "1";
27+
}
28+
2329
if (!$this->context->customer->isLogged() && $this->php_self != 'authentication' && $this->php_self != 'password') {
2430
$this->ajaxRender(json_encode([
2531
'code' => 410,

controllers/AbstractProductListingRESTController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ abstract class AbstractProductListingRESTController extends ProductListingFrontC
2929
public function init()
3030
{
3131
header('Content-Type: ' . "application/json");
32+
33+
if (Tools::getValue('iso_currency')){
34+
$_GET['id_currency'] = (string)Currency::getIdByIsoCode(Tools::getValue('currency'));
35+
$_GET['SubmitCurrency'] = "1";
36+
}
37+
3238
parent::init();
39+
3340
switch ($_SERVER['REQUEST_METHOD']) {
3441
case 'GET':
3542
$this->processGetRequest();

controllers/AbstractRESTController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ abstract class AbstractRESTController extends ModuleFrontController
2222
public function init()
2323
{
2424
header('Content-Type: ' . "application/json");
25+
26+
if (Tools::getValue('iso_currency')){
27+
$_GET['id_currency'] = (string)Currency::getIdByIsoCode(Tools::getValue('currency'));
28+
$_GET['SubmitCurrency'] = "1";
29+
}
30+
2531
parent::init();
32+
2633
switch ($_SERVER['REQUEST_METHOD']) {
2734
case 'GET':
2835
$this->processGetRequest();

controllers/front/productdetail.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ protected function processGetRequest()
7373

7474
$product = $this->getProduct();
7575
$product['groups'] = $this->assignAttributesGroups($product);
76+
$product['breadcrumb'] = $this->getBreadcrumbLinks();
7677

7778
$this->ajaxRender(json_encode([
7879
'success' => true,
@@ -937,4 +938,31 @@ protected function assignAttributesGroups($product_for_template = null)
937938
return [];
938939
}
939940
}
941+
942+
public function getBreadcrumbLinks()
943+
{
944+
$breadcrumb = parent::getBreadcrumbLinks();
945+
946+
$categoryDefault = new Category($this->product->id_category_default, $this->context->language->id);
947+
948+
foreach ($categoryDefault->getAllParents() as $category) {
949+
if ($category->id_parent != 0 && !$category->is_root_category && $category->active) {
950+
$breadcrumb['links'][] = [
951+
'title' => $category->name,
952+
'category_id' => $category->id,
953+
'url' => $this->context->link->getCategoryLink($category),
954+
];
955+
}
956+
}
957+
958+
if ($categoryDefault->id_parent != 0 && !$categoryDefault->is_root_category && $categoryDefault->active) {
959+
$breadcrumb['links'][] = [
960+
'title' => $categoryDefault->name,
961+
'category_id' => $categoryDefault->id,
962+
'url' => $this->context->link->getCategoryLink($categoryDefault),
963+
];
964+
}
965+
966+
return $breadcrumb['links'];
967+
}
940968
}

0 commit comments

Comments
 (0)