@lancom/shared 0.0.105 → 0.0.106

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.
Files changed (103) hide show
  1. package/assets/js/models/print-area.js +8 -6
  2. package/assets/js/models/product-layers.js +3 -3
  3. package/assets/js/utils/fabric-helper.js +2 -4
  4. package/assets/js/utils/filters.js +7 -1
  5. package/assets/js/utils/prints.js +15 -4
  6. package/assets/js/utils/product.js +4 -4
  7. package/assets/scss/ui_kit/_table.scss +3 -0
  8. package/assets/scss/ui_kit/_typography.scss +6 -0
  9. package/components/checkout/payment/payment-cart/payment-cart.scss +2 -2
  10. package/components/common/color-picker.vue +6 -1
  11. package/components/common/file_uploader.vue +1 -1
  12. package/components/common/pricing_discounts_table/pricing-discounts-table.vue +14 -5
  13. package/components/common/pricing_table/pricing-table.scss +1 -3
  14. package/components/common/pricing_table/pricing-table.vue +13 -4
  15. package/components/common/products_list_dropdown/products-list-dropdown.vue +3 -1
  16. package/components/common/range/range.scss +23 -0
  17. package/components/common/range/range.vue +19 -0
  18. package/components/editor/editor.vue +3 -2
  19. package/components/editor/editor_layers/editor_layer_forms/editor_layer_form_text/editor-layer-form-text.vue +3 -1
  20. package/components/editor/editor_layers/editor_layers_toolbar/editor-layers-toolbar.vue +1 -0
  21. package/components/editor/editor_pricing/editor-pricing.vue +3 -123
  22. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  23. package/components/editor/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  24. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  25. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +119 -0
  26. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  27. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +101 -0
  28. package/components/editor/editor_print_area_options/editor-print-area-options.vue +16 -15
  29. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +12 -12
  30. package/components/editor/editor_product_details/editor-product-details.scss +1 -1
  31. package/components/editor/editor_product_details/editor-product-details.vue +22 -10
  32. package/components/editor/editor_workspace/editor-workspace.vue +10 -5
  33. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +8 -5
  34. package/components/modals/cart_modal/cart-modal.vue +1 -1
  35. package/components/modals/order_modal/order-modal.vue +5 -7
  36. package/components/modals/payment_modal/payment-modal.vue +1 -1
  37. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -4
  38. package/components/pricing/pricing_example/pricing-example.scss +4 -1
  39. package/components/pricing/pricing_example/pricing-example.vue +106 -26
  40. package/components/pricing/pricing_garment/pricing-garment.scss +44 -31
  41. package/components/pricing/pricing_garment/pricing-garment.vue +24 -10
  42. package/components/pricing/pricing_main_section/pricing-main-section.scss +0 -1
  43. package/components/pricing/pricing_main_section/pricing-main-section.vue +6 -17
  44. package/components/pricing/pricing_print/pricing-print.scss +1 -1
  45. package/components/pricing/pricing_print/pricing-print.vue +19 -7
  46. package/components/pricing/pricing_products_calculator/pricing-products-calculator.scss +64 -0
  47. package/components/pricing/pricing_products_calculator/pricing-products-calculator.vue +86 -0
  48. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.scss +58 -0
  49. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +296 -0
  50. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.scss +1 -0
  51. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing_product_print_calculator/pricing-product-print-calculator.vue +26 -0
  52. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.scss +34 -0
  53. package/components/pricing/pricing_products_calculator/pricing_product_calculator/print_size_icon/print-size-icon.vue +55 -0
  54. package/components/pricing/pricing_screen_print/pricing-screen-print.vue +6 -3
  55. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -2
  56. package/components/product/gallery/gallery.scss +168 -0
  57. package/components/product/gallery/gallery.vue +252 -0
  58. package/components/product/layouts/product_fabric_and_size_info/product-fabric-and-size-info.vue +8 -6
  59. package/components/product/layouts/product_gallery/product-gallery.vue +10 -3
  60. package/components/product/layouts/product_size_table/product-size-table.vue +16 -39
  61. package/components/product/layouts/product_tier_prices/product-tier-prices.vue +3 -2
  62. package/components/product/product.vue +16 -5
  63. package/components/product/product_price_range/product-price-range.vue +20 -4
  64. package/components/product/product_prints_price_info/product_print_price_info/product_print_price_info_item/product-print-price-info-item.vue +14 -2
  65. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.scss +5 -0
  66. package/components/product/product_prints_price_info/product_screen_print_price_info/product-screen-print-price-info.vue +53 -12
  67. package/components/product/product_sizes_info/product-sizes-info.vue +13 -2
  68. package/components/product/related_products/related-products.scss +34 -0
  69. package/components/product/related_products/related-products.vue +52 -0
  70. package/components/products/product_list/product-list.scss +2 -1
  71. package/components/products/product_list_product/product-list-product.scss +44 -20
  72. package/components/products/product_list_product/product-list-product.vue +6 -4
  73. package/components/products/products_aside/products-aside.vue +29 -4
  74. package/components/products/products_brands/products-brands.vue +9 -2
  75. package/components/products/products_filters/products-filters.vue +10 -0
  76. package/components/products/products_tags/products-tags.vue +7 -0
  77. package/components/products/products_types/products-types.vue +6 -1
  78. package/mixins/product-preview.js +1 -1
  79. package/package.json +1 -1
  80. package/static/icons/{back_hoodie_a4_v.svg → back_hoodie_a4.svg} +0 -0
  81. package/static/icons/{back_hoodie_half_a4_h.svg → back_hoodie_half_a4.svg} +0 -0
  82. package/static/icons/{back_hoodie_rect10_l.svg → back_hoodie_rect10.svg} +0 -0
  83. package/static/icons/{back_polo_a4_v.svg → back_polo_a4.svg} +0 -0
  84. package/static/icons/{back_polo_half_a4_h.svg → back_polo_half_a4.svg} +0 -0
  85. package/static/icons/{back_polo_rect10_l.svg → back_polo_rect10.svg} +0 -0
  86. package/static/icons/{back_tee_a4_v.svg → back_tee_a4.svg} +0 -0
  87. package/static/icons/{back_tee_half_a4_h.svg → back_tee_half_a4.svg} +0 -0
  88. package/static/icons/{back_tee_rect10_l.svg → back_tee_rect10.svg} +0 -0
  89. package/static/icons/{front_hoodie_a4_v.svg → front_hoodie_a4.svg} +0 -0
  90. package/static/icons/{front_hoodie_half_a4_h.svg → front_hoodie_half_a4.svg} +0 -0
  91. package/static/icons/{front_hoodie_rect10_l.svg → front_hoodie_rect10.svg} +0 -0
  92. package/static/icons/{front_polo_a4_v.svg → front_polo_a4.svg} +0 -0
  93. package/static/icons/{front_polo_half_a4_h.svg → front_polo_half_a4.svg} +0 -0
  94. package/static/icons/{front_polo_rect10_l.svg → front_polo_rect10.svg} +0 -0
  95. package/static/icons/{front_tee_a4_v.svg → front_tee_a4.svg} +0 -0
  96. package/static/icons/{front_tee_half_a4_h.svg → front_tee_half_a4.svg} +0 -0
  97. package/static/icons/{front_tee_rect10_l.svg → front_tee_rect10.svg} +0 -0
  98. package/store/index.js +3 -1
  99. package/store/product.js +25 -14
  100. package/components/pricing/pricing_print/discounts_table/discounts-table.scss +0 -8
  101. package/components/pricing/pricing_print/discounts_table/discounts-table.vue +0 -91
  102. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.scss +0 -14
  103. package/components/pricing/pricing_screen_print/discounts_table/discounts-table.vue +0 -78
@@ -0,0 +1,41 @@
1
+ @import '@/assets/scss/variables';
2
+
3
+ .EditorPricingDetailsPrints {
4
+ &__wrapper td {
5
+ font-weight: 600;
6
+ border: 1px solid $gray;
7
+ font-size: 16px;
8
+ line-height: 25px;
9
+ text-transform: uppercase;
10
+ color: $black;
11
+ @media (max-width: $bp-extra-small-max) {
12
+ padding: 2px;
13
+ font-size: 12px;
14
+ }
15
+ strong {
16
+ font-weight: bold;
17
+ }
18
+ &.disabled {
19
+ color: $gray_main;
20
+ pointer-events: none !important;
21
+ }
22
+ }
23
+ &__th {
24
+ font-weight: bold !important;
25
+ background: $gray;
26
+ @media (max-width: $bp-extra-small-max) {
27
+ padding: 2px;
28
+ font-size: 12px;
29
+ }
30
+ }
31
+ &__name {
32
+ width: 70px;
33
+ @media (max-width: $bp-extra-small-max) {
34
+ width: 30px;
35
+ }
36
+ span {
37
+ writing-mode: vertical-lr;
38
+ transform: rotate(180deg);
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,119 @@
1
+ <template>
2
+ <div class="EditorPricingDetailsPrints__wrapper">
3
+ <table class="lc_table EditorPricingDetailsPrints__table">
4
+ <tbody class="centered">
5
+ <tr>
6
+ <td
7
+ class="EditorPricingDetailsPrints__name"
8
+ :rowspan="groupedProductsByPrintArea.length + (hasPrintSurcharge ? 3 : 2)">
9
+ <span>printing</span>
10
+ </td>
11
+ <td class="EditorPricingDetailsPrints__th">
12
+ type of print
13
+ </td>
14
+ <td class="EditorPricingDetailsPrints__th">
15
+ location
16
+ </td>
17
+ <td class="EditorPricingDetailsPrints__th">
18
+ Setup cost
19
+ </td>
20
+ <td class="EditorPricingDetailsPrints__th">
21
+ Price
22
+ </td>
23
+ </tr>
24
+ <tr
25
+ v-for="([, group], index) in groupedProductsByPrintArea"
26
+ :key="index">
27
+ <td>
28
+ {{ group.printType.name }}
29
+ </td>
30
+ <td>
31
+ {{ group.printArea.name }}
32
+ </td>
33
+ <td>
34
+ <strong>
35
+ {{ group.setupPriceWithoutTax | priceWithTax(pricingSettings) }}
36
+ </strong>
37
+ </td>
38
+ <td>
39
+ <span v-if="group.costType !== 'setup only'">
40
+ <strong>
41
+ {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
42
+ </strong>
43
+ = {{ group.amount }} x {{ (displayPricingWithTax ? group.price : group.priceWithoutTax) | price }}
44
+ </span>
45
+ <strong v-else>
46
+ {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
47
+ </strong>
48
+ </td>
49
+ </tr>
50
+ <tr v-if="hasPrintSurcharge">
51
+ <td colspan="4">
52
+ {{ printSurchargeNote }}
53
+ </td>
54
+ </tr>
55
+ <tr class="highlighted">
56
+ <td colspan="3">
57
+ Prints Subtotal:
58
+ </td>
59
+ <td>
60
+ <strong>
61
+ {{ (displayPricingWithTax ? productPricing.products.prints.totalPrice : productPricing.products.prints.totalPriceWithoutTax) | price }}
62
+ </strong>
63
+ </td>
64
+ </tr>
65
+ </tbody>
66
+ </table>
67
+ </div>
68
+ </template>
69
+
70
+ <script>
71
+ import { mapGetters } from 'vuex';
72
+ import { price, sizesRange, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
73
+ import { groupProductsPrintsByPrintArea } from '@lancom/shared/assets/js/utils/products-grouping';
74
+
75
+ export default {
76
+ name: 'EditorPricingDetailsPrints',
77
+ filters: {
78
+ price,
79
+ priceWithTax,
80
+ sizesRange
81
+ },
82
+ computed: {
83
+ ...mapGetters(['displayPricingWithTax', 'pricingSettings']),
84
+ ...mapGetters('product', [
85
+ 'product',
86
+ 'usedSimpleProducts',
87
+ 'productPricing',
88
+ 'mainProductPricing'
89
+ ]),
90
+ hasPrintSurcharge() {
91
+ return this.product.printSurcharge > 0;
92
+ },
93
+ printSurchargeNote() {
94
+ const message = this.product.printSurchargeNote || 'surcharge of $x per print';
95
+ return message.replace(/\$x/, price(this.product.printSurcharge));
96
+ },
97
+ hasUsedSimpleProducts() {
98
+ return this.usedSimpleProducts.length > 0;
99
+ },
100
+ products() {
101
+ return this.hasUsedSimpleProducts
102
+ ? this.usedSimpleProducts
103
+ : [];
104
+ },
105
+ groupedProductsByPrintArea() {
106
+ const groups = this.mainProductPricing
107
+ ? groupProductsPrintsByPrintArea(
108
+ this.mainProductPricing
109
+ )
110
+ : [];
111
+ return groups;
112
+ }
113
+ }
114
+ };
115
+ </script>
116
+
117
+ <style lang="scss" scoped>
118
+ @import 'editor-pricing-details-prints';
119
+ </style>
@@ -0,0 +1,41 @@
1
+ @import '@/assets/scss/variables';
2
+
3
+ .EditorPricingDetailsProducts {
4
+ &__wrapper td {
5
+ font-weight: 600;
6
+ border: 1px solid $gray;
7
+ font-size: 16px;
8
+ line-height: 25px;
9
+ text-transform: uppercase;
10
+ color: $black;
11
+ @media (max-width: $bp-extra-small-max) {
12
+ padding: 2px;
13
+ font-size: 12px;
14
+ }
15
+ strong {
16
+ font-weight: bold;
17
+ }
18
+ &.disabled {
19
+ color: $gray_main;
20
+ pointer-events: none !important;
21
+ }
22
+ }
23
+ &__th {
24
+ font-weight: bold !important;
25
+ background: $gray;
26
+ @media (max-width: $bp-extra-small-max) {
27
+ padding: 2px;
28
+ font-size: 12px;
29
+ }
30
+ }
31
+ &__name {
32
+ width: 70px;
33
+ @media (max-width: $bp-extra-small-max) {
34
+ width: 30px;
35
+ }
36
+ span {
37
+ writing-mode: vertical-lr;
38
+ transform: rotate(180deg);
39
+ }
40
+ }
41
+ }
@@ -0,0 +1,101 @@
1
+ <template>
2
+ <div class="EditorPricingDetailsProducts__wrapper">
3
+ <table class="lc_table EditorPricingDetailsProducts__table">
4
+ <tbody class="centered">
5
+ <tr>
6
+ <td
7
+ class="EditorPricingDetailsProducts__name"
8
+ :rowspan="groupedProductsByPrice.length + 2">
9
+ <span>product</span>
10
+ </td>
11
+ <td class="EditorPricingDetailsProducts__th">
12
+ Products
13
+ </td>
14
+ <td class="EditorPricingDetailsProducts__th">
15
+ Sizes
16
+ </td>
17
+ <td class="EditorPricingDetailsProducts__th">
18
+ Cost
19
+ </td>
20
+ <td class="EditorPricingDetailsProducts__th">
21
+ Total Cost
22
+ </td>
23
+ </tr>
24
+ <tr
25
+ v-for="([groupPrice, group], index) in groupedProductsByPrice"
26
+ :key="index">
27
+ <td>
28
+ {{ group.amount }}
29
+ </td>
30
+ <td>
31
+ {{ group.sizes | sizesRange }}
32
+ </td>
33
+ <td>
34
+ <span class="EditorPricingDetailsProducts__hoverable">
35
+ {{ groupPrice | priceWithTax(pricingSettings) }}
36
+ </span>
37
+ </td>
38
+ <td>
39
+ <strong>
40
+ {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price }}
41
+ </strong>
42
+ </td>
43
+ </tr>
44
+ <tr class="highlighted">
45
+ <td colspan="3">
46
+ Products Subtotal:
47
+ </td>
48
+ <td>
49
+ <strong>
50
+ {{ (displayPricingWithTax ? productPricing.products.products.totalPrice : productPricing.products.products.totalPriceWithoutTax) | price }}
51
+ </strong>
52
+ </td>
53
+ </tr>
54
+ </tbody>
55
+ </table>
56
+ </div>
57
+ </template>
58
+
59
+ <script>
60
+ import { mapGetters } from 'vuex';
61
+ import { price, sizesRange, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
62
+ import { groupProductsSizesByPrice } from '@lancom/shared/assets/js/utils/products-grouping';
63
+
64
+ export default {
65
+ name: 'EditorPricingDetailsProducts',
66
+ filters: {
67
+ price,
68
+ priceWithTax,
69
+ sizesRange
70
+ },
71
+ computed: {
72
+ ...mapGetters(['displayPricingWithTax', 'pricingSettings']),
73
+ ...mapGetters('product', [
74
+ 'product',
75
+ 'usedSimpleProducts',
76
+ 'mainProductPricing',
77
+ 'productPricing'
78
+ ]),
79
+ hasUsedSimpleProducts() {
80
+ return this.usedSimpleProducts.length > 0;
81
+ },
82
+ products() {
83
+ return this.hasUsedSimpleProducts
84
+ ? this.usedSimpleProducts
85
+ : [];
86
+ },
87
+ groupedProductsByPrice() {
88
+ return this.mainProductPricing
89
+ ? groupProductsSizesByPrice(
90
+ this.products,
91
+ this.mainProductPricing
92
+ )
93
+ : [];
94
+ }
95
+ }
96
+ };
97
+ </script>
98
+
99
+ <style lang="scss" scoped>
100
+ @import 'editor-pricing-details-products';
101
+ </style>
@@ -7,14 +7,14 @@
7
7
  :key="index"
8
8
  class="EditorPrintAreaOptions__option"
9
9
  :class="{
10
- 'EditorPrintAreaOptions__option--no-print': !option.value
10
+ 'EditorPrintAreaOptions__option--no-print': !option.printArea
11
11
  }">
12
12
  <editor-print-area-option
13
13
  :option="option"
14
14
  :product="product"
15
15
  :selected="
16
- (option.value === selected) ||
17
- (option.suboptions && option.value.includes(selected))
16
+ (option.printArea && option.printArea._id === selected) ||
17
+ (option.suboptions && option.printArea && option.printArea._id === selected)
18
18
  "
19
19
  @select="select"
20
20
  @option-mouseover="$emit('option-mouseover', $event)"
@@ -59,27 +59,28 @@ export default {
59
59
  },
60
60
  watch: {
61
61
  side() {
62
- this.setOptions();
62
+ this.updateOptions();
63
63
  }
64
64
  },
65
65
  mounted() {
66
- this.setOptions();
66
+ this.updateOptions();
67
67
  },
68
68
  methods: {
69
- setOptions() {
70
- const options = this.getProductOptions().filter(({ sides }) => sides.includes(this.side));
69
+ updateOptions() {
70
+ const productsOptions = this.getProductOptions();
71
+ const options = productsOptions.filter(({ sides }) => sides.includes(this.side));
71
72
  this.options = this.allowNoPrint ? [...options, { label: 'No Print' }] : options;
72
73
  },
73
- select(value) {
74
- this.$emit('select', value);
74
+ select(option) {
75
+ this.$emit('select', option);
75
76
  },
76
77
  getProductOptions() {
77
- const groupItemToOption = ({ printArea, name }) => ({ value: printArea.alias, label: name });
78
- return (this.product.productType.printGroups || [])
79
- .map(group => ({
80
- ...groupItemToOption(group),
81
- sides: group.sides,
82
- suboptions: (group.items || []).map(i => ({ ...groupItemToOption(i), sides: group.sides }))
78
+ const groupItemToOption = printArea => ({ printArea, label: printArea.name, size: printArea.printSize.alias });
79
+ return (this.product.printAreas || [])
80
+ .map(printArea => ({
81
+ ...groupItemToOption(printArea),
82
+ sides: [printArea.side],
83
+ suboptions: (printArea.sizes || []).map(i => ({ ...groupItemToOption(i), sides: [printArea.side] }))
83
84
  }));
84
85
  }
85
86
  }
@@ -10,8 +10,8 @@
10
10
  {{ option.label }}
11
11
  </div>
12
12
  <div class="lc_regular10">
13
- <span v-if="option.value">
14
- {{ calcPrintPrice(option) | tax(gstTax) | price }}
13
+ <span v-if="option.printArea && calcPrintPrice(option) > 0">
14
+ {{ calcPrintPrice(option) | priceWithTax(pricingSettings) }}
15
15
  </span>
16
16
  </div>
17
17
  </div>
@@ -36,14 +36,13 @@
36
36
 
37
37
  <script>
38
38
  import { mapGetters } from 'vuex';
39
- import { price, priceInRange, tax } from '@lancom/shared/assets/js/utils/filters';
39
+ import { priceWithTax, priceInRange } from '@lancom/shared/assets/js/utils/filters';
40
40
  import { getProductPrintsAreasPrices } from '@lancom/shared/assets/js/models/print-area';
41
41
 
42
42
  export default {
43
43
  name: 'EditorPrintAreaOption',
44
44
  filters: {
45
- price,
46
- tax
45
+ priceWithTax
47
46
  },
48
47
  props: {
49
48
  product: {
@@ -66,13 +65,14 @@ export default {
66
65
  },
67
66
  computed: {
68
67
  ...mapGetters([
69
- 'gstTax'
68
+ 'pricingSettings'
70
69
  ]),
71
70
  ...mapGetters('product', [
72
- 'usedSimpleProducts'
71
+ 'usedSimpleProducts',
72
+ 'selectedPrintType'
73
73
  ]),
74
74
  printsPricing() {
75
- return getProductPrintsAreasPrices(this.product);
75
+ return getProductPrintsAreasPrices(this.product, this.selectedPrintType);
76
76
  }
77
77
  },
78
78
  methods: {
@@ -80,16 +80,16 @@ export default {
80
80
  if (this.option.suboptions && this.option.suboptions.length) {
81
81
  this.showOptions = !this.showOptions;
82
82
  } else {
83
- this.$emit('select', this.option.value);
83
+ this.$emit('select', this.option);
84
84
  }
85
85
  },
86
- selectSuboption({ value }) {
86
+ selectSuboption(option) {
87
87
  this.closeSuboptions();
88
- this.$emit('select', value);
88
+ this.$emit('select', option);
89
89
  },
90
90
  calcPrintPrice(option) {
91
91
  const amount = this.usedSimpleProducts.reduce((amount, product) => product.amount + amount, 0);
92
- return priceInRange(this.printsPricing[option.value], amount || 1);
92
+ return option.printArea ? priceInRange(this.printsPricing[option.printArea._id], amount || 1) : null;
93
93
  },
94
94
  closeSuboptions() {
95
95
  this.showOptions = false;
@@ -43,7 +43,7 @@
43
43
 
44
44
  thead tr,
45
45
  tbody td:first-child {
46
- background-color: $grey_3 !important;
46
+ background-color: $grey_4 !important;
47
47
  text-align: center;
48
48
  }
49
49
  }
@@ -20,7 +20,7 @@
20
20
  popover-class="tooltip popover white"
21
21
  class="EditorProductDetails__discounts-table">
22
22
  <span class="lc_semibold22 lc_black EditorProductDetails__dashed-underline">
23
- {{ defaultSimpleProduct.pricing[0].price | tax(pricingSettings.gstTax) | price }}
23
+ {{ defaultSimpleProduct.pricing[0].price | priceWithTax(pricingSettings) }}
24
24
  </span>
25
25
  <template slot="popover">
26
26
  <pricing-discounts-table :prices="defaultSimpleProduct.pricing" />
@@ -50,9 +50,10 @@
50
50
  Printing
51
51
  </span>
52
52
  <template slot="popover">
53
- <discounts-table
54
- :visible-sleeve="false"
55
- :striped="true"
53
+ <pricing-table
54
+ :items="printTypePrices"
55
+ :bordered="true"
56
+ :striped="false"
56
57
  class="EditorProductDetails__prints-table" />
57
58
  </template>
58
59
  </v-popover>
@@ -80,10 +81,10 @@ import { mapGetters } from 'vuex';
80
81
  import ProductColorsSelector from '@lancom/shared/components/product/layouts/product_colors_selector/product-colors-selector';
81
82
  import ProductSizeSelector from '@lancom/shared/components/product/product_size_selector/product-size-selector';
82
83
  import EditorPricing from '@lancom/shared/components/editor/editor_pricing/editor-pricing';
83
- import DiscountsTable from '@lancom/shared/components/pricing/pricing_print/discounts_table/discounts-table.vue';
84
84
  import PricingDiscountsTable from '@lancom/shared/components/common/pricing_discounts_table/pricing-discounts-table';
85
85
  import modals from '@lancom/shared/mixins/modals';
86
- import { price, tax, staticLink } from '@lancom/shared/assets/js/utils/filters';
86
+ import { staticLink, priceWithTax } from '@lancom/shared/assets/js/utils/filters';
87
+ import PricingTable from '@lancom/shared/components/common/pricing_table/pricing-table';
87
88
 
88
89
  export default {
89
90
  name: 'EditorProductDetails',
@@ -92,11 +93,10 @@ export default {
92
93
  ProductSizeSelector,
93
94
  PricingDiscountsTable,
94
95
  EditorPricing,
95
- DiscountsTable
96
+ PricingTable
96
97
  },
97
98
  filters: {
98
- price,
99
- tax,
99
+ priceWithTax,
100
100
  staticLink
101
101
  },
102
102
  mixins: [modals],
@@ -104,7 +104,8 @@ export default {
104
104
  ...mapGetters('product', [
105
105
  'product',
106
106
  'productDetailsLoaded',
107
- 'defaultSimpleProduct'
107
+ 'defaultSimpleProduct',
108
+ 'selectedPrintType'
108
109
  ]),
109
110
  ...mapGetters('layers', [
110
111
  'layerThumbnails'
@@ -114,6 +115,17 @@ export default {
114
115
  ]),
115
116
  productLink() {
116
117
  return `/${this.product.SKU}/${this.product.alias}`;
118
+ },
119
+ printTypePrices() {
120
+ return [...(this.selectedPrintType?.printAreas || []).reduce((sizes, area) => {
121
+ (area.printSizes || []).forEach(size => {
122
+ sizes.set(size._id, {
123
+ name: size.name,
124
+ pricing: area.printCost
125
+ });
126
+ });
127
+ return sizes;
128
+ }, new Map()).values()];
117
129
  }
118
130
  }
119
131
  };
@@ -24,7 +24,8 @@
24
24
  ref="editor"
25
25
  :key="side"
26
26
  :side="side"
27
- :print-area="selectedPrintArea"
27
+ :print-area="editablePrintArea"
28
+ :print-area-size="selectedPrintArea"
28
29
  :class="side"
29
30
  class="EditorWorkspace__side rotate-y-element">
30
31
  </editor-workspace-side>
@@ -56,7 +57,8 @@
56
57
  ref="editor"
57
58
  :key="editableSide.id"
58
59
  :side="editableSide.id"
59
- :print-area="selectedPrintArea"
60
+ :print-area="editablePrintArea"
61
+ :print-area-size="selectedPrintArea"
60
62
  :class="editableSide.id"
61
63
  :zoom-size="zoomSize"
62
64
  class="EditorWorkspace__side rotate-y-element"
@@ -139,6 +141,7 @@ export default {
139
141
  'product',
140
142
  'productDetailsLoaded',
141
143
  'selectedPrintArea',
144
+ 'editablePrintArea',
142
145
  'editableSide',
143
146
  'editableColor'
144
147
  ]),
@@ -149,7 +152,8 @@ export default {
149
152
  methods: {
150
153
  ...mapMutations([
151
154
  'setEditableSide',
152
- 'setSelectedPrintArea'
155
+ 'setSelectedPrintArea',
156
+ 'setEditablePrintArea'
153
157
  ]),
154
158
  selectTab(value) {
155
159
  this.setEditableSide({ id: value }); // todo improve later by adding real sides
@@ -159,8 +163,9 @@ export default {
159
163
  id: this.editableSide.id === 'front' ? 'back' : 'front'
160
164
  });
161
165
  },
162
- selectPrintArea(printArea) {
163
- this.setSelectedPrintArea({ sideId: this.editableSide.id, printArea });
166
+ selectPrintArea({ printArea, size }) {
167
+ this.setEditablePrintArea(printArea);
168
+ this.setSelectedPrintArea({ sideId: this.editableSide.id, printArea: printArea._id, size });
164
169
  },
165
170
  toogleBoundBox(state, printAreaOption) {
166
171
  if (this.$refs.editor) {
@@ -86,6 +86,9 @@ export default {
86
86
  default: null
87
87
  },
88
88
  printArea: {
89
+ type: Object
90
+ },
91
+ printAreaSize: {
89
92
  type: String,
90
93
  required: true
91
94
  },
@@ -147,10 +150,10 @@ export default {
147
150
  );
148
151
  },
149
152
  printAreaIsSmall() {
150
- return ['rect10_l', 'rect10_r'].includes(this.printArea);
153
+ return this.printAreaSize === 'rect10';
151
154
  },
152
155
  backgroundColor() {
153
- return this.backgroundImageLoaded && this.editableColor.rgb;
156
+ return this.backgroundImageLoaded && this.editableColor?.rgb;
154
157
  },
155
158
  isZoomed() {
156
159
  return !!this.zoomSize;
@@ -320,13 +323,13 @@ export default {
320
323
  setOffsetWarningVisibility(visible) {
321
324
  // this.offsetWarningVisible = visible;
322
325
  },
323
- toogleBoundBox(state, printArea) {
326
+ toogleBoundBox(state, option) {
324
327
  if (!this.fabricHelper || this.breakpoints.is === 'xs') {
325
328
  return;
326
329
  }
327
330
 
328
- if (printArea) {
329
- const area = state ? printArea.value : this.printArea;
331
+ if (option) {
332
+ const area = state ? option.printArea : this.printArea;
330
333
  this.fabricHelper.setPrintArea(area, this.editorSize, this.product);
331
334
  }
332
335
 
@@ -31,7 +31,7 @@
31
31
 
32
32
  <script>
33
33
  import { mapGetters } from 'vuex';
34
- import Cart from '@lancom/shared/components/checkout/cart/cart';
34
+ import Cart from '@/components/checkout/cart/cart';
35
35
 
36
36
  export default {
37
37
  name: 'CartModal',
@@ -295,13 +295,10 @@ export default {
295
295
  ...mapGetters(['shop']),
296
296
  ...mapGetters('order', ['orderData']),
297
297
  ...mapGetters('cart', [
298
- 'notEmptySimpleProducts',
298
+ 'entities',
299
299
  'cartPricing',
300
300
  'suburb'
301
- ]),
302
- numberOfProducts() {
303
- return this.notEmptySimpleProducts.length;
304
- }
301
+ ])
305
302
  },
306
303
  mounted() {
307
304
  if (this.orderData) {
@@ -340,8 +337,9 @@ export default {
340
337
  try {
341
338
  this.processing = true;
342
339
  await this.createOrder({
343
- ...this.form,
344
- products: this.notEmptySimpleProducts,
340
+ billingAddress: this.form,
341
+ shippingAddress: this.form,
342
+ products: this.entities,
345
343
  pricing: this.cartPricing,
346
344
  shop: this.shop._id
347
345
  });
@@ -155,7 +155,7 @@ export default {
155
155
  },
156
156
  isSuccessOrderCharge() {
157
157
  const { charge, test } = this.orderData;
158
- return true || (charge && charge.success) || test;
158
+ return (charge && charge.success) || test;
159
159
  },
160
160
  isFailedOrderCharge() {
161
161
  const { charge } = this.orderData;
@@ -250,7 +250,7 @@ export default {
250
250
  },
251
251
  data() {
252
252
  return {
253
- product: null
253
+ product: this.products.find(p => p.productType.alias === PRODUCT_TYPES.TEE)
254
254
  };
255
255
  },
256
256
  computed: {
@@ -271,9 +271,6 @@ export default {
271
271
  return productType?.alias;
272
272
  }
273
273
  },
274
- created() {
275
- this.product = this.findProductByType(PRODUCT_TYPES.TEE);
276
- },
277
274
  methods: {
278
275
  contactUs() {
279
276
  this.$aside.show(ContactUs);