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 new file mode 100644 index 000000000..5d3f4b2ce --- /dev/null +++ b/packages/Webkul/Cart/src/Database/Migrations/2018_09_05_150915_create_cart_products_table.php @@ -0,0 +1,39 @@ +increments('id'); + $table->integer('product_id')->unsigned(); + $table->foreign('product_id')->references('id')->on('products'); + $table->integer('quantity')->unsigned()->default(1); + $table->integer('cart_id')->unsigned(); + $table->foreign('cart_id')->references('id')->on('cart'); + $table->integer('tax_category_id')->unsigned()->nullable(); + $table->foreign('tax_category_id')->references('id')->on('tax_categories'); + $table->string('coupon_code')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cart_items'); + } +} 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 ff076ad79..519507600 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 { @@ -22,4 +23,20 @@ class Cart extends Model public function items() { return $this->hasMany('Webkul\Cart\Models\CartItem'); } + + /** + * 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/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 6e00de737..d8da68161 100644 --- a/packages/Webkul/Shop/src/Http/routes.php +++ b/packages/Webkul/Shop/src/Http/routes.php @@ -16,6 +16,15 @@ Route::group(['middleware' => ['web']], function () { Route::get('test', 'Webkul\Cart\Http\Controllers\CartController@test'); + 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 */ + + Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [ 'view' => 'shop::products.view' ])->name('shop.products.index'); 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 @@