Merge branch 'master' of https://github.com/bagisto/bagisto into development

This commit is contained in:
Prashant Singh 2019-04-27 12:11:37 +05:30
commit a0dd4b62cf
10 changed files with 46 additions and 21 deletions

View File

@ -156,7 +156,7 @@ class AttributeRepository extends Repository
*/
public function getFilterAttributes()
{
return $this->model->where('is_filterable', 1)->get();
return $this->model->where('is_filterable', 1)->with('options')->get();
}
/**

View File

@ -76,8 +76,8 @@ class CategoryRepository extends Repository
public function getCategoryTree($id = null)
{
return $id
? Category::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
: Category::orderBy('position', 'ASC')->get()->toTree();
? $this->model::orderBy('position', 'ASC')->where('id', '!=', $id)->get()->toTree()
: $this->model::orderBy('position', 'ASC')->get()->toTree();
}
@ -88,7 +88,7 @@ class CategoryRepository extends Repository
*/
public function getRootCategories()
{
return Category::withDepth()->having('depth', '=', 0)->get();
return $this->model::withDepth()->having('depth', '=', 0)->get();
}
/**
@ -104,9 +104,9 @@ class CategoryRepository extends Repository
if(array_key_exists($id, $categories))
return $categories[$id];
return $categories[$id] = $id
? Category::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
: Category::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
return $categories[$id] = $id
? $this->model::orderBy('position', 'ASC')->where('status', 1)->descendantsOf($id)->toTree()
: $this->model::orderBy('position', 'ASC')->where('status', 1)->get()->toTree();
}
/**

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=fc251a49a8378ebc43e7",
"/css/shop.css": "/css/shop.css?id=8991884e53441d770cee"
"/js/shop.js": "/js/shop.js?id=ad1039174ce2c81c8805",
"/css/shop.css": "/css/shop.css?id=bafca07fed1830b7fd24"
}

View File

@ -1963,6 +1963,14 @@ section.product-detail {
}
}
}
.quantity-change {
cursor: pointer;
&:focus {
border-color: $border-color !important;
}
}
}
}
}
@ -3139,12 +3147,6 @@ section.review {
height: 30px;
}
}
// .default-address {
// position: absolute;
// top: 10px;
// right: 10px;
// }
}
}

View File

@ -321,7 +321,8 @@ return [
'quantity' => 'الكمية',
'in-stock' => 'في الأسهم',
'out-of-stock' => 'خارج الأسهم',
'view-all' => 'عرض الكل'
'view-all' => 'عرض الكل',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -330,7 +330,8 @@ return [
'in-stock' => 'In Stock',
'out-of-stock' => 'Out Of Stock',
'view-all' => 'View All',
'select-above-options' => 'Please select above options first.'
'select-above-options' => 'Please select above options first.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -326,7 +326,8 @@ return [
'in-stock' => 'Em Estoque',
'out-of-stock' => 'Fora de Estoque',
'view-all' => 'Ver Tudo',
'select-above-options' => 'Por favor, selecione as opções acima primeiro.'
'select-above-options' => 'Por favor, selecione as opções acima primeiro.',
'less-quantity' => 'Quantity can not be less than one.'
],
'wishlist' => [

View File

@ -50,7 +50,11 @@
<label class="required">{{ __('shop::app.products.quantity') }}</label>
<input name="quantity" class="control" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;">
<input class="control quantity-change" value="-" style="width: 35px; border-radius: 3px 0px 0px 3px;" onclick="updateQunatity('remove')" readonly>
<input name="quantity" id="quantity" class="control quantity-change" value="1" v-validate="'required|numeric|min_value:1'" style="width: 60px; position: relative; margin-left: -4px; margin-right: -4px; border-right: none;border-left: none; border-radius: 0px;" data-vv-as="&quot;{{ __('shop::app.products.quantity') }}&quot;" readonly>
<input class="control quantity-change" value="+" style="width: 35px; padding: 0 12px; border-radius: 0px 3px 3px 0px;" onclick=updateQunatity('add') readonly>
<span class="control-error" v-if="errors.has('quantity')">@{{ errors.first('quantity') }}</span>
</div>
@ -184,5 +188,21 @@
}
}
};
function updateQunatity(operation) {
var quantity = document.getElementById('quantity').value;
if (operation == 'add') {
quantity = parseInt(quantity) + 1;
} else if (operation == 'remove') {
if (quantity > 1) {
quantity = parseInt(quantity) - 1;
} else {
alert('{{ __('shop::app.products.less-quantity') }}');
}
}
document.getElementById("quantity").value = quantity;
event.preventDefault();
}
</script>
@endpush