]> _ Git - physioassist-wordpress.git/commitdiff
wait #7304 @8:00
authorsoufiane <soufiane@cubedesigners.com>
Wed, 5 Feb 2025 11:04:10 +0000 (12:04 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 5 Feb 2025 11:04:10 +0000 (12:04 +0100)
wp-content/themes/physioassist/resources/functions.php

index 3f5f0d9ac8f43393ef4e11883f94f776808084db..a406ce29f55060bd49584b162179254fda302ad7 100644 (file)
@@ -128,3 +128,45 @@ function flux_posts()
 
     die();
 }
+
+add_filter('wps_sfw_show_sync_interval', function() {
+   return '';
+});
+
+
+add_filter('wps_sfw_price_html', function(){
+    global $product;
+    global $woocommerce;
+    $symbol = get_woocommerce_currency_symbol();
+    $price = apply_filters('wps_rbpfw_price',$product->get_regular_price());
+    $suffix = $product->get_price_suffix();
+    return "<span class='woocommerce-Price-amount amount'><bdi><span class='woocommerce-Price-currencySymbol'>$symbol</span>$price</bdi></span><small class='woocommerce-price-suffix'>$suffix</small>";
+});
+
+add_filter('wps_rbpfw_price', function($price){
+    return $price;
+});
+
+add_filter('wps_sfw_show_one_time_subscription_price', function($price) {
+    return $price;
+});
+
+add_action('woocommerce_after_add_to_cart_quantity', function() {
+    global $product;
+    $product_id = $product->get_id();
+    $wps_price_html = "<div class='recurrent'>";
+    $wps_price_html .= "<p>Frequency</p>";
+    $wps_price_html  .= '<div class="wps_sfw_subscription_wrapper">';
+    $wps_price_html .= '<div class ="wps_wsp_onetimesimple_wrapper">';
+    $wps_price_html .= '<label for="wps_sfw_check_simple_cart_one_time_purchase"><input name="wps_type_selection" type="radio" class="wps_sfw_check_simple_cart_one_time_purchase" data-pro_type="one_time" value="one_time" id="wps_sfw_check_simple_cart_one_time_purchase" data-id="' . $product_id . '" checked>';
+    // translators: one time price.
+    $wps_price_html .= sprintf( esc_html__( 'One Time', 'woocommerce-subscriptions-pro' ), wc_price( $wps_wsp_onetime_price ) ) . ' ';
+    $wps_price_html .= '</label></div>';
+    $wps_price_html .= '<div class ="wps_sfw_subscription_inner_wrapper">';
+    // translators: placeholder is price_discount_percentage.
+    $wps_price_html .= '<label class="wps_sfw_subscription_label" for="wps_sfw_check_simple_cart_subscription_purchase"><input name="wps_type_selection" type="radio" class="wps_sfw_check_simple_cart_subscription_purchase" value="subscribe" id ="wps_sfw_check_simple_cart_subscription_purchase" data-pro_type="subscription" data-id="' . $product_id . '">' . sprintf( esc_html__( 'Monthly', 'woocommerce-subscriptions-pro' ) ) . '</label></div>';
+    $wps_price_html .= '</div>';
+
+    $wps_price_html .= "</div>";
+    echo $wps_price_html;
+});