Skip to content

Commit

Permalink
cart
Browse files Browse the repository at this point in the history
  • Loading branch information
agni21 committed Oct 30, 2016
1 parent 88dc96c commit a523f98
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/Http/Controllers/PagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ public function add_custom(AddToCart $request)

public function item(Request $request)
{
Item::where('price', '<', 0)->where('cart_id', '=', $this->cart->id)->delete();
GuestItem::where('price', '<', 0)->where('guestcart_id', '=', $this->cart->id)->delete();
if ( $request->get('action') == 'rm' ) {
if (Item::where('cart_id', '=', $this->cart->id)->where('id', '=', $request->get('item'))->first()!=null) {
foreach (ItemRelation::where('parent_id', '=', $request->get('item'))->where('item_no', '=', $request->get('item_no'))->get() as $itr) {
Expand Down Expand Up @@ -338,8 +340,8 @@ public function applycoupon(Request $request)
$disc50 += $custom_item->price * 0.5;
}
}
if ($disc50>500) {
$disc50=500;
if ($disc50>200) {
$disc50=200;
}
$this->cart->add(['sku' => 'MONO506908', 'price' => 0 - $disc50]);
}
Expand Down

0 comments on commit a523f98

Please sign in to comment.