fix category without product
This commit is contained in:
parent
887e67c83e
commit
689c4509b5
|
@ -169,10 +169,13 @@ angular
|
||||||
}
|
}
|
||||||
$scope.removeAll = function () {
|
$scope.removeAll = function () {
|
||||||
$scope.categories.forEach(category => {
|
$scope.categories.forEach(category => {
|
||||||
|
if (category.products && category.products.length) {
|
||||||
|
|
||||||
category.products.forEach(product => {
|
category.products.forEach(product => {
|
||||||
product.enabled = false
|
product.enabled = false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
$scope.activeSelling = [];
|
$scope.activeSelling = [];
|
||||||
$scope.regenActiveSellingIds();
|
$scope.regenActiveSellingIds();
|
||||||
|
@ -238,6 +241,7 @@ $scope.categories.forEach(category => {
|
||||||
* @param product
|
* @param product
|
||||||
*/
|
*/
|
||||||
$scope.expressSell = function (product) {
|
$scope.expressSell = function (product) {
|
||||||
|
$scope.removeAll();
|
||||||
$scope.addProduct(product);
|
$scope.addProduct(product);
|
||||||
$scope.sendForm();
|
$scope.sendForm();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue