<?php

add_filter('woocommerce_dropdown_variation_attribute_options_args','woo_select_default_option',10,1);

function woo_select_default_option( $args)
{

    if(count($args['options']) > 0) //Ensure product variation isn't empty
        $args['selected'] = $args['options'][0];
    return $args;
}


add_action( 'woocommerce_variable_add_to_cart', 'bbloomer_update_price_with_variation_price' );
  
function bbloomer_update_price_with_variation_price() {
if(is_product()){
global $product;
$price = $product->get_price_html();
wc_enqueue_js( "
  $(document).on('found_variation', 'form.cart', function( event, variation ) {
  if(variation.price_html) $('.fb-prod-content-one p.price').html(variation.price_html);
  $('.woocommerce-variation-price').hide();
  });
  $(document).on('hide_variation', 'form.cart', function( event, variation ) {
  $('.fb-prod-content-one p.price').html('" . $price . "');
  });
" );
}
}

add_filter('woocommerce_available_variation', function($available_variations, \WC_Product_Variable $variable, \WC_Product_Variation $variation) {
    if (empty($available_variations['price_html'])) {
        $available_variations['price_html'] = '<span class="price">' . $variation->get_price_html() . '</span>';
    }
  
    return $available_variations;
}, 10, 3);

?>
<?php

function add_variation_radio_buttons() {
    ?>
    <script type="text/javascript">
    document.addEventListener( 'DOMContentLoaded', function() {
        var variations_form = document.querySelector( 'form.variations_form' );
        var data = variations_form.getAttribute( 'data-product_variations' );
        data = JSON.parse( data );

        var selects = document.querySelectorAll( 'table.variations select' );
        selects.forEach( function( select ) {
            var options = select.querySelectorAll( 'option' );
            options.forEach( function( option ) {
                if( ! option.value ) {
                    return;
                }

                var pricing = '';
                data.forEach( function( row ) {
                    if( row.attributes[select.name] == option.value ) {
                        pricing = row.price_html;
                    }
                } );

                var radio = document.createElement( 'input' );
                radio.type = 'radio';
                radio.name = select.name;
                radio.value = option.value;
                radio.checked = option.selected;
                var label = document.createElement( 'label' );
                label.appendChild( document.createTextNode( ' ' + option.text + ' ' ) );
                var div = document.createElement( 'div' );
                div.classList.add('fb-woo-single-btn-variation');
                div.appendChild( radio );
                div.appendChild( label );

                // Check if variation has stock
                var variationData = data.find(function(row) {
                    return row.attributes[select.name] == option.value;
                });

                // Check if product has only one attribute
                var hasSingleAttribute = Object.keys(variationData.attributes).length === 1;

                if (variationData && !variationData.is_in_stock && hasSingleAttribute) {
                    div.classList.add('disable');
                }

                select.closest( 'td' ).appendChild( div );

                radio.addEventListener( 'click', function( event ) {
                    select.value = radio.value;
                    jQuery( select ).trigger( 'change' );
                } );
            } );

            select.style.display = 'none';
        } );
    } );
    </script>
    <?php
}

add_action( 'woocommerce_variable_add_to_cart', 'add_variation_radio_buttons' );



# SOURCE: https://codedcommerce.com/woo/change-variation-drop-downs-to-radio-buttons/
/*
add_action( 'woocommerce_variable_add_to_cart', function() {
 
    add_action( 'wp_print_footer_scripts', function() {
 
        ?>
        <script type="text/javascript">
 
        // DOM Loaded
        document.addEventListener( 'DOMContentLoaded', function() {
  
            // Get Variation Pricing Data
            var variations_form = document.querySelector( 'form.variations_form' );
            var data = variations_form.getAttribute( 'data-product_variations' );
            data = JSON.parse( data );
 
            // Loop Drop Downs
            document.querySelectorAll( 'table.variations select' )
                .forEach( function( select ) {
 
                // Loop Drop Down Options
                select.querySelectorAll( 'option' )
                    .forEach( function( option ) {
 
                    // Skip Empty
                    if( ! option.value ) {
                        return;
                    }
 
                    // Get Pricing For This Option
                    var pricing = '';
                    data.forEach( function( row ) {
                        if( row.attributes[select.name] == option.value ) {
                            pricing = row.price_html;
                        }
                    } );
 
                    // Create Radio
                    var radio = document.createElement( 'input' );
                        radio.type = 'radio';
                        radio.name = select.name;
                        radio.value = option.value;
                        radio.checked = option.selected;
                    var label = document.createElement( 'label' );
                   
                        label.appendChild( document.createTextNode( ' ' + option.text + ' ' ) );
                    var div = document.createElement( 'div' );
                        div.classList.add('fb-woo-single-btn-variation');
                        div.appendChild( radio );
                        div.appendChild( label );
 
                    // Insert Radio
                    select.closest( 'td' ).appendChild( div );
 
                    // Handle Clicking
                    radio.addEventListener( 'click', function( event ) {
                        select.value = radio.value;
                        jQuery( select ).trigger( 'change' );
                    } );
 
                } ); // End Drop Down Options Loop
 
                // Hide Drop Down
                select.style.display = 'none';
 
            } ); // End Drop Downs Loop
  
        } ); // End Document Loaded
 
        </script>
        <?php
 
    } );
 
} );

*/
?>

چهارشیره (شربت آهن طبیعی)

85,000 تومان

چهارشیره عسلی 360 گرمی، ترکیب طبیعی و مقوی از شیره انگور، انجیر، خرما و توت که به عنوان شربت آهن طبیعی شناخته می‌شود. این محصول خونساز، انرژی‌زا و تقویت‌کننده عمومی بدن است که می‌تواند به صورت محلول در آب یا مخلوط با ارده مصرف شود.

موجود در انبار

موجود در انبار

🍯 چهارشیره عسلی: معجون انرژی و خونسازی!

چهارشیره عسلی ترکیبی منحصر به فرد از شیره انگور، انجیر، خرما و توت است که به عنوان یک منبع طبیعی آهن و انرژی شناخته می‌شود. این محصول سنتی ایرانی، نه تنها طعمی دلنشین دارد بلکه خواص درمانی متعددی نیز ارائه می‌دهد.

🔍 چرا چهارشیره عسلی ما را انتخاب کنید؟

✅ منبع طبیعی آهن – پیشگیری و درمان کم‌خونی
✅ ترکیب چهار شیره مقوی – انرژی‌بخش فوری
✅ تقویت سیستم ایمنی بدن
✅ بدون مواد افزودنی و نگهدارنده
✅ طبیعی و ارگانیک

💎 خواص اصلی:
  • درمان کم‌خونی و فقر آهن

  • انرژی‌بخش و مقوی عمومی بدن

  • تقویت حافظه و تمرکز

  • بهبود سیستم گوارش

  • مناسب برای ورزشکاران

🍽 روش‌های مصرف پیشنهادی:
  1. مستقیماً: روزانه ۱ قاشق غذاخوری (بزرگسالان) یا ۱ قاشق مرباخوری (کودکان)

  2. محلول در آب: ۲-۳ قاشق در یک لیوان آب + گلاب یا عرق بیدمشک

  3. با ارده: مخلوط با ارده به عنوان صبحانه‌ای مقوی

📊 ترکیبات اصلی:
  • شیره انگور (انرژی‌زای قوی)

  • شیره انجیر (مقوی سیستم گوارش)

  • شیره خرما (منبع آهن طبیعی)

  • شیره توت (تقویت‌کننده عمومی)

📦 مشخصات محصول:
  • وزن: ۳۶۰ گرم

  • ترکیبات: شیره انگور، انجیر، خرما، توت

  • نوع بسته‌بندی: ظرف شیشه‌ای یا پلاستیکی بهداشتی

  • مورد مصرف: تقویت عمومی، خونسازی، انرژی‌بخشی

✅ تضمین کیفیت:
  • تولید شده تحت نظارت بهداشتی

  • بدون مواد افزودنی

وزن360 گرم

  1. نیما

    جزء خوشمزه ترین چهار شیره هایی بوده که خوردم و ممنونم ازتون.

دیدگاه خود را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *