Skip to content

Commit

Permalink
Выведена цена в модивикации продукта
Browse files Browse the repository at this point in the history
  • Loading branch information
t1mon committed Aug 4, 2020
1 parent 313fc65 commit 2790bdd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/views/shop/catalog/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@
<div class="checkbox">
<ul>
<?php foreach ($modifications as $modification_id=>$modification): ?>
<?php $priceModification = $cartForm->getModificationPrice($modification_id)?>
<li>
<input type="checkbox" id="<?=$modification_id?>" name="scales"><label for="<?=$modification_id?>"><?=$modification?>
<input type="checkbox" id="<?=$modification_id?>" name="scales"><label for="<?=$modification_id?>"><?=$modification?><span class="mod-price">&nbsp;<?=PriceHelper::format($priceModification)?>&#8381;</span>
</label>
<div class="modification-plus-minus">
<div class="dec qtybutton" data-id="<?=$modification_id?>">-</div>
Expand Down
7 changes: 7 additions & 0 deletions frontend/web/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,11 @@
}
.modification .pro-details-quality .pro-details-cart a{
padding: 12px 20px 12px;
}
.mod-price{
color: #fff;
background-color: #fe0101 ;
padding: 1px;
border: 1px solid #fe0101;
border-radius: 2px;
}
5 changes: 5 additions & 0 deletions shop/forms/Shop/AddToCartForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public function modificationsList1C() : array
});
}

public function getModificationPrice($id)
{
return Modification::findOne($id)->price;
}

private function indexSpecification()
{
$array = [];
Expand Down

0 comments on commit 2790bdd

Please sign in to comment.