diff --git a/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.scss b/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.scss deleted file mode 100644 index cd34f3f03cd..00000000000 --- a/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.scss +++ /dev/null @@ -1,9 +0,0 @@ -.o_product_badge_extra_price { - display: inline-block; - width: 1rem; - height: 1rem; - color: map-get($theme-colors, 'primary'); - background: white; - line-height: 1rem; - border-radius: 50%; -} diff --git a/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.xml b/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.xml index 0f28a859b3c..4b708b4372e 100644 --- a/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.xml +++ b/addons/sale_product_configurator/static/src/js/badge_extra_price/badge_extra_price.xml @@ -1,9 +1,9 @@ - - - + + + diff --git a/addons/sale_product_configurator/static/src/js/product/product.scss b/addons/sale_product_configurator/static/src/js/product/product.scss index 0f50115c1b4..6e2ca2be3ae 100644 --- a/addons/sale_product_configurator/static/src/js/product/product.scss +++ b/addons/sale_product_configurator/static/src/js/product/product.scss @@ -1,47 +1,36 @@ +.table.o_sale_product_configurator_table { + & tr:first-child > td { + padding-top: 0 !important; + } + + &.o_sale_product_configurator_table_optional > :not(caption) > *:last-child > * { + border-bottom: 0; + } +} + .o_sale_product_configurator_img { - width: 100px; + width: 120px; max-height: 240px; } .o_sale_product_configurator_qty { - width: 200px; + width: 160px; - .input-group { - display: inline-flex; - } - - div { - width: initial; // We don't want the quantity form to be full-width - - .btn, input { - border-color: $input-border-color; + input { + max-width: 4rem; + //removing input field=number arrows as their size might + //change depending on browser default styling and shift input's position + &::-webkit-outer-spin-button, + &::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; } - - input { - // Needs !important because themes customize btns' padding directly - // rather than change '$input-btn-padding-X' (shared with inputs). - height: auto !important; - max-width: 4rem; - text-align: center; - //removing input field=number arrows as their size might - //change depending on browser default styling and shift input's position - &::-webkit-outer-spin-button, - &::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; - } - &[type=number] { - -moz-appearance: textfield; - } + &[type=number] { + -moz-appearance: textfield; } } } -.o_sale_product_configurator_name { - word-wrap: break-word; - min-width: 140px; -} - .o_sale_product_configurator_price { - width: 120px; + width: 160px; } diff --git a/addons/sale_product_configurator/static/src/js/product/product.xml b/addons/sale_product_configurator/static/src/js/product/product.xml index 15c7c45d887..61d72fac68f 100644 --- a/addons/sale_product_configurator/static/src/js/product/product.xml +++ b/addons/sale_product_configurator/static/src/js/product/product.xml @@ -1,69 +1,77 @@ - + Product Image Product Image - -
- + +
+
+
+ This option or combination of options is not available +
- -
+ +
+
+
+
+ + Remove product + - - - + +
+
+
+
- - -

Option not available

-
- diff --git a/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.js b/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.js index 088ee25176f..2bd3b057778 100644 --- a/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.js +++ b/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.js @@ -36,7 +36,7 @@ export class ProductConfiguratorDialog extends Component { } setup() { - this.title = _t("Configure"); + this.title = _t("Configure your product"); this.rpc = useService("rpc"); this.state = useState({ products: [], diff --git a/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.xml b/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.xml index 0c1e26977b5..1da2d540075 100644 --- a/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.xml +++ b/addons/sale_product_configurator/static/src/js/product_configurator_dialog/product_configurator_dialog.xml @@ -1,7 +1,7 @@ - + diff --git a/addons/sale_product_configurator/static/src/js/product_list/product_list.xml b/addons/sale_product_configurator/static/src/js/product_list/product_list.xml index 347b90a3218..ac7ac4876eb 100644 --- a/addons/sale_product_configurator/static/src/js/product_list/product_list.xml +++ b/addons/sale_product_configurator/static/src/js/product_list/product_list.xml @@ -1,31 +1,25 @@ - - - - - - - +

Add optional products

+
Product - Quantity - - Price -
+ + + + + - - + - - +
ProductQuantityPrice

Available Options:

- Total: - + +

Total:

diff --git a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.js b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.js index ca2cff0a672..d3793b7a53c 100644 --- a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.js +++ b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.js @@ -133,4 +133,15 @@ export class ProductTemplateAttributeLine extends Component { ptav => this.props.selected_attribute_value_ids.includes(ptav.id) )?.is_custom; } + + /** + * Check if the line has a custom ptav or not. + * + * @return {Boolean} - Whether the line has a custom ptav or not. + */ + hasPTAVCustom() { + return this.props.attribute_values.some( + ptav => ptav.is_custom + ); + } } diff --git a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.scss b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.scss index b17003cb654..8097ccc2e06 100644 --- a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.scss +++ b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.scss @@ -1,24 +1,5 @@ -.o_sale_product_configurator_ptal_name { - display: flex; - align-items: center; - font-size: 0.9rem; - text-transform: uppercase; - padding-bottom: 0.5rem; - - &:after { - content: ''; - margin-left: $spacer; - flex-grow: 1; - border-bottom: 1px solid map-get($grays, '400'); - } -} - .o_sale_product_configurator_ptav_color { - position: relative; - display: inline-block; - border: 5px solid $input-border-color; - border-radius: 50%; - text-align: center; + border: 5px solid $border-color; transition: $input-transition; @include o-field-pointer(); @@ -27,7 +8,7 @@ content: ""; display: block; @include o-position-absolute(-3px, -3px, -3px, -3px); - border: 4px solid white; + border: 4px solid $o-view-background-color; border-radius: 50%; box-shadow: inset 0 0 3px rgba(black, 0.3); } @@ -66,27 +47,12 @@ } } -.o_sale_product_configurator_ptav_pills { - padding: $spacer/2 $spacer; - margin-right: 0.2rem; - border: none; - cursor: default !important; - - &.btn.active { - color: $white; - background-color: map-get($theme-colors, 'primary'); - } - &:not(.active) { - color: map-get($grays, '600'); - background-color: map-get($grays, '200'); - } - - input { - -moz-appearance: none; - -webkit-appearance: none; - appearance: none; - opacity: 0; - } +.o_sale_product_configurator_ptav_pills.active label { + $-btn-secondary-design: map-get($o-btns-bs-override, "secondary"); + + background-color: map-get($-btn-secondary-design, active-background); + border-color: map-get($-btn-secondary-design, active-border); + color: map-get($-btn-secondary-design, active-color); } .css_not_available { diff --git a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.xml b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.xml index 93c83f84e11..f055af387d8 100644 --- a/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.xml +++ b/addons/sale_product_configurator/static/src/js/product_template_attribute_line/product_template_attribute_line.xml @@ -2,26 +2,31 @@ +
- - - +
+
+ +
- - -
- - -
- -
    -
  • -
    -
- -
    + +
    • + t-att-class="{'active': this.props.selected_attribute_value_ids.includes(ptav.id)}" + class="o_sale_product_configurator_ptav_pills list-inline-item"> + + +
    • +
    +
    + +
      +