Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Fixed product_id request to read from get or post parameters and template array product key

givanz8e6b8d71f95f
diff --git a/app/controller/cart/compare.php b/app/controller/cart/compare.php
index 2c5190e..53b5700 100644
--- a/app/controller/cart/compare.php
+++ b/app/controller/cart/compare.php
@@ -91,7 +91,7 @@ class Compare extends Base {
}
private function action($action) {
- $productId = (int)($this->request->request['product_id'] ?? false);
+ $productId = (int)($this->request->get['product_id'] ?? $this->request->post['product_id'] ?? false);
if ($productId) {
$compare = sess('compare');
diff --git a/app/template/cart/compare.tpl b/app/template/cart/compare.tpl
index e292625..5ebed67 100644
--- a/app/template/cart/compare.tpl
+++ b/app/template/cart/compare.tpl
@@ -8,7 +8,7 @@ import(common.tpl)
@compare-product|before = <?php
-$products = $this->products['products'] ?? [];
+$products = $this->products['product'] ?? [];
$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => ['product_id' => 1, 'product_id' => 1, 'image' => '#']] : false;
$products = empty($products) ? $_default : $products;