Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions _dev/front/js/components/Product/Product.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,25 @@
<button
class="btn wishlist-product-addtocart"
:class="{
'btn-secondary': product.customizable,
'btn-primary': !product.customizable
'btn-secondary': product.customization_required,
'btn-primary': !product.customization_required
}"
:disabled="isDisabled || forceDisable"
@click="
product.add_to_cart_url || product.customizable
product.add_to_cart_url || product.customization_required
? addToCartAction()
: null
"
>
<i
class="material-icons shopping-cart"
v-if="!product.customizable"
v-if="!product.customization_required"
>
shopping_cart
</i>
{{ product.customizable ? customizeText : addToCart }}
<!-- customization_required, not customizable: a product whose customization fields are all
optional can be added to the cart directly, which is the rule the cart itself applies -->
{{ product.customization_required ? customizeText : addToCart }}
</button>

<button
Expand Down Expand Up @@ -235,7 +237,7 @@
return false;
}

if (this.product.customizable) {
if (this.product.customization_required) {
return false;
}

Expand Down Expand Up @@ -271,7 +273,7 @@
});
},
async addToCartAction() {
if (this.product.add_to_cart_url && !this.product.customizable) {
if (this.product.add_to_cart_url && !this.product.customization_required) {
try {
this.forceDisable = true;
const datas = new FormData();
Expand Down