geer-builder 1.2.485 → 1.2.486

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/GProductList.vue CHANGED
@@ -16,8 +16,8 @@
16
16
  <div class="product-list-detail" v-if="sort_by!='gc_price'">
17
17
  <div class="product-list-row">
18
18
  <!-- <div class="prod_price price" :class="field.user_discount>0 ? 'has-discount' : ''">{{main_currency}} {{$_formatNumber(field.original_price, { decimal: 2})}}{{field.user}}</div> -->
19
- <div class="prod_price price has-discount" v-if="!hide_original_price">{{main_currency}} {{$_formatNumber(field.original_price, { decimal: 2})}}{{field.user}}</div>
20
- <div class="prod_price discount" v-if="show_discount_price && field.user_discount>0">{{main_currency}} {{ $_formatNumber(field.selling_price * (field.user_discount / 100), { decimal: 2 }) }}</div>
19
+ <div class="prod_price price has-discount" v-if="!show_original_price">{{main_currency}} {{$_formatNumber(field.original_price, { decimal: 2})}}{{field.user}}</div>
20
+ <div class="prod_price discount" v-if="show_discount_price && field.user_discount>0">{{main_currency}} {{ $_formatNumber(field.selling_price - (field.selling_price * (field.user_discount / 100)), { decimal: 2 }) }}</div>
21
21
  <div class="prod_price discount" v-else>{{main_currency}} {{ $_formatNumber(field.selling_price, { decimal: 2 }) }}</div>
22
22
  </div>
23
23
  <template v-if="!show_only">
@@ -74,7 +74,7 @@ export default {
74
74
  cashback:Boolean,
75
75
  show_discount_price: Boolean,
76
76
  show_discount_badge: Boolean,
77
- hide_original_price:Boolean,
77
+ show_original_price:Boolean,
78
78
  },
79
79
  data: () =>
80
80
  ({
@@ -5,7 +5,9 @@ export default class ProductClass
5
5
  }
6
6
  getProductDiscount( membership_list, rank_list, slot_details, stockist_list, product_details)
7
7
  {
8
+ let sum_discount = false;
8
9
  let stockist_info={};
10
+
9
11
  if(slot_details.stockist)
10
12
  {
11
13
  stockist_info = slot_details.stockist_info;
@@ -57,6 +59,7 @@ export default class ProductClass
57
59
  })
58
60
  }
59
61
  }
62
+
60
63
  if(rank_discount>member_discount)
61
64
  {
62
65
  tot_discount = rank_discount;
@@ -65,7 +68,9 @@ export default class ProductClass
65
68
  {
66
69
  tot_discount = member_discount;
67
70
  }
68
- if(slot_details.stockist){
71
+
72
+ if(slot_details.stockist)
73
+ {
69
74
  if(stockist_discount>tot_discount)
70
75
  {
71
76
  tot_discount = stockist_discount;
@@ -80,14 +85,36 @@ export default class ProductClass
80
85
  {
81
86
  fixed_discount = member_discount_fixed;
82
87
  }
83
- if(slot_details.stockist){
88
+ if(slot_details.stockist)
89
+ {
84
90
  if(stockist_discount_fixed > fixed_discount)
85
91
  {
86
92
  fixed_discount = stockist_discount_fixed;
87
93
  }
88
94
  }
89
- converted_percent = product_details.selling_price * (Number(tot_discount)/100);
90
- let total_discount_percent = ((converted_percent+fixed_discount)/product_details.selling_price)*100;
95
+
96
+ let total_discount_percent = 0;
97
+ if(sum_discount)
98
+ {
99
+ converted_percent = product_details.selling_price * (Number(tot_discount)/100);
100
+ total_discount_percent = ((converted_percent+fixed_discount)/product_details.selling_price)*100;
101
+ }
102
+ else
103
+ {
104
+ converted_percent = product_details.selling_price * (Number(tot_discount)/100);
105
+ converted_percent = (converted_percent/product_details.selling_price)*100;
106
+ fixed_discount = (fixed_discount/product_details.selling_price)*100;
107
+
108
+ if(converted_percent> fixed_discount)
109
+ {
110
+ total_discount_percent = converted_percent;
111
+ }
112
+ else
113
+ {
114
+ total_discount_percent = fixed_discount;
115
+ }
116
+ }
117
+
91
118
  if(total_discount_percent > 100)
92
119
  {
93
120
  total_discount_percent = 100;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.485",
3
+ "version": "1.2.486",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {