From 3df726ddf7cad9de618bb80f38d6ff5fafd2f2ed Mon Sep 17 00:00:00 2001 From: Tony Volpe Date: Mon, 2 Dec 2024 16:53:56 -0500 Subject: [PATCH] remove lifeline code --- wp/wp-content/themes/medicalalert/404.php | 2 +- .../medicalalert/tpl/checkout-step-1.tpl | 2 +- .../medicalalert/tpl/single_product.tpl | 23 ++++---- .../woocommerce/single-product.php | 59 +++++++------------ 4 files changed, 34 insertions(+), 52 deletions(-) diff --git a/wp/wp-content/themes/medicalalert/404.php b/wp/wp-content/themes/medicalalert/404.php index 39051d34..a9ab45c3 100644 --- a/wp/wp-content/themes/medicalalert/404.php +++ b/wp/wp-content/themes/medicalalert/404.php @@ -2,7 +2,7 @@ get_header(); ?> -
+
diff --git a/wp/wp-content/themes/medicalalert/tpl/checkout-step-1.tpl b/wp/wp-content/themes/medicalalert/tpl/checkout-step-1.tpl index 100a347c..0a984093 100644 --- a/wp/wp-content/themes/medicalalert/tpl/checkout-step-1.tpl +++ b/wp/wp-content/themes/medicalalert/tpl/checkout-step-1.tpl @@ -7,7 +7,7 @@

Subscriber Contact Information

-

Please enter the information for the person who will be using the Lifeline service.

+

Please enter the information for the person who will be using the MedicalAlert service.

{{{ subscriber_first_name }}} {{{ subscriber_last_name }}} diff --git a/wp/wp-content/themes/medicalalert/tpl/single_product.tpl b/wp/wp-content/themes/medicalalert/tpl/single_product.tpl index 26f20d29..54353e50 100644 --- a/wp/wp-content/themes/medicalalert/tpl/single_product.tpl +++ b/wp/wp-content/themes/medicalalert/tpl/single_product.tpl @@ -14,18 +14,17 @@
-{{#if showHomesafeOptions}} -
-

Select Your System Type:

- {{#if currentProductIsHomeSafe}} - {{#each autoAlertProducts}} - - {{ _product_attributes.connection-type.value }} - - {{/each}} - {{/if}} -
- {{/if}} + {{#if showHomeOptions}} +
+

Select Your System Type:

+ {{#if currentProductIsHome}} + {{#each homesystemProducts}} + + {{ _product_attributes.connection-type.value }} + {{/each}} + {{/if}} +
+ {{/if}} {{#if showOTGOptions}}
diff --git a/wp/wp-content/themes/medicalalert/woocommerce/single-product.php b/wp/wp-content/themes/medicalalert/woocommerce/single-product.php index 332cf410..077ffcba 100644 --- a/wp/wp-content/themes/medicalalert/woocommerce/single-product.php +++ b/wp/wp-content/themes/medicalalert/woocommerce/single-product.php @@ -42,52 +42,41 @@ $allProducts = site()->getPosts( ['post_type' => 'product', 'nopaging' => true], ["id", "title", "permalink", "meta._product_attributes"] ); -$homeSafeStandardVsAutoAlertProducts = []; -$currentProductIsHomeSafe = false; -$productsWithWearingStyle = []; +$currentProductIsHome = false; + $productsWithConnectionType = []; -$HomeSafeProducts = []; -foreach ($allProducts as $lifelineProduct) { - if (strpos($lifelineProduct["title"], "Home") !== false) { - $autoAlertProducts[] = $lifelineProduct; + +foreach ($allProducts as $maProduct) { + if (strpos($maProduct["title"], "Home") !== false) { + $homesystemProducts[] = $maProduct; } - if (is_array($lifelineProduct["_product_attributes"]) && - array_key_exists("style", $lifelineProduct["_product_attributes"]) && + if (is_array($maProduct["_product_attributes"]) && + array_key_exists("style", $maProduct["_product_attributes"]) && is_array($currentProduct["_product_attributes"]) && array_key_exists("connection-type", $currentProduct["_product_attributes"]) && - $currentProduct["_product_attributes"]["connection-type"]["value"] == $lifelineProduct["_product_attributes"]["connection-type"]["value"] + $currentProduct["_product_attributes"]["connection-type"]["value"] == $maProduct["_product_attributes"]["connection-type"]["value"] ) { - $productsWithWearingStyle[] = $lifelineProduct; + $productsWithWearingStyle[] = $maProduct; } - if (is_array($lifelineProduct["_product_attributes"]) && - array_key_exists("connection-type", $lifelineProduct["_product_attributes"]) && + if (is_array($maProduct["_product_attributes"]) && + array_key_exists("connection-type", $maProduct["_product_attributes"]) && is_array($currentProduct["_product_attributes"]) && array_key_exists("style", $currentProduct["_product_attributes"]) && - $currentProduct["_product_attributes"]["style"]["value"] == $lifelineProduct["_product_attributes"]["style"]["value"] - ) { - $productsWithConnectionType[] = $lifelineProduct; - } + $currentProduct["_product_attributes"]["style"]["value"] == $maProduct["_product_attributes"]["style"]["value"] + ) if (strpos($currentProduct["title"], "Home") !== false) { - $currentProductIsHomeSafe = true; + $currentProductIsHome = true; } - if (is_array($lifelineProduct["_product_attributes"]) && - array_key_exists("connection-type", $lifelineProduct["_product_attributes"]) && + if (is_array($maProduct["_product_attributes"]) && + array_key_exists("connection-type", $maProduct["_product_attributes"]) && is_array($currentProduct["_product_attributes"]) && array_key_exists("connection-type", $currentProduct["_product_attributes"]) && - $currentProduct["_product_attributes"]["connection-type"]["value"] == $lifelineProduct["_product_attributes"]["connection-type"]["value"] - ) { - if (is_array($lifelineProduct["_product_attributes"]["style"])) { - if ($lifelineProduct["_product_attributes"]["style"]["value"] === "Wristband") { - $homeSafeStandardVsAutoAlertProducts[] = $lifelineProduct; - } - } else { - $homeSafeStandardVsAutoAlertProducts[] = $lifelineProduct; - } + $currentProduct["_product_attributes"]["connection-type"]["value"] == $maProduct["_product_attributes"]["connection-type"]["value"]) { } } @@ -121,17 +110,11 @@ echo site()->render("single_product", [ "product" => $currentProduct, "add-to-cart-url" => do_shortcode("[add_to_cart_url id='".$currentProduct->ID."']"), "flex-content" => $flexOutput, - "showHomesafeOptions" => strtolower(substr($currentProduct["title"], 0, 4)) === "home", - "homeSafeProducts" => array_reverse($homeSafeProducts), + "showHomeOptions" => strtolower(substr($currentProduct["title"], 0, 4)) === "home", "showOTGOptions" => strtolower($currentProduct["title"]) === "mobile system" || strtolower($currentProduct["title"]) === "mini mobile system", "OTGProducts" => array_reverse($ontheGoProducts), - "hasWearingStyle" => is_array($currentProduct["_product_attributes"]) && array_key_exists("style", $currentProduct["_product_attributes"]), - "productsWithWearingStyle" => $productsWithWearingStyle, - "productsWithConnectionType" => array_reverse($productsWithConnectionType), - "productsWithWearingStyle" => $productsWithWearingStyle, - "autoAlertProducts" => array_reverse($autoAlertProducts), - "currentProductIsHomeSafe" => $currentProductIsHomeSafe, - "homeSafeStandardVsAutoAlertProducts" => array_reverse($homeSafeStandardVsAutoAlertProducts), + "homesystemProducts" => array_reverse($homesystemProducts), + "currentProductIsHome" => $currentProductIsHome, ]); get_footer('shop');