Skip to content

Commit 8e6b8d7

Browse files
committed
Fixed product_id request to read from get or post parameters and template array product key
1 parent d4cad09 commit 8e6b8d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/controller/cart/compare.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function index() {
9191
}
9292

9393
private function action($action) {
94-
$productId = (int)($this->request->request['product_id'] ?? false);
94+
$productId = (int)($this->request->get['product_id'] ?? $this->request->post['product_id'] ?? false);
9595

9696
if ($productId) {
9797
$compare = sess('compare');

app/template/cart/compare.tpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import(common.tpl)
88

99
@compare-product|before = <?php
1010

11-
$products = $this->products['products'] ?? [];
11+
$products = $this->products['product'] ?? [];
1212
$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => ['product_id' => 1, 'product_id' => 1, 'image' => '#']] : false;
1313
$products = empty($products) ? $_default : $products;
1414

0 commit comments

Comments
 (0)