jeudi 28 juillet 2016

Make Shopping Cart in Laravel

in there i want to add shopping cart in my project. i have try make it but its still want work.

this my controller :

function postCreate(){

        echo '<pre>';
        print_r(Request::all());
        exit;
        $data['list'] = DB::table('package')
        ->join("cms_car","cms_car.id","=","package.id_cms_car")
        ->join("zone","zone.id","=","package.id_zone")
        ->select("package.*","cms_car.car as name_car","cms_car.photo as car_photo");       


        return view('detail',$data);
    }

and here my view for listing :

 @if ($row->driver == 'Driver Included')
          <img src="" style="max-width:15px;">
        @else

        @endif

         </p>
        <p>
        @if ($row->driver == 'Driver Included')
          <img src=""style="max-width:15px;"> 
        @else

        @endif
        </p>
        <h6 class="post-price">price :</h6>
        <p>Rp. </p>
    </div>
</div>
<hr>
<div class="col-md-6">
Unit Quality :<br><br>
    <div class="input-group" style="width: 150px;">
<span class="input-group-btn">
              <button type="button" class="btn btn-danger btn-number btn-minus"  data-type="minus">
                <span class="glyphicon glyphicon-minus"></span>
              </button>
          </span>
          <input type="text" name="quantity" class="form-control input-number" value="1" data-price="" data-id="" min="1" max="100">
          <span class="input-group-btn">
              <button type="button" class="btn btn-success btn-number btn-plus" data-type="plus">
                  <span class="glyphicon glyphicon-plus"></span>
              </button>
          </span>
</div>
</div>

<div class="col-md-6">

   <h3 style="margin-top:40px" id="price">Rp. </h3>
</div>
  </div>
  </div>
  @endforeach

in there i want to make cart it only add when i change the unit quantity

form input name : quantity

my webview

have someone tell me what improvements do i have to make to the code to achieve my goal?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire