Checkout review page added

This commit is contained in:
jitendra 2018-09-27 13:23:26 +05:30
parent 69ada20a2b
commit 19775a4017
17 changed files with 180 additions and 121 deletions

View File

@ -16,6 +16,7 @@ class CreateCartPayment extends Migration
Schema::create('cart_payment', function (Blueprint $table) {
$table->increments('id');
$table->string('method');
$table->string('method_title')->nullable();
$table->integer('cart_id')->nullable()->unsigned();
$table->foreign('cart_id')->references('id')->on('cart');
$table->timestamps();

View File

@ -0,0 +1,43 @@
<?php
namespace Webkul\Cart\Helpers;
use Webkul\Attribute\Repositories\AttributeOptionRepository as AttributeOption;
class Checkout
{
/**
* AttributeOptionRepository object
*
* @var array
*/
protected $attributeOption;
/**
* Create a new helper instance.
*
* @param Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOption
* @return void
*/
public function __construct(AttributeOption $attributeOption)
{
$this->attributeOption = $attributeOption;
}
/**
* Returns the allowed variants
*
* @param CartItem $item
* @return array
*/
public function getItemOptionDetails($item)
{
$data = [];
foreach ($item->product->super_attributes as $attribute) {
}
return $data;
}
}

View File

@ -31,7 +31,7 @@ class Cart extends Model
/**
* Get the biling address for the cart.
*/
public function biling_address()
public function billing_address()
{
return $this->addresses()->where('address_type', 'billing');
}
@ -39,9 +39,9 @@ class Cart extends Model
/**
* Get all of the attributes for the attribute groups.
*/
public function getBilingAddressAttribute()
public function getBillingAddressAttribute()
{
return $this->biling_address()->first();
return $this->billing_address()->first();
}
/**

View File

@ -18,4 +18,12 @@ class CartAddress extends Model
{
return $this->hasMany(CartShippingRate::class);
}
/**
* Get all of the attributes for the attribute groups.
*/
public function getNameAttribute()
{
return $this->first_name . ' ' . $this->last_name;
}
}

View File

@ -8,6 +8,7 @@ use Webkul\Core\Models\Locale as LocaleModel;
use Webkul\Core\Models\Currency as CurrencyModel;
use Webkul\Core\Models\TaxCategory as TaxCategory;
use Webkul\Core\Models\TaxRate as TaxRate;
use Illuminate\Support\Facades\Config;
class Core
{
@ -276,4 +277,21 @@ class Core
return $date->format($format);
}
/**
* Retrieve information from payment configuration
*
* @param string $field
* @param int|string|null $channelId
*
* @return mixed
*/
public function getConfigData($field, $channelId = null)
{
if (null === $channelId) {
$channelId = $this->getCurrentChannel()->id;
}
return Config::get($field);
}
}

View File

@ -21,7 +21,7 @@ class Payment
if($object->isAvailable()) {
$paymentMethods[] = [
'method' => $object->getCode(),
'title' => $object->getTitle(),
'method_title' => $object->getTitle(),
'description' => $object->getDescription(),
];
}

View File

@ -58,14 +58,8 @@ abstract class Payment
*
* @return mixed
*/
public function getConfigData($field, $channelId = null)
public function getConfigData($field)
{
if (null === $channelId) {
$channelId = core()->getCurrentChannel()->id;
}
$paymentConfig = Config::get('paymentmethods.' . $this->getCode());
return $paymentConfig[$field];
return core()->getConfigData('paymentmethods.' . $this->getCode() . '.' . $field);
}
}

View File

@ -67,16 +67,9 @@ abstract class AbstractShipping
*
* @return mixed
*/
public function getConfigData($field, $channelId = null)
public function getConfigData($field)
{
if (null === $channelId) {
$channelId = core()->getCurrentChannel()->id;
}
$shippingConfig = Config::get('carriers.' . $this->getCode());
return $shippingConfig[$field];
return core()->getConfigData('carriers.' . $this->getCode() . '.' . $field);
}
}
?>

View File

@ -1,12 +1,14 @@
//shop variables
$font-color: #242424;
$border-color: #E8E8E8;
$font-size-base: 16px;
$border-color: #c7c7c7;
$border-color: #E8E8E8;
$brand-color: #0031f0;
//shop variables ends here
//=======>Need to be removed
//customer variables
$profile-content-color: #5e5e5e;
$horizontal-rule-color: #E8E8E8;
//customer variables ends here
//customer variables ends here
//<=======Need to be removed

View File

@ -1,6 +1,4 @@
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,500");
@import "icons";
@import "mixins";
@import "variables";
@ -3189,14 +3187,7 @@ section.cart {
.address-card {
width: 50%;
&.left {
float: left;
}
&.right {
float: right;
}
float: left;
.card-title span {
font-weight: 600;

View File

@ -90,7 +90,11 @@ return [
'payment-information' => 'Payment Information',
'summary' => 'Summary of Order',
'price' => 'Price',
'quantity' => 'Quantity'
'quantity' => 'Quantity',
'billing-address' => 'Billing Address',
'shipping-address' => 'Shipping Address',
'contact' => 'Contact',
'place-order' => 'Place Order'
],
'total' => [

View File

@ -88,7 +88,7 @@
<div class="button-group">
<button type="button" class="btn btn-lg btn-primary" @click="placeOrder()">
{{ __('shop::app.checkout.onepage.continue') }}
{{ __('shop::app.checkout.onepage.place-order') }}
</button>
</div>

View File

@ -13,7 +13,7 @@
<span class="radio" >
<input v-validate="'required'" type="radio" id="{{ $payment['method'] }}" name="payment[method]" value="{{ $payment['method'] }}" v-model="payment.method" @change="methodSelected()">
<label class="radio-view" for="{{ $payment['method'] }}"></label>
{{ $payment['title'] }}
{{ $payment['method_title'] }}
</span>
<span class="control-info">{{ $payment['description'] }}</span>

View File

@ -5,37 +5,41 @@
<div class="address">
<div class="address-card shipping-address left">
<div class="card-title">
<span>Shipping address</span>
@if ($billingAddress = $cart->billing_address)
<div class="address-card billing-address">
<div class="card-title">
<span>{{ __('shop::app.checkout.onepage.billing-address') }}</span>
</div>
<div class="card-content">
{{ $billingAddress->name }}</br>
{{ $billingAddress->address1 }}, {{ $billingAddress->address2 ? $billingAddress->address2 . ',' : '' }} {{ $billingAddress->state }}</br>
{{ country()->name($billingAddress->country) }} {{ $billingAddress->postcode }}</br>
<span class="horizontal-rule"></span>
{{ __('shop::app.checkout.onepage.contact') }} : {{ $billingAddress->phone }}
</div>
</div>
@endif
<div class="card-content">
John Doe</br>
25 , Washington</br>
USA 5751434</br>
<span class="horizontal-rule"></span>
@if ($shippingAddress = $cart->shipping_address)
<div class="address-card shipping-address">
<div class="card-title">
<span>{{ __('shop::app.checkout.onepage.shipping-address') }}</span>
</div>
Contact : 9876543210
<div class="card-content">
{{ $shippingAddress->name }}</br>
{{ $shippingAddress->address1 }}, {{ $shippingAddress->address2 ? $shippingAddress->address2 . ',' : '' }} , {{ $shippingAddress->state }}</br>
{{ country()->name($shippingAddress->country) }} {{ $shippingAddress->postcode }}</br>
<span class="horizontal-rule"></span>
{{ __('shop::app.checkout.onepage.contact') }} : {{ $shippingAddress->phone }}
</div>
</div>
</div>
<div class="address-card billing-addres right">
<div class="card-title">
<span>Billing address</span>
</div>
<div class="card-content">
John Doe</br>
25 , Washington</br>
USA 5751434</br>
<span class="horizontal-rule"></span>
Contact : 9876543210
</div>
</div>
@endif
</div>
@ -79,9 +83,15 @@
</span>
</div>
<div class="summary" >
Color : Gray, Size : S
</div>
@if ($product->type == 'configurable')
<div class="summary" >
@foreach ($product->super_attributes as $attribute)
{{ $attribute->name . ' : ' . $product->{$attribute->code} }},
@endforeach
</div>
@endif
</div>
</div>
@ -91,7 +101,7 @@
<div class="order-description">
<div class="pull-left">
<div class="pull-left" style="width: 50%;">
<div class="shipping">
<div class="decorator">
@ -99,10 +109,10 @@
</div>
<div class="text">
$ 25.00
{{ core()->currency($cart->selected_shipping_rate->base_price) }}
<div class="info">
FedEx Shipping
{{ $cart->selected_shipping_rate->method_title }}
</div>
</div>
</div>
@ -113,13 +123,13 @@
</div>
<div class="text">
Net banking
{{ core()->getConfigData('paymentmethods.' . $cart->payment->method . '.title') }}
</div>
</div>
</div>
<div class="pull-right">
<div class="pull-right" style="width: 50%;">
@include('shop::checkout.total.summary', ['cart' => $cart])

View File

@ -11,7 +11,7 @@
<span class="breadcrumb">Home</span> > <span class="breadcrumb">Men</span> > <span class="breadcrumb">Slit Open Jeans</span>
</div>
<div class="layouter">
<form method="POST" action="{{ route('cart.add', $product->id) }}">
<form method="POST" action="{{ route('cart.add', $product->id) }}" @submit.prevent="onSubmit">
@csrf()
<input type="hidden" name="product" value="{{ $product->id }}">

View File

@ -49,6 +49,8 @@
template: '#product-options-template',
inject: ['$validator'],
data: () => ({
config: @json($config),

View File

@ -147,7 +147,7 @@ body {
.header .header-top div.left-content ul.search-container li.search-group .search-field {
height: 38px;
border: 2px solid #c7c7c7;
border: 2px solid #E8E8E8;
border-radius: 3px;
border-right: none;
border-top-right-radius: 0px;
@ -162,7 +162,7 @@ body {
box-sizing: border-box;
height: 38px;
width: 38px;
border: 2px solid #c7c7c7;
border: 2px solid #E8E8E8;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
@ -192,7 +192,7 @@ body {
.header .header-top div.right-content ul.account-dropdown-container {
float: right;
border-right: 2px solid #c7c7c7;
border-right: 2px solid #E8E8E8;
}
.header .header-top div.right-content ul.account-dropdown-container li.account-dropdown {
@ -473,8 +473,8 @@ body {
display: none;
}
.header .search-suggestion .search-content {
border-top: 1px solid #c7c7c7;
border-bottom: 1px solid #c7c7c7;
border-top: 1px solid #E8E8E8;
border-bottom: 1px solid #E8E8E8;
height: 48px;
}
.header .search-suggestion .search-content .icon.search-icon {
@ -493,7 +493,7 @@ body {
margin-top: 14px;
height: 32px;
margin-bottom: 14px;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
.header .search-suggestion .suggestion span {
margin-left: 48px;
@ -513,7 +513,7 @@ body {
}
.header .header-bottom .nav > li {
float: none;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
.header .header-bottom .nav > li a {
margin-left: 10px;
@ -524,7 +524,7 @@ body {
margin-right: 5px;
}
.header .header-bottom .nav > li:first-child {
border-top: 1px solid #c7c7c7;
border-top: 1px solid #E8E8E8;
}
.header .header-bottom .nav > li:last-child {
float: none;
@ -634,7 +634,7 @@ body {
}
.header .header-bottom .nav > li {
float: none;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
.header .header-bottom .nav > li a {
margin-left: 10px;
@ -645,7 +645,7 @@ body {
margin-right: 5px;
}
.header .header-bottom .nav > li:first-child {
border-top: 1px solid #c7c7c7;
border-top: 1px solid #E8E8E8;
}
.header .header-bottom .nav > li:last-child {
float: none;
@ -772,13 +772,13 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
}
.layered-filter-wrapper .filter-title {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
color: #242424;
padding: 10px 0;
}
.layered-filter-wrapper .filter-attributes .filter-attributes-item {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
padding-bottom: 10px;
}
@ -1144,7 +1144,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
font-size: 12px;
}
.main-container-wrapper .top-toolbar {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
margin-bottom: 10px;
}
.main-container-wrapper .top-toolbar .page-info span:first-child {
@ -1218,7 +1218,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
font-size: 12px;
}
.main-container-wrapper .top-toolbar {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
margin-bottom: 10px;
}
.main-container-wrapper .top-toolbar .page-info span:first-child {
@ -1379,7 +1379,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
display: -ms-flexbox;
display: flex;
background: #f2f2f2;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
@ -1454,7 +1454,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
-webkit-box-pack: start;
-ms-flex-pack: start;
justify-content: flex-start;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
background: #f2f2f2;
width: 25%;
height: 100%;
@ -1479,7 +1479,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
text-align: center;
}
@ -1521,7 +1521,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.account-content .profile-content {
@ -1556,7 +1556,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
display: -ms-flexbox;
display: flex;
background: #f2f2f2;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
@ -1837,7 +1837,7 @@ section.product-detail div.layouter form .details .attributes {
section.product-detail div.layouter form .details {
width: 100%;
margin-top: 20px;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
section.product-detail div.layouter form .details .attributes {
border-bottom: none;
@ -1886,7 +1886,7 @@ section.product-detail div.layouter form .details .attributes {
section.product-detail div.layouter form .details {
width: 100%;
margin-top: 20px;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
section.product-detail div.layouter form .details .attributes {
border-bottom: none;
@ -2019,7 +2019,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.cart .right-side .price-section .total-details {
@ -2071,7 +2071,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
margin-bottom: 9px;
}
@ -2166,7 +2166,7 @@ section.cart .cart-content {
width: 60px;
text-align: center;
line-height: 38px;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
border-radius: 3px;
margin-right: 30px;
}
@ -2282,7 +2282,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.order .order-section-head-small {
@ -2352,7 +2352,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.order .order-details {
@ -2486,7 +2486,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.order .order-information {
@ -2554,7 +2554,7 @@ section.cart .cart-content {
margin-bottom: 13px;
}
.order .order-section-head-small .horizon-rule {
border: 0.5px solid #c7c7c7;
border: 0.5px solid #E8E8E8;
width: 150%;
margin-left: -10%;
margin-right: -10%;
@ -2616,7 +2616,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.order .order-details {
display: none;
@ -2687,7 +2687,7 @@ section.cart .cart-content {
display: none;
}
.order .product-config {
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
height: 19%;
width: 100%;
margin-top: 10px;
@ -2778,7 +2778,7 @@ section.cart .cart-content {
margin-bottom: 13px;
}
.order .order-section-head-small .horizon-rule {
border: 0.5px solid #c7c7c7;
border: 0.5px solid #E8E8E8;
width: 150%;
margin-left: -10%;
margin-right: -10%;
@ -2840,7 +2840,7 @@ section.cart .cart-content {
width: 100%;
height: 1px;
vertical-align: middle;
background: #c7c7c7;
background: #E8E8E8;
}
.order .order-details {
display: none;
@ -2911,7 +2911,7 @@ section.cart .cart-content {
display: none;
}
.order .product-config {
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
height: 19%;
width: 100%;
margin-top: 10px;
@ -2992,7 +2992,7 @@ section.cart .cart-content {
justify-content: space-between;
width: 100%;
padding-bottom: 15px;
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}
.checkout-process .col-main ul.checkout-steps li {
@ -3010,7 +3010,7 @@ section.cart .cart-content {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
background-repeat: no-repeat;
background-position: center;
}
@ -3071,7 +3071,7 @@ section.cart .cart-content {
}
.checkout-process .col-main .step-content .form-container {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
padding-top: 20px;
padding-bottom: 20px;
}
@ -3095,16 +3095,9 @@ section.cart .cart-content {
.checkout-process .col-main .step-content .address .address-card {
width: 50%;
}
.checkout-process .col-main .step-content .address .address-card.left {
float: left;
}
.checkout-process .col-main .step-content .address .address-card.right {
float: right;
}
.checkout-process .col-main .step-content .address .address-card .card-title span {
font-weight: 600;
}
@ -3123,7 +3116,7 @@ section.cart .cart-content {
}
.checkout-process .col-main .step-content .cart-item-list .item {
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
border-radius: 3px;
padding: 20px;
}
@ -3154,7 +3147,7 @@ section.cart .cart-content {
height: 48px;
width: 48px;
border-radius: 50%;
border: 1px solid #c7c7c7;
border: 1px solid #E8E8E8;
vertical-align: middle;
display: inline-block;
text-align: center;
@ -3194,7 +3187,7 @@ section.cart .cart-content {
.checkout-process .order-summary .payble-amount {
margin-top: 17px;
border-top: 1px solid #c7c7c7;
border-top: 1px solid #E8E8E8;
padding-top: 12px;
}
@ -3382,7 +3375,7 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p
-webkit-box-direction: normal;
-ms-flex-direction: row;
flex-direction: row;
border-top: 1px solid #c7c7c7;
border-top: 1px solid #E8E8E8;
}
.cusomer-section .customer-section-info .pro-img {
@ -3419,5 +3412,5 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p
}
.cusomer-section .customer-section-info:last-child {
border-bottom: 1px solid #c7c7c7;
border-bottom: 1px solid #E8E8E8;
}