Order Grid, Wishlist Bug Fixes

This commit is contained in:
prashant-webkul 2018-10-30 10:01:01 +05:30
parent 1cd59b4b86
commit e59f5a775b
8 changed files with 127 additions and 45 deletions

View File

@ -90,6 +90,12 @@ class OrderDataGrid
'wrapper' => function ($value) {
return core()->currency($value);
}
], [
'name' => 'or.created_at',
'alias' => 'created_at',
'type' => 'string',
'label' => 'Order Date',
'sortable' => false,
], [
'name' => 'or.status',
'alias' => 'orstatus',

View File

@ -10,6 +10,7 @@ use Webkul\Customer\Repositories\CustomerRepository;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Tax\Repositories\TaxCategoryRepository;
use Webkul\Checkout\Models\CartPayment;
use Webkul\Customer\Repositories\WishlistRepository;
/**
* Facade for all the methods to be implemented in Cart.
@ -62,6 +63,13 @@ class Cart {
*/
protected $taxCategory;
/**
* WishlistRepository model
*
* @var mixed
*/
protected $wishlist;
/**
* Create a new controller instance.
*
@ -79,7 +87,8 @@ class Cart {
CartAddressRepository $cartAddress,
CustomerRepository $customer,
ProductRepository $product,
TaxCategoryRepository $taxCategory
TaxCategoryRepository $taxCategory,
WishlistRepository $wishlist
)
{
$this->customer = $customer;
@ -93,6 +102,8 @@ class Cart {
$this->product = $product;
$this->taxCategory = $taxCategory;
$this->wishlist = $wishlist;
}
/**
@ -700,6 +711,7 @@ class Cart {
$labels = [];
$attribute = $product->parent->super_attributes;
foreach($product->parent->super_attributes as $attribute) {
$option = $attribute->options()->where('id', $product->{$attribute->code})->first();
@ -1178,11 +1190,17 @@ class Cart {
unset($productAddtionalData['html']);
$additional = [
'request' => $childData,
'variant_id' => $productId,
'attributes' => $productAddtionalData
];
// $additional = [
// 'request' => $childData,
// 'variant_id' => $productId,
// 'attributes' => $productAddtionalData
// ];
$additional['_token'] = null;
$additional['product'] = $product->id;
$additional['quantity'] = 1;
$additional['is_configurable'] = true;
$additional['selected_configurable_option'] = $child->id;
$additional['super_attributes'] = $productAddtionalData;
$parentData = [
'sku' => $product->sku,
@ -1199,10 +1217,30 @@ class Cart {
'base_total_weight' => $weight,
'additional' => $additional
];
// dd(['parent' => $parentData, 'child' => $childData]);
return ['parent' => $parentData, 'child' => $childData];
}
/**
* Function to move a already added product to wishlist
* will run only on customer authentication.
*
* @param instance cartItem $id
*/
public function moveToWishlist($itemId) {
$item = $this->findOneByField($itemId);
if(!$item)
return false;
if($item->parent_id == 'null' ||$item->parent_id == null) {
$variantSku = $item->child->sku;
$variantName = $item->child->name;
} else {
}
}
/**
* Handle the buy now process for simple as well as configurable products
*

View File

@ -150,4 +150,16 @@ class CartController extends Controller
return redirect()->back();
}
}
/**
* Function to move a already added product to wishlist
* will run only on customer authentication.
*
* @param instance cartItem $id
*/
public function moveToWishlist($id) {
$result = Cart::moveToWishlist($id);
dd($result);
}
}

View File

@ -67,6 +67,9 @@ Route::group(['middleware' => ['web', 'theme', 'locale', 'currency']], function
//Shop buynow button action
Route::get('buynow/{id}', 'Webkul\Shop\Http\Controllers\CartController@test')->name('shop.product.buynow');
//Shop buynow button action
Route::get('move/cart/{id}', 'Webkul\Shop\Http\Controllers\CartController@moveToWishlist')->name('shop.movetowishlist');
//Show Product Details Page(For individually Viewable Product)
Route::get('/products/{slug}', 'Webkul\Shop\Http\Controllers\ProductController@index')->defaults('_config', [
'view' => 'shop::products.view'

View File

@ -429,6 +429,48 @@ input {
}
}
@media only screen and (max-width: 580px) {
.main-container-wrapper {
padding: 0px;
}
}
//product components
@media only screen and (max-width: 551px) {
.product-grid-3 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 20px;
}
}
@media only screen and (max-width: 854px) {
.product-grid-4 {
grid-template-columns: 29.5% 29.5% 29.5%;
grid-column-gap: 35px;
}
}
@media only screen and (max-width: 653px) {
.product-grid-4 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 17px;
}
}
@media only screen and (max-width: 425px) {
.product-card {
font-size: 90%;
.btn.btn-md {
padding: 5px;
}
}
.product-grid-4 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 10px;
}
}
.product-list {
min-height: 200px;
@ -532,40 +574,11 @@ input {
}
}
}
//product components
@media only screen and (max-width: 551px) {
.product-grid-3 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 20px;
}
}
@media only screen and (max-width: 854px) {
.product-grid-4 {
grid-template-columns: 29.5% 29.5% 29.5%;
grid-column-gap: 35px;
}
}
@media only screen and (max-width: 653px) {
.product-grid-4 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 17px;
}
}
@media only screen and (max-width: 425px) {
.product-card {
font-size: 90%;
.btn.btn-md {
padding: 5px;
}
}
.product-grid-4 {
grid-template-columns: 48.5% 48.5%;
grid-column-gap: 10px;
@media only screen and (max-width: 530px) {
.main-container-wrapper {
padding-left: 0px;
padding-right: 0px;
}
}
@ -2649,7 +2662,7 @@ section.review {
border: 1px solid $border-color;
flex-direction: column;
max-width: 530px;
max-width: 500px;
min-width: 380px;
padding: 25px;

View File

@ -380,4 +380,8 @@ return [
'thanks' => 'Thanks!'
]
],
'webkul' => [
'copy-right' => '© Copyright 2018 Webkul Software, All rights reserved.'
]
];

View File

@ -67,9 +67,16 @@
<span class="control-error" v-if="errors.has('qty[{{$item->id}}]')">@{{ errors.first('qty') }}</span>
<span class="remove"><a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove-link') }}</a></span>
<span class="remove">
<a href="{{ route('shop.checkout.cart.remove', $item->id) }}">{{ __('shop::app.checkout.cart.remove-link') }}</a></span>
<span class="towishlist">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</span>
<span class="towishlist">
@if($item->parent_id != 'null' ||$item->parent_id != null)
<a href="{{ route('shop.movetowishlist', $item->id) }}">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</a>
@else
<a href="{{ route('shop.movetowishlist', $item->child->id) }}">{{ __('shop::app.checkout.cart.move-to-wishlist') }}</a>
@endif
</span>
</div>
@if (!cart()->isItemHaveQuantity($item))

View File

@ -48,10 +48,9 @@
@include('shop::layouts.footer.footer')
<div class="footer-bottom">
<p>
© Copyright 2018 Webkul Software, All rights reserved.
{{ __('shop::app.webkul.copy-right') }}
</p>
</div>
</div>
<script type="text/javascript">
window.flashMessages = [];