From 31ae7c025e08eb889ac83818c7a0188bfb960c65 Mon Sep 17 00:00:00 2001 From: jitendra Date: Thu, 20 Sep 2018 15:31:51 +0530 Subject: [PATCH] Check process --- composer.json | 6 +- config/app.php | 1 + config/carriers.php | 7 +- config/paymentmethods.php | 13 + .../2018_09_05_150444_create_cart_table.php | 0 ...9_05_150915_create_cart_products_table.php | 0 .../2018_09_19_092845_create_cart_address.php | 43 + .../2018_09_19_093453_create_cart_payment.php | 34 + ...2018_09_19_093508_create_cart_shipping.php | 41 + .../Http/Controllers/CheckoutController.php | 32 +- packages/Webkul/Cart/src/Models/Cart.php | 19 +- .../Webkul/Cart/src/Models/CartAddress.php | 10 + .../Webkul/Cart/src/Models/CartShipping.php | 10 + ..._09_20_060658_create_core_config_table.php | 34 + .../src/Providers/CoreServiceProvider.php | 1 + packages/Webkul/Payment/Payment.php | 32 + packages/Webkul/Payment/composer.json | 27 + .../Webkul/Payment/src/Facades/Payment.php | 18 + packages/Webkul/Payment/src/Http/helpers.php | 10 + .../Payment/src/Payment/CashOnDelivery.php | 13 + .../Webkul/Payment/src/Payment/Payment.php | 71 + .../src/Providers/PaymentServiceProvider.php | 46 + .../Webkul/Product/src/Models/Product.php | 2 +- .../src/Models/ProductAttributeValue.php | 2 +- .../src/Carriers/AbstractShipping.php | 82 + .../Webkul/Shipping/src/Carriers/FlatRate.php | 36 +- .../src/Contracts/AbstractShipping.php | 15 - .../Webkul/Shipping/src/Facades/Shipping.php | 18 + packages/Webkul/Shipping/src/Helpers/Rate.php | 29 - packages/Webkul/Shipping/src/Http/helpers.php | 10 + .../src/Providers/ShippingServiceProvider.php | 20 +- packages/Webkul/Shipping/src/Shipping.php | 29 + packages/Webkul/Shop/src/Http/routes.php | 6 + .../Shop/src/Resources/assets/sass/app.scss | 1135 +------ .../Webkul/Shop/src/Resources/lang/en/app.php | 3 +- .../views/checkout/onepage.blade.php | 121 +- .../checkout/onepage/customer-info.blade.php | 44 +- .../views/checkout/onepage/shipping.blade.php | 26 + public/themes/default/assets/css/shop.css | 848 +---- public/themes/default/assets/js/shop.js | 2801 +++++++++++++---- 40 files changed, 3161 insertions(+), 2534 deletions(-) create mode 100644 config/paymentmethods.php rename packages/Webkul/Cart/src/Database/{migrations => Migrations}/2018_09_05_150444_create_cart_table.php (100%) rename packages/Webkul/Cart/src/Database/{migrations => Migrations}/2018_09_05_150915_create_cart_products_table.php (100%) create mode 100644 packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php create mode 100644 packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093453_create_cart_payment.php create mode 100644 packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php create mode 100644 packages/Webkul/Cart/src/Models/CartAddress.php create mode 100644 packages/Webkul/Cart/src/Models/CartShipping.php create mode 100644 packages/Webkul/Core/src/Database/Migrations/2018_09_20_060658_create_core_config_table.php create mode 100644 packages/Webkul/Payment/Payment.php create mode 100644 packages/Webkul/Payment/composer.json create mode 100644 packages/Webkul/Payment/src/Facades/Payment.php create mode 100644 packages/Webkul/Payment/src/Http/helpers.php create mode 100644 packages/Webkul/Payment/src/Payment/CashOnDelivery.php create mode 100644 packages/Webkul/Payment/src/Payment/Payment.php create mode 100644 packages/Webkul/Payment/src/Providers/PaymentServiceProvider.php create mode 100644 packages/Webkul/Shipping/src/Carriers/AbstractShipping.php delete mode 100644 packages/Webkul/Shipping/src/Contracts/AbstractShipping.php create mode 100644 packages/Webkul/Shipping/src/Facades/Shipping.php delete mode 100644 packages/Webkul/Shipping/src/Helpers/Rate.php create mode 100644 packages/Webkul/Shipping/src/Http/helpers.php create mode 100644 packages/Webkul/Shipping/src/Shipping.php diff --git a/composer.json b/composer.json index 0a58b0e6c..cc67bf6ff 100644 --- a/composer.json +++ b/composer.json @@ -40,7 +40,8 @@ "webkul/laravel-product": "self.version", "webkul/laravel-shop": "self.version", "webkul/laravel-theme": "self.version", - "webkul/laravel-shipping": "self.version" + "webkul/laravel-shipping": "self.version", + "webkul/laravel-payment": "self.version" }, "autoload": { "classmap": [ @@ -61,7 +62,8 @@ "Webkul\\Inventory\\": "packages/Webkul/Inventory/src", "Webkul\\Product\\": "packages/Webkul/Product/src", "Webkul\\Theme\\": "packages/Webkul/Theme/src", - "Webkul\\Shipping\\": "packages/Webkul/Shipping/src" + "Webkul\\Shipping\\": "packages/Webkul/Shipping/src", + "Webkul\\Payment\\": "packages/Webkul/Payment/src" } }, "autoload-dev": { diff --git a/config/app.php b/config/app.php index c0f4ca1dd..fd2e405f9 100644 --- a/config/app.php +++ b/config/app.php @@ -192,6 +192,7 @@ return [ Webkul\Theme\Providers\ThemeServiceProvider::class, Webkul\Cart\Providers\CartServiceProvider::class, Webkul\Shipping\Providers\ShippingServiceProvider::class, + Webkul\Payment\Providers\PaymentServiceProvider::class, ], /* diff --git a/config/carriers.php b/config/carriers.php index 87ef4edc0..f088f4172 100644 --- a/config/carriers.php +++ b/config/carriers.php @@ -5,12 +5,9 @@ return [ 'code' => 'flatrate', 'title' => 'Flatrate', 'description' => 'This is a flat rate', - 'status' => '1', + 'active' => true, 'default_rate' => '10', - 'type' => [ - 'per_unit' => 'Per Unit', - 'per order' => 'Per Order', - ], + 'type' => 'per_unit', 'class' => 'Webkul\Shipping\Carriers\FlatRate', ] ]; diff --git a/config/paymentmethods.php b/config/paymentmethods.php new file mode 100644 index 000000000..9b63a0c10 --- /dev/null +++ b/config/paymentmethods.php @@ -0,0 +1,13 @@ + [ + 'code' => 'cashondelivery', + 'title' => 'Cash On Delivery', + 'class' => 'Webkul\Payment\Payment\Payment', + 'order_status' => 'Pending', + 'active' => true + ] +]; + +?> \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Database/migrations/2018_09_05_150444_create_cart_table.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php similarity index 100% rename from packages/Webkul/Cart/src/Database/migrations/2018_09_05_150444_create_cart_table.php rename to packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150444_create_cart_table.php diff --git a/packages/Webkul/Cart/src/Database/migrations/2018_09_05_150915_create_cart_products_table.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_products_table.php similarity index 100% rename from packages/Webkul/Cart/src/Database/migrations/2018_09_05_150915_create_cart_products_table.php rename to packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_products_table.php diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php new file mode 100644 index 000000000..070ea4609 --- /dev/null +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_092845_create_cart_address.php @@ -0,0 +1,43 @@ +increments('id'); + $table->string('address1'); + $table->string('address2')->nullable(); + $table->string('country'); + $table->string('state'); + $table->string('city'); + $table->integer('postcode'); + $table->string('phone'); + $table->string('address_type'); + $table->integer('cart_id')->nullable()->unsigned(); + $table->foreign('cart_id')->references('id')->on('cart'); + $table->integer('customer_id')->nullable()->unsigned(); + $table->foreign('customer_id')->references('id')->on('customers'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_address'); + } +} diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093453_create_cart_payment.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093453_create_cart_payment.php new file mode 100644 index 000000000..9521ad2b6 --- /dev/null +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093453_create_cart_payment.php @@ -0,0 +1,34 @@ +increments('id'); + $table->string('method'); + $table->integer('cart_id')->nullable()->unsigned(); + $table->foreign('cart_id')->references('id')->on('cart'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_payment'); + } +} diff --git a/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php new file mode 100644 index 000000000..9413012ae --- /dev/null +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_19_093508_create_cart_shipping.php @@ -0,0 +1,41 @@ +increments('id'); + $table->string('carrier'); + $table->string('carrier_title'); + $table->string('method'); + $table->string('method_title'); + $table->string('method_description')->nullable(); + $table->double('price')->nullable(); + $table->integer('cart_id')->nullable()->unsigned(); + $table->foreign('cart_id')->references('id')->on('cart'); + $table->integer('cart_address_id')->nullable()->unsigned(); + $table->foreign('cart_address_id')->references('id')->on('cart_address'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_shipping'); + } +} diff --git a/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php b/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php index b763fc1e9..058b8ac5b 100644 --- a/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php +++ b/packages/Webkul/Cart/src/Http/Controllers/CheckoutController.php @@ -5,6 +5,7 @@ use Illuminate\Routing\Controller; use Illuminate\Http\Request; use Illuminate\Http\Response; use Auth; +use Webkul\Shipping\Facades\Shipping; /** * Chekout controller for the customer @@ -15,7 +16,6 @@ use Auth; */ class CheckoutController extends Controller { - /** * Contains route related configuration * @@ -43,4 +43,34 @@ class CheckoutController extends Controller return view($this->_config['view']); } + /** + * Saves customer address. + * + * @return \Illuminate\Http\Response + */ + public function saveAddress() + { + + return response()->json([ + 'shipping' => Shipping::collectRates() + ]); + } + + /** + * Saves shipping method. + * + * @return \Illuminate\Http\Response + */ + public function saveShipping() + { + } + + /** + * Saves payment method. + * + * @return \Illuminate\Http\Response + */ + public function saveAPayment() + { + } } \ No newline at end of file diff --git a/packages/Webkul/Cart/src/Models/Cart.php b/packages/Webkul/Cart/src/Models/Cart.php index f1591cdb4..78c3c4152 100644 --- a/packages/Webkul/Cart/src/Models/Cart.php +++ b/packages/Webkul/Cart/src/Models/Cart.php @@ -3,8 +3,9 @@ namespace Webkul\Cart\Models; use Illuminate\Database\Eloquent\Model; - use Webkul\Product\Models\Product; +use Webkul\Cart\Models\CartAddress; +use Webkul\Cart\Models\CartShipping; class Cart extends Model { @@ -18,4 +19,20 @@ class Cart extends Model return $this->belongsToMany(Product::class, 'cart_products')->withPivot('id', 'product_id','quantity', 'cart_id'); } + + /** + * Get the addresses for the cart. + */ + public function addresses() + { + return $this->hasMany(CartAddress::class); + } + + /** + * Get the shipping for the cart. + */ + public function shipping() + { + return $this->hasMany(CartShipping::class); + } } diff --git a/packages/Webkul/Cart/src/Models/CartAddress.php b/packages/Webkul/Cart/src/Models/CartAddress.php new file mode 100644 index 000000000..5ecad6830 --- /dev/null +++ b/packages/Webkul/Cart/src/Models/CartAddress.php @@ -0,0 +1,10 @@ +increments('id'); + $table->string('code'); + $table->string('value'); + $table->integer('channel_id')->unsigned(); + $table->foreign('channel_id')->references('id')->on('channels')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('core_config'); + } +} diff --git a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php index 2c036ddca..f0d7e4113 100644 --- a/packages/Webkul/Core/src/Providers/CoreServiceProvider.php +++ b/packages/Webkul/Core/src/Providers/CoreServiceProvider.php @@ -33,6 +33,7 @@ class CoreServiceProvider extends ServiceProvider Validator::extend('slug', 'Webkul\Core\Contracts\Validations\Slug@passes'); Validator::extend('code', 'Webkul\Core\Contracts\Validations\Code@passes'); } + /** * Register services. * diff --git a/packages/Webkul/Payment/Payment.php b/packages/Webkul/Payment/Payment.php new file mode 100644 index 000000000..543172f86 --- /dev/null +++ b/packages/Webkul/Payment/Payment.php @@ -0,0 +1,32 @@ + $object->getCode(), + 'title' => $object->getTitle(), + 'description' => $object->getDescription(), + ]; + } + } + + return $paymentMethods; + } +} \ No newline at end of file diff --git a/packages/Webkul/Payment/composer.json b/packages/Webkul/Payment/composer.json new file mode 100644 index 000000000..7806912d2 --- /dev/null +++ b/packages/Webkul/Payment/composer.json @@ -0,0 +1,27 @@ +{ + "name": "webkul/laravel-payment", + "license": "MIT", + "authors": [ + { + "name": "Jitendra Singh", + "email": "jitendra@webkul.com" + } + ], + "require": {}, + "autoload": { + "psr-4": { + "Webkul\\Payment\\": "src/" + } + }, + "extra": { + "laravel": { + "providers": [ + "Webkul\\Payment\\Providers\\PaymentServiceProvider" + ], + "aliases": { + "Bouncer": "Webkul\\Payment\\Facades\\Bouncer" + } + } + }, + "minimum-stability": "dev" +} diff --git a/packages/Webkul/Payment/src/Facades/Payment.php b/packages/Webkul/Payment/src/Facades/Payment.php new file mode 100644 index 000000000..ee919d03b --- /dev/null +++ b/packages/Webkul/Payment/src/Facades/Payment.php @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/packages/Webkul/Payment/src/Payment/CashOnDelivery.php b/packages/Webkul/Payment/src/Payment/CashOnDelivery.php new file mode 100644 index 000000000..8db87b36f --- /dev/null +++ b/packages/Webkul/Payment/src/Payment/CashOnDelivery.php @@ -0,0 +1,13 @@ +getConfigData('active'); + } + + /** + * Returns payment method code + * + * @return array + */ + public function getCode() + { + if (empty($this->code)) { + // throw exception + } + + return $this->_code; + } + + /** + * Returns payment method title + * + * @return array + */ + public function getTitle() + { + return $this->getConfigData('title'); + } + + /** + * Returns payment method decription + * + * @return array + */ + public function getDecription() + { + return $this->getConfigData('decription'); + } + + /** + * 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 = core()->getCurrentChannel()->getId(); + } + + $paymentConfig = Config::get('paymentmethods' . $this->getCode()); + + return $paymentConfig[$field]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Payment/src/Providers/PaymentServiceProvider.php b/packages/Webkul/Payment/src/Providers/PaymentServiceProvider.php new file mode 100644 index 000000000..2bd28d181 --- /dev/null +++ b/packages/Webkul/Payment/src/Providers/PaymentServiceProvider.php @@ -0,0 +1,46 @@ +registerFacades(); + } + /** + * Register Bouncer as a singleton. + * + * @return void + */ + protected function registerFacades() + { + $loader = AliasLoader::getInstance(); + $loader->alias('payment', PaymentFacade::class); + + $this->app->singleton('payment', function () { + return new Payment(); + }); + } +} diff --git a/packages/Webkul/Product/src/Models/Product.php b/packages/Webkul/Product/src/Models/Product.php index 1ca1cf59c..73c475242 100644 --- a/packages/Webkul/Product/src/Models/Product.php +++ b/packages/Webkul/Product/src/Models/Product.php @@ -157,7 +157,7 @@ class Product extends Model * @return mixed */ public function getAttribute($key) - { + { if (!method_exists(self::class, $key) && !in_array($key, ['parent_id', 'attribute_family_id']) && !isset($this->attributes[$key])) { if (isset($this->id) && $this->isCustomAttribute($key)) { $this->attributes[$key] = ''; diff --git a/packages/Webkul/Product/src/Models/ProductAttributeValue.php b/packages/Webkul/Product/src/Models/ProductAttributeValue.php index 828664442..6eb459ae3 100644 --- a/packages/Webkul/Product/src/Models/ProductAttributeValue.php +++ b/packages/Webkul/Product/src/Models/ProductAttributeValue.php @@ -23,7 +23,7 @@ class ProductAttributeValue extends Model 'boolean' => 'boolean_value', 'select' => 'integer_value', 'multiselect' => 'text_value', - 'datetime' => 'datetime_time', + 'datetime' => 'datetime_value', 'date' => 'date_value', ]; diff --git a/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php b/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php new file mode 100644 index 000000000..8c2690dfd --- /dev/null +++ b/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php @@ -0,0 +1,82 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +abstract class AbstractShipping +{ + + abstract public function calculate(); + + /** + * Checks if payment method is available + * + * @return array + */ + public function isAvailable() + { + return $this->getConfigData('active'); + } + + /** + * Returns payment method code + * + * @return array + */ + public function getCode() + { + if (empty($this->code)) { + // throw exception + } + + return $this->code; + } + + /** + * Returns payment method title + * + * @return array + */ + public function getTitle() + { + return $this->getConfigData('title'); + } + + /** + * Returns payment method decription + * + * @return array + */ + public function getDecription() + { + return $this->getConfigData('decription'); + } + + /** + * 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 = core()->getCurrentChannel()->id; + } + + $shippingConfig = Config::get('carriers' . $this->getCode()); + + return $shippingConfig[$field]; + } + +} +?> \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Carriers/FlatRate.php b/packages/Webkul/Shipping/src/Carriers/FlatRate.php index ba3faa6c7..ec9a1457c 100644 --- a/packages/Webkul/Shipping/src/Carriers/FlatRate.php +++ b/packages/Webkul/Shipping/src/Carriers/FlatRate.php @@ -2,8 +2,8 @@ namespace Webkul\Shipping\Carriers; -use Webkul\Shipping\Contracts\AbstractShipping; use Config; +use Webkul\Cart\Models\CartShipping; /** * Class Rate. @@ -11,8 +11,40 @@ use Config; */ class FlatRate extends AbstractShipping { + /** + * Payment method code + * + * @var string + */ + protected $code = 'flatrate'; + public function calculate() { - return []; + return [ + 'carrier_code' => 'flatrate', + 'carrier_title' => 'Flat Rate', + 'carrier_description' => '', + 'rates' => [ + [ + 'method' => 'flatrate_flatrate', + 'method_title' => 'Flat Rate', + 'price' => 10, + 'price_formated' => core()->currency(10), + ] + ] + ]; + + $object = new CartShipping; + + $object->carrier = 'flatrate_flatrate'; + $object->carrier_title = $this->getConfigData('description'); + $object->method = 'flatrate'; + $object->method_title = $this->getConfigData('title'); + $object->method_description = $this->getConfigData('description'); + $object->price = 10; + + return [ + 'flatrate' => [$object] + ]; } } \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Contracts/AbstractShipping.php b/packages/Webkul/Shipping/src/Contracts/AbstractShipping.php deleted file mode 100644 index bce60f009..000000000 --- a/packages/Webkul/Shipping/src/Contracts/AbstractShipping.php +++ /dev/null @@ -1,15 +0,0 @@ - - */ -abstract class AbstractShipping -{ - - abstract public function calculate(); - -} -?> \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Facades/Shipping.php b/packages/Webkul/Shipping/src/Facades/Shipping.php new file mode 100644 index 000000000..65ba5ad85 --- /dev/null +++ b/packages/Webkul/Shipping/src/Facades/Shipping.php @@ -0,0 +1,18 @@ +calculate()) { - $rates[] = $rate; - } - } - - return $rates; - } -} \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Http/helpers.php b/packages/Webkul/Shipping/src/Http/helpers.php new file mode 100644 index 000000000..93a8f1baa --- /dev/null +++ b/packages/Webkul/Shipping/src/Http/helpers.php @@ -0,0 +1,10 @@ + \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Providers/ShippingServiceProvider.php b/packages/Webkul/Shipping/src/Providers/ShippingServiceProvider.php index 4757cce0d..f7a29055d 100644 --- a/packages/Webkul/Shipping/src/Providers/ShippingServiceProvider.php +++ b/packages/Webkul/Shipping/src/Providers/ShippingServiceProvider.php @@ -3,8 +3,11 @@ namespace Webkul\Shipping\Providers; use Illuminate\Support\ServiceProvider; +use Illuminate\Foundation\AliasLoader; use Illuminate\Routing\Router; use Webkul\Customer\Http\Middleware\RedirectIfNotCustomer; +use Webkul\Shipping\Shipping; +use Webkul\Shipping\Facades\Shipping as ShippingFacade; class ShippingServiceProvider extends ServiceProvider { @@ -15,8 +18,9 @@ class ShippingServiceProvider extends ServiceProvider */ public function boot(Router $router) { + include __DIR__ . '/../Http/helpers.php'; } - + /** * Register services. * @@ -24,6 +28,20 @@ class ShippingServiceProvider extends ServiceProvider */ public function register() { + $this->registerFacades(); + } + /** + * Register Bouncer as a singleton. + * + * @return void + */ + protected function registerFacades() + { + $loader = AliasLoader::getInstance(); + $loader->alias('shipping', ShippingFacade::class); + $this->app->singleton('shipping', function () { + return new Shipping(); + }); } } diff --git a/packages/Webkul/Shipping/src/Shipping.php b/packages/Webkul/Shipping/src/Shipping.php new file mode 100644 index 000000000..d0d2f9642 --- /dev/null +++ b/packages/Webkul/Shipping/src/Shipping.php @@ -0,0 +1,29 @@ +isAvailable()) { + $rates[] = $object->calculate(); + // } + } + + return $rates; + + // return view('shop::checkout.onepage.shipping', compact('rates')); + } +} \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Http/routes.php b/packages/Webkul/Shop/src/Http/routes.php index 7d8361989..5c043fa0a 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -14,6 +14,12 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'shop::checkout.onepage' ])->name('shop.checkout'); + Route::post('/checkout/save-address', 'Webkul\Cart\Http\Controllers\CheckoutController@saveAddress')->name('shop.checkout.save-address'); + + Route::post('/checkout/save-shipping', 'Webkul\Cart\Http\Controllers\CheckoutController@saveShipping')->name('shop.checkout.save-shipping'); + + Route::post('/checkout/save-payment', 'Webkul\Cart\Http\Controllers\CheckoutController@savePayment')->name('shop.checkout.save-payment'); + /* dummy routes ends here */ diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index 16a6e521e..554d6f408 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -758,7 +758,7 @@ section.slider-block { } .filter-attributes-title .icon { - background-image: url('../images//arrow-up.svg') !important; + background-image: url('../images/arrow-up.svg') !important; } } } @@ -1515,162 +1515,73 @@ section.product-detail { font-size: 16px; } } - - // .rating-reviews { - // margin-top: 0px; - // width: 50%; - // margin-left: 20px; - - // .title-inline { - // display: inline-flex; - // align-items: center; - // justify-content: space-between; - // margin-bottom: 20px; - // width: 100%; - - // button { - // float: right; - // border-radius: 0px !important; - // } - // } - - // .overall { - // display: flex; - // flex-direction: row; - // align-items: center; - // justify-content: space-between; - // height: 150px; - - // .left-side { - // margin-bottom: 20px; - - // .number{ - // font-size: 34px; - // } - // } - - // .right-side { - // display: block; - - // .rater { - // display: inline-flex; - // align-items: center; - - // .star { - // width: 50px; - // height: 20px; - // padding: 1px; - // margin-right: 8px; - // } - - // .line-bar { - // height: 4px; - // width: 158px; - // margin-right: 12px; - // background: $bar-color; - - // .line-value { - // background-color: $dark-blue-shade; - // } - // } - // } - // } - // } - - // .reviews { - // margin-top: 34px; - // margin-bottom: 90px; - - // .review { - // margin-bottom: 25px; - - // .title { - // margin-bottom: 5px; - // } - - // .stars { - // margin-bottom: 15px; - // } - // .message { - // margin-bottom: 10px; - // } - // } - // .view-all { - // margin-top:15px; - // color: $logo-color; - // margin-bottom:15px; - // } - // } - // } - - } } } -// .rating-reviews { +.rating-reviews { -// .rating-header { -// font-weight: 600; -// padding: 20px 0; -// } + .rating-header { + font-weight: 600; + padding: 20px 0; + } -// .stars { -// .icon { -// width: 16px; -// height: 16px; -// } -// } + .stars { + .icon { + width: 16px; + height: 16px; + } + } -// .overall { -// display: flex; -// flex-direction: row; -// align-items: center; -// justify-content: space-between; + .overall { + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; -// .review-info { -// .number { -// font-size: 34px; -// } + .review-info { + .number { + font-size: 34px; + } -// .total-reviews { -// margin-top: 10px; -// } -// } -// } + .total-reviews { + margin-top: 10px; + } + } + } -// .reviews { -// margin-top: 40px; -// margin-bottom: 40px; + .reviews { + margin-top: 40px; + margin-bottom: 40px; -// .review { -// margin-bottom: 25px; + .review { + margin-bottom: 25px; -// .title { -// margin-bottom: 5px; -// } + .title { + margin-bottom: 5px; + } -// .stars { -// margin-bottom: 15px; -// display: inline-block; -// } + .stars { + margin-bottom: 15px; + display: inline-block; + } -// .message { -// margin-bottom: 10px; -// } + .message { + margin-bottom: 10px; + } -// .reviewer-details { -// color: #5E5E5E; -// } -// } + .reviewer-details { + color: #5E5E5E; + } + } -// .view-all { -// margin-top:15px; -// color: $logo-color; -// margin-bottom:15px; -// } -// } -// } + .view-all { + margin-top:15px; + color: $logo-color; + margin-bottom:15px; + } + } +} /* cart pages and elements css begins here */ section.cart { @@ -2202,572 +2113,8 @@ section.cart { // oder page css end here -// responsive order page css start here - -@media all and (max-width: 480px) { - - .order { - margin-left: 0%; - - .order-section-head { - display: none; - } - - .order-section-head-small { - display: block; - margin-top: -15px; - - span { - display:inline-block; - width:33.3%; - } - - .icon { - float: left; - - img { - margin-top: 11px; - } - } - - .order-number { - text-align: center; - font-size: 16px; - color: #242424; - letter-spacing: -0.38px; - text-align: center; - margin-top: 13px; - margin-bottom: 13px; - } - - .cancel { - float: right; - text-align: right; - font-size: 17px; - color: #0031F0; - letter-spacing: -0.11px; - margin-top: 13px; - margin-bottom: 13px; - } - - .horizon-rule { - border: .5px solid #E8E8E8; - width: 150%; - margin-left: -10%; - margin-right: -10%; - } - } - - .payment-place { - font-size: 16px; - color: $profile-content-color; - margin-top: 4%; - - .placed-on { - display: flex; - flex-direction: column; - - .place-text { - width:100%; - - span { - font-size: 14px; - } - - .processing { - display: block; - float: right; - background: #2ED04C; - height: 25px; - border-radius: 100px; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.12px; - width: 110px; - text-align: center; - padding-top: 3.5px; - padding-left: 5px; - margin-top: 3px; - } - } - - .place-date{ - margin-top: -5px; - } - } - - .payment-status { - display: flex; - flex-direction: column; - - .payment-text { - - span { - font-size: 14px; - } - } - - .status { - margin-top: 2px; - } - } - - .horizontal-rule { - margin-top: 1.1%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - } - - .order-details{ - display: none; - } - - .total { - margin-top: 5%; - height: 130px; - - .calculate { - width: 100%; - float: left; - - .sub-total { - - .left { - margin-left: 0px; - width:100px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .ship-handle { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .discount { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .grand-total { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .due { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - } - } - - .horizontal-rule { - display: none; - } - - .table { - display:none; - } - - .product-config { - border: 1px solid #E8E8E8; - height: 19%; - width:100%; - margin-top: 10px; - display: block; - - .product-attribute { - display: flex; - flex-direction: row; - - .product-property { - width: 30%; - margin-top: 10px; - margin-left: 5px; - - span { - font-size: 14px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - } - - .property-name { - margin-top: 10px; - width:50%; - - span { - font-size: 16px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - } - } - - } - - .order-information { - flex-direction: column; - - .order-address-method { - width : 250px; - } - - .order-address-method:nth-child(3) { - margin-top: 10px; - } - - .order-address-method:nth-child(2) { - margin-top: 10px; - } - - .order-address-method:nth-child(4) { - margin-top: 10px; - } - - } - } -} - -@media all and (min-width: 481px) and (max-width: 920px) { - - .order { - margin-left: 0%; - - .order-section-head { - display: none; - } - - .order-section-head-small { - display: block; - margin-top: -15px; - - span { - display:inline-block; - width:33.3%; - } - - .icon { - float: left; - - img { - margin-top: 11px; - } - } - - .order-number { - text-align: center; - font-size: 16px; - color: #242424; - letter-spacing: -0.38px; - text-align: center; - margin-top: 13px; - margin-bottom: 13px; - } - - .cancel { - float: right; - text-align: right; - font-size: 17px; - color: #0031F0; - letter-spacing: -0.11px; - margin-top: 13px; - margin-bottom: 13px; - } - - .horizon-rule { - border: .5px solid #E8E8E8; - width: 150%; - margin-left: -10%; - margin-right: -10%; - } - } - - .payment-place { - font-size: 16px; - color: $profile-content-color; - margin-top: 4%; - - .placed-on { - display: flex; - flex-direction: column; - - .place-text { - width:100%; - - span { - font-size: 14px; - } - - .processing { - display: block; - float: right; - background: #2ED04C; - height: 25px; - border-radius: 100px; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.12px; - width: 110px; - text-align: center; - padding-top: 3.5px; - padding-left: 5px; - margin-top: 3px; - } - } - - .place-date{ - margin-top: -5px; - } - } - - .payment-status { - display: flex; - flex-direction: column; - - .payment-text { - - span { - font-size: 14px; - } - } - - .status { - margin-top: 2px; - } - } - - .horizontal-rule { - margin-top: 1.1%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - } - - .order-details{ - display: none; - } - - .total { - margin-top: 5%; - height: 130px; - - .calculate { - width: 100%; - float: left; - - .sub-total { - - .left { - margin-left: 0px; - width:100px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .ship-handle { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .discount { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .grand-total { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - - .due { - - .left { - margin-left: 0px; - } - - .middle { - display: none; - } - - .right { - float:right; - width:25%; - } - } - } - } - - .horizontal-rule { - display: none; - } - - .table { - display:none; - } - - .product-config { - border: 1px solid #E8E8E8; - height: 19%; - width:100%; - margin-top: 10px; - display: block; - - .product-attribute { - display: flex; - flex-direction: row; - - .product-property { - width: 30%; - margin-top: 10px; - margin-left: 5px; - - span { - font-size: 14px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - } - - .property-name { - margin-top: 10px; - width:50%; - - span { - font-size: 16px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - } - } - - } - - .order-information { - flex-direction: column; - - .order-address-method { - width : 250px; - } - - .order-address-method:nth-child(3) { - margin-top: 10px; - } - - .order-address-method:nth-child(2) { - margin-top: 10px; - } - - .order-address-method:nth-child(4) { - margin-top: 10px; - } - - } - } - -} -// responsive order css end here - // checkout starts here -.checkout-process{ +.checkout-process { display: flex; flex-direction: row; width: 100%; @@ -2784,7 +2131,7 @@ section.cart { justify-content: space-between; width: 100%; padding-bottom: 15px; - border-bottom: 1px solid #E8E8E8;; + border-bottom: 1px solid #E8E8E8; li { height: 48px; @@ -2797,9 +2144,31 @@ section.cart { border-radius: 50%; display: inline-flex; border: 1px solid #E8E8E8; + background-repeat: no-repeat; + background-position: center; - img { - margin: auto; + &.address-info { + background-image: url('../images/address.svg'); + } + + &.shipping { + background-image: url('../images/shipping.svg'); + } + + &.payment { + background-image: url('../images/payment.svg'); + } + + &.review { + background-image: url('../images/finish.svg'); + } + } + + &.completed { + cursor: pointer; + + .decorator { + background-image: url('../images/complete.svg'); } } @@ -2841,6 +2210,12 @@ section.cart { padding-top: 20px; padding-bottom: 20px; } + + .shipping-methods { + h4 { + margin: 0; + } + } } } @@ -2879,14 +2254,6 @@ section.cart { } } - .horizontal-rule { - margin-top: 6%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - .payble-amount { margin-top: 12px; @@ -2901,7 +2268,6 @@ section.cart { } .right { - float:right; font-size: 16px; color: #242424; @@ -2911,341 +2277,8 @@ section.cart { } } } - // checkout ends here -// responsive checkout start here - -@media all and (max-width: 480px) { - .checkout-process{ - width: 100%; - margin-top: 3%; - - .left-side { - width: 100%; - margin-right: 0%; - height: 60px; - - .checkout-menu { - width: 100%; - - ul.checkout-detail { - height: 60px; - width: 100%; - padding: 5px; - - li { - height: 48px; - - .wrapper { - display: flex; - - span { - display: none; - } - } - } - - .line { - margin-top: 23px; - width: 100%; - margin-left: 5px; - margin-right: 5px; - border: 1px solid #E7E7E7; - height: 1px; - } - } - - .horizontal-rule { - display: none; - } - } - } - - .right-side { - display: none; - } - } - - .order-info{ - width: 100%; - margin-right: 0%; - margin-top: 10px; - height:50px; - - .control-group { - - .control{ - width:100%; - } - } - - .different-billing-addr { - margin-top: 5%; - } - - .horizontal-rule { - margin-top: 10%; - } - - .countinue-button { - margin-top: 8%; - } - } -} - -@media all and (min-width: 481px) and (max-width: 920px) { - - .checkout-process{ - width: 100%; - margin-top:3%; - - .left-side { - width: 100%; - margin-right: 0%; - height: 60px; - - .checkout-menu { - width: 100%; - - ul.checkout-detail { - height: 60px; - width: 100%; - padding: 5px; - - li { - height: 48px; - - .wrapper { - display:flex; - - span { - display: none; - } - - } - } - - .line { - margin-top: 23px; - width: 100%; - margin-left: 10px; - margin-right: 10px; - border: 1px solid #E7E7E7; - height: 1px; - } - } - - .horizontal-rule { - display: none; - } - } - } - - .right-side { - display:none; - } - } - - .order-info{ - width: 100%; - margin-right: 0%; - margin-top: 10px; - height:50px; - - .control-group { - - .control{ - width:100%; - } - } - - .different-billing-addr { - margin-top: 3%; - } - - .horizontal-rule { - margin-top: 10%; - } - - .countinue-button { - margin-top: 5%; - } - } -} -// responsive checkout end here - - - -//shipment start here -.ship-method { - width: 67%; - margin-right: 6%; - height: 600px; - margin-top: -190px; - - .ship-info { - - .ship-text{ - font-size: 24px; - color: #242424; - letter-spacing: -0.58px; - font-weight: bold; - } - } - - .ship-price { - margin-top: 31px; - - .price-checkbox { - display:flex; - - span { - margin-left: 8px; - font-size: 16px; - color: #242424; - line-height: 22px; - font-weight: bold; - } - - } - - .price-checkbox-text { - margin-left: 25px; - width:580px; - height:44px; - margin-top: 4px; - - b { - font-size: 16px; - } - - span { - font-size: 16px; - color: #242424; - line-height: 22px; - } - } - - - } - - .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - - .countinue-button { - margin-top: 3%; - - button { - background: #0031F0; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.26px; - text-align: center; - height: 38px; - width: 137px; - border: none; - } - } -} -//shipment end here - -// payment method start here -.payment-method { - width: 67%; - margin-right: 6%; - height: 600px; - margin-top: -190px; - - .payment-info { - - .payment-text{ - font-size: 24px; - color: #242424; - letter-spacing: -0.58px; - font-weight: bold; - } - } - - .payment-price { - margin-top: 31px; - - .payment-checkbox { - display:flex; - - span { - margin-left: 8px; - font-size: 16px; - color: #242424; - line-height: 22px; - font-weight: bold; - } - - } - - .payment-checkbox-text { - margin-left: 25px; - width:580px; - height:44px; - margin-top: 4px; - - b { - font-size: 16px; - } - - span { - font-size: 16px; - color: #242424; - line-height: 22px; - } - } - - - } - - .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - - .countinue-button { - margin-top: 3%; - - button { - background: #0031F0; - font-size: 14px; .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - color: #FFFFFF; - letter-spacing: -0.26px; .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - text-align: center; - height: 38px; - width: 137px; - border: none; - } - } -} -// payment method end here - - // complete page start here .complete-page{ width:880px; diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index 13b6216bc..7c8d171eb 100644 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -84,7 +84,8 @@ return [ 'order-summary' => 'Order Summary', 'shipping-address' => 'Shipping Address', 'use_for_shipping' => 'Ship to this address', - 'continue' => 'Continue' + 'continue' => 'Continue', + 'shipping-method' => 'Shipping Method' ] ] ]; \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php index dbb4cb629..40a6ae6f7 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php @@ -18,40 +18,28 @@
-
+
@include('shop::checkout.onepage.customer-info') @@ -65,15 +53,32 @@
-
+
+ + @include('shop::checkout.onepage.shipping') -
-
+
-
-
+ + +
+ +
+ +
+ + @include('shop::checkout.onepage.payment') + +
+ +
+ + @include('shop::checkout.onepage.review') + +
-
@include('shop::checkout.onepage.summary') @@ -89,10 +94,27 @@ inject: ['$validator'], data: () => ({ - billing: { - use_for_shipping: true + currentStep: 1, + + completedStep: 0, + + shipping_methods: [], + + payment_methods: [], + + address: { + billing: { + use_for_shipping: true + }, + + shipping: {}, }, - shipping: {}, + + selected_shipping_method: '', + + selected_payment: { + method: '' + } }), created () { @@ -100,19 +122,52 @@ }, methods: { + navigateToStep (step) { + if(step <= this.completedStep) { + this.currentStep = step + this.completedStep = step - 1; + } + }, + validateForm: function (scope) { this.$validator.validateAll(scope).then((result) => { if(result) { - this.saveAddress() + if(scope == 'address-form') { + this.saveAddress() + } else if(scope == 'shipping-form') { + this.saveShipping() + } } }); }, saveAddress () { + var this_this = this; + + this.$http.post("{{ route('shop.checkout.save-address') }}", this.address) + .then(function(response) { + if(response.data.shipping) { + this_this.shipping_methods = response.data.shipping + this_this.completedStep = 1; + this_this.currentStep = 2; + } + }) + }, + + saveShipping () { // this.$http.get('https://api.coindesk.com/v1/bpi/currentprice.json') // .then(function(response) { - // console.log(response) - // }) + this.completedStep = 2; + this.currentStep = 3; + // }) + }, + + savePayment () { + // this.$http.get('https://api.coindesk.com/v1/bpi/currentprice.json') + // .then(function(response) { + this.completedStep = 1; + this.currentStep = 2; + // }) } } }) diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php index 9a0d01d2a..96642d85b 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/customer-info.blade.php @@ -15,7 +15,7 @@ {{ __('shop::app.checkout.onepage.first-name') }} - + @{{ errors.first('address-form.billing[first_name]') }} @@ -27,7 +27,7 @@ {{ __('shop::app.checkout.onepage.last-name') }} - + @{{ errors.first('address-form.billing[last_name]') }} @@ -39,7 +39,7 @@ {{ __('shop::app.checkout.onepage.email') }} - + @{{ errors.first('address-form.billing[email]') }} @@ -51,7 +51,7 @@ {{ __('shop::app.checkout.onepage.address1') }} - + @{{ errors.first('address-form.billing[address1]') }} @@ -63,7 +63,7 @@ {{ __('shop::app.checkout.onepage.address2') }} - +
@@ -71,7 +71,7 @@ {{ __('shop::app.checkout.onepage.city') }} - + @{{ errors.first('address-form.billing[city]') }} @@ -83,7 +83,7 @@ {{ __('shop::app.checkout.onepage.state') }} - + @{{ errors.first('address-form.billing[state]') }} @@ -95,7 +95,7 @@ {{ __('shop::app.checkout.onepage.postcode') }} - + @{{ errors.first('address-form.billing[postcode]') }} @@ -107,7 +107,7 @@ {{ __('shop::app.checkout.onepage.phone') }} - + @{{ errors.first('address-form.billing[phone]') }} @@ -119,7 +119,7 @@ {{ __('shop::app.checkout.onepage.country') }} - @foreach (country()->all() as $code => $country) @@ -136,7 +136,7 @@
- + {{ __('shop::app.checkout.onepage.use_for_shipping') }} @@ -144,7 +144,7 @@
-
+

{{ __('shop::app.checkout.onepage.shipping-address') }}

@@ -155,7 +155,7 @@ {{ __('shop::app.checkout.onepage.first-name') }} - + @{{ errors.first('address-form.shipping[first_name]') }} @@ -167,7 +167,7 @@ {{ __('shop::app.checkout.onepage.last-name') }} - + @{{ errors.first('address-form.shipping[last_name]') }} @@ -179,7 +179,7 @@ {{ __('shop::app.checkout.onepage.email') }} - + @{{ errors.first('address-form.shipping[email]') }} @@ -191,7 +191,7 @@ {{ __('shop::app.checkout.onepage.address1') }} - + @{{ errors.first('address-form.shipping[address1]') }} @@ -203,7 +203,7 @@ {{ __('shop::app.checkout.onepage.address2') }} - +
@@ -211,7 +211,7 @@ {{ __('shop::app.checkout.onepage.city') }} - + @{{ errors.first('address-form.shipping[city]') }} @@ -223,7 +223,7 @@ {{ __('shop::app.checkout.onepage.state') }} - + @{{ errors.first('address-form.shipping[state]') }} @@ -235,7 +235,7 @@ {{ __('shop::app.checkout.onepage.postcode') }} - + @{{ errors.first('address-form.shipping[postcode]') }} @@ -247,7 +247,7 @@ {{ __('shop::app.checkout.onepage.phone') }} - + @{{ errors.first('address-form.shipping[phone]') }} @@ -259,7 +259,7 @@ {{ __('shop::app.checkout.onepage.country') }} - @foreach (country()->all() as $code => $country) diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php index e69de29bb..a9c0800e9 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/shipping.blade.php @@ -0,0 +1,26 @@ +
+
+
+

{{ __('shop::app.checkout.onepage.shipping-method') }}

+
+ +
+ +
+

@{{ shipping_method.carrier_title }}

+ + + + + @{{ rate.method_title }} + @{{ rate.price_formated }} + + + + @{{ errors.first('shipping-form.shipping_method') }} + +
+ +
+
+
\ No newline at end of file diff --git a/public/themes/default/assets/css/shop.css b/public/themes/default/assets/css/shop.css index 4be3042bb..f307a35e2 100644 --- a/public/themes/default/assets/css/shop.css +++ b/public/themes/default/assets/css/shop.css @@ -816,7 +816,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } .layered-filter-wrapper .filter-attributes .filter-attributes-item.active .filter-attributes-title .icon { - background-image: url("../images//arrow-up.svg") !important; + background-image: url("../images/arrow-up.svg") !important; } .main-container-wrapper { @@ -1605,6 +1605,72 @@ section.product-detail div.layouter form .details .full-description { font-size: 16px; } +.rating-reviews .rating-header { + font-weight: 600; + padding: 20px 0; +} + +.rating-reviews .stars .icon { + width: 16px; + height: 16px; +} + +.rating-reviews .overall { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: justify; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.rating-reviews .overall .review-info .number { + font-size: 34px; +} + +.rating-reviews .overall .review-info .total-reviews { + margin-top: 10px; +} + +.rating-reviews .reviews { + margin-top: 40px; + margin-bottom: 40px; +} + +.rating-reviews .reviews .review { + margin-bottom: 25px; +} + +.rating-reviews .reviews .review .title { + margin-bottom: 5px; +} + +.rating-reviews .reviews .review .stars { + margin-bottom: 15px; + display: inline-block; +} + +.rating-reviews .reviews .review .message { + margin-bottom: 10px; +} + +.rating-reviews .reviews .review .reviewer-details { + color: #5E5E5E; +} + +.rating-reviews .reviews .view-all { + margin-top: 15px; + color: #0031f0; + margin-bottom: 15px; +} + /* cart pages and elements css begins here */ section.cart { color: #242424; @@ -2145,462 +2211,6 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #3A3A3A; } -@media all and (max-width: 480px) { - .order { - margin-left: 0%; - } - .order .order-section-head { - display: none; - } - .order .order-section-head-small { - display: block; - margin-top: -15px; - } - .order .order-section-head-small span { - display: inline-block; - width: 33.3%; - } - .order .order-section-head-small .icon { - float: left; - } - .order .order-section-head-small .icon img { - margin-top: 11px; - } - .order .order-section-head-small .order-number { - text-align: center; - font-size: 16px; - color: #242424; - letter-spacing: -0.38px; - text-align: center; - margin-top: 13px; - margin-bottom: 13px; - } - .order .order-section-head-small .cancel { - float: right; - text-align: right; - font-size: 17px; - color: #0031F0; - letter-spacing: -0.11px; - margin-top: 13px; - margin-bottom: 13px; - } - .order .order-section-head-small .horizon-rule { - border: .5px solid #E8E8E8; - width: 150%; - margin-left: -10%; - margin-right: -10%; - } - .order .payment-place { - font-size: 16px; - color: #5e5e5e; - margin-top: 4%; - } - .order .payment-place .placed-on { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .payment-place .placed-on .place-text { - width: 100%; - } - .order .payment-place .placed-on .place-text span { - font-size: 14px; - } - .order .payment-place .placed-on .place-text .processing { - display: block; - float: right; - background: #2ED04C; - height: 25px; - border-radius: 100px; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.12px; - width: 110px; - text-align: center; - padding-top: 3.5px; - padding-left: 5px; - margin-top: 3px; - } - .order .payment-place .placed-on .place-date { - margin-top: -5px; - } - .order .payment-place .payment-status { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .payment-place .payment-status .payment-text span { - font-size: 14px; - } - .order .payment-place .payment-status .status { - margin-top: 2px; - } - .order .payment-place .horizontal-rule { - margin-top: 1.1%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - .order .order-details { - display: none; - } - .order .total { - margin-top: 5%; - height: 130px; - } - .order .total .calculate { - width: 100%; - float: left; - } - .order .total .calculate .sub-total .left { - margin-left: 0px; - width: 100px; - } - .order .total .calculate .sub-total .middle { - display: none; - } - .order .total .calculate .sub-total .right { - float: right; - width: 25%; - } - .order .total .calculate .ship-handle .left { - margin-left: 0px; - } - .order .total .calculate .ship-handle .middle { - display: none; - } - .order .total .calculate .ship-handle .right { - float: right; - width: 25%; - } - .order .total .calculate .discount .left { - margin-left: 0px; - } - .order .total .calculate .discount .middle { - display: none; - } - .order .total .calculate .discount .right { - float: right; - width: 25%; - } - .order .total .calculate .grand-total .left { - margin-left: 0px; - } - .order .total .calculate .grand-total .middle { - display: none; - } - .order .total .calculate .grand-total .right { - float: right; - width: 25%; - } - .order .total .calculate .due .left { - margin-left: 0px; - } - .order .total .calculate .due .middle { - display: none; - } - .order .total .calculate .due .right { - float: right; - width: 25%; - } - .order .horizontal-rule { - display: none; - } - .order .table { - display: none; - } - .order .product-config { - border: 1px solid #E8E8E8; - height: 19%; - width: 100%; - margin-top: 10px; - display: block; - } - .order .product-config .product-attribute { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: horizontal; - -webkit-box-direction: normal; - -ms-flex-direction: row; - flex-direction: row; - } - .order .product-config .product-attribute .product-property { - width: 30%; - margin-top: 10px; - margin-left: 5px; - } - .order .product-config .product-attribute .product-property span { - font-size: 14px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - .order .product-config .product-attribute .property-name { - margin-top: 10px; - width: 50%; - } - .order .product-config .product-attribute .property-name span { - font-size: 16px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - .order .order-information { - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .order-information .order-address-method { - width: 250px; - } - .order .order-information .order-address-method:nth-child(3) { - margin-top: 10px; - } - .order .order-information .order-address-method:nth-child(2) { - margin-top: 10px; - } - .order .order-information .order-address-method:nth-child(4) { - margin-top: 10px; - } -} - -@media all and (min-width: 481px) and (max-width: 920px) { - .order { - margin-left: 0%; - } - .order .order-section-head { - display: none; - } - .order .order-section-head-small { - display: block; - margin-top: -15px; - } - .order .order-section-head-small span { - display: inline-block; - width: 33.3%; - } - .order .order-section-head-small .icon { - float: left; - } - .order .order-section-head-small .icon img { - margin-top: 11px; - } - .order .order-section-head-small .order-number { - text-align: center; - font-size: 16px; - color: #242424; - letter-spacing: -0.38px; - text-align: center; - margin-top: 13px; - margin-bottom: 13px; - } - .order .order-section-head-small .cancel { - float: right; - text-align: right; - font-size: 17px; - color: #0031F0; - letter-spacing: -0.11px; - margin-top: 13px; - margin-bottom: 13px; - } - .order .order-section-head-small .horizon-rule { - border: .5px solid #E8E8E8; - width: 150%; - margin-left: -10%; - margin-right: -10%; - } - .order .payment-place { - font-size: 16px; - color: #5e5e5e; - margin-top: 4%; - } - .order .payment-place .placed-on { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .payment-place .placed-on .place-text { - width: 100%; - } - .order .payment-place .placed-on .place-text span { - font-size: 14px; - } - .order .payment-place .placed-on .place-text .processing { - display: block; - float: right; - background: #2ED04C; - height: 25px; - border-radius: 100px; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.12px; - width: 110px; - text-align: center; - padding-top: 3.5px; - padding-left: 5px; - margin-top: 3px; - } - .order .payment-place .placed-on .place-date { - margin-top: -5px; - } - .order .payment-place .payment-status { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .payment-place .payment-status .payment-text span { - font-size: 14px; - } - .order .payment-place .payment-status .status { - margin-top: 2px; - } - .order .payment-place .horizontal-rule { - margin-top: 1.1%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; - } - .order .order-details { - display: none; - } - .order .total { - margin-top: 5%; - height: 130px; - } - .order .total .calculate { - width: 100%; - float: left; - } - .order .total .calculate .sub-total .left { - margin-left: 0px; - width: 100px; - } - .order .total .calculate .sub-total .middle { - display: none; - } - .order .total .calculate .sub-total .right { - float: right; - width: 25%; - } - .order .total .calculate .ship-handle .left { - margin-left: 0px; - } - .order .total .calculate .ship-handle .middle { - display: none; - } - .order .total .calculate .ship-handle .right { - float: right; - width: 25%; - } - .order .total .calculate .discount .left { - margin-left: 0px; - } - .order .total .calculate .discount .middle { - display: none; - } - .order .total .calculate .discount .right { - float: right; - width: 25%; - } - .order .total .calculate .grand-total .left { - margin-left: 0px; - } - .order .total .calculate .grand-total .middle { - display: none; - } - .order .total .calculate .grand-total .right { - float: right; - width: 25%; - } - .order .total .calculate .due .left { - margin-left: 0px; - } - .order .total .calculate .due .middle { - display: none; - } - .order .total .calculate .due .right { - float: right; - width: 25%; - } - .order .horizontal-rule { - display: none; - } - .order .table { - display: none; - } - .order .product-config { - border: 1px solid #E8E8E8; - height: 19%; - width: 100%; - margin-top: 10px; - display: block; - } - .order .product-config .product-attribute { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - -webkit-box-orient: horizontal; - -webkit-box-direction: normal; - -ms-flex-direction: row; - flex-direction: row; - } - .order .product-config .product-attribute .product-property { - width: 30%; - margin-top: 10px; - margin-left: 5px; - } - .order .product-config .product-attribute .product-property span { - font-size: 14px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - .order .product-config .product-attribute .property-name { - margin-top: 10px; - width: 50%; - } - .order .product-config .product-attribute .property-name span { - font-size: 16px; - color: #5E5E5E; - letter-spacing: -0.11px; - } - .order .order-information { - -webkit-box-orient: vertical; - -webkit-box-direction: normal; - -ms-flex-direction: column; - flex-direction: column; - } - .order .order-information .order-address-method { - width: 250px; - } - .order .order-information .order-address-method:nth-child(3) { - margin-top: 10px; - } - .order .order-information .order-address-method:nth-child(2) { - margin-top: 10px; - } - .order .order-information .order-address-method:nth-child(4) { - margin-top: 10px; - } -} - .checkout-process { display: -webkit-box; display: -ms-flexbox; @@ -2648,10 +2258,32 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo display: -ms-inline-flexbox; display: inline-flex; border: 1px solid #E8E8E8; + background-repeat: no-repeat; + background-position: center; } -.checkout-process .col-main ul.checkout-steps li .decorator img { - margin: auto; +.checkout-process .col-main ul.checkout-steps li .decorator.address-info { + background-image: url("../images/address.svg"); +} + +.checkout-process .col-main ul.checkout-steps li .decorator.shipping { + background-image: url("../images/shipping.svg"); +} + +.checkout-process .col-main ul.checkout-steps li .decorator.payment { + background-image: url("../images/payment.svg"); +} + +.checkout-process .col-main ul.checkout-steps li .decorator.review { + background-image: url("../images/finish.svg"); +} + +.checkout-process .col-main ul.checkout-steps li.completed { + cursor: pointer; +} + +.checkout-process .col-main ul.checkout-steps li.completed .decorator { + background-image: url("../images/complete.svg"); } .checkout-process .col-main ul.checkout-steps li span { @@ -2692,6 +2324,10 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo padding-bottom: 20px; } +.checkout-process .col-main .step-content .shipping-methods h4 { + margin: 0; +} + .checkout-process .col-right { width: 35%; padding-left: 40px; @@ -2723,14 +2359,6 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #242424; } -.checkout-process .col-right .order-summary .horizontal-rule { - margin-top: 6%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; -} - .checkout-process .col-right .order-summary .payble-amount { margin-top: 12px; } @@ -2752,292 +2380,6 @@ section.cart .cart-content .right-side .coupon-section .after-coupon-amount .amo color: #242424; } -@media all and (max-width: 480px) { - .checkout-process { - width: 100%; - margin-top: 3%; - } - .checkout-process .left-side { - width: 100%; - margin-right: 0%; - height: 60px; - } - .checkout-process .left-side .checkout-menu { - width: 100%; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail { - height: 60px; - width: 100%; - padding: 5px; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li { - height: 48px; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper span { - display: none; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail .line { - margin-top: 23px; - width: 100%; - margin-left: 5px; - margin-right: 5px; - border: 1px solid #E7E7E7; - height: 1px; - } - .checkout-process .left-side .checkout-menu .horizontal-rule { - display: none; - } - .checkout-process .right-side { - display: none; - } - .order-info { - width: 100%; - margin-right: 0%; - margin-top: 10px; - height: 50px; - } - .order-info .control-group .control { - width: 100%; - } - .order-info .different-billing-addr { - margin-top: 5%; - } - .order-info .horizontal-rule { - margin-top: 10%; - } - .order-info .countinue-button { - margin-top: 8%; - } -} - -@media all and (min-width: 481px) and (max-width: 920px) { - .checkout-process { - width: 100%; - margin-top: 3%; - } - .checkout-process .left-side { - width: 100%; - margin-right: 0%; - height: 60px; - } - .checkout-process .left-side .checkout-menu { - width: 100%; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail { - height: 60px; - width: 100%; - padding: 5px; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li { - height: 48px; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail li .wrapper span { - display: none; - } - .checkout-process .left-side .checkout-menu ul.checkout-detail .line { - margin-top: 23px; - width: 100%; - margin-left: 10px; - margin-right: 10px; - border: 1px solid #E7E7E7; - height: 1px; - } - .checkout-process .left-side .checkout-menu .horizontal-rule { - display: none; - } - .checkout-process .right-side { - display: none; - } - .order-info { - width: 100%; - margin-right: 0%; - margin-top: 10px; - height: 50px; - } - .order-info .control-group .control { - width: 100%; - } - .order-info .different-billing-addr { - margin-top: 3%; - } - .order-info .horizontal-rule { - margin-top: 10%; - } - .order-info .countinue-button { - margin-top: 5%; - } -} - -.ship-method { - width: 67%; - margin-right: 6%; - height: 600px; - margin-top: -190px; -} - -.ship-method .ship-info .ship-text { - font-size: 24px; - color: #242424; - letter-spacing: -0.58px; - font-weight: bold; -} - -.ship-method .ship-price { - margin-top: 31px; -} - -.ship-method .ship-price .price-checkbox { - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} - -.ship-method .ship-price .price-checkbox span { - margin-left: 8px; - font-size: 16px; - color: #242424; - line-height: 22px; - font-weight: bold; -} - -.ship-method .ship-price .price-checkbox-text { - margin-left: 25px; - width: 580px; - height: 44px; - margin-top: 4px; -} - -.ship-method .ship-price .price-checkbox-text b { - font-size: 16px; -} - -.ship-method .ship-price .price-checkbox-text span { - font-size: 16px; - color: #242424; - line-height: 22px; -} - -.ship-method .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; -} - -.ship-method .countinue-button { - margin-top: 3%; -} - -.ship-method .countinue-button button { - background: #0031F0; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.26px; - text-align: center; - height: 38px; - width: 137px; - border: none; -} - -.payment-method { - width: 67%; - margin-right: 6%; - height: 600px; - margin-top: -190px; -} - -.payment-method .payment-info .payment-text { - font-size: 24px; - color: #242424; - letter-spacing: -0.58px; - font-weight: bold; -} - -.payment-method .payment-price { - margin-top: 31px; -} - -.payment-method .payment-price .payment-checkbox { - display: -webkit-box; - display: -ms-flexbox; - display: flex; -} - -.payment-method .payment-price .payment-checkbox span { - margin-left: 8px; - font-size: 16px; - color: #242424; - line-height: 22px; - font-weight: bold; -} - -.payment-method .payment-price .payment-checkbox-text { - margin-left: 25px; - width: 580px; - height: 44px; - margin-top: 4px; -} - -.payment-method .payment-price .payment-checkbox-text b { - font-size: 16px; -} - -.payment-method .payment-price .payment-checkbox-text span { - font-size: 16px; - color: #242424; - line-height: 22px; -} - -.payment-method .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; -} - -.payment-method .countinue-button { - margin-top: 3%; -} - -.payment-method .countinue-button button { - background: #0031F0; - font-size: 14px; - color: #FFFFFF; - letter-spacing: -0.26px; - text-align: center; - height: 38px; - width: 137px; - border: none; -} - -.payment-method .countinue-button button .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; -} - -.payment-method .countinue-button button .horizontal-rule { - margin-top: 7%; - width: 100%; - height: 1px; - vertical-align: middle; - background: #e8e8e8; -} - .complete-page { width: 880px; height: 1050px; diff --git a/public/themes/default/assets/js/shop.js b/public/themes/default/assets/js/shop.js index ea917445b..785943a1c 100644 --- a/public/themes/default/assets/js/shop.js +++ b/public/themes/default/assets/js/shop.js @@ -60,34 +60,317 @@ /******/ __webpack_require__.p = "/"; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 2); +/******/ return __webpack_require__(__webpack_require__.s = 12); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -var g; +"use strict"; -// This works in non-strict mode -g = (function() { - return this; -})(); -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; +var bind = __webpack_require__(5); +var isBuffer = __webpack_require__(21); + +/*global toString:true*/ + +// utils is a library of generic helper functions non-specific to axios + +var toString = Object.prototype.toString; + +/** + * Determine if a value is an Array + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Array, otherwise false + */ +function isArray(val) { + return toString.call(val) === '[object Array]'; } -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} +/** + * Determine if a value is an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an ArrayBuffer, otherwise false + */ +function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; +} -module.exports = g; +/** + * Determine if a value is a FormData + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an FormData, otherwise false + */ +function isFormData(val) { + return (typeof FormData !== 'undefined') && (val instanceof FormData); +} + +/** + * Determine if a value is a view on an ArrayBuffer + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false + */ +function isArrayBufferView(val) { + var result; + if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { + result = ArrayBuffer.isView(val); + } else { + result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); + } + return result; +} + +/** + * Determine if a value is a String + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a String, otherwise false + */ +function isString(val) { + return typeof val === 'string'; +} + +/** + * Determine if a value is a Number + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Number, otherwise false + */ +function isNumber(val) { + return typeof val === 'number'; +} + +/** + * Determine if a value is undefined + * + * @param {Object} val The value to test + * @returns {boolean} True if the value is undefined, otherwise false + */ +function isUndefined(val) { + return typeof val === 'undefined'; +} + +/** + * Determine if a value is an Object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is an Object, otherwise false + */ +function isObject(val) { + return val !== null && typeof val === 'object'; +} + +/** + * Determine if a value is a Date + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Date, otherwise false + */ +function isDate(val) { + return toString.call(val) === '[object Date]'; +} + +/** + * Determine if a value is a File + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a File, otherwise false + */ +function isFile(val) { + return toString.call(val) === '[object File]'; +} + +/** + * Determine if a value is a Blob + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Blob, otherwise false + */ +function isBlob(val) { + return toString.call(val) === '[object Blob]'; +} + +/** + * Determine if a value is a Function + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Function, otherwise false + */ +function isFunction(val) { + return toString.call(val) === '[object Function]'; +} + +/** + * Determine if a value is a Stream + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a Stream, otherwise false + */ +function isStream(val) { + return isObject(val) && isFunction(val.pipe); +} + +/** + * Determine if a value is a URLSearchParams object + * + * @param {Object} val The value to test + * @returns {boolean} True if value is a URLSearchParams object, otherwise false + */ +function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; +} + +/** + * Trim excess whitespace off the beginning and end of a string + * + * @param {String} str The String to trim + * @returns {String} The String freed of excess whitespace + */ +function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); +} + +/** + * Determine if we're running in a standard browser environment + * + * This allows axios to run in a web worker, and react-native. + * Both environments support XMLHttpRequest, but not fully standard globals. + * + * web workers: + * typeof window -> undefined + * typeof document -> undefined + * + * react-native: + * navigator.product -> 'ReactNative' + */ +function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') { + return false; + } + return ( + typeof window !== 'undefined' && + typeof document !== 'undefined' + ); +} + +/** + * Iterate over an Array or an Object invoking a function for each item. + * + * If `obj` is an Array callback will be called passing + * the value, index, and complete array for each item. + * + * If 'obj' is an Object callback will be called passing + * the value, key, and complete object for each property. + * + * @param {Object|Array} obj The object to iterate + * @param {Function} fn The callback to invoke for each item + */ +function forEach(obj, fn) { + // Don't bother if no value provided + if (obj === null || typeof obj === 'undefined') { + return; + } + + // Force an array if not already something iterable + if (typeof obj !== 'object') { + /*eslint no-param-reassign:0*/ + obj = [obj]; + } + + if (isArray(obj)) { + // Iterate over array values + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + // Iterate over object keys + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } +} + +/** + * Accepts varargs expecting each argument to be an object, then + * immutably merges the properties of each object and returns result. + * + * When multiple objects contain the same key the later object in + * the arguments list will take precedence. + * + * Example: + * + * ```js + * var result = merge({foo: 123}, {foo: 456}); + * console.log(result.foo); // outputs 456 + * ``` + * + * @param {Object} obj1 Object to merge + * @returns {Object} Result of all merge properties + */ +function merge(/* obj1, obj2, obj3, ... */) { + var result = {}; + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + return result; +} + +/** + * Extends object a by mutably adding to it the properties of object b. + * + * @param {Object} a The object to be extended + * @param {Object} b The object to copy properties from + * @param {Object} thisArg The object to bind function to + * @return {Object} The resulting value of object a + */ +function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = bind(val, thisArg); + } else { + a[key] = val; + } + }); + return a; +} + +module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + extend: extend, + trim: trim +}; /***/ }), @@ -201,27 +484,928 @@ module.exports = function normalizeComponent ( /***/ }), /* 2 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ (function(module, exports) { -__webpack_require__(3); -module.exports = __webpack_require__(25); +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1,eval)("this"); +} catch(e) { + // This works if the window reference is available + if(typeof window === "object") + g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { -window.jQuery = window.$ = $ = __webpack_require__(4); -window.Vue = __webpack_require__(5); -window.VeeValidate = __webpack_require__(9); +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { + +var utils = __webpack_require__(0); +var normalizeHeaderName = __webpack_require__(23); + +var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' +}; + +function setContentTypeIfUnset(headers, value) { + if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } +} + +function getDefaultAdapter() { + var adapter; + if (typeof XMLHttpRequest !== 'undefined') { + // For browsers use XHR adapter + adapter = __webpack_require__(6); + } else if (typeof process !== 'undefined') { + // For node use HTTP adapter + adapter = __webpack_require__(6); + } + return adapter; +} + +var defaults = { + adapter: getDefaultAdapter(), + + transformRequest: [function transformRequest(data, headers) { + normalizeHeaderName(headers, 'Content-Type'); + if (utils.isFormData(data) || + utils.isArrayBuffer(data) || + utils.isBuffer(data) || + utils.isStream(data) || + utils.isFile(data) || + utils.isBlob(data) + ) { + return data; + } + if (utils.isArrayBufferView(data)) { + return data.buffer; + } + if (utils.isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + if (utils.isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); + } + return data; + }], + + transformResponse: [function transformResponse(data) { + /*eslint no-param-reassign:0*/ + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) { /* Ignore */ } + } + return data; + }], + + /** + * A timeout in milliseconds to abort a request. If set to 0 (default) a + * timeout is not created. + */ + timeout: 0, + + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + + maxContentLength: -1, + + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } +}; + +defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } +}; + +utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; +}); + +utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); +}); + +module.exports = defaults; + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 4 */ +/***/ (function(module, exports) { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + return fn.apply(thisArg, args); + }; +}; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var utils = __webpack_require__(0); +var settle = __webpack_require__(24); +var buildURL = __webpack_require__(26); +var parseHeaders = __webpack_require__(27); +var isURLSameOrigin = __webpack_require__(28); +var createError = __webpack_require__(7); +var btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(29); + +module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (utils.isFormData(requestData)) { + delete requestHeaders['Content-Type']; // Let the browser set it + } + + var request = new XMLHttpRequest(); + var loadEvent = 'onreadystatechange'; + var xDomain = false; + + // For IE 8/9 CORS support + // Only supports POST and GET calls and doesn't returns the response headers. + // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest. + if ("development" !== 'test' && + typeof window !== 'undefined' && + window.XDomainRequest && !('withCredentials' in request) && + !isURLSameOrigin(config.url)) { + request = new window.XDomainRequest(); + loadEvent = 'onload'; + xDomain = true; + request.onprogress = function handleProgress() {}; + request.ontimeout = function handleTimeout() {}; + } + + // HTTP basic authentication + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true); + + // Set the request timeout in MS + request.timeout = config.timeout; + + // Listen for ready state + request[loadEvent] = function handleLoad() { + if (!request || (request.readyState !== 4 && !xDomain)) { + return; + } + + // The request errored out and we didn't get a response, this will be + // handled by onerror instead + // With one exception: request that using file: protocol, most browsers + // will return status as 0 even though it's a successful request + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + // Prepare the response + var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201) + status: request.status === 1223 ? 204 : request.status, + statusText: request.status === 1223 ? 'No Content' : request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + settle(resolve, reject, response); + + // Clean up request + request = null; + }; + + // Handle low level network errors + request.onerror = function handleError() { + // Real errors are hidden from us by the browser + // onerror should only fire if it's a network error + reject(createError('Network Error', config, null, request)); + + // Clean up request + request = null; + }; + + // Handle timeout + request.ontimeout = function handleTimeout() { + reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED', + request)); + + // Clean up request + request = null; + }; + + // Add xsrf header + // This is only done if running in a standard browser environment. + // Specifically not if we're in a web worker, or react-native. + if (utils.isStandardBrowserEnv()) { + var cookies = __webpack_require__(30); + + // Add xsrf header + var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ? + cookies.read(config.xsrfCookieName) : + undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + // Add headers to the request + if ('setRequestHeader' in request) { + utils.forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + // Remove Content-Type if data is undefined + delete requestHeaders[key]; + } else { + // Otherwise add header to the request + request.setRequestHeader(key, val); + } + }); + } + + // Add withCredentials to request if needed + if (config.withCredentials) { + request.withCredentials = true; + } + + // Add responseType to request if needed + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. + // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. + if (config.responseType !== 'json') { + throw e; + } + } + } + + // Handle progress if needed + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + // Not all browsers support upload events + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + // Handle cancellation + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + // Clean up request + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + // Send the request + request.send(requestData); + }); +}; + + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var enhanceError = __webpack_require__(25); + +/** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {Object} config The config. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * @returns {Error} The created error. + */ +module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return enhanceError(error, config, code, request, response); +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); +}; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/** + * A `Cancel` is an object that is thrown when an operation is canceled. + * + * @class + * @param {string=} message The message. + */ +function Cancel(message) { + this.message = message; +} + +Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); +}; + +Cancel.prototype.__CANCEL__ = true; + +module.exports = Cancel; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +module.exports = function(useSourceMap) { + var list = []; + + // return the list of modules as css string + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item, useSourceMap); + if(item[2]) { + return "@media " + item[2] + "{" + content + "}"; + } else { + return content; + } + }).join(""); + }; + + // import a list of modules into the list + list.i = function(modules, mediaQuery) { + if(typeof modules === "string") + modules = [[null, modules, ""]]; + var alreadyImportedModules = {}; + for(var i = 0; i < this.length; i++) { + var id = this[i][0]; + if(typeof id === "number") + alreadyImportedModules[id] = true; + } + for(i = 0; i < modules.length; i++) { + var item = modules[i]; + // skip already imported module + // this implementation is not 100% perfect for weird media query combinations + // when a module is imported multiple times with different media queries. + // I hope this will never occur (Hey this way we have smaller bundles) + if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { + if(mediaQuery && !item[2]) { + item[2] = mediaQuery; + } else if(mediaQuery) { + item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; + } + list.push(item); + } + } + }; + return list; +}; + +function cssWithMappingToString(item, useSourceMap) { + var content = item[1] || ''; + var cssMapping = item[3]; + if (!cssMapping) { + return content; + } + + if (useSourceMap && typeof btoa === 'function') { + var sourceMapping = toComment(cssMapping); + var sourceURLs = cssMapping.sources.map(function (source) { + return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' + }); + + return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); + } + + return [content].join('\n'); +} + +// Adapted from convert-source-map (MIT) +function toComment(sourceMap) { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); + var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; + + return '/*# ' + data + ' */'; +} + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + Modified by Evan You @yyx990803 +*/ + +var hasDocument = typeof document !== 'undefined' + +if (typeof DEBUG !== 'undefined' && DEBUG) { + if (!hasDocument) { + throw new Error( + 'vue-style-loader cannot be used in a non-browser environment. ' + + "Use { target: 'node' } in your Webpack config to indicate a server-rendering environment." + ) } +} + +var listToStyles = __webpack_require__(47) + +/* +type StyleObject = { + id: number; + parts: Array +} + +type StyleObjectPart = { + css: string; + media: string; + sourceMap: ?string +} +*/ + +var stylesInDom = {/* + [id: number]: { + id: number, + refs: number, + parts: Array<(obj?: StyleObjectPart) => void> + } +*/} + +var head = hasDocument && (document.head || document.getElementsByTagName('head')[0]) +var singletonElement = null +var singletonCounter = 0 +var isProduction = false +var noop = function () {} +var options = null +var ssrIdKey = 'data-vue-ssr-id' + +// Force single-tag solution on IE6-9, which has a hard limit on the # of