Merge pull request #5517 from devansh-webkul/compare-auto-count-issue
Auto Count Fixed #5510
This commit is contained in:
commit
47a11d1b9a
|
|
@ -1,5 +1,6 @@
|
|||
@php
|
||||
$attributeRepository = app('\Webkul\Attribute\Repositories\AttributeFamilyRepository');
|
||||
|
||||
$comparableAttributes = $attributeRepository->getComparableAttributesBelongsToFamily();
|
||||
|
||||
$locale = core()->getRequestedLocaleCode();
|
||||
|
|
@ -229,6 +230,8 @@
|
|||
|
||||
window.flashMessages = [{'type': 'alert-success', 'message': response.data.message }];
|
||||
|
||||
this.updateCompareCount();
|
||||
|
||||
this.$root.addFlashMessages();
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<compare-component product-id="{{ $productId }}"></compare-component>
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script type="text/x-template" id="compare-component-template">
|
||||
<a
|
||||
class="unset text-right"
|
||||
|
|
@ -38,6 +37,8 @@
|
|||
'message': response.data.message
|
||||
}];
|
||||
|
||||
this.updateCompareCount();
|
||||
|
||||
this.$root.addFlashMessages()
|
||||
}).catch(error => {
|
||||
window.flashMessages = [{
|
||||
|
|
@ -49,6 +50,7 @@
|
|||
});
|
||||
} else {
|
||||
let updatedItems = [this.productId];
|
||||
|
||||
let existingItems = this.getStorageValue('compared_product');
|
||||
|
||||
if (existingItems) {
|
||||
|
|
@ -79,7 +81,7 @@
|
|||
'message': "{{ __('shop::app.customer.compare.added') }}"
|
||||
}];
|
||||
|
||||
this.$root.addFlashMessages()
|
||||
this.$root.addFlashMessages()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,6 +120,7 @@
|
|||
});
|
||||
} else {
|
||||
let comparedItems = JSON.parse(localStorage.getItem('compared_product'));
|
||||
|
||||
comparedItemsCount = comparedItems ? comparedItems.length : 0;
|
||||
|
||||
$('#compare-items-count').html(comparedItemsCount);
|
||||
|
|
|
|||
Loading…
Reference in New Issue