Merge pull request #93 from bagisto/prashant

Prashant
This commit is contained in:
JItendra Singh 2018-10-26 19:14:05 +05:30 committed by GitHub
commit 7d68e20de6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 39295 additions and 24 deletions

View File

@ -40,7 +40,20 @@ class OrderDataGrid
],
],
'actions' => [ ],
'actions' => [
[
'type' => 'Edit',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really wanis?',
'icon' => 'icon pencil-lg-icon',
],
[
'type' => 'Delete',
'route' => route('admin.datagrid.delete'),
'confirm_text' => 'Do you really want to do this?',
'icon' => 'icon trash-icon',
],
],
'join' => [],

View File

@ -465,7 +465,7 @@ return [
'page-title' => '404 Page not found',
'name' => '404',
'title' => 'Page Not found',
'message' => 'The Page you are looking for doesnt exist or have secrately escaped;head back to home and make a fresh move again.'
'message' => 'The Page you are looking for does not exist or have been moved. Navigate using sidemenu.'
],
'403' => [
'page-title' => '403 forbidden Error',

View File

@ -169,8 +169,7 @@ class Cart {
*
* @return void
*/
public function add($id, $data, $prepared = false, $preparedData = [])
{
public function add($id, $data, $prepared = false, $preparedData = []) {
if($prepared == false) {
$itemData = $this->prepareItemData($id, $data);
} else {
@ -298,12 +297,24 @@ class Cart {
*
* @return Booleans
*/
public function createNewCart($id, $data, $prepared = false, $preparedData = [])
{
if($prepared == false)
public function createNewCart($id, $data, $prepared = false, $preparedData = []) {
if($prepared == false) {
if(isset($data['selected_configurable_option'])) {
$canAdd = $this->canAdd($data['selected_configurable_option'], $data['quantity']);
} else {
$canAdd = $this->canAdd($id, $data['quantity']);
}
if(!$canAdd) {
session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning'));
return false;
}
$itemData = $this->prepareItemData($id, $data);
else
} else {
$itemData = $preparedData;
}
//if the item data is not valid to be processed it will be returning false
if($itemData == false) {
@ -337,7 +348,6 @@ class Cart {
$cartData['items_qty'] = 1;
}
//create the cart instance in the database
if($cart = $this->cart->create($cartData)) {
$itemData['parent']['cart_id'] = $cart->id;
@ -609,6 +619,22 @@ class Cart {
return false;
}
/**
* Can Add the product or not will check the quantity for that particular product
* before adding it each time.
*
* @return boolean
*/
public function canAdd($id, $qty) {
$product = $this->product->find($id);
if($product->haveSufficientQuantity($qty)) {
return true;
}
return false;
}
/**
* Save cart
*
@ -1125,6 +1151,14 @@ class Cart {
public function moveConfigurableFromWishlistToCart($configurableproductId, $productId) {
$product = $this->product->find($configurableproductId);
$canAdd = $this->product->find($productId)->haveSufficientQuantity(1);
if(!$canAdd) {
session()->flash('warning', trans('shop::app.checkout.cart.quantity.inventory_warning'));
return false;
}
$child = $childData = null;
if($product->type == 'configurable') {
$child = $this->product->findOneByField('id', $productId);
@ -1144,8 +1178,8 @@ class Cart {
unset($productAddtionalData['html']);
$additional = [
'request' => $data,
'variant_id' => $data['selected_configurable_option'],
'request' => $childData,
'variant_id' => $productId,
'attributes' => $productAddtionalData
];
@ -1162,7 +1196,7 @@ class Cart {
'weight' => $weight = ($product->type == 'configurable' ? $child->weight : $product->weight),
'total_weight' => $weight,
'base_total_weight' => $weight,
'additional' => json_encode($additonal)
'additional' => json_encode($additional)
];
return ['parent' => $parentData, 'child' => $childData];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/shop.js": "/js/shop.js?id=89eb7f5427ed81ec3ce7",
"/css/shop.css": "/css/shop.css?id=798e3c7a27d0c8764fda"
"/js/shop.js": "/js/shop.js",
"/css/shop.css": "/css/shop.css"
}

View File

@ -24,7 +24,7 @@
<div class="control-group" :class="[errors.has('address2') ? 'has-error' : '']">
<label for="address2">{{ __('shop::app.customer.account.address.create.address2') }}</label>
<input type="text" class="control" name="address2" v-validate="'required'">
<input type="text" class="control" name="address2">
<span class="control-error" v-if="errors.has('address2')">@{{ errors.first('address2') }}</span>
</div>

View File

@ -27,7 +27,7 @@
<div class="control-group" :class="[errors.has('address2') ? 'has-error' : '']">
<label for="address2">{{ __('shop::app.customer.account.address.create.address2') }}</label>
<input type="text" class="control" name="address2" v-validate="'required'" value ="{{ $address['address2'] }}">
<input type="text" class="control" name="address2" value ="{{ $address['address2'] }}">
<span class="control-error" v-if="errors.has('address2')">@{{ errors.first('address2') }}</span>
</div>

View File

@ -1,3 +1,3 @@
<a href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" style="text-align: center;">
{{-- <a href="{{ route('shop.product.buynow', $product->id)}}" class="btn btn-lg btn-primary buynow" style="text-align: center;">
{{ __('shop::app.products.buy-now') }}
</a>
</a> --}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=b25a07d206dd0b89048f",
"/css/ui.css": "/css/ui.css?id=b42597156bd91a494a1c"
"/js/ui.js": "/js/ui.js",
"/css/ui.css": "/css/ui.css"
}