sarga/packages/Webkul/Shop/src/Http/routes.php

294 lines
15 KiB
PHP
Raw Normal View History

2018-07-12 07:12:48 +00:00
<?php
Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function () {
2018-10-28 13:23:20 +00:00
//Store front home
2019-04-18 10:20:03 +00:00
Route::get('/', 'Webkul\Shop\Http\Controllers\HomeController@index')->defaults('_config', [
2018-08-21 10:58:55 +00:00
'view' => 'shop::home.index'
2019-04-18 10:20:03 +00:00
])->name('shop.home.index');
//subscription
//subscribe
Route::get('/subscribe', 'Webkul\Shop\Http\Controllers\SubscriptionController@subscribe')->name('shop.subscribe');
//unsubscribe
Route::get('/unsubscribe/{token}', 'Webkul\Shop\Http\Controllers\SubscriptionController@unsubscribe')->name('shop.unsubscribe');
2018-10-28 13:23:20 +00:00
//Store front header nav-menu fetch
2018-08-21 10:58:55 +00:00
Route::get('/categories/{slug}', 'Webkul\Shop\Http\Controllers\CategoryController@index')->defaults('_config', [
2018-08-17 05:48:21 +00:00
'view' => 'shop::products.index'
])->name('shop.categories.index');
2018-09-08 08:41:36 +00:00
2018-10-29 06:09:09 +00:00
//Store front search
Route::get('/search', 'Webkul\Shop\Http\Controllers\SearchController@index')->defaults('_config', [
'view' => 'shop::search.search'
])->name('shop.search.index');
2018-11-05 04:55:05 +00:00
//Country State Selector
Route::get('get/countries', 'Webkul\Core\Http\Controllers\CountryStateController@getCountries')->defaults('_config', [
'view' => 'shop::test'
])->name('get.countries');
//Get States When Country is Passed
Route::get('get/states/{country}', 'Webkul\Core\Http\Controllers\CountryStateController@getStates')->defaults('_config', [
'view' => 'shop::test'
])->name('get.states');
//checkout and cart
2018-10-28 13:23:20 +00:00
//Cart Items(listing)
Route::get('checkout/cart', 'Webkul\Shop\Http\Controllers\CartController@index')->defaults('_config', [
2018-09-26 04:21:14 +00:00
'view' => 'shop::checkout.cart.index'
])->name('shop.checkout.cart.index');
Route::post('checkout/check/coupons', 'Webkul\Shop\Http\Controllers\OnepageController@applyCoupon')->name('shop.checkout.check.coupons');
Cart rule inside promotions, various improvements and fixes. (#964) * Some syntax issue fixes * Adding discount things inside promotions in admin * routes updated for creating discount rules * fixed customer profile redirect parameter issue * added cart and catalog rule routes to admin section * migrations for discount almost to be finished, final revision left * migrations for discounts complete * catalog rule form underway * catalog rule * Made some dynamic form fields in catalog rule create form * made some changes for custom validations used in ProductForm request class * working on prepopulating the values fields in conditions * need another revisit on discount rules tables and then prepare for actions * removed discounts table * catalog rule form changed to muliti attribute set for single condition * new icons added for promotion and customer note. new action for customer added to take notes on the customers * catalog and cart rule designs stable, now moving towards validations on client side and backend * catalog rules migrations added * catalog rule models added with contracts and proxies * fixed customer group bug in customer registration controller * fixed customer registration bug due to last fix * fixed product card image not found issue * catalog rule translations added * Added migrations for cart rules and catalog rule products their contracts and remaining necessary files related to them. * making cart attributes for cart rules * Added more fields for cart rules * working on conditions for cart rule form * minor changes in migrations related to price rules * currency and locale switcher now only available for a channel on storefront when more than on locale and currency are assigned to that channel * part of conditions on the cart rule form added * daily sync * cart rate migrations updated * Added select and multi select attributes options fetching with ajax on catalog rule form * changed some migrations and data being populated at runtime inside catalog rule form * catalog rule create complete, migrations changes, translations added * catalog rule edit form complete * catalog rule form complete, now moving towards catalog rule products * added delete functionality for catalog rules * added cart rule preferences for coupon codes * cart rule submission problem due to repository issue * Cart rule form and migrations complete * Models and Repositories updated for cart rule usage * base sync with master * designing process to get suitable discount rules * cart rule form completed * added helpers in cart and discount to apply rules on cart at checkout or not * cart rule coupon implementation in progress for discount coupon in shop checkout pages * cart rules working * added coupon box on checkout screen * removed the conditions empty bug * Nearing to completion of coupon based rules * made some changes in cart rule coupon application on checkout related to new designs * some bug fixes * calculation for automatic cart rules complete * non couponable cart rules implemented, now moving on to binding them on frontend * some conditions improvements in couponable cart rules * some bug fixes * removed some bugs from summary blade for cart rule * added the table for cart rule cart for managing rules with cart and removed various bug fixes * some bug fixes * Removed bugs and added coupon based cart rule removal functionality * some bug fixes * cart rule labels refactoring in midway * Cart rule labels bug fixed * removed margin classes from shop to UI * Refactoring cart rule on front end * added checks * Discount rule implemented. * cart rule bug fixes * provision to remove the couponable and non couponable rule had been added * Cart rule frontend work done * altered some frontend variables on onepage checkout * Altered cart rules to some extent
2019-06-10 07:49:05 +00:00
Route::post('checkout/remove/coupon', 'Webkul\Shop\Http\Controllers\OnepageController@removeCoupon')->name('shop.checkout.remove.coupon');
Cart rule inside promotions, various improvements and fixes. (#964) * Some syntax issue fixes * Adding discount things inside promotions in admin * routes updated for creating discount rules * fixed customer profile redirect parameter issue * added cart and catalog rule routes to admin section * migrations for discount almost to be finished, final revision left * migrations for discounts complete * catalog rule form underway * catalog rule * Made some dynamic form fields in catalog rule create form * made some changes for custom validations used in ProductForm request class * working on prepopulating the values fields in conditions * need another revisit on discount rules tables and then prepare for actions * removed discounts table * catalog rule form changed to muliti attribute set for single condition * new icons added for promotion and customer note. new action for customer added to take notes on the customers * catalog and cart rule designs stable, now moving towards validations on client side and backend * catalog rules migrations added * catalog rule models added with contracts and proxies * fixed customer group bug in customer registration controller * fixed customer registration bug due to last fix * fixed product card image not found issue * catalog rule translations added * Added migrations for cart rules and catalog rule products their contracts and remaining necessary files related to them. * making cart attributes for cart rules * Added more fields for cart rules * working on conditions for cart rule form * minor changes in migrations related to price rules * currency and locale switcher now only available for a channel on storefront when more than on locale and currency are assigned to that channel * part of conditions on the cart rule form added * daily sync * cart rate migrations updated * Added select and multi select attributes options fetching with ajax on catalog rule form * changed some migrations and data being populated at runtime inside catalog rule form * catalog rule create complete, migrations changes, translations added * catalog rule edit form complete * catalog rule form complete, now moving towards catalog rule products * added delete functionality for catalog rules * added cart rule preferences for coupon codes * cart rule submission problem due to repository issue * Cart rule form and migrations complete * Models and Repositories updated for cart rule usage * base sync with master * designing process to get suitable discount rules * cart rule form completed * added helpers in cart and discount to apply rules on cart at checkout or not * cart rule coupon implementation in progress for discount coupon in shop checkout pages * cart rules working * added coupon box on checkout screen * removed the conditions empty bug * Nearing to completion of coupon based rules * made some changes in cart rule coupon application on checkout related to new designs * some bug fixes * calculation for automatic cart rules complete * non couponable cart rules implemented, now moving on to binding them on frontend * some conditions improvements in couponable cart rules * some bug fixes * removed some bugs from summary blade for cart rule * added the table for cart rule cart for managing rules with cart and removed various bug fixes * some bug fixes * Removed bugs and added coupon based cart rule removal functionality * some bug fixes * cart rule labels refactoring in midway * Cart rule labels bug fixed * removed margin classes from shop to UI * Refactoring cart rule on front end * added checks * Discount rule implemented. * cart rule bug fixes * provision to remove the couponable and non couponable rule had been added * Cart rule frontend work done * altered some frontend variables on onepage checkout * Altered cart rules to some extent
2019-06-10 07:49:05 +00:00
2018-10-28 13:23:20 +00:00
//Cart Items Add
Route::post('checkout/cart/add/{id}', 'Webkul\Shop\Http\Controllers\CartController@add')->defaults('_config', [
2019-01-18 11:10:40 +00:00
'redirect' => 'shop.checkout.cart.index'
])->name('cart.add');
2018-10-28 13:23:20 +00:00
//Cart Items Add Configurable for more
2018-10-30 11:22:36 +00:00
Route::get('checkout/cart/addconfigurable/{slug}', 'Webkul\Shop\Http\Controllers\CartController@addConfigurable')->name('cart.add.configurable');
2018-10-12 11:15:55 +00:00
2018-10-28 13:23:20 +00:00
//Cart Items Remove
Route::get('checkout/cart/remove/{id}', 'Webkul\Shop\Http\Controllers\CartController@remove')->name('cart.remove');
2018-10-28 13:23:20 +00:00
//Cart Update Before Checkout
Route::post('/checkout/cart', 'Webkul\Shop\Http\Controllers\CartController@updateBeforeCheckout')->defaults('_config', [
'redirect' => 'shop.checkout.cart.index'
])->name('shop.checkout.cart.update');
2018-10-28 13:23:20 +00:00
//Cart Items Remove
Route::get('/checkout/cart/remove/{id}', 'Webkul\Shop\Http\Controllers\CartController@remove')->defaults('_config', [
'redirect' => 'shop.checkout.cart.index'
])->name('shop.checkout.cart.remove');
2018-10-28 13:23:20 +00:00
//Checkout Index page
Route::get('/checkout/onepage', 'Webkul\Shop\Http\Controllers\OnepageController@index')->defaults('_config', [
2018-09-19 06:58:15 +00:00
'view' => 'shop::checkout.onepage'
2018-09-26 04:21:14 +00:00
])->name('shop.checkout.onepage.index');
2018-09-13 11:10:45 +00:00
2019-05-30 13:02:01 +00:00
//Checkout Save Order
Route::get('/checkout/summary', 'Webkul\Shop\Http\Controllers\OnepageController@summary')->name('shop.checkout.summary');
2018-10-28 13:23:20 +00:00
//Checkout Save Address Form Store
2018-10-04 06:42:06 +00:00
Route::post('/checkout/save-address', 'Webkul\Shop\Http\Controllers\OnepageController@saveAddress')->name('shop.checkout.save-address');
2018-08-21 13:14:48 +00:00
2018-10-28 13:23:20 +00:00
//Checkout Save Shipping Address Form Store
2018-10-04 06:42:06 +00:00
Route::post('/checkout/save-shipping', 'Webkul\Shop\Http\Controllers\OnepageController@saveShipping')->name('shop.checkout.save-shipping');
2018-09-20 10:01:51 +00:00
2018-10-28 13:23:20 +00:00
//Checkout Save Payment Method Form
2018-10-04 06:42:06 +00:00
Route::post('/checkout/save-payment', 'Webkul\Shop\Http\Controllers\OnepageController@savePayment')->name('shop.checkout.save-payment');
2018-10-28 13:23:20 +00:00
//Checkout Save Order
2018-10-04 06:42:06 +00:00
Route::post('/checkout/save-order', 'Webkul\Shop\Http\Controllers\OnepageController@saveOrder')->name('shop.checkout.save-order');
2018-10-28 13:23:20 +00:00
//Checkout Order Successfull
2018-10-04 06:42:06 +00:00
Route::get('/checkout/success', 'Webkul\Shop\Http\Controllers\OnepageController@success')->defaults('_config', [
'view' => 'shop::checkout.success'
])->name('shop.checkout.success');
2018-09-20 10:01:51 +00:00
2018-10-28 13:23:20 +00:00
//Shop buynow button action
Route::get('buynow/{id}', 'Webkul\Shop\Http\Controllers\CartController@buyNow')->name('shop.product.buynow');
2018-08-21 13:14:48 +00:00
2018-10-30 04:31:01 +00:00
//Shop buynow button action
2018-10-30 11:22:36 +00:00
Route::get('move/wishlist/{id}', 'Webkul\Shop\Http\Controllers\CartController@moveToWishlist')->name('shop.movetowishlist');
2018-10-30 04:31:01 +00:00
2018-10-28 13:23:20 +00:00
//Show Product Details Page(For individually Viewable Product)
2018-08-30 13:22:15 +00:00
Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [
'view' => 'shop::products.view'
])->name('shop.products.index');
2018-10-28 13:23:20 +00:00
// Show Product Review Form
2018-09-19 06:58:15 +00:00
Route::get('/reviews/{slug}', 'Webkul\Shop\Http\Controllers\ReviewController@show')->defaults('_config', [
2018-08-30 13:22:15 +00:00
'view' => 'shop::products.reviews.index'
])->name('shop.reviews.index');
2018-10-28 13:23:20 +00:00
// Show Product Review(listing)
2018-09-08 08:41:36 +00:00
Route::get('/product/{slug}/review', 'Webkul\Shop\Http\Controllers\ReviewController@create')->defaults('_config', [
2018-08-30 13:22:15 +00:00
'view' => 'shop::products.reviews.create'
])->name('shop.reviews.create');
2018-10-28 13:23:20 +00:00
// Show Product Review Form Store
2018-09-08 08:41:36 +00:00
Route::post('/product/{slug}/review', 'Webkul\Shop\Http\Controllers\ReviewController@store')->defaults('_config', [
2019-02-21 11:06:27 +00:00
'redirect' => 'shop.home.index'
2018-09-08 08:41:36 +00:00
])->name('shop.reviews.store');
2019-06-27 09:08:24 +00:00
// Download file or image
Route::get('/product/{id}/{attribute_id}', 'Webkul\Shop\Http\Controllers\ProductController@download')->defaults('_config', [
'view' => 'shop.products.index'
])->name('shop.product.file.download');
2018-10-25 07:46:45 +00:00
//customer routes starts here
Route::prefix('customer')->group(function () {
// forgot Password Routes
2018-10-28 13:23:20 +00:00
// Forgot Password Form Show
2018-10-25 07:46:45 +00:00
Route::get('/forgot-password', 'Webkul\Customer\Http\Controllers\ForgotPasswordController@create')->defaults('_config', [
'view' => 'shop::customers.signup.forgot-password'
])->name('customer.forgot-password.create');
2018-10-10 10:41:33 +00:00
2018-10-28 13:23:20 +00:00
// Forgot Password Form Store
2018-10-25 07:46:45 +00:00
Route::post('/forgot-password', 'Webkul\Customer\Http\Controllers\ForgotPasswordController@store')->name('customer.forgot-password.store');
2018-10-10 10:41:33 +00:00
2018-10-28 13:23:20 +00:00
// Reset Password Form Show
2018-10-25 07:46:45 +00:00
Route::get('/reset-password/{token}', 'Webkul\Customer\Http\Controllers\ResetPasswordController@create')->defaults('_config', [
'view' => 'shop::customers.signup.reset-password'
])->name('customer.reset-password.create');
2018-08-21 13:14:48 +00:00
2018-10-28 13:23:20 +00:00
// Reset Password Form Store
2018-10-25 07:46:45 +00:00
Route::post('/reset-password', 'Webkul\Customer\Http\Controllers\ResetPasswordController@store')->defaults('_config', [
'redirect' => 'customer.profile.index'
2018-10-25 07:46:45 +00:00
])->name('customer.reset-password.store');
2018-08-22 07:27:41 +00:00
// Login Routes
2018-10-28 13:23:20 +00:00
// Login form show
2018-08-22 07:27:41 +00:00
Route::get('login', 'Webkul\Customer\Http\Controllers\SessionController@show')->defaults('_config', [
'view' => 'shop::customers.session.index',
])->name('customer.session.index');
2018-10-28 13:23:20 +00:00
// Login form store
2018-08-22 07:27:41 +00:00
Route::post('login', 'Webkul\Customer\Http\Controllers\SessionController@create')->defaults('_config', [
2018-10-25 07:46:45 +00:00
'redirect' => 'customer.profile.index'
2018-08-22 07:27:41 +00:00
])->name('customer.session.create');
// Registration Routes
2018-10-28 13:23:20 +00:00
//registration form show
2018-08-22 07:27:41 +00:00
Route::get('register', 'Webkul\Customer\Http\Controllers\RegistrationController@show')->defaults('_config', [
2018-10-28 13:23:20 +00:00
'view' => 'shop::customers.signup.index'
2018-08-22 07:27:41 +00:00
])->name('customer.register.index');
2018-10-28 13:23:20 +00:00
//registration form store
2018-08-22 07:27:41 +00:00
Route::post('register', 'Webkul\Customer\Http\Controllers\RegistrationController@create')->defaults('_config', [
'redirect' => 'customer.session.index',
2018-10-28 13:23:20 +00:00
])->name('customer.register.create');
2018-08-22 07:27:41 +00:00
//verify account
Route::get('/verify-account/{token}', 'Webkul\Customer\Http\Controllers\RegistrationController@verifyAccount')->name('customer.verify');
//resend verification email
Route::get('/resend/verification/{email}', 'Webkul\Customer\Http\Controllers\RegistrationController@resendVerificationEmail')->name('customer.resend.verification-email');
2018-08-22 07:27:41 +00:00
// Auth Routes
Route::group(['middleware' => ['customer']], function () {
2018-10-28 13:23:20 +00:00
//Customer logout
2018-08-22 07:27:41 +00:00
Route::get('logout', 'Webkul\Customer\Http\Controllers\SessionController@destroy')->defaults('_config', [
'redirect' => 'customer.session.index'
])->name('customer.session.destroy');
2018-10-28 13:23:20 +00:00
//Customer Wishlist add
Route::get('wishlist/add/{id}', 'Webkul\Customer\Http\Controllers\WishlistController@add')->name('customer.wishlist.add');
2018-10-28 13:23:20 +00:00
//Customer Wishlist remove
Route::get('wishlist/remove/{id}', 'Webkul\Customer\Http\Controllers\WishlistController@remove')->name('customer.wishlist.remove');
//Customer Wishlist remove
Route::get('wishlist/removeall', 'Webkul\Customer\Http\Controllers\WishlistController@removeAll')->name('customer.wishlist.removeall');
2018-10-28 13:23:20 +00:00
//Customer Wishlist move to cart
Route::get('wishlist/move/{id}', 'Webkul\Customer\Http\Controllers\WishlistController@move')->name('customer.wishlist.move');
2018-08-22 07:27:41 +00:00
//customer account
Route::prefix('account')->group(function () {
2018-10-28 13:23:20 +00:00
//Customer Dashboard Route
Route::get('index', 'Webkul\Customer\Http\Controllers\AccountController@index')->defaults('_config', [
'view' => 'shop::customers.account.index'
])->name('customer.account.index');
2018-10-28 13:23:20 +00:00
//Customer Profile Show
Route::get('profile', 'Webkul\Customer\Http\Controllers\CustomerController@index')->defaults('_config', [
'view' => 'shop::customers.account.profile.index'
])->name('customer.profile.index');
2018-08-22 07:27:41 +00:00
2018-10-28 13:23:20 +00:00
//Customer Profile Edit Form Show
Route::get('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@edit')->defaults('_config', [
'view' => 'shop::customers.account.profile.edit'
])->name('customer.profile.edit');
2018-10-28 13:23:20 +00:00
//Customer Profile Edit Form Store
Route::post('profile/edit', 'Webkul\Customer\Http\Controllers\CustomerController@update')->defaults('_config', [
2019-05-08 12:22:54 +00:00
'redirect' => 'customer.profile.index'
2018-08-22 07:27:41 +00:00
])->name('customer.profile.edit');
/* Profile Routes Ends Here */
/* Routes for Addresses */
2018-10-28 13:23:20 +00:00
//Customer Address Show
Route::get('addresses', 'Webkul\Customer\Http\Controllers\AddressController@index')->defaults('_config', [
'view' => 'shop::customers.account.address.index'
])->name('customer.address.index');
2018-10-28 13:23:20 +00:00
//Customer Address Create Form Show
Route::get('addresses/create', 'Webkul\Customer\Http\Controllers\AddressController@create')->defaults('_config', [
'view' => 'shop::customers.account.address.create'
])->name('customer.address.create');
2018-10-28 13:23:20 +00:00
//Customer Address Create Form Store
Route::post('addresses/create', 'Webkul\Customer\Http\Controllers\AddressController@store')->defaults('_config', [
'view' => 'shop::customers.account.address.address',
'redirect' => 'customer.address.index'
])->name('customer.address.create');
2018-10-28 13:23:20 +00:00
//Customer Address Edit Form Show
Route::get('addresses/edit/{id}', 'Webkul\Customer\Http\Controllers\AddressController@edit')->defaults('_config', [
'view' => 'shop::customers.account.address.edit'
])->name('customer.address.edit');
2018-10-28 13:23:20 +00:00
//Customer Address Edit Form Store
Route::put('addresses/edit/{id}', 'Webkul\Customer\Http\Controllers\AddressController@update')->defaults('_config', [
2018-09-10 09:31:34 +00:00
'redirect' => 'customer.address.index'
])->name('customer.address.edit');
2018-10-28 13:23:20 +00:00
//Customer Address Make Default
Route::get('addresses/default/{id}', 'Webkul\Customer\Http\Controllers\AddressController@makeDefault')->name('make.default.address');
2018-10-28 13:23:20 +00:00
//Customer Address Delete
Route::get('addresses/delete/{id}', 'Webkul\Customer\Http\Controllers\AddressController@destroy')->name('address.delete');
/* Wishlist route */
2018-10-28 13:23:20 +00:00
//Customer wishlist(listing)
2018-10-05 12:00:48 +00:00
Route::get('wishlist', 'Webkul\Customer\Http\Controllers\WishlistController@index')->defaults('_config', [
'view' => 'shop::customers.account.wishlist.wishlist'
])->name('customer.wishlist.index');
/* Orders route */
2018-10-28 13:23:20 +00:00
//Customer orders(listing)
2019-04-09 08:35:57 +00:00
Route::get('orders', 'Webkul\Shop\Http\Controllers\OrderController@index')->defaults('_config', [
2018-10-17 07:21:47 +00:00
'view' => 'shop::customers.account.orders.index'
])->name('customer.orders.index');
2018-10-28 13:23:20 +00:00
//Customer orders view summary and status
2019-04-09 08:35:57 +00:00
Route::get('orders/view/{id}', 'Webkul\Shop\Http\Controllers\OrderController@view')->defaults('_config', [
2018-10-17 07:21:47 +00:00
'view' => 'shop::customers.account.orders.view'
])->name('customer.orders.view');
//Prints invoice
2019-04-09 08:35:57 +00:00
Route::get('orders/print/{id}', 'Webkul\Shop\Http\Controllers\OrderController@print')->defaults('_config', [
'view' => 'shop::customers.account.orders.print'
])->name('customer.orders.print');
/* Reviews route */
2018-12-14 12:06:49 +00:00
//Customer reviews
Route::get('reviews', 'Webkul\Customer\Http\Controllers\CustomerController@reviews')->defaults('_config', [
2018-10-15 08:22:27 +00:00
'view' => 'shop::customers.account.reviews.index'
])->name('customer.reviews.index');
2018-10-30 06:37:07 +00:00
//Customer review delete
Route::get('reviews/delete/{id}', 'Webkul\Shop\Http\Controllers\ReviewController@destroy')->defaults('_config', [
2018-10-30 06:37:07 +00:00
'redirect' => 'customer.reviews.index'
])->name('customer.review.delete');
2018-12-14 12:06:49 +00:00
//Customer all review delete
2018-12-14 12:06:49 +00:00
Route::get('reviews/all-delete', 'Webkul\Shop\Http\Controllers\ReviewController@deleteAll')->defaults('_config', [
'redirect' => 'customer.reviews.index'
])->name('customer.review.deleteall');
2018-08-22 07:27:41 +00:00
});
});
});
//customer routes end here
2019-04-18 10:20:03 +00:00
2019-08-02 14:21:28 +00:00
Route::get('pages/{slug}', 'Webkul\CMS\Http\Controllers\Shop\PagePresenterController@presenter')->name('shop.cms.page');
2019-04-23 07:13:42 +00:00
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@notFound');
2018-07-12 07:12:48 +00:00
});