diff --git a/src/app/frontend/controllers/PageController.php b/src/app/frontend/controllers/PageController.php index 2e4c1c9..a370f75 100644 --- a/src/app/frontend/controllers/PageController.php +++ b/src/app/frontend/controllers/PageController.php @@ -135,6 +135,9 @@ $timestamp_left = $left_date->getTimestamp(); $active_sales[$k]['seconds_left'] = $timestamp_left - $now; } + + $discount = $this->models->getDiscount()->getOneData(4); + $discount = $discount['discount']; $css = [ '/landing_sales/style.css', @@ -168,7 +171,8 @@ 'meta_title' => $meta_title[$this->lang_id], 'meta_description' => $meta_description[$this->lang_id], 'slider' => $slider, - 'active_sales' => $active_sales + 'active_sales' => $active_sales, + 'discount' => $discount ]); } diff --git a/src/app/frontend/views/page/index.php b/src/app/frontend/views/page/index.php index 7776af7..0d96fcd 100644 --- a/src/app/frontend/views/page/index.php +++ b/src/app/frontend/views/page/index.php @@ -158,7 +158,7 @@
$i ): ?> - partial('partial/item_group', ['k' => $k, 'i' => $i, 'limit' => 5]) ?> + partial('partial/item_group', ['k' => $k, 'i' => $i, 'limit' => 5, 'discount' => $this->discount]) ?>
diff --git a/src/app/frontend/views/partial/item_group.php b/src/app/frontend/views/partial/item_group.php index c114ebb..e838010 100644 --- a/src/app/frontend/views/partial/item_group.php +++ b/src/app/frontend/views/partial/item_group.php @@ -31,7 +31,17 @@
-
_("price_from") ?> грн
+
+ _("price_from") ?> + 0) { + echo ''.$i['price'].' грн'; + echo ''.($i['price']*(1-$discount/100)).' грн'; + } + else { + echo ''.$i['price'].' грн'; + } + ?> +
_("details") ?> _("buy") ?> -- libgit2 0.21.4