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 index 9521ad2b6..89ab7fd4d 100644 --- 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 @@ -16,6 +16,7 @@ class CreateCartPayment extends Migration Schema::create('cart_payment', function (Blueprint $table) { $table->increments('id'); $table->string('method'); + $table->string('method_title')->nullable(); $table->integer('cart_id')->nullable()->unsigned(); $table->foreign('cart_id')->references('id')->on('cart'); $table->timestamps(); diff --git a/packages/Webkul/Cart/src/Helpers/Checkout.php b/packages/Webkul/Cart/src/Helpers/Checkout.php new file mode 100644 index 000000000..9e695c7db --- /dev/null +++ b/packages/Webkul/Cart/src/Helpers/Checkout.php @@ -0,0 +1,43 @@ +attributeOption = $attributeOption; + } + + /** + * Returns the allowed variants + * + * @param CartItem $item + * @return array + */ + public function getItemOptionDetails($item) + { + $data = []; + + foreach ($item->product->super_attributes as $attribute) { + + } + + return $data; + } +} \ 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 310d16703..e70421da3 100644 --- a/packages/Webkul/Cart/src/Models/Cart.php +++ b/packages/Webkul/Cart/src/Models/Cart.php @@ -31,7 +31,7 @@ class Cart extends Model /** * Get the biling address for the cart. */ - public function biling_address() + public function billing_address() { return $this->addresses()->where('address_type', 'billing'); } @@ -39,9 +39,9 @@ class Cart extends Model /** * Get all of the attributes for the attribute groups. */ - public function getBilingAddressAttribute() + public function getBillingAddressAttribute() { - return $this->biling_address()->first(); + return $this->billing_address()->first(); } /** diff --git a/packages/Webkul/Cart/src/Models/CartAddress.php b/packages/Webkul/Cart/src/Models/CartAddress.php index 889328d39..935b09eb0 100644 --- a/packages/Webkul/Cart/src/Models/CartAddress.php +++ b/packages/Webkul/Cart/src/Models/CartAddress.php @@ -18,4 +18,12 @@ class CartAddress extends Model { return $this->hasMany(CartShippingRate::class); } + + /** + * Get all of the attributes for the attribute groups. + */ + public function getNameAttribute() + { + return $this->first_name . ' ' . $this->last_name; + } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index 35aa98a5d..2375fc466 100644 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -8,6 +8,7 @@ use Webkul\Core\Models\Locale as LocaleModel; use Webkul\Core\Models\Currency as CurrencyModel; use Webkul\Core\Models\TaxCategory as TaxCategory; use Webkul\Core\Models\TaxRate as TaxRate; +use Illuminate\Support\Facades\Config; class Core { @@ -276,4 +277,21 @@ class Core return $date->format($format); } + + /** + * Retrieve information from payment configuration + * + * @param string $field + * @param int|string|null $channelId + * + * @return mixed + */ + public function getConfigData($field, $channelId = null) + { + if (null === $channelId) { + $channelId = $this->getCurrentChannel()->id; + } + + return Config::get($field); + } } \ No newline at end of file diff --git a/packages/Webkul/Payment/src/Payment.php b/packages/Webkul/Payment/src/Payment.php index ebbd54637..da4d78114 100644 --- a/packages/Webkul/Payment/src/Payment.php +++ b/packages/Webkul/Payment/src/Payment.php @@ -21,7 +21,7 @@ class Payment if($object->isAvailable()) { $paymentMethods[] = [ 'method' => $object->getCode(), - 'title' => $object->getTitle(), + 'method_title' => $object->getTitle(), 'description' => $object->getDescription(), ]; } diff --git a/packages/Webkul/Payment/src/Payment/Payment.php b/packages/Webkul/Payment/src/Payment/Payment.php index 6b4c0a063..4f3f5242c 100644 --- a/packages/Webkul/Payment/src/Payment/Payment.php +++ b/packages/Webkul/Payment/src/Payment/Payment.php @@ -58,14 +58,8 @@ abstract class Payment * * @return mixed */ - public function getConfigData($field, $channelId = null) + public function getConfigData($field) { - if (null === $channelId) { - $channelId = core()->getCurrentChannel()->id; - } - - $paymentConfig = Config::get('paymentmethods.' . $this->getCode()); - - return $paymentConfig[$field]; + return core()->getConfigData('paymentmethods.' . $this->getCode() . '.' . $field); } } \ No newline at end of file diff --git a/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php b/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php index 55cb97848..53be021ac 100644 --- a/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php +++ b/packages/Webkul/Shipping/src/Carriers/AbstractShipping.php @@ -67,16 +67,9 @@ abstract class AbstractShipping * * @return mixed */ - public function getConfigData($field, $channelId = null) + public function getConfigData($field) { - if (null === $channelId) { - $channelId = core()->getCurrentChannel()->id; - } - - $shippingConfig = Config::get('carriers.' . $this->getCode()); - - return $shippingConfig[$field]; + return core()->getConfigData('carriers.' . $this->getCode() . '.' . $field); } - } ?> \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/_variables.scss b/packages/Webkul/Shop/src/Resources/assets/sass/_variables.scss index 67c473993..b9b2593e8 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/_variables.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/_variables.scss @@ -1,12 +1,14 @@ //shop variables $font-color: #242424; -$border-color: #E8E8E8; $font-size-base: 16px; -$border-color: #c7c7c7; +$border-color: #E8E8E8; $brand-color: #0031f0; //shop variables ends here + +//=======>Need to be removed //customer variables $profile-content-color: #5e5e5e; $horizontal-rule-color: #E8E8E8; -//customer variables ends here \ No newline at end of file +//customer variables ends here +//<=======Need to be removed \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss index 07fbc6dc6..970be8186 100644 --- a/packages/Webkul/Shop/src/Resources/assets/sass/app.scss +++ b/packages/Webkul/Shop/src/Resources/assets/sass/app.scss @@ -1,6 +1,4 @@ - @import url("https://fonts.googleapis.com/css?family=Montserrat:400,500"); - @import "icons"; @import "mixins"; @import "variables"; @@ -3189,14 +3187,7 @@ section.cart { .address-card { width: 50%; - - &.left { - float: left; - } - - &.right { - float: right; - } + float: left; .card-title span { font-weight: 600; diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index 736b6ba5e..d2ccf7be8 100644 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -90,7 +90,11 @@ return [ 'payment-information' => 'Payment Information', 'summary' => 'Summary of Order', 'price' => 'Price', - 'quantity' => 'Quantity' + 'quantity' => 'Quantity', + 'billing-address' => 'Billing Address', + 'shipping-address' => 'Shipping Address', + 'contact' => 'Contact', + 'place-order' => 'Place Order' ], 'total' => [ 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 17b2889c8..11de9111c 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage.blade.php @@ -88,7 +88,7 @@
diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/payment.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/payment.blade.php index d5dba6af8..e12395dbf 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/payment.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/payment.blade.php @@ -13,7 +13,7 @@ - {{ $payment['title'] }} + {{ $payment['method_title'] }} {{ $payment['description'] }} diff --git a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/review.blade.php b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/review.blade.php index 6ca9b95ea..33f4b31d7 100644 --- a/packages/Webkul/Shop/src/Resources/views/checkout/onepage/review.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/checkout/onepage/review.blade.php @@ -5,37 +5,41 @@
-
-
- Shipping address + @if ($billingAddress = $cart->billing_address) +
+
+ {{ __('shop::app.checkout.onepage.billing-address') }} +
+ +
+ {{ $billingAddress->name }}
+ {{ $billingAddress->address1 }}, {{ $billingAddress->address2 ? $billingAddress->address2 . ',' : '' }} {{ $billingAddress->state }}
+ {{ country()->name($billingAddress->country) }} {{ $billingAddress->postcode }}
+ + + + {{ __('shop::app.checkout.onepage.contact') }} : {{ $billingAddress->phone }} +
+ @endif -
- John Doe
- 25 , Washington
- USA 5751434
- - + @if ($shippingAddress = $cart->shipping_address) +
+
+ {{ __('shop::app.checkout.onepage.shipping-address') }} +
- Contact : 9876543210 +
+ {{ $shippingAddress->name }}
+ {{ $shippingAddress->address1 }}, {{ $shippingAddress->address2 ? $shippingAddress->address2 . ',' : '' }} , {{ $shippingAddress->state }}
+ {{ country()->name($shippingAddress->country) }} {{ $shippingAddress->postcode }}
+ + + + {{ __('shop::app.checkout.onepage.contact') }} : {{ $shippingAddress->phone }} +
-
- -
-
- Billing address -
- -
- John Doe
- 25 , Washington
- USA 5751434
- - - - Contact : 9876543210 -
-
+ @endif
@@ -79,9 +83,15 @@
-
- Color : Gray, Size : S -
+ @if ($product->type == 'configurable') +
+ @foreach ($product->super_attributes as $attribute) + + {{ $attribute->name . ' : ' . $product->{$attribute->code} }}, + + @endforeach +
+ @endif
@@ -91,7 +101,7 @@
-
+
@@ -99,10 +109,10 @@
- $ 25.00 + {{ core()->currency($cart->selected_shipping_rate->base_price) }}
- FedEx Shipping + {{ $cart->selected_shipping_rate->method_title }}
@@ -113,13 +123,13 @@
- Net banking + {{ core()->getConfigData('paymentmethods.' . $cart->payment->method . '.title') }}
-
+
@include('shop::checkout.total.summary', ['cart' => $cart]) diff --git a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php index 8d61b6af9..8ff545cc2 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view.blade.php @@ -11,7 +11,7 @@ Home > Men > Slit Open Jeans
-
+ @csrf() diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php index b22edf9f1..53e7d6939 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/configurable-options.blade.php @@ -49,6 +49,8 @@ template: '#product-options-template', + inject: ['$validator'], + data: () => ({ config: @json($config), diff --git a/public/themes/default/assets/css/shop.css b/public/themes/default/assets/css/shop.css index d341e82b8..84a0cc127 100644 --- a/public/themes/default/assets/css/shop.css +++ b/public/themes/default/assets/css/shop.css @@ -147,7 +147,7 @@ body { .header .header-top div.left-content ul.search-container li.search-group .search-field { height: 38px; - border: 2px solid #c7c7c7; + border: 2px solid #E8E8E8; border-radius: 3px; border-right: none; border-top-right-radius: 0px; @@ -162,7 +162,7 @@ body { box-sizing: border-box; height: 38px; width: 38px; - border: 2px solid #c7c7c7; + border: 2px solid #E8E8E8; border-top-right-radius: 3px; border-bottom-right-radius: 3px; } @@ -192,7 +192,7 @@ body { .header .header-top div.right-content ul.account-dropdown-container { float: right; - border-right: 2px solid #c7c7c7; + border-right: 2px solid #E8E8E8; } .header .header-top div.right-content ul.account-dropdown-container li.account-dropdown { @@ -473,8 +473,8 @@ body { display: none; } .header .search-suggestion .search-content { - border-top: 1px solid #c7c7c7; - border-bottom: 1px solid #c7c7c7; + border-top: 1px solid #E8E8E8; + border-bottom: 1px solid #E8E8E8; height: 48px; } .header .search-suggestion .search-content .icon.search-icon { @@ -493,7 +493,7 @@ body { margin-top: 14px; height: 32px; margin-bottom: 14px; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } .header .search-suggestion .suggestion span { margin-left: 48px; @@ -513,7 +513,7 @@ body { } .header .header-bottom .nav > li { float: none; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } .header .header-bottom .nav > li a { margin-left: 10px; @@ -524,7 +524,7 @@ body { margin-right: 5px; } .header .header-bottom .nav > li:first-child { - border-top: 1px solid #c7c7c7; + border-top: 1px solid #E8E8E8; } .header .header-bottom .nav > li:last-child { float: none; @@ -634,7 +634,7 @@ body { } .header .header-bottom .nav > li { float: none; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } .header .header-bottom .nav > li a { margin-left: 10px; @@ -645,7 +645,7 @@ body { margin-right: 5px; } .header .header-bottom .nav > li:first-child { - border-top: 1px solid #c7c7c7; + border-top: 1px solid #E8E8E8; } .header .header-bottom .nav > li:last-child { float: none; @@ -772,13 +772,13 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { } .layered-filter-wrapper .filter-title { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; color: #242424; padding: 10px 0; } .layered-filter-wrapper .filter-attributes .filter-attributes-item { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; padding-bottom: 10px; } @@ -1144,7 +1144,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { font-size: 12px; } .main-container-wrapper .top-toolbar { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; margin-bottom: 10px; } .main-container-wrapper .top-toolbar .page-info span:first-child { @@ -1218,7 +1218,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { font-size: 12px; } .main-container-wrapper .top-toolbar { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; margin-bottom: 10px; } .main-container-wrapper .top-toolbar .page-info span:first-child { @@ -1379,7 +1379,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { display: -ms-flexbox; display: flex; background: #f2f2f2; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; @@ -1454,7 +1454,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; background: #f2f2f2; width: 25%; height: 100%; @@ -1479,7 +1479,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { -webkit-box-align: center; -ms-flex-align: center; align-items: center; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; text-align: center; } @@ -1521,7 +1521,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .account-content .profile-content { @@ -1556,7 +1556,7 @@ section.slider-block div.slider-content div.slider-control .light-right-icon { display: -ms-flexbox; display: flex; background: #f2f2f2; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; @@ -1837,7 +1837,7 @@ section.product-detail div.layouter form .details .attributes { section.product-detail div.layouter form .details { width: 100%; margin-top: 20px; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } section.product-detail div.layouter form .details .attributes { border-bottom: none; @@ -1886,7 +1886,7 @@ section.product-detail div.layouter form .details .attributes { section.product-detail div.layouter form .details { width: 100%; margin-top: 20px; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } section.product-detail div.layouter form .details .attributes { border-bottom: none; @@ -2019,7 +2019,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .cart .right-side .price-section .total-details { @@ -2071,7 +2071,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; margin-bottom: 9px; } @@ -2166,7 +2166,7 @@ section.cart .cart-content { width: 60px; text-align: center; line-height: 38px; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; border-radius: 3px; margin-right: 30px; } @@ -2282,7 +2282,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .order .order-section-head-small { @@ -2352,7 +2352,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .order .order-details { @@ -2486,7 +2486,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .order .order-information { @@ -2554,7 +2554,7 @@ section.cart .cart-content { margin-bottom: 13px; } .order .order-section-head-small .horizon-rule { - border: 0.5px solid #c7c7c7; + border: 0.5px solid #E8E8E8; width: 150%; margin-left: -10%; margin-right: -10%; @@ -2616,7 +2616,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .order .order-details { display: none; @@ -2687,7 +2687,7 @@ section.cart .cart-content { display: none; } .order .product-config { - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; height: 19%; width: 100%; margin-top: 10px; @@ -2778,7 +2778,7 @@ section.cart .cart-content { margin-bottom: 13px; } .order .order-section-head-small .horizon-rule { - border: 0.5px solid #c7c7c7; + border: 0.5px solid #E8E8E8; width: 150%; margin-left: -10%; margin-right: -10%; @@ -2840,7 +2840,7 @@ section.cart .cart-content { width: 100%; height: 1px; vertical-align: middle; - background: #c7c7c7; + background: #E8E8E8; } .order .order-details { display: none; @@ -2911,7 +2911,7 @@ section.cart .cart-content { display: none; } .order .product-config { - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; height: 19%; width: 100%; margin-top: 10px; @@ -2992,7 +2992,7 @@ section.cart .cart-content { justify-content: space-between; width: 100%; padding-bottom: 15px; - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; } .checkout-process .col-main ul.checkout-steps li { @@ -3010,7 +3010,7 @@ section.cart .cart-content { display: -webkit-inline-box; display: -ms-inline-flexbox; display: inline-flex; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; background-repeat: no-repeat; background-position: center; } @@ -3071,7 +3071,7 @@ section.cart .cart-content { } .checkout-process .col-main .step-content .form-container { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; padding-top: 20px; padding-bottom: 20px; } @@ -3095,16 +3095,9 @@ section.cart .cart-content { .checkout-process .col-main .step-content .address .address-card { width: 50%; -} - -.checkout-process .col-main .step-content .address .address-card.left { float: left; } -.checkout-process .col-main .step-content .address .address-card.right { - float: right; -} - .checkout-process .col-main .step-content .address .address-card .card-title span { font-weight: 600; } @@ -3123,7 +3116,7 @@ section.cart .cart-content { } .checkout-process .col-main .step-content .cart-item-list .item { - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; border-radius: 3px; padding: 20px; } @@ -3154,7 +3147,7 @@ section.cart .cart-content { height: 48px; width: 48px; border-radius: 50%; - border: 1px solid #c7c7c7; + border: 1px solid #E8E8E8; vertical-align: middle; display: inline-block; text-align: center; @@ -3194,7 +3187,7 @@ section.cart .cart-content { .checkout-process .order-summary .payble-amount { margin-top: 17px; - border-top: 1px solid #c7c7c7; + border-top: 1px solid #E8E8E8; padding-top: 12px; } @@ -3382,7 +3375,7 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; - border-top: 1px solid #c7c7c7; + border-top: 1px solid #E8E8E8; } .cusomer-section .customer-section-info .pro-img { @@ -3419,5 +3412,5 @@ section.review .review-layouter .review-info .review-detail .rating-calculate .p } .cusomer-section .customer-section-info:last-child { - border-bottom: 1px solid #c7c7c7; + border-bottom: 1px solid #E8E8E8; }