From 1b84212da560479beac9ce0d2a26123fc167fef0 Mon Sep 17 00:00:00 2001 From: "artnuc.ct9" Date: Thu, 26 Nov 2020 22:35:21 +0400 Subject: [PATCH 1/2] create tmp --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index db00ea7..70395a0 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ENV?="dev" install: #copy config file from template - cp config.xml.dist config.xml + #cp config.xml.dist config.xml @if [ $(ENV) = "dev" ]; then \ make install_dev; \ fi @@ -63,6 +63,8 @@ frontend: else \ haxe cagetteJs.hxml; \ fi + mkdir -p tmp + chown www-data:www-data tmp #update POT file from source i18n: From 93f3d362a4e5fbfdb53bb96476c101cd8c13ee9f Mon Sep 17 00:00:00 2001 From: CAGETTE DEPLOYER Date: Wed, 9 Dec 2020 23:04:20 +0400 Subject: [PATCH 2/2] fix empty categories --- js/ShopCart.hx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/js/ShopCart.hx b/js/ShopCart.hx index 9013a18..6d370c4 100644 --- a/js/ShopCart.hx +++ b/js/ShopCart.hx @@ -164,7 +164,13 @@ class ShopCart var groups = new Map}>(); var pinned = new Map}>(); - var firstCategGroup = this.categories[0].categs; + + trace(this.categories); + var firstCategGroup = null; + if (this.categories.length > 0){ + firstCategGroup = this.categories[0].categs; + } + //trace(firstCategGroup); //trace(pinnedCategories); @@ -181,7 +187,7 @@ class ShopCart for ( categ in p.categories){ - if (Lambda.find(firstCategGroup, function(c) return c.id == categ) != null){ + if (firstCategGroup != null && Lambda.find(firstCategGroup, function(c) return c.id == categ) != null){ //is in this category group var g = groups.get(categ); @@ -442,4 +448,4 @@ class ShopCart } -} \ No newline at end of file +}