ווקומרס

add_action( 'woocommerce_before_cart', 'calculator_free_shipping_cart_notice' );
  
function calculator_free_shipping_cart_notice() {
  
   $min_amount = 350; //change this to your free shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {
      $added_text = ' עוד ' . wc_price( $min_amount - $current ) . ' ויש לכם שליח עד הבית בחינם!';
      $return_to = wc_get_page_permalink( 'home' );
      $notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'הוסיפו פריטים לסל למשלוח חינם', $added_text );
      wc_print_notice( $notice, 'notice' );
   }
  
}

add_action( 'woocommerce_before_checkout_form', 'free_shipping_cart_notice' );
  
function free_shipping_cart_notice() {
  
   $min_amount = 350; //change this to your free shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {
      $added_text = ' עוד ' . wc_price( $min_amount - $current ) . ' ויש לכם שליח עד הבית בחינם!';
      $return_to = wc_get_page_permalink( 'home' );
      $notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'הוסיפו פריטים לסל למשלוח חינם', $added_text );
      wc_print_notice( $notice, 'notice' );
   }
  
}
function cw_custom_checkbox_fields( $checkout ) {
        echo '<div class="cw_custom_class"><h3>'.__('אישור דיוור: ').'</h3>';
        woocommerce_form_field( 'custom_checkbox', array(
            'type'          => 'checkbox',
            'label'         => __('אני מאשר\ת את הדיוור.'),
            'required'  => false,
        ), $checkout->get_value( 'custom_checkbox' ));
        echo '</div>';
    }
/**
 * Hide shipping rates when free shipping is available.
 *
 * @param array $rates Array of rates found for the package.
 * @return array
 */
function my_hide_shipping_when_free_is_available( $rates ) {
	$free = array();
	foreach ( $rates as $rate_id => $rate ) {
		if ( 'free_shipping' === $rate->method_id ) {
			$free[ $rate_id ] = $rate;
			break;
		}
	}
	return ! empty( $free ) ? $free : $rates;
}
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );
add_action( 'woocommerce_after_checkout_form', 'bbloomer_disable_shipping_local_pickup' );
  
function bbloomer_disable_shipping_local_pickup( $available_gateways ) {
    
   // Part 1: Hide shipping based on the static choice @ Cart
   // Note: "#customer_details .col-2" strictly depends on your theme
 
   $chosen_methods = WC()->session->get( 'chosen_shipping_methods' );
   $chosen_shipping = $chosen_methods[0];
   if ( 0 === strpos( $chosen_shipping, 'local_pickup' ) ) {
   ?>
      <script type="text/javascript">
         jQuery('#customer_details .col-2').fadeOut();
      </script>
   <?php  
   } 
 
   // Part 2: Hide shipping based on the dynamic choice @ Checkout
   // Note: "#customer_details .col-2" strictly depends on your theme
 
   ?>
      <script type="text/javascript">
         jQuery('form.checkout').on('change','input[name^="shipping_method"]',function() {
            var val = jQuery( this ).val();
            if (val.match("^local_pickup")) {
                     jQuery('#customer_details .col-2').fadeOut();
               } else {
               jQuery('#customer_details .col-2').fadeIn();
            }
         });
      </script>
   <?php
  
}
function cw_custom_checkbox_fields( $checkout ) {
        echo '<div class="cw_custom_class"><h3>'.__('אישור דיוור: ').'</h3>';
        woocommerce_form_field( 'custom_checkbox', array(
            'type'          => 'checkbox',
            'label'         => __('אני מאשר\ת את הדיוור.'),
            'required'  => false,
        ), $checkout->get_value( 'custom_checkbox' ));
        echo '</div>';
    }
// Edit WooCommerce dropdown menu item of shop page//
// Options: menu_order, popularity, rating, date, price, price-desc
 
function my_woocommerce_catalog_orderby( $orderby ) {
    unset($orderby["rating"]);
    unset($orderby["date"]);
    return $orderby;
}
add_filter( "woocommerce_catalog_orderby", "my_woocommerce_catalog_orderby", 20 );
add_filter( 'woocommerce_get_availability', 'wcs_custom_get_availability', 1, 2);
function wcs_custom_get_availability( $availability, $_product ) {
  
    // Change Out of Stock Text
    if ( ! $_product->is_in_stock() ) {
        $availability['availability'] = __('Sold Out', 'woocommerce');
    }
    return $availability;
}
add_action( 'woocommerce_after_cart', 'seger_notice_cart_hodula' );
 
function seger_notice_cart_hodula() {
echo '
<style>
p.notice-seger-cart{
	background-color:#f1f1f1!important;
	font-size:16px;
	border:1px solid #eee;
	display: block;
    padding: 20px;
	color:black;
	box-shadow:2px 2px 2px grey;
	margin-top:20px;
}
</style>
<p class="notice-seger-cart"><b style="font-size:18px;">שימי לב 💗</b><br>
בעקבות הסגר החלטנו לספסד את מחיר שירות המשלוחים עד הבית ל<u>20 ₪ בלבד.</u>
</p>';
}
/*
* Changing the maximum quantity to 1 for all the WooCommerce products
*/

function woocommerce_quantity_input_max_callback( $max, $product ) {
	$max = 1;  
	return $max;
}
add_filter( 'woocommerce_quantity_input_max', 'woocommerce_quantity_input_max_callback', 10, 2 );
?>
// Get WooCommerce product name by ID via shortcode: [iw_product_name id='']
function iw_product_name_shortcode( $atts ) {
    $atts = shortcode_atts( array(
        'id' => null,
    ), $atts, 'bartag' );

    $html = '';

    if( intval( $atts['id'] ) > 0 && function_exists( 'wc_get_product' ) ){
		$_product = wc_get_product( $atts['id'] );
		$html = $_product->get_title();
    }
    return $html;
}
add_shortcode( 'iw_product_name', 'iw_product_name_shortcode' );
/**
* WhatsApp button in product archive
*/
add_action('woocommerce_after_shop_loop_item', 'add_a_custom_button', 5 );
function add_a_custom_button() {
    global $product;

    // Not for variable and grouped products that doesn't have an "add to cart" button
    if( $product->is_type('variable') || $product->is_type('grouped') ) return;

    // Output the custom button linked to the product
    echo '<div style="margin-bottom:10px;">
        <a class="button custom-button" target="blank" href="https://api.whatsapp.com/send?phone=22222222&text=' . esc_attr( $product->get_title() ) . '">' . _('שלח ווטסאפ') . '</a>
    </div>';
}
add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields' );
function customise_postcode_fields( $address_fields ) {
    $address_fields['postcode']['required'] = false;

    return $address_fields;
}
/**
 * Woocommerce redirect to checkout after add to cart
 */
add_filter( 'woocommerce_add_to_cart_redirect', 'barbareshet_skip_cart_redirect_checkout' );

function barbareshet_skip_cart_redirect_checkout( $url ) {
	return wc_get_checkout_url();
}
add_action( 'woocommerce_before_cart', 'bbloomer_free_shipping_cart_notice' );
  
function bbloomer_free_shipping_cart_notice() {
  
   $min_amount = 350; //change this to your free shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {
$added_text = ' בכדי לקבל משלוח חינם עליך לרכוש בסכום מעל 350 ש"ח הוסף מוצרים בסך ' . wc_price( $min_amount - $current ) . ' נוספים!';      $return_to = wc_get_page_permalink( 'shop' );
      $notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'המשך בקניות', $added_text );
      wc_print_notice( $notice, 'notice' );
   }
}
add_action( 'woocommerce_before_cart', 'computec_shipping_cart_notice' );
  
function computec_shipping_cart_notice() {
  
   $min_amount = 150; //change this to your shipping threshold
   
   $current = WC()->cart->subtotal;
  
   if ( $current < $min_amount ) {

	$added_text = ' אנו מבצעים משלוחים מסכום של 150 ש"ח ומעלה הוסף מוצרים בסך ' . wc_price( $min_amount - $current ) . ' נוספים!';       
	$return_to = wc_get_page_permalink( 'shop' );
	$notice = sprintf( '<a href="%s" class="button wc-forward">%s</a> %s', esc_url( $return_to ), 'המשך בקניות', $added_text );
	wc_print_notice( $notice, 'notice' );
   }
}
// Set a minimum dollar amount per order
add_action( 'woocommerce_check_cart_items', 'spyr_set_min_total' );
function spyr_set_min_total() {
	// Only run in the Cart or Checkout pages
	if( is_cart() || is_checkout() ) {
		global $woocommerce;

		// Set minimum cart total
		$minimum_cart_total = 500;

		// Total we are going to be using for the Math
		// This is before taxes and shipping charges
		$total = WC()->cart->subtotal;
		
		// Compare values and add an error is Cart's total
	    // happens to be less than the minimum required before checking out.
		// Will display a message along the lines of
		// A Minimum of 10 USD is required before checking out. (Cont. below)
		if( $total <= $minimum_cart_total  ) {
			// Display our error message
			wc_add_notice( sprintf( '<strong>A Minimum of %s %s is required before checking out.</strong>'
				.'<br />Current cart\'s total: %s %s',
				$minimum_cart_total,
				get_option( 'woocommerce_currency'),
				$total,
				get_option( 'woocommerce_currency') ),
			'error' );
		}
	}
}
// Move Coupon Code To Order Review
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_coupon_form', 5 );
// Move Coupon Code To Order Review
remove_action( 'woocommerce_before_checkout_form', 'woocommerce_checkout_coupon_form', 10 );
add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_coupon_form', 5 );
@import url('https://fonts.googleapis.com/css2?family=Assistant&display=swap');

#template_header h1, #template_header .subtitle, #body_content_inner, .td, .text, #template_body h2, #template_body h2 a, #template_body h3, #template_footer a.ft-social-link, #template_footer #credit {
font-family: 'Assistant', sans-serif!important;
}
* Sorting out of stock WooCommerce products – Order product collections by stock status, in-stock products first.
*/
class iWC_Orderby_Stock_Status
{
public function __construct()
{
// Check if WooCommerce is active
if (in_array(‘woocommerce/woocommerce.php’, apply_filters(‘active_plugins’, get_option(‘active_plugins’)))) {
add_filter(‘posts_clauses’, array($this, ‘order_by_stock_status’), 2000);
}
}
public function order_by_stock_status($posts_clauses)
{
global $wpdb;
// only change query on WooCommerce loops
if (is_woocommerce() && (is_shop() || is_product_category() || is_product_tag())) {
$posts_clauses[‘join’] .= ” INNER JOIN $wpdb->postmeta istockstatus ON ($wpdb->posts.ID = istockstatus.post_id) “;
$posts_clauses[‘orderby’] = ” istockstatus.meta_value ASC, ” . $posts_clauses[‘orderby’];
$posts_clauses[‘where’] = ” AND istockstatus.meta_key = ‘_stock_status’ AND istockstatus.meta_value <> ” ” . $posts_clauses[‘where’];
}
return $posts_clauses;
}
}
new iWC_Orderby_Stock_Status;
/**
* END – Order product collections by stock status, instock products first.
*/
/* Create Buy Now Button dynamically after Add To Cart button
    function add_content_after_addtocart() {
    
        // get the current post/product ID
        $current_product_id = get_the_ID();
    
        // get the product based on the ID
        $product = wc_get_product( $current_product_id );
    
        // get the "Checkout Page" URL
        $checkout_url = WC()->cart->get_checkout_url();
    
        // run only on simple products
        if( $product->is_type( 'simple' ) ){
            echo '<a href="'.$checkout_url.'?add-to-cart='.$current_product_id.'" class="buy-now button" style="background-color: #000000 !important; margin-right: 10px;">קנה עכשיו</a>';
            //echo '<a href="'.$checkout_url.'" class="buy-now button">קנה עכשיו</a>';
        }
    }
    add_action( 'woocommerce_after_add_to_cart_button', 'add_content_after_addtocart' );
 * @snippet       Hide ALL shipping rates in ALL zones when Free Shipping is available
 * @how-to        Get CustomizeWoo.com FREE
 * @sourcecode    https://businessbloomer.com/?p=260
 * @author        Rodolfo Melogli
 * @compatible    WooCommerce 3.6.3
 * @donate $9     https://businessbloomer.com/bloomer-armada/
 */
  
add_filter( 'woocommerce_package_rates', 'bbloomer_unset_shipping_when_free_is_available_all_zones', 10, 2 );
   
function bbloomer_unset_shipping_when_free_is_available_all_zones( $rates, $package ) {
      
$all_free_rates = array();
     
foreach ( $rates as $rate_id => $rate ) {
      if ( 'free_shipping' === $rate->method_id ) {
         $all_free_rates[ $rate_id ] = $rate;
         break;
      }
}
     
if ( empty( $all_free_rates )) {
        return $rates;
} else {
        return $all_free_rates;
} 
 
}
/** * Change a currency symbol */
add_filter('woocommerce_currency_symbol', 'change_existing_currency_symbol', 10, 2); 
function change_existing_currency_symbol( $currency_symbol, $currency ) { switch( $currency ) { case 'ILS': $currency_symbol = 'ILS'; break; } return $currency_symbol;}
// Set WooCommerce Virtual Order Status to Complete After Payment
add_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 2 );
function virtual_order_payment_complete_order_status( $order_status, $order_id ) {
  $order = new WC_Order( $order_id );
  if ( 'processing' == $order_status &&
       ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) {
    $virtual_order = null;
    if ( count( $order->get_items() ) > 0 ) {
      foreach( $order->get_items() as $item ) {
        if ( 'line_item' == $item['type'] ) {
          $_product = $order->get_product_from_item( $item );
          if ( ! $_product->is_virtual() ) {
            // once we've found one non-virtual product we know we're done, break out of the loop
            $virtual_order = false;
            break;
          } else {
            $virtual_order = true;
          }
        }
      }
    }
    // virtual order, mark as completed
    if ( $virtual_order ) {
      return 'completed';
    }
  }
  // non-virtual order, return original status
  return $order_status;
}
add_filter( 'woocommerce_sale_flash', 'navarro_change_badge_to_percentage', 10, 3 );


function navarro_change_badge_to_percentage( $html, $post, $product ) {

	$price = intval( ( $product instanceof WC_Product_Variable ) ? $product->get_variation_regular_price() : $product->get_regular_price() );
	
	$sale = intval( ( $product instanceof WC_Product_Variable ) ? $product->get_variation_sale_price() : $product->get_sale_price() );

	$percent = floor( 100 - ( $sale * 100 / $price ) );

	return sprintf( '<div class="onsale-wrapper"><span class="onsale">%s%% %s</span></div>', $percent, __( 'הנחה', 'woocommerce' ) );

}
dd_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' );
/* * custom_woocommerce_template_loop_add_to_cart**/
function custom_woocommerce_product_add_to_cart_text() {	
global $product;		
  $product_type = $product->get_type();		switch ( $product_type ) {		case 'external':			return _( 'Buy product', 'woocommerce' );		break;		case 'grouped':			return _( 'View products', 'woocommerce' );		break;		case 'simple':			return _( 'Add to cart', 'woocommerce' );		break;		case 'variable':			return _( 'Select options', 'woocommerce' );		break;		default:			return __( 'Read more', 'woocommerce' );	}	}
function search_by_sku( $search, &$query_vars ) {
    global $wpdb;
    if(isset($query_vars->query['s']) && !empty($query_vars->query['s'])){
        $args = array(
            'posts_per_page'  => -1,
            'post_type'       => 'product',
            'meta_query' => array(
                array(
                    'key' => '_sku',
                    'value' => $query_vars->query['s'],
                    'compare' => 'LIKE'
                )
            )
        );
        $posts = get_posts($args);
        if(empty($posts)) return $search;
        $get_post_ids = array();
        foreach($posts as $post){
            $get_post_ids[] = $post->ID;
        }
        if(sizeof( $get_post_ids ) > 0 ) {
                $search = str_replace( 'AND (((', "AND ((({$wpdb->posts}.ID IN (" . implode( ',', $get_post_ids ) . ")) OR (", $search);
        }
    }
    return $search;
    
}
    add_filter( 'posts_search', 'search_by_sku', 999, 2 );
   var image_to_show = '';
    var variations = JSON.parse($(".variations_form").attr("data-product_variations"));
    if(variations) {
        var first_attr = Object.keys(variations[0].attributes)[0];
        // when swatch button is clicked
        $("ul[data-attribute_name='"+first_attr+"'] li").click(function() {
            var choice = $(this).attr("data-value");
            var found = false;
            // loop variations JSON
            for(const i in variations) {
                if(found) continue;
                if(variations.hasOwnProperty(i)) {
                    // if first attribute has the same value as has been selected
                    if (choice === variations[i].attributes[Object.keys(variations[0].attributes)[0]]) {
                        // change featured image
                        image_to_show = variations[i].image_src;
                        found = true;
                    }
                }
            }
        });

        // after woo additional images has changed the image, change it again
        jQuery(".variations_form").on("wc_additional_variation_images_frontend_image_swap_done_callback", function() {
            if(image_to_show.length) {
                $(".attachment-shop_single").attr("src", image_to_show).removeAttr("srcset");
            }
        });

    }
add_action( 'woocommerce_cart_calculate_fees', 'elex_discount_price' ); 

function elex_discount_price() 

{ 

global $woocommerce; //Set the price for user role. 

$discount_price = 5; 

$set_role = array('administrator','vendor'); //Get the login user role 

$user = wp_get_current_user(); 

$user_role = $user->roles; //Check the specifc user role for discount. 

if( in_array( $user_role[0] , $set_role ) )

{ 

$woocommerce->cart->add_fee( 'Discounted Price', -$discount_price, true, 'standard' ); 

} 

}
function sv_discount_price_percentage($cart) {

    global $woocommerce; //Set the price for user role.

    $discount_percentage = 0.1;
	//כל 0.1 שווה ל10 אחוז


    $set_role = array('administrator', 'vendor'); //Get the login user role
    $user = wp_get_current_user();


    $percentage_fee = ($cart->cart_contents_total + $cart->shipping_total) * $discount_percentage;

    $user_role = $user->roles; //Check the specifc user role for discount.
    if (in_array($user_role[0], $set_role)) {

        $cart->add_fee('הנחה באחוזים', -$percentage_fee, true);
    }
}

add_action('woocommerce_cart_calculate_fees', 'sv_discount_price_percentage');
add_filter( 'woocommerce_checkout_fields' , 'virtual_products_less_fields' );

function virtual_products_less_fields( $fields ) {

    $virtual_products = true;

    foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {

        if ( ! $cart_item['data']->is_virtual() ) $virtual_products = false;
    }

    if( $virtual_products===true) {
        unset($fields['billing']['billing_company']);
        unset($fields['billing']['billing_address_1']);
        unset($fields['billing']['billing_address_2']);
        unset($fields['billing']['billing_city']);
        unset($fields['billing']['billing_postcode']);
        unset($fields['billing']['billing_country']);
        unset($fields['billing']['billing_state']);
        unset($fields['billing']['billing_phone']);

        add_filter( 'woocommerce_enable_order_notes_field', '__return_false',9999 );
    }

    return $fields;

}
/**
 * Remove product data tabs
 */
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

function woo_remove_product_tabs( $tabs ) {

    unset( $tabs['description'] );      	// Remove the description tab
    unset( $tabs['reviews'] ); 			// Remove the reviews tab
    unset( $tabs['about'] );  	// Remove the additional information tab
	unset( $tabs['additional_information'] );
	unset( $tabs['wcfm_product_store_tab'] );
	unset( $tabs['wcfm_enquiry_tab'] );

    return $tabs;
}
/**
 Display "Sold Out" on Loop Pages - WooCommerce
 */
 
add_action( 'woocommerce_before_shop_loop_item_title', 'bbloomer_display_sold_out_loop_woocommerce' );
 
function bbloomer_display_sold_out_loop_woocommerce() {
    global $product;
 
    if ( !$product->is_in_stock() ) {
        echo '<span class="soldout">' . __( 'אזל מהמלאי', 'woocommerce' ) . '</span>';
    }
} 
/** unrequiered checkout fields**/
add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields' );
function customise_postcode_fields( $address_fields ) {
    $address_fields['postcode']['required'] = false;
    return $address_fields;
} 

add_filter( 'woocommerce_checkout_fields' , 'misha_not_required_fields', 9999 );
 
function misha_not_required_fields( $f ) {
 
	unset( $f['billing']['billing_postcode']['required'] );
	unset( $f['shipping']['shipping_postcode']['required'] );
 
	// the same way you can make any field required, example:
	// $f['billing']['billing_company']['required'] = true;
 
	return $f;
}
/**
*  Out of stock message for product variations.
* @param string $text default message.
* @return string
*/
function puri_out_of_stock_message( $text ){
 $text = 'המוצר אזל מהמלאי, לכניסה לרשימת המתנה, אנא צרו קשר!';
 return $text;
}
add_filter( 'woocommerce_out_of_stock_message', 'puri_out_of_stock_message', 999);
add_action( 'wp_head', function () { ?>
<style>

	.woocommerce-message, .woocommerce-info {
    border-top-color: var( --e-global-color-secondary );
}

.woocommerce-message::before, .woocommerce-info::before {
    color: var( --e-global-color-secondary );
}

</style>
<?php } );
function add_post_tag_columns( $columns ) {
    $columns['id'] = 'Id';
    return $columns;
}
add_filter( 'manage_edit-product_cat_columns', 'add_post_tag_columns' );

function add_post_tag_column_content( $content, $column, $id ) {
    if ( 'id' === $column ) {
        $content = $id;
    }

    return $content;
}
add_filter( 'manage_product_cat_custom_column', 'add_post_tag_column_content', 10, 3 );
/**

 Display "Sold Out" on Loop Pages - WooCommerce

 */

 

add_action( 'woocommerce_before_shop_loop_item_title', 'bbloomer_display_sold_out_loop_woocommerce' );

 

function bbloomer_display_sold_out_loop_woocommerce() {

    global $product;

 

    if ( !$product->is_in_stock() ) {

        echo '<span class="soldout">' . __( 'אזל מהמלאי', 'woocommerce' ) . '</span>';

    }

} 

​

/**

* Change "Out of stock" to "Sold Out"

* @param string $text

* @param WC_Product $product

* @return string

*/

function puri_woocommerce_get_availability_text( $text, $product ) {

    if (!$product->is_in_stock()) {

        $text = 'המוצר אזל מהמלאי, לכניסה לרשימת המתנה, אנא צרו קשר!';

    } else {

    // You can add more conditions here. e.g if product is available.

    // $text = 'Available right now';

    }

    return $text;

}

​

add_filter( 'woocommerce_get_availability_text', 'puri_woocommerce_get_availability_text', 999, 2);

​

/**

*  Out of stock message for product variations.

* @param string $text default message.

* @return string

*/

function puri_out_of_stock_message( $text ){

 $text = 'המוצר אזל מהמלאי, לכניסה לרשימת המתנה, אנא צרו קשר!';

 return $text;

}

add_filter( 'woocommerce_out_of_stock_message', 'puri_out_of_stock_message', 999);
/**

 * @snippet       Display supplier @ WooCommerce Single Product Page

 * @how-to        Get CustomizeWoo.com FREE

 * @author        Rodolfo Melogli

 * @compatible    WC 4.
6
 * @donate $     https://businessbloomer.com/bloomer-armada/

 */

  
9
// -----------------------------------------

// 1. Add supplier field input @ product edit page

  

add_action( 'woocommerce_product_options_pricing', 'bbloomer_add_supplier_to_products' );      

  

function bbloomer_add_supplier_to_products() {          

    woocommerce_wp_text_input( array( 

        'id' => 'supplier', 

        'class' => 'short wc_input_price', 

        'label' => __( 'מחיר ספק', 'woocommerce' ) . ' (' . get_woocommerce_currency_symbol() . ')',

        'data_type' => 'price', 

    ));      

}

  

// -----------------------------------------

// 2. Save supplier field via custom field

  

add_action( 'save_post_product', 'bbloomer_save_supplier' );

  

function bbloomer_save_supplier( $product_id ) {

    global $pagenow, $typenow;

    if ( 'post.php' !== $pagenow || 'product' !== $typenow ) return;

    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;

    if ( isset( $_POST['supplier'] ) ) {

        update_post_meta( $product_id, 'supplier', $_POST['supplier'] );

    }

}
add_filter('woocommerce_get_availability_text', 'Computec_change_soldout', 10, 2 );

/**
* Change Sold Out Text to Something Else
*/
function Computec_change_soldout ( $text, $product) {
if ( !$product->is_in_stock() ) {
$text = 'אזל מהמלאי';
}
return $text;
}

Similiar Collections

Python strftime reference pandas.Period.strftime python - Formatting Quarter time in pandas columns - Stack Overflow python - Pandas: Change day - Stack Overflow python - Check if multiple columns exist in a df - Stack Overflow Pandas DataFrame apply() - sending arguments examples python - How to filter a dataframe of dates by a particular month/day? - Stack Overflow python - replace a value in the entire pandas data frame - Stack Overflow python - Replacing blank values (white space) with NaN in pandas - Stack Overflow python - get list from pandas dataframe column - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to drop rows of Pandas DataFrame whose value in a certain column is NaN - Stack Overflow python - How to lowercase a pandas dataframe string column if it has missing values? - Stack Overflow How to Convert Integers to Strings in Pandas DataFrame - Data to Fish How to Convert Integers to Strings in Pandas DataFrame - Data to Fish create a dictionary of two pandas Dataframe columns? - Stack Overflow python - ValueError: No axis named node2 for object type <class 'pandas.core.frame.DataFrame'> - Stack Overflow Python Pandas iterate over rows and access column names - Stack Overflow python - Creating dataframe from a dictionary where entries have different lengths - Stack Overflow python - Deleting DataFrame row in Pandas based on column value - Stack Overflow python - How to check if a column exists in Pandas - Stack Overflow python - Import pandas dataframe column as string not int - Stack Overflow python - What is the most efficient way to create a dictionary of two pandas Dataframe columns? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow python - How do I get the row count of a Pandas DataFrame? - Stack Overflow python - How to save a new sheet in an existing excel file, using Pandas? - Stack Overflow Python Loop through Excel sheets, place into one df - Stack Overflow How do I select a subset of a DataFrame? — pandas 1.2.4 documentation python - Delete column from pandas DataFrame - Stack Overflow python - Convert list of dictionaries to a pandas DataFrame - Stack Overflow How to Add or Insert Row to Pandas DataFrame? - Python Examples python - Check if a value exists in pandas dataframe index - Stack Overflow python - Set value for particular cell in pandas DataFrame using index - Stack Overflow python - Pandas Dataframe How to cut off float decimal points without rounding? - Stack Overflow python - Pandas: Change day - Stack Overflow python - Clean way to convert quarterly periods to datetime in pandas - Stack Overflow Pandas - Number of Months Between Two Dates - Stack Overflow python - MonthEnd object result in <11 * MonthEnds> instead of number - Stack Overflow python - Extracting the first day of month of a datetime type column in pandas - Stack Overflow
כמה עוד נשאר למשלוח חינם גם לעגלה ולצקאאוט הוספת צ'קבוקס לאישור דיוור בצ'קאאוט הסתרת אפשרויות משלוח אחרות כאשר משלוח חינם זמין דילוג על מילוי כתובת במקרה שנבחרה אפשרות איסוף עצמי הוספת צ'קבוקס לאישור דיוור בצ'קאאוט שינוי האפשרויות בתפריט ה-סידור לפי בווקומרס שינוי הטקסט "אזל מהמלאי" הערה אישית לסוף עמוד העגלה הגבלת רכישה לכל המוצרים למקסימום 1 מכל מוצר קבלת שם המוצר לפי ה-ID בעזרת שורטקוד הוספת כפתור וואטסאפ לקנייה בלופ ארכיון מוצרים הפיכה של מיקוד בצ'קאאוט ללא חובה מעבר ישיר לצ'קאאוט בלחיתה על הוספה לסל (דילוג עגלה) התראה לקבלת משלוח חינם בדף עגלת הקניות גרסה 1 התראה לקבלת משלוח חינם בדף עגלת הקניות גרסה 2 קביעה של מחיר הזמנה מינימלי (מוצג בעגלה ובצ'קאאוט) העברת קוד הקופון ל-ORDER REVIEW העברת קוד הקופון ל-ORDER REVIEW Kadence WooCommerce Email Designer קביעת פונט אסיסנט לכל המייל בתוסף מוצרים שאזלו מהמלאי - יופיעו מסומנים באתר, אבל בתחתית הארכיון הוספת כפתור "קנה עכשיו" למוצרים הסתרת אפשרויות משלוח אחרות כאשר משלוח חינם זמין שיטה 2 שינוי סימן מטבע ש"ח ל-ILS להפוך סטטוס הזמנה מ"השהייה" ל"הושלם" באופן אוטומטי תצוגת הנחה באחוזים שינוי טקסט "בחר אפשרויות" במוצרים עם וריאציות חיפוש מוצר לפי מק"ט שינוי תמונת מוצר לפי וריאציה אחרי בחירה של וריאציה אחת במקרה של וריאציות מרובות הנחה קבועה לפי תפקיד בתעריף קבוע הנחה קבועה לפי תפקיד באחוזים הסרה של שדות משלוח לקבצים וירטואליים הסתרת טאבים מעמוד מוצר הצגת תגית "אזל מהמלאי" בלופ המוצרים להפוך שדות ל-לא חובה בצ'קאאוט שינוי טקסט "אזל מהמלאי" לוריאציות שינוי צבע ההודעות המובנות של ווקומרס הצגת ה-ID של קטגוריות המוצרים בעמוד הקטגוריות אזל מהמלאי- שינוי ההודעה, תגית בלופ, הודעה בדף המוצר והוספת אזל מהמלאי על וריאציה הוספת שדה מחיר ספק לדף העריכה שינוי טקסט אזל מהמלאי