From b28b8cedde0e0bdb275835f1eabd2b2584fa0df6 Mon Sep 17 00:00:00 2001 From: bach Date: Fri, 11 Jun 2021 10:31:22 +0200 Subject: [PATCH] changed 'add to cart' button text --- .../custom/materiotheme/materiotheme.theme | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/web/themes/custom/materiotheme/materiotheme.theme b/web/themes/custom/materiotheme/materiotheme.theme index 2bd35e74..2418b85c 100644 --- a/web/themes/custom/materiotheme/materiotheme.theme +++ b/web/themes/custom/materiotheme/materiotheme.theme @@ -199,6 +199,22 @@ function materiotheme_form_alter(&$form, FormStateInterface $form_state, $form_i "@click.prevent.stop" => "checkaddtocart(\$event, $variation_id)" ); } + + // change "add to cart" button text + switch ($form_id) { + case 'commerce_order_item_variation_cart_form_form_commerce_product_variation_3': + $form['actions']['submit']['#value'] = t('Yeees!'); + break; + case 'commerce_order_item_variation_cart_form_form_commerce_product_variation_4': + $form['actions']['submit']['#value'] = t('Yay!'); + break; + case 'commerce_order_item_variation_cart_form_form_commerce_product_variation_5': + $form['actions']['submit']['#value'] = t('Great!'); + break; + case 'commerce_order_item_variation_cart_form_form_commerce_product_variation_6': + $form['actions']['submit']['#value'] = t('OKAY!'); + break; + } } /**