Commit 831d0198 by Angel MAS

shipping no required and placeholder select

parent 50a7bc5f
...@@ -281,13 +281,19 @@ class AdminProductController extends Controller ...@@ -281,13 +281,19 @@ class AdminProductController extends Controller
{ {
$sale = Sale::find($id); $sale = Sale::find($id);
$promo = null; $promo = null;
$shipping = null;
$shipping_price = null;
if ($sale->coupon != null) { if ($sale->coupon != null) {
$promo = $this->util->getDiscount($sale, $sale->coupon); $promo = $this->util->getDiscount($sale, $sale->coupon);
} }
$client = $sale->client; $client = $sale->client;
$orden = $sale->items; $orden = $sale->items;
if ($client->shipping != null) {
$shipping = $client->shipping; $shipping = $client->shipping;
$shipping_price = $shipping->shipping_price; $shipping_price = $shipping->shipping_price;
}
if ($sale->status == 0) { if ($sale->status == 0) {
$estado = "Cancelado"; $estado = "Cancelado";
......
...@@ -47,18 +47,21 @@ class CartController extends Controller ...@@ -47,18 +47,21 @@ class CartController extends Controller
if (!\Session::has('cart')) { if (!\Session::has('cart')) {
\Session::put('cart', array()); \Session::put('cart', array());
} }
setlocale(LC_MONETARY, 'en_US'); setlocale(LC_MONETARY, 'en_US');
$this->util = new Util(); $this->util = new Util();
} }
public function show() public function show()
{ {
$total = $this->total(); $total = $this->total();
$cart = \Session::get('cart'); $cart = \Session::get('cart');
return view('shop-public::cart.show-cart') return view('shop-public::cart.show-cart')
->with('cart', $cart) ->with('cart', $cart)
->with('total', $total); ->with('total', $total);
} }
public function add(Product $product) public function add(Product $product)
...@@ -183,10 +186,17 @@ public function shipping() ...@@ -183,10 +186,17 @@ public function shipping()
$client = new Client(); $client = new Client();
$addres = new Addres(); $addres = new Addres();
$cart = \Session::get('cart'); $cart = \Session::get('cart');
$costoEnvio = 0;
if(\Session::has('client')) { if(\Session::has('client')) {
$client = \Session::get('client'); $client = \Session::get('client');
if ($client->shipping != null) {
$addres = $client->shipping; $addres = $client->shipping;
}
if (\Session::get('client')->email != $request->email) { if (\Session::get('client')->email != $request->email) {
$client = new Client(); $client = new Client();
$addres = new Addres(); $addres = new Addres();
...@@ -198,6 +208,8 @@ public function shipping() ...@@ -198,6 +208,8 @@ public function shipping()
$client->fill($request->all()); $client->fill($request->all());
$client->save(); $client->save();
if ($request->home_delivery) {
/** Crea forma de envio ····· */ /** Crea forma de envio ····· */
$addres->fill($request->all()); $addres->fill($request->all());
...@@ -210,9 +222,12 @@ public function shipping() ...@@ -210,9 +222,12 @@ public function shipping()
/** Guarda productos en tabla ······ */ /** Guarda productos en tabla ······ */
$costoEnvio = $addres->shipping_price->cost; $costoEnvio = $addres->shipping_price->cost;
}
if (!\Session::has('sale')) { if (!\Session::has('sale')) {
$sale = $client->sales()->save(new Sale(['status' => 1, 'total'=>($this->total() + $costoEnvio)])); $sale = $client->sales()->save(new Sale(['home_delivery'=>$request->home_delivery,'status' => 1, 'total'=>($this->total() + $costoEnvio)]));
foreach ($cart as $product) { foreach ($cart as $product) {
$item = Item::create([ $item = Item::create([
...@@ -284,20 +299,25 @@ public function shipping() ...@@ -284,20 +299,25 @@ public function shipping()
$sale = Sale::find(\Session::get('sale')->id); $sale = Sale::find(\Session::get('sale')->id);
$client = $sale->client; $client = $sale->client;
$items = $sale->items; $items = $sale->items;
$addres = $client->shipping; $addres = $client->shipping != null ? $client->shipping : null;
$products = $sale->products; $products = $sale->products;
$detail = ''; $detail = '';
$status = ''; $status = '';
$user = \App\User::first(); $user = \App\User::first();
$descuento = 0; $descuento = 0;
$cupon = ''; $cupon = '';
$costo_envio = 0;
foreach ($sale->products as $item) { foreach ($sale->products as $item) {
$detail = $detail." ".$item->pivot->quantity." ".$item->name." Sub. ".money_format('%(#10n', ($item->infoSale->sale_price*$item->pivot->quantity)).", "; $detail = $detail." ".$item->pivot->quantity." ".$item->name." Sub. ".money_format('%(#10n', ($item->infoSale->sale_price*$item->pivot->quantity)).", ";
} }
$detail = $detail." Envio ". $addres->shipping_price->name ." $". $addres->shipping_price->cost .".00"; if ($addres != null) {
$detail = $detail." Envio ". $addres->shipping_price->name." ".money_format('%(#10n',$addres->shipping_price->cost);
$costo_envio = $addres->shipping_price->cost;
}
if ($request->coupon != null) { if ($request->coupon != null) {
$data = $this->getDiscount($sale, $request->coupon); $data = $this->getDiscount($sale, $request->coupon);
...@@ -314,7 +334,7 @@ public function shipping() ...@@ -314,7 +334,7 @@ public function shipping()
$mp = new MP(env('AC_MERCADO_PAGO')); $mp = new MP(env('AC_MERCADO_PAGO'));
$payment_data = array( $payment_data = array(
"transaction_amount" => ($this->total() + $addres->shipping_price->cost) - $descuento, "transaction_amount" => ($this->total() + $costo_envio) - $descuento,
"token" => $request->card_token_id, "token" => $request->card_token_id,
"description" => $detail, "description" => $detail,
"installments" => 1, "installments" => 1,
...@@ -402,18 +422,24 @@ public function shipping() ...@@ -402,18 +422,24 @@ public function shipping()
$sale = Sale::find(\Session::get('sale')->id); $sale = Sale::find(\Session::get('sale')->id);
$client = $sale->client; $client = $sale->client;
$items = $sale->items; $items = $sale->items;
$addres = $client->shipping; $addres = $client->shipping != null ? $client->shipping : null;
$products = $sale->products; $products = $sale->products;
$detail = ''; $detail = '';
$descuento = 0; $descuento = 0;
$cupon = ''; $cupon = '';
$costo_envio = 0;
foreach ($sale->products as $item) { foreach ($sale->products as $item) {
$detail = $detail." ".$item->pivot->quantity." ".$item->name." Sub. ".money_format('%(#10n', ($item->infoSale->sale_price*$item->pivot->quantity)).", "; $detail = $detail." ".$item->pivot->quantity." ".$item->name." Sub. ".money_format('%(#10n', ($item->infoSale->sale_price*$item->pivot->quantity)).", ";
} }
if ($addres != null) {
$detail = $detail." Envio ". $addres->shipping_price->name." ".money_format('%(#10n',$addres->shipping_price->cost); $detail = $detail." Envio ". $addres->shipping_price->name." ".money_format('%(#10n',$addres->shipping_price->cost);
$costo_envio = $addres->shipping_price->cost;
}
if ($request->coupon != null) { if ($request->coupon != null) {
$data = $this->getDiscount($sale, $request->coupon); $data = $this->getDiscount($sale, $request->coupon);
...@@ -431,7 +457,7 @@ public function shipping() ...@@ -431,7 +457,7 @@ public function shipping()
$mp = new MP(env('AC_MERCADO_PAGO')); $mp = new MP(env('AC_MERCADO_PAGO'));
$payment_data = array( $payment_data = array(
"transaction_amount" => ($this->total() + $addres->shipping_price->cost)-$descuento, "transaction_amount" => ($this->total() + $costo_envio)-$descuento,
"description" => $detail, "description" => $detail,
...@@ -522,7 +548,8 @@ public function shipping() ...@@ -522,7 +548,8 @@ public function shipping()
$sale = Sale::find(\Session::get('sale')->id); $sale = Sale::find(\Session::get('sale')->id);
$client = $sale->client; $client = $sale->client;
$items = $sale->items; $items = $sale->items;
$addres = $client->shipping; $addres = $client->shipping != null ? $client->shipping : null;
$costo_envio = 0;
$products = $sale->products; $products = $sale->products;
$old = $sale->status; $old = $sale->status;
$sale->status = 2; $sale->status = 2;
...@@ -579,7 +606,8 @@ public function shipping() ...@@ -579,7 +606,8 @@ public function shipping()
$client = $sale->client; $client = $sale->client;
$items = $sale->items; $items = $sale->items;
$products = $sale->products; $products = $sale->products;
$addres = $client->shipping; $addres = $client->shipping != null ? $client->shipping : null;
$costo_envio = 0;
$detail = ''; $detail = '';
$descuento = 0; $descuento = 0;
...@@ -619,6 +647,10 @@ public function shipping() ...@@ -619,6 +647,10 @@ public function shipping()
$items[]=$item1; $items[]=$item1;
} }
if ($addres != null) {
$costo_envio = $addres->shipping_price->cost;
$item2 = new PaypalItem(); $item2 = new PaypalItem();
$item2->setName($addres->shipping_price->name) $item2->setName($addres->shipping_price->name)
->setDescription($addres->shipping_price->name) ->setDescription($addres->shipping_price->name)
...@@ -628,6 +660,8 @@ public function shipping() ...@@ -628,6 +660,8 @@ public function shipping()
array_push($items, $item2); array_push($items, $item2);
}
if ($request->coupon != null) { if ($request->coupon != null) {
$data = $this->getDiscount($sale, $request->coupon); $data = $this->getDiscount($sale, $request->coupon);
if ($data['valid']) { if ($data['valid']) {
...@@ -654,12 +688,12 @@ public function shipping() ...@@ -654,12 +688,12 @@ public function shipping()
$itemList->setItems($items); $itemList->setItems($items);
$details = new Details(); $details = new Details();
$details->setSubtotal(($this->total() + $addres->shipping_price->cost) - $descuento); $details->setSubtotal(($this->total() + $costo_envio) - $descuento);
$amount = new \PayPal\Api\Amount(); $amount = new \PayPal\Api\Amount();
$amount->setCurrency("MXN") $amount->setCurrency("MXN")
->setTotal(($this->total() + $addres->shipping_price->cost)-$descuento) ->setTotal(($this->total() + $costo_envio)-$descuento)
->setDetails($details); ->setDetails($details);
...@@ -709,7 +743,8 @@ public function shipping() ...@@ -709,7 +743,8 @@ public function shipping()
$client = $sale->client; $client = $sale->client;
$products = $sale->products; $products = $sale->products;
$items = $sale->items; $items = $sale->items;
$addres = $client->shipping; $addres = $client->shipping != null ? $client->shipping : null;
$costo_envio = 0;
$detail = ''; $detail = '';
$sale->status = 3; $sale->status = 3;
...@@ -802,9 +837,13 @@ public function shipping() ...@@ -802,9 +837,13 @@ public function shipping()
{ {
$client = $sale->client; $client = $sale->client;
$addres = null;
$cost_shipping = 0;
if ($sale->home_delivery) {
$addres = $client->shipping; $addres = $client->shipping;
$cost_shipping = $addres->shipping_price->cost; $cost_shipping = $addres->shipping_price->cost;
}
$coupon = Coupon::where('code', $code)->first(); $coupon = Coupon::where('code', $code)->first();
$today = date("Y-m-d"); $today = date("Y-m-d");
...@@ -864,8 +903,13 @@ public function getDiscount2($sale) ...@@ -864,8 +903,13 @@ public function getDiscount2($sale)
{ {
$client = $sale->client; $client = $sale->client;
$addres = null;
$cost_shipping = 0;
if ($sale->home_delivery) {
$addres = $client->shipping; $addres = $client->shipping;
$cost_shipping = $addres->shipping_price->cost; $cost_shipping = $addres->shipping_price->cost;
}
$coupon = Coupon::where('code', $sale->coupon)->first(); $coupon = Coupon::where('code', $sale->coupon)->first();
......
...@@ -39,7 +39,12 @@ class OrderDataTable extends DataTable ...@@ -39,7 +39,12 @@ class OrderDataTable extends DataTable
if ($sale->status == 3) { if ($sale->status == 3) {
$estado = "<span class='label primary'>En proceso</span>"; $estado = "<span class='label primary'>En proceso</span>";
} }
if ($sale->client->shipping != null) {
$html = "Estado: <b>$estado</b><br>Tipo: <b>$sale->payment_type</b> <br>Transaccion:<br><b>$sale->transaction_id</b><br>Envio: <b>".$sale->client->shipping->shipping_price->name."</b>"; $html = "Estado: <b>$estado</b><br>Tipo: <b>$sale->payment_type</b> <br>Transaccion:<br><b>$sale->transaction_id</b><br>Envio: <b>".$sale->client->shipping->shipping_price->name."</b>";
} else {
$html = "Estado: <b>$estado</b><br>Tipo: <b>$sale->payment_type</b> <br>Transaccion:<br><b>$sale->transaction_id</b><br>Envio: <b>Recojer en la tienda</b>";
}
return $html; return $html;
}) })
->addColumn('action', function (Sale $sale){ ->addColumn('action', function (Sale $sale){
......
...@@ -60,9 +60,13 @@ class Util ...@@ -60,9 +60,13 @@ class Util
{ {
$client = $sale->client; $client = $sale->client;
$addres = null;
$cost_shipping = 0;
if ($sale->home_delivery) {
$addres = $client->shipping; $addres = $client->shipping;
$cost_shipping = $addres->shipping_price->cost; $cost_shipping = $addres->shipping_price->cost;
}
$coupon = Coupon::where('code', $code)->first(); $coupon = Coupon::where('code', $code)->first();
$today = date("Y-m-d"); $today = date("Y-m-d");
......
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddShippmentOptionToClientShopsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('sale_shops', function (Blueprint $table) {
$table->boolean('home_delivery')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sale_shops', function (Blueprint $table) {
$table->dropColumn('home_delivery');
});
}
}
...@@ -7,7 +7,16 @@ use Illuminate\Database\Eloquent\Model; ...@@ -7,7 +7,16 @@ use Illuminate\Database\Eloquent\Model;
class SaleShop extends Model class SaleShop extends Model
{ {
protected $table = 'sale_shops'; protected $table = 'sale_shops';
protected $fillable = ['status', 'total', 'client_id', 'transaction_id', 'payment_type', 'shipping_status', 'coupon']; protected $fillable = [
'status',
'total',
'client_id',
'transaction_id',
'payment_type',
'shipping_status',
'coupon',
'home_delivery'
];
public function client() public function client()
......
...@@ -29,7 +29,7 @@ class ResumenOrder extends Notification ...@@ -29,7 +29,7 @@ class ResumenOrder extends Notification
* *
* @return void * @return void
*/ */
public function __construct(Order $order, $products, Client $client, Shipping $shipping) public function __construct(Order $order, $products, Client $client, $shipping)
{ {
$this->order = $order; $this->order = $order;
$this->products = $products; $this->products = $products;
......
...@@ -45,8 +45,9 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -45,8 +45,9 @@ setlocale(LC_MONETARY, 'en_US');
<p>Teléfono: <b>{{$client->phone}}</b></p> <p>Teléfono: <b>{{$client->phone}}</b></p>
<p>Correo: <b>{{$client->email}}</b></p> <p>Correo: <b>{{$client->email}}</b></p>
<p>Fecha de registro: <b>{{$client->created_at}}</b></p> <p>Fecha de registro: <b>{{$client->created_at}}</b></p>
@if($shipping != null)
<p>Requiere factura: <b>{{$shipping->facturacion}}</b></p> <p>Requiere factura: <b>{{$shipping->facturacion}}</b></p>
@endif
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
...@@ -151,12 +152,14 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -151,12 +152,14 @@ setlocale(LC_MONETARY, 'en_US');
<td> - {{$promo['amount']}}</td> <td> - {{$promo['amount']}}</td>
</tr> </tr>
@endif @endif
@if($shipping_price != null)
<tr> <tr>
<td>1</td> <td>1</td>
<td>{{$shipping_price->name}}</td> <td>{{$shipping_price->name}}</td>
<td>{{money_format('%(#10n', $shipping_price->cost)}}</td> <td>{{money_format('%(#10n', $shipping_price->cost)}}</td>
<td>{{money_format('%(#10n', $shipping_price->cost)}}</td> <td>{{money_format('%(#10n', $shipping_price->cost)}}</td>
</tr> </tr>
@endif
<tfoot> <tfoot>
<tr> <tr>
<td></td> <td></td>
...@@ -184,6 +187,7 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -184,6 +187,7 @@ setlocale(LC_MONETARY, 'en_US');
<div class="box-body"> <div class="box-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@if($shipping != null)
Direccion de entrega:<br> Direccion de entrega:<br>
<b>{{$shipping->calle}}, # {{$shipping->numero}}, col. {{$shipping->colonia}}</b><br> <b>{{$shipping->calle}}, # {{$shipping->numero}}, col. {{$shipping->colonia}}</b><br>
...@@ -195,6 +199,11 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -195,6 +199,11 @@ setlocale(LC_MONETARY, 'en_US');
Estatus del envio: <a href="javascript::void()" data-target="#m-a-a" data-toggle="modal" href="#" ui-target="#animate" ui-toggle-class="zoom"><i class="fa fa-edit"></i></a><br> Estatus del envio: <a href="javascript::void()" data-target="#m-a-a" data-toggle="modal" href="#" ui-target="#animate" ui-toggle-class="zoom"><i class="fa fa-edit"></i></a><br>
<span class="label warning">{{$sale->shipping_status}}</span> <span class="label warning">{{$sale->shipping_status}}</span>
@else
<h6>
No hay datos de envio, el cliente pasara a la tienda a recoger el producto
</h6>
@endif
</div> </div>
......
...@@ -21,7 +21,9 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -21,7 +21,9 @@ setlocale(LC_MONETARY, 'en_US');
@foreach($products as $p) @foreach($products as $p)
| {{$p->pivot->quantity}} | {{$p->name}} | {{money_format('%(#10n', $p->infoSale->sale_price)}} | {{money_format('%(#10n', $p->infoSale->sale_price * $p->pivot->quantity)}} | | {{$p->pivot->quantity}} | {{$p->name}} | {{money_format('%(#10n', $p->infoSale->sale_price)}} | {{money_format('%(#10n', $p->infoSale->sale_price * $p->pivot->quantity)}} |
@endforeach @endforeach
@if($shipping != null)
| 1 | {{$shipping->shipping_price->name}} | {{money_format('%(#10n',$shipping->shipping_price->cost)}} | {{money_format('%(#10n',$shipping->shipping_price->cost)}} | | 1 | {{$shipping->shipping_price->name}} | {{money_format('%(#10n',$shipping->shipping_price->cost)}} | {{money_format('%(#10n',$shipping->shipping_price->cost)}} |
@endif
@if($promo != null) @if($promo != null)
| 1 | Descuento *** {{$order->coupon}} *** | {{" - ".$promo['amount']}} | {{" - ".$promo['amount']}}| | 1 | Descuento *** {{$order->coupon}} *** | {{" - ".$promo['amount']}} | {{" - ".$promo['amount']}}|
@endif @endif
...@@ -37,6 +39,7 @@ Datos del comprador: ...@@ -37,6 +39,7 @@ Datos del comprador:
- Correo: *** {{$client->email}} *** - Correo: *** {{$client->email}} ***
@endcomponent @endcomponent
@if($shipping != null)
@component('mail::panel') @component('mail::panel')
Datos de envio: Datos de envio:
...@@ -50,6 +53,7 @@ Datos de envio: ...@@ -50,6 +53,7 @@ Datos de envio:
@endif @endif
@endcomponent @endcomponent
@endif
Gracias por tu compra,<br> Gracias por tu compra,<br>
{{ config('app.name') }} {{ config('app.name') }}
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<div class="col-md-4"> <div class="col-md-4">
<div class="form-group"> <div class="form-group">
{!! Form::label($extra->variable, $extra->alias, ['class'=>'control-label'])!!} {!! Form::label($extra->variable, $extra->alias, ['class'=>'control-label'])!!}
{!! Form::select($extra->variable, array_combine( explode(",", $extra->values), explode(",", $extra->values)), null, ["class"=>"form-control"]) !!} {!! Form::select($extra->variable, array_combine( explode(",", $extra->values), explode(",", $extra->values)), null, ["class"=>"form-control", "placeholder"=>"Elije una opción"]) !!}
</div> </div>
</div> </div>
@endif @endif
......
...@@ -47,8 +47,10 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -47,8 +47,10 @@ setlocale(LC_MONETARY, 'en_US');
</td> </td>
<td align="center"> <td align="center">
{{ money_format('%(#10n', ($total)) }} + {{ money_format('%(#10n', ($total)) }} +
{{ money_format('%(#10n', $addres->shipping_price->cost) }} =
{{ money_format('%(#10n', ($total + $addres->shipping_price->cost)) }} {{ $sale->home_delivery ? money_format('%(#10n', $addres->shipping_price->cost) : '0' }} =
{{ $sale->home_delivery ? money_format('%(#10n', ($total + $addres->shipping_price->cost)) : money_format('%(#10n', ($total))}}
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -54,21 +54,32 @@ setlocale(LC_MONETARY, 'en_US'); ...@@ -54,21 +54,32 @@ setlocale(LC_MONETARY, 'en_US');
@include('shop-public::forms.fields-client') @include('shop-public::forms.fields-client')
</section> </section>
<section> <section id="delivery" style="display: none;">
<h4>Datos de envio</h4> <h4>Datos de envio</h4>
@include('shop-public::forms.fields-shipping') @include('shop-public::forms.fields-shipping')
<br> <br>
{!! Form::submit('Enviar información', ['class'=>'']) !!}
{!! Form::close() !!}
</section> </section>
{!! Form::submit('Enviar información', ['class'=>'']) !!}
{!! Form::close() !!}
@endsection @endsection
@section('scripts_extra') @section('scripts_extra')
<script type="text/javascript">
$('#home_delivery').change(function () {
if ($(this).val() == 1) {
$('#delivery').show();
$("#delivery :input").prop('required','required');
}
if ($(this).val() == 0)
{
$('#delivery').hide();
$("#delivery :input").prop('required',null);
}
})
</script>
@endsection @endsection
\ No newline at end of file
...@@ -17,3 +17,8 @@ ...@@ -17,3 +17,8 @@
{!! Form::label('phone', 'Teléfono', ['class'=>'']) !!} {!! Form::label('phone', 'Teléfono', ['class'=>'']) !!}
{!! Form::text('phone', null, ['class'=>'form-control', 'required'=>'required', 'id'=>'phone']) !!} {!! Form::text('phone', null, ['class'=>'form-control', 'required'=>'required', 'id'=>'phone']) !!}
</div> </div>
<div class="form-group">
{!! Form::label('home_delivery', '¿Requieres envio a domicilio?', ['class'=>'']) !!}
{!! Form::select('home_delivery',[false=>'No, pasare por el paquete a la tienda', true=>'SI'], null, ['class'=>'form-control', 'required'=>'required', 'id'=>'home_delivery']) !!}
</div>
\ No newline at end of file
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<br> <br>
<button> <button>
Pagar {{ money_format('%(#10n', ($total + $addres->shipping_price->cost)) }} Pagar {{ $sale->home_delivery ? money_format('%(#10n', ($total + $addres->shipping_price->cost)) : money_format('%(#10n', $total)}}
<span class="amount_discount"></span> <span class="amount_discount"></span>
</button> </button>
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
</div> </div>
<br> <br>
<button> <button>
Pagar {{ money_format('%(#10n', ($total + $addres->shipping_price->cost)) }} Pagar {{ $sale->home_delivery ? money_format('%(#10n', ($total + $addres->shipping_price->cost)) : money_format('%(#10n', $total ) }}
<span class="amount_discount"></span> <span class="amount_discount"></span>
</button> </button>
......
<div class="form-group"> <div class="form-group">
{!! Form::label('cp', 'Codigo postal', ['class'=>'']) !!} {!! Form::label('cp', 'Codigo postal', ['class'=>'']) !!}
{!! Form::text('cp', $addres->cp, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('cp', isset($address) ? $addres->cp : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('calle', 'Calle', ['class'=>'']) !!} {!! Form::label('calle', 'Calle', ['class'=>'']) !!}
{!! Form::text('calle', $addres->calle, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('calle', isset($address) ? $addres->calle : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('numero', 'Numero', ['class'=>'']) !!} {!! Form::label('numero', 'Numero', ['class'=>'']) !!}
{!! Form::text('numero', $addres->numero, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('numero', isset($address) ? $addres->numero : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('colonia', 'Colonia', ['class'=>'']) !!} {!! Form::label('colonia', 'Colonia', ['class'=>'']) !!}
{!! Form::text('colonia', $addres->colonia, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('colonia', isset($address) ? $addres->colonia : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('ciudad', 'Ciudad o delegación', ['class'=>'']) !!} {!! Form::label('ciudad', 'Ciudad o delegación', ['class'=>'']) !!}
{!! Form::text('ciudad', $addres->ciudad, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('ciudad', isset($address) ? $addres->ciudad : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('estado', 'Estado', ['class'=>'']) !!} {!! Form::label('estado', 'Estado', ['class'=>'']) !!}
{!! Form::text('estado', $addres->estado, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('estado', isset($address) ? $addres->estado : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('referencias', 'Referencias', ['class'=>'']) !!} {!! Form::label('referencias', 'Referencias', ['class'=>'']) !!}
{!! Form::text('referencias', $addres->referencias, ['class'=>'form-control','required'=>'required']) !!} {!! Form::text('referencias', isset($address) ? $addres->referencias : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('facturacion', '¿Necesitaras factura?', ['class'=>'']) !!} {!! Form::label('facturacion', '¿Necesitaras factura?', ['class'=>'']) !!}
{!! Form::select('facturacion',['No'=>'No', 'Si'=>'Si'], $addres->facturacion, ['class'=>'form-control','required'=>'required']) !!} {!! Form::select('facturacion',['No'=>'No', 'Si'=>'Si'], isset($address) ? $addres->facturacion : null, ['class'=>'form-control']) !!}
</div> </div>
<div class="form-group"> <div class="form-group">
{!! Form::label('shipping_price_id', 'Tipo de envio', ['class'=>'']) !!} {!! Form::label('shipping_price_id', 'Tipo de envio', ['class'=>'']) !!}
{!! Form::select('shipping_price_id', $shipping, $addres->shipping_price_id != null ? $addres->shipping_price_id : null,['class'=>'form-control','required'=>'required']) !!} {!! Form::select('shipping_price_id', $shipping, isset($address) && $addres->shipping_price_id != null ? $addres->shipping_price_id : null,['class'=>'form-control']) !!}
</div> </div>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
<br> <br>
<button> <button>
Acordar con el vendedor {{ money_format('%(#10n', ($total + $addres->shipping_price->cost)) }} Acordar con el vendedor {{ $sale->home_delivery ? money_format('%(#10n', ($total + $addres->shipping_price->cost)) : money_format('%(#10n', $total ) }}
<br> <br>
<span class="amount_discount"></span> <span class="amount_discount"></span>
</button> </button>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</div> </div>
<br> <br>
<button type="submit"> <button type="submit">
Pagar con paypal {{ money_format('%(#10n', ($total + $addres->shipping_price->cost)) }} Pagar con paypal {{ $sale->home_delivery ? money_format('%(#10n', ($total + $addres->shipping_price->cost)): money_format('%(#10n', $total)}}
<span class="amount_discount"></span> <span class="amount_discount"></span>
</button> </button>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment