Customer Account Section Mostly Completed Upto 80%

This commit is contained in:
prashant-webkul 2018-08-23 18:41:56 +05:30
parent 20d486cc17
commit 1bff70bd7b
37 changed files with 904 additions and 134 deletions

View File

@ -28,7 +28,7 @@ class SliderRepository extends Repository
*/
public function create(array $data)
{
$image = request()->hasFile('image');
$image = request()->file('image');
$image_name = uniqid(20).'.'.$image->getClientOriginalExtension();

View File

@ -0,0 +1,132 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Repositories\CustomerAddressRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class AddressController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
protected $address;
public function __construct(CustomerRepository $customer, CustomerAddressRepository $address)
{
$this->middleware('auth:customer');
$this->_config = request('_config');
$this->customer = $customer;
$this->address = $address;
}
/**
* Getting logged in
* customer helper
* @return Array
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
/**
* Getting logged in
* customer address
* helper
* @return Array
*/
private function getAddress($id) {
$address = collect($this->address->findOneWhere(['id'=>$id]));
return $address;
}
/**
* Address Route
* index page
* @return View
*/
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
$address = $this->getAddress($id);
if(count($address)==0)
return view($this->_config['view'])->with('address', 'You don\'t have any addresses saved yet, create new.');
else
return view($this->_config['view'])->with('address', $address);
}
/**
* Show the address
* create form
* @return View
*/
public function show() {
return view($this->_config['view']);
}
/**
* Create a new
* address for
* customer.
*
* @return View
*/
public function create() {
$id = auth()->guard('customer')->user()->id;
$this->validate(request(), [
'address1' => 'string|required',
'address1' => 'string|required',
'country' => 'string|required',
'state' => 'string|required',
'city' => 'string|required',
'pincode' => 'numeric|required',
]);
$data = collect(request()->input())->except('_token')->toArray();
dd($data);
}
/**
* For editing the
* existing address
* of the customer
*
* @return View
*/
public function edit() {
return view($this->_config['view']);
}
}

View File

@ -4,8 +4,9 @@ namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Routing\Controller;
use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Customer\Models\Customer;
use Auth;
/**
* Customer controlller for the customer
@ -24,10 +25,14 @@ class CustomerController extends Controller
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct()
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
$this->middleware('auth:customer');
}
/**
@ -36,23 +41,104 @@ class CustomerController extends Controller
* authentication
* @return view
*/
private function getCustomer($id)
{
$customer = collect(Customer::find($id));
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function profile()
{
/**
* Taking the customer
* to profile details
* page
* @return View
*/
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function editProfile()
{
/**
* For loading the
* edit form page.
*
* @return View
*/
public function editIndex() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
/**
* Edit function
* for editing customer
* profile.
*
* @return Redirect.
*/
public function edit() {
$id = auth()->guard('customer')->user()->id;
$this->validate(request(), [
'first_name' => 'string',
'last_name' => 'string',
'gender' => 'required',
'date_of_birth' => 'date',
'phone' => 'string|size:10',
'email' => 'email|unique:customers,email,'.$id,
'password' => 'confirmed|required_if:oldpassword,!=,null'
]);
$data = collect(request()->input())->except('_token')->toArray();
if($data['oldpassword'] == null) {
$data = collect(request()->input())->except(['_token','password','password_confirmation','oldpassword'])->toArray();
if($this->customer->update($data, $id)) {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
} else {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
}
} else {
$data = collect(request()->input())->except(['_token','oldpassword'])->toArray();
$data['password'] = bcrypt($data['password']);
if($this->customer->update($data, $id)) {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
} else {
Session()->flash('success','Profile Updated Successfully');
return redirect()->back();
}
}
}
public function orders() {
return view($this->_config['view']);
}
public function wishlist() {
return view($this->_config['view']);
}
public function reviews() {
return view($this->_config['view']);
}
public function address() {
return view($this->_config['view']);
}
}

View File

@ -0,0 +1,59 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class OrdersController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
$this->middleware('auth:customer');
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function orders() {
return view($this->_config['view']);
}
}

View File

@ -8,7 +8,7 @@ use Illuminate\Routing\Controller;
use Webkul\Customer\Repositories\CustomerRepository;
/**
* Dashboard controller
* Registration controller
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
@ -21,10 +21,13 @@ class RegistrationController extends Controller
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct()
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
}
/**
@ -43,7 +46,7 @@ class RegistrationController extends Controller
*/
public function create(Request $request)
{
// return $request->except('_token'); //don't let csrf token to be openly printed
$request->validate([
'first_name' => 'string|required',
@ -53,13 +56,9 @@ class RegistrationController extends Controller
]);
$customer = new \Webkul\Customer\Models\Customer();
$customer->first_name = $request->first_name;
$customer->last_name = $request->last_name;
$customer->email = $request->email;
$customer->password = bcrypt($request->password);
$registrationData = $request->except('_token');
if ($customer->save()) {
if ($this->customer->create($registrationData)) {
session()->flash('success', 'Account created successfully.');
return redirect()->route($this->_config['redirect']);

View File

@ -0,0 +1,59 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class ReviewsController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
$this->middleware('auth:customer');
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function reviews() {
return view($this->_config['view']);
}
}

View File

@ -25,6 +25,7 @@ class SessionController extends Controller
public function __construct()
{
$this->_config = request('_config');
$this->middleware('auth:customer')->except(['show','create']);
}
public function show()
@ -39,11 +40,9 @@ class SessionController extends Controller
'password' => 'required'
]);
// $remember = request('remember');
if (!auth()->guard('customer')->attempt(request(['email', 'password']))) {
dd('cannot be authorized');
session()->flash('error', 'Please check your credentials and try again.');
session()->flash('error', 'Please check your credentials and try again.');
return back();
}

View File

@ -0,0 +1,59 @@
<?php
namespace Webkul\Customer\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Webkul\Customer\Repositories\CustomerRepository;
use Auth;
/**
* Customer controlller for the customer
* basically for the tasks of customers
* which will be done after customer
* authenticastion.
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class WishlistController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
protected $_config;
protected $customer;
public function __construct(CustomerRepository $customer)
{
$this->_config = request('_config');
$this->customer = $customer;
$this->middleware('auth:customer');
}
/**
* For taking the customer
* to the dashboard after
* authentication
* @return view
*/
private function getCustomer($id) {
$customer = collect($this->customer->findOneWhere(['id'=>$id]));
return $customer;
}
public function index() {
$id = auth()->guard('customer')->user()->id;
$customer = $this->getCustomer($id);
return view($this->_config['view'])->with('customer', $customer);
}
public function wishlist() {
return view($this->_config['view']);
}
}

View File

@ -9,6 +9,13 @@ use Illuminate\Support\Facades\URL;
class Menu
{
public $items = array();
public $current;
public $currentKey;
public function __construct() {
$this->current = Request::url();
}
public static function create($callback)
{
@ -26,4 +33,19 @@ class Menu
];
array_push($this->items, $item);
}
/**
* Method to find the active links
*
* @param array $item Item that
* needs to be checked if active
* @return string
*/
public function getActive($item)
{
$url = trim($item['url'], '/');
if ((strpos($this->current, $url) !== false) || (strpos($this->currentKey, $item['key']) === 0)) {
return 'active';
}
}
}

View File

@ -15,5 +15,6 @@ class Customer extends Authenticatable
use Notifiable;
protected $table = 'customers';
protected $fillable = ['first_name','last_name','gender','date_of_birth','phone','email','password'];
protected $hidden = ['password','remember_token'];
}

View File

@ -34,8 +34,17 @@ class EventServiceProvider extends ServiceProvider
});
Event::listen('customer.menu.build', function ($menu) {
$menu->add('customer.account.profile', 'Profile');
$menu->add('customer.account.profile', 'Wishlist');
$menu->add('customer.profile.index', 'Profile');
$menu->add('customer.orders.index', 'Orders');
$menu->add('customer.address.index', 'Address');
$menu->add('customer.reviews.index', 'Reviews');
$menu->add('customer.wishlist.index', 'Wishlist');
});
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace Webkul\Customer\Repositories;
use Webkul\Core\Eloquent\Repository;
/**
* Customer Reposotory
*
* @author Prashant Singh <prashant.singh852@webkul.com>
* @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com)
*/
class CustomerAddressRepository extends Repository
{
/**
* Specify Model class name
*
* @return mixed
*/
function model()
{
return 'Webkul\Customer\Models\CustomersAddress';
}
/**
* @param array $data
* @return mixed
*/
public function create(array $data)
{
$address = $this->model->create($data);
return $address;
}
/**
* @param array $data
* @param $id
* @param string $attribute
* @return mixed
*/
public function update(array $data, $id, $attribute = "id")
{
$address = $this->find($id);
$address->update($data);
return $address;
}
}

View File

@ -2,7 +2,7 @@
namespace Webkul\Customer\Repositories;
use Webkul\Customer\Eloquent\Repository;
use Webkul\Core\Eloquent\Repository;
/**
* Customer Reposotory
@ -45,7 +45,7 @@ class CustomerRepository extends Repository
public function update(array $data, $id, $attribute = "id")
{
$customer = $this->findOrFail($id);
$customer = $this->find($id);
$customer->update($data);

View File

@ -31,8 +31,8 @@ use Webkul\Channel\Channel as Channel;
$current_channel = core()->getCurrentChannel();
$all_sliders = $this->sliders->findOneWhere(['channel_id'=>$current_channel['id']]);
$all_sliders = $this->sliders->findWhere(['channel_id'=>$current_channel['id']]);
return view($this->_config['view'])->with('data',$all_sliders);
return view($this->_config['view'])->with('sliderData',$all_sliders->toArray());
}
}

View File

@ -4,14 +4,12 @@ Route::group(['middleware' => ['web']], function () {
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
'view' => 'shop::home.index'
]);
])->name('store.home');
Route::get('/categories/{slug}', 'Webkul\Shop\Http\Controllers\CategoryController@index')->defaults('_config', [
'view' => 'shop::products.index'
]);
Route::view('/cart', 'shop::store.product.view.cart.index');
Route::view('/products/{slug}', 'shop::store.product.details.index');
//customer routes starts here
@ -23,7 +21,7 @@ Route::group(['middleware' => ['web']], function () {
])->name('customer.session.index');
Route::post('login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [
'redirect' => 'customer.account.profile'
'redirect' => 'customer.account.index'
])->name('customer.session.create');
@ -33,7 +31,7 @@ Route::group(['middleware' => ['web']], function () {
])->name('customer.register.index');
Route::post('register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [
'redirect' => 'customer.account.profile',
'redirect' => 'customer.account.index',
])->name('customer.register.create'); //redirect attribute will get changed immediately to account.index when account's index page will be made
// Auth Routes
@ -44,16 +42,75 @@ Route::group(['middleware' => ['web']], function () {
'redirect' => 'customer.session.index'
])->name('customer.session.destroy');
Route::view('/cart', 'shop::store.product.view.cart.index')->name('customer.cart');
Route::view('/product', 'shop::store.product.details.home.index')->name('customer.product');
Route::view('/product/review', 'shop::store.product.review.index')->name('customer.product.review');
//customer account
Route::prefix('account')->group(function () {
Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@profile')->defaults('_config', [
Route::get('account/index', 'Webkul\Customer\Http\Controllers\AccountController@index')->defaults('_config', [
'view' => 'shop::customers.account.index'
])->name('customer.account.index');
/* Profile Routes Starts Here */
Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@index')->defaults('_config', [
'view' => 'shop::customers.account.profile.index'
])->name('customer.account.profile');
])->name('customer.profile.index');
//profile edit
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editProfile')->defaults('_config', [
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@editIndex')->defaults('_config', [
'view' => 'shop::customers.account.profile.edit'
])->name('customer.profile.edit');
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [
'view' => 'shop::customers.account.profile.edit'
])->name('customer.profile.edit');
/* Profile Routes Ends Here */
/* Routes for Addresses */
Route::get('address/index', 'Webkul\Customer\Http\Controllers\AddressController@index')->defaults('_config', [
'view' => 'shop::customers.account.address.address'
])->name('customer.address.index');
Route::get('address/create', 'Webkul\Customer\Http\Controllers\AddressController@show')->defaults('_config', [
'view' => 'shop::customers.account.address.create'
])->name('customer.address.create');
Route::post('address/create', 'Webkul\Customer\Http\Controllers\AddressController@create')->defaults('_config', [
'view' => 'shop::customers.account.address.address'
])->name('customer.address.create');
Route::get('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [
'view' => 'shop::customers.account.address.address'
])->name('customer.address.edit');
Route::post('address/edit', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [
'view' => 'shop::customers.account.address.address'
])->name('customer.address.edit');
/* Routes for Addresses ends here */
/* Wishlist route */
Route::get('wishlist', 'Webkul\Customer\Http\Controllers\WishlistController@wishlist')->defaults('_config', [
'view' => 'shop::customers.account.wishlist.wishlist'
])->name('customer.wishlist.index');
/* Orders route */
Route::get('orders', 'Webkul\Customer\Http\Controllers\OrdersController@orders')->defaults('_config', [
'view' => 'shop::customers.account.orders.orders'
])->name('customer.orders.index');
/* Reviews route */
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
'view' => 'shop::customers.account.reviews.reviews'
])->name('customer.reviews.index');
});
});
});

View File

@ -1,41 +0,0 @@
<?php
namespace Webkul\Customer\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\View;
use Webkul\Shop\Menu;
class EventServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
$this->createStoreNavigationMenu();
}
/**
* This method fires an event for menu creation, any package can add their menu item by listening to the customer.menu.build event
*
* @return void
*/
public function createStoreNavigationMenu()
{
Event::listen('shop.navmenu.create', function () {
return Menu::create(function ($menu) {
Event::fire('shop.navmenu.build', $menu);
});
});
Event::listen('shop.navmenu.build', function ($menu) {
$menu->add('customer.account.profile', 'Profile');
$menu->add('customer.account.profile', 'Wishlist');
});
}
}

View File

@ -4,8 +4,6 @@ window.VeeValidate = require("vee-validate");
Vue.use(VeeValidate);
//pure JS for resizing of browser purposes only
Vue.component("category-nav", require("./components/category-nav.vue"));
Vue.component("category-item", require("./components/category-item.vue"));
Vue.component("image-slider", require("./components/image-slider.vue"));

View File

@ -9,7 +9,7 @@
:parent="index">
</category-item>
<li>
<img src="vendor/webkul/shop/assets/images/offer-zone.svg"/>
<img src="http://localhost/bagisto/public/vendor/webkul/shop/assets/images/offer-zone.svg"/>
<span>Offer Zone</span>
</li>

View File

@ -849,11 +849,12 @@ section.slider-block {
//edit form
.edit-form-content {
padding: 0px 25px;
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
.edit-text {
.title {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
@ -863,13 +864,36 @@ section.slider-block {
.edit-form {
display: flex;
background: $background-color;
border: 1px solid $border-color;
flex-direction: column;
min-height: 345px;
padding: 25px;
// padding: 25px;
}
}
//edit form ends
//address form
.address-form-content {
padding: 0px 25px;
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
.title {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
font-size: 24px;
}
.address-form {
display: flex;
background: $background-color;
flex-direction: column;
min-height: 345px;
// padding: 25px;
}
}
//address form ends
}
//account ends here

View File

@ -0,0 +1,63 @@
@extends('shop::layouts.master')
@section('content-wrapper')
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<div class="profile">
<div class="section-head">
<span class="profile-heading">Address</span>
<span class="profile-edit"><a href="{{ route('customer.address.edit') }}">Edit</a></span>
<div class="horizontal-rule"></div>
</div>
<div class="profile-content">
@if(gettype($address) == "string")
<div>You don't have any saved addresses here, please create a new one by clicking the link below.</div>
<br/>
<a href="{{ route('customer.address.create') }}">Create Address</a>
@else
<table>
<thead>
<tr>
<td>Address 1</td>
<td>Address 2</td>
<td>Country</td>
<td>State</td>
<td>City</td>
<td>Postcode</td>
</tr>
</thead>
<tbody>
<tr>
<td>One</td>
<td>One</td>
<td>One</td>
<td>One</td>
<td>One</td>
<td>One</td>
</tr>
</tbody>
</table>
@endif
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,59 @@
@extends('shop::layouts.master')
@section('content-wrapper')
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<div class="address-form-content">
<div class="title">Add Address</div>
<form method="post" action="{{ route('customer.address.create') }}">
<div class="edit-form">
@csrf
<div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']">
<label for="first_name">Address Line 1</label>
<input type="text" class="control" name="address1" v-validate="'required'">
<span class="control-error" v-if="errors.has('address1')">@{{ errors.first('address1') }}</span>
</div>
<div class="control-group" :class="[errors.has('address2') ? 'has-error' : '']">
<label for="address2">Address Line 2</label>
<input type="text" class="control" name="address2" v-validate="'required'">
<span class="control-error" v-if="errors.has('address2')">@{{ errors.first('address2') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country">Country</label>
<input type="text" class="control" name="country" v-validate="'required'">
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state">state</label>
<input type="text" class="control" name="state" v-validate="'required'">
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
<label for="city">city</label>
<input type="text" class="control" name="city" v-validate="'required'">
<span class="control-error" v-if="errors.has('city')">@{{ errors.first('city') }}</span>
</div>
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
<label for="postcode">Postcode</label>
<input type="text" class="control" name="postcode" v-validate="'required|digits:6'">
<span class="control-error" v-if="errors.has('postcode')">@{{ errors.first('postcode') }}</span>
</div>
<div class="button-group">
<input class="btn btn-primary btn-lg" type="submit" value="Create Address">
</div>
</div>
</form>
</div>
</div>
@endsection

View File

@ -0,0 +1,59 @@
@extends('shop::layouts.master')
@section('content-wrapper')
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<div class="address-form-content">
<div class="title">Add Address</div>
<form method="post" action="{{ route('customer.address.create') }}">
<div class="edit-form">
@csrf
<div class="control-group" :class="[errors.has('address1') ? 'has-error' : '']">
<label for="first_name">Address Line 1</label>
<input type="text" class="control" name="address1" v-validate="'required'">
<span class="control-error" v-if="errors.has('address1')">@{{ errors.first('address1') }}</span>
</div>
<div class="control-group" :class="[errors.has('address2') ? 'has-error' : '']">
<label for="address2">Address Line 2</label>
<input type="text" class="control" name="address2" v-validate="'required'">
<span class="control-error" v-if="errors.has('address2')">@{{ errors.first('address2') }}</span>
</div>
<div class="control-group" :class="[errors.has('country') ? 'has-error' : '']">
<label for="country">Country</label>
<input type="text" class="control" name="country" v-validate="'required'">
<span class="control-error" v-if="errors.has('country')">@{{ errors.first('country') }}</span>
</div>
<div class="control-group" :class="[errors.has('state') ? 'has-error' : '']">
<label for="state">state</label>
<input type="text" class="control" name="state" v-validate="'required'">
<span class="control-error" v-if="errors.has('state')">@{{ errors.first('state') }}</span>
</div>
<div class="control-group" :class="[errors.has('city') ? 'has-error' : '']">
<label for="city">city</label>
<input type="text" class="control" name="city" v-validate="'required|digits:10'">
<span class="control-error" v-if="errors.has('city')">@{{ errors.first('city') }}</span>
</div>
<div class="control-group" :class="[errors.has('postcode') ? 'has-error' : '']">
<label for="postcode">Postcode</label>
<input type="text" class="control" name="postcode" v-validate="'required|digits:10'">
<span class="control-error" v-if="errors.has('postcode')">@{{ errors.first('postcode') }}</span>
</div>
<div class="button-group">
<input class="btn btn-primary btn-lg" type="submit" value="Create Address">
</div>
</div>
</form>
</div>
</div>
@endsection

View File

@ -0,0 +1,7 @@
@extends('shop::layouts.master')
@section('content-wrapper')
<div class="account-content">
@include('shop::customers.account.partials.sidemenu')
<h1>Account Index Page</h1>
</div>
@endsection

View File

@ -0,0 +1 @@
<h1>Customer past orders page</h1>

View File

@ -1,5 +1,7 @@
<ul class="account-side-menu">
@foreach($menu->items as $key=>$value)
<li class="{{ request()->is('*/account/profile') ? 'active' : '' }}"><a href="{{ $value['url'] }}">{{ $value['name'] }}</a></li>
<li><a href="{{ $value['url'] }}">{{ $value['name'] }}</a></li>
@endforeach
</ul>

View File

@ -7,63 +7,67 @@
<div class="edit-form-content">
<div class="edit-text">Edit Profile</div>
<div class="title">Edit Profile</div>
<form method="post" action="{{ route('customer.register.create') }}">
<form method="post" action="{{ route('customer.profile.edit') }}">
<div class="edit-form">
@csrf
{{ csrf_field() }}
<div class="control-group">
<div class="control-group" :class="[errors.has('first_name') ? 'has-error' : '']">
<label for="first_name">First Name</label>
<input type="text" class="control" name="first_name" value="{{ $customer['first_name'] }}" v-validate="'required'">
<span>@{{ errors.first('first_name') }}</span>
<span class="control-error" v-if="errors.has('first_name')">@{{ errors.first('first_name') }}</span>
</div>
<div class="control-group">
<div class="control-group" :class="[errors.has('last_name') ? 'has-error' : '']">
<label for="last_name">Last Name</label>
<input type="text" class="control" name="last_name" value="{{ $customer['last_name'] }}" v-validate="'required'">
<span>@{{ errors.first('last_name') }}</span>
<span class="control-error" v-if="errors.has('last_name')">@{{ errors.first('last_name') }}</span>
</div>
<div class="control-group">
<div class="control-group" :class="[errors.has('gender') ? 'has-error' : '']">
<label for="email">Gender</label>
<select name="gender" class="control" v-validate="'required'">
<option value="Male" @if($customer['gender']=="Male") selected @endif>Male</option>
<option value="Female" @if($customer['gender']=="Female") selected @endif>Female</option>
</select>
<span class="control-error" v-if="errors.has('gender')">@{{ errors.first('gender') }}</span>
</div>
<div class="control-group" :class="[errors.has('date_of_birth') ? 'has-error' : '']">
<label for="date_of_birth">Date of Birth</label>
<input type="date" class="control" name="date_of_birth" value="{{ $customer['date_of_birth'] }}" v-validate="'required'">
<span class="control-error" v-if="errors.has('date_of_birth')">@{{ errors.first('date_of_birth') }}</span>
</div>
<div class="control-group" :class="[errors.has('phone') ? 'has-error' : '']">
<label for="phone">Phone</label>
<input type="text" class="control" name="phone" value="{{ $customer['phone'] }}" v-validate="'required|digits:10'">
<span class="control-error" v-if="errors.has('phone')">@{{ errors.first('phone') }}</span>
</div>
<div class="control-group" :class="[errors.has('email') ? 'has-error' : '']">
<label for="email">Email</label>
<input type="email" class="control" name="email" value="{{ $customer['email'] }}" v-validate="'required'">
<span>@{{ errors.first('email') }}</span>
<span class="control-error" v-if="errors.has('email')">@{{ errors.first('email') }}</span>
</div>
<div class="control-group">
<label for="email">Gender</label>
<select name="gender" class="control" value="{{ $customer['gender'] }}" v-validate="'required'">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
<span>@{{ errors.first('gender') }}</span>
<div class="control-group" :class="[errors.has('old_password') ? 'has-error' : '']">
<label for="password">Old Password</label>
<input type="oldpassword" class="control" name="oldpassword">
<span class="control-error" v-if="errors.has('oldpassword')">@{{ errors.first('oldpassword') }}</span>
</div>
<div class="control-group">
<label for="dob">Date of Birth</label>
<input type="date" class="control" name="dob" value="{{ $customer['date_of_birth'] }}" v-validate="'required'">
<span>@{{ errors.first('first_name') }}</span>
</div>
<div class="control-group">
<label for="phone">Phone</label>
<input type="text" class="control" name="phone" value="{{ $customer['phone'] }}" v-validate="'required'">
<span>@{{ errors.first('phone') }}</span>
</div>
<div class="control-group">
<div class="control-group" :class="[errors.has('password') ? 'has-error' : '']">
<label for="password">Password</label>
<input type="password" class="control" name="password">
<span>@{{ errors.first('password') }}</span>
<span class="control-error" v-if="errors.has('password')">@{{ errors.first('password') }}</span>
</div>
<div class="control-group">
<label for="password">Confirm Password</label>
<input type="password" class="control" name="password">
<input type="password" class="control" name="password_confirmation">
<span>@{{ errors.first('password') }}</span>
</div>

View File

@ -0,0 +1 @@
<h1>Customer Reviews page</h1>

View File

@ -0,0 +1 @@
<h1>Wishlist page here</h1>

View File

@ -1,3 +1,3 @@
<section class="slider-block">
<image-slider :slides='@json($data)'> </image-slider>
<image-slider :slides='@json($sliderData)'> </image-slider>
</section>

View File

@ -7,7 +7,7 @@
<ul class="logo-container">
<li>
<a href="">
<img class="logo" src="vendor/webkul/shop/assets/images/logo.svg" />
<img class="logo" src="{{ asset('vendor/webkul/shop/assets/images/logo.svg') }}" />
</a>
</li>
</ul>
@ -48,6 +48,7 @@
</div>
@guest
<div class="dropdown-list bottom-right" style="display: none;">
<div class="dropdown-container">
@ -62,6 +63,27 @@
</div>
</div>
@endguest
@auth('customer')
<div class="dropdown-list bottom-right" style="display: none;">
<div class="dropdown-container">
<label>Account</label>
<ul>
<li><a href="{{ route('customer.account.index') }}">Account</a></li>
<li><a href="{{ route('customer.profile.index') }}">Profile</a></li>
<li><a href="{{ route('customer.wishlist.index') }}">Wishlist</a></li>
<li><a href="{{ route('customer.cart') }}">Cart</a></li>
<li><a href="{{ route('customer.orders.index') }}">Orders</a></li>
<li><a href="{{ route('customer.session.destroy') }}">Logout</a></li>
</ul>
</div>
</div>
@endauth
</li>
@ -119,35 +141,43 @@
window.width = $(document).width();
window.height = $(document).height();
if (window.width < 785) {
$(".header").css("margin-bottom", "0");
$(".header-top").css("margin-bottom", "0");
$("ul.search-container").css("display", "none");
$(".header-bottom").css("display", "none");
$("div.right-content").css("display", "none");
$(".right-responsive").css("display", "inherit");
} else if (window.width > 785) {
$(".header").css("margin-bottom", "21px");
$(".header-top").css("margin-bottom", "16px");
$("ul.search-container").css("display", "inherit");
$(".header-bottom").css("display", "block");
$("div.right-content").css("display", "inherit");
$(".right-responsive").css("display", "none");
}
});
$(document).ready(function (){
/* Responsiveness script goes here */
var w = $(document).width();
var window = {};
window.width = $(document).width();
window.height = $(document).height();
if (window.width < 785) {
$(".header").css("margin-bottom", "0");
$(".header-top").css("margin-bottom", "0");
$("ul.search-container").css("display", "none");
$(".header-bottom").css("display", "none");
$("div.right-content").css("display", "none");
$(".right-responsive").css("display", "inherit");
}
/* Responsiveness script ends here */
});

View File

@ -952,12 +952,13 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
}
.account-content .edit-form-content {
padding: 0px 25px;
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
}
.account-content .edit-form-content .edit-text {
.account-content .edit-form-content .title {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
@ -969,13 +970,37 @@ section.slider-block div.slider-content div.slider-control .light-right-icon {
display: -ms-flexbox;
display: flex;
background: #ffffff;
border: 1px solid #c7c7c7;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-height: 345px;
padding: 25px;
}
.account-content .address-form-content {
padding: 0px 25px;
margin-left: 5.5%;
margin-top: 1%;
width: 100%;
}
.account-content .address-form-content .title {
margin-bottom: 2%;
margin-left: auto;
margin-right: auto;
font-size: 24px;
}
.account-content .address-form-content .address-form {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
background: #ffffff;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
min-height: 345px;
}
section.product-detail, section.product-review {

View File

@ -217,8 +217,6 @@ window.VeeValidate = __webpack_require__(9);
Vue.use(VeeValidate);
//pure JS for resizing of browser purposes only
Vue.component("category-nav", __webpack_require__(10));
Vue.component("category-item", __webpack_require__(13));
Vue.component("image-slider", __webpack_require__(16));
@ -29177,7 +29175,10 @@ var staticRenderFns = [
var _c = _vm._self._c || _h
return _c("li", [
_c("img", {
attrs: { src: "vendor/webkul/shop/assets/images/offer-zone.svg" }
attrs: {
src:
"http://localhost/bagisto/public/vendor/webkul/shop/assets/images/offer-zone.svg"
}
}),
_vm._v(" "),
_c("span", [_vm._v("Offer Zone")])