• Resolved liranrak

    (@liranrak)


    ???? ??, ?? ????? ?? ?????? ?? ???????, ??? ??? ???? ???? ???? ????? ?????? ????…

    ????, ????? ???? ?? ????? ??? ?????? ??? ?????? ????????? ??????? ????, ??? ?? ????? ????

    ?????,
    ????

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Condless

    (@condless)

    ??? ????,
    ???? ?? ????? ??? ?????? ???? ???? ???? ????? ??? ??????, ???? ???? ????? ?? ?? ???????, ??? ???, ???? ??? ????, ?????? ?????? ??? ?????
    functions.php:

    add_filter( 'woocommerce_states', 'csz_set_woocommerce_states', 20 );
    function csz_set_woocommerce_states( $states ) {
    	$country = 'IL';
    	$cities = array( 'IL3000', 'IL4000', 'IL5000', 'IL9000' );
    	$new_states = array();
    	foreach ( $cities as $city ) {
    		if ( isset( $states[ $country ][ $city ] ) ) {
    			$new_states[ $city ] = $states[ $country ][ $city ];
    		}
    	}
    	$states[ $country ] = $new_states;
    	return $states;
    }

    $cities
    ???? ?? ?????? ?? ????? ??????, ????? ?????? ?? ?? ????? ?????? ????? ??????? ????? ?????:
    /i18n/cities/IL.php

    (example of how to manipluate existing cities list)

    • This reply was modified 4 years, 4 months ago by Condless.
    Thread Starter liranrak

    (@liranrak)

    ???? ?? ?????? ??????
    ??? ?????, ?? ??? ????? ????? ?????? ???? ????? ?????? ?????? ??? ???? ???? ????? ????? ?????? ?? ?????, ?? ???? ???? ??? ????
    ????? ??????? ????? ???????? ?? ????? ?????? ????? ???? ???? ????? ?? ????, ?? ????? ?????? ??? ??? ?? ????? ?? ????….
    ????? ?? ???? ?? ???? ???? ????? ??????? ?? ????? ??????? ???? ?? ???? ???? ????? ??? ??? ????? ???? ??? ??????? ??? ??? ???? ???? ?? ?????? ?????? ???? ???? ????? ????? ????? ?? ????…

    ??? ???? ??????? ????????? ???? ?? ????? ?????? ????? ???? ???? ????? ?? ?????

    Plugin Author Condless

    (@condless)

    ???, ???? ?? ??????.
    ????? ????? ????? ????? ????-
    ?????? ???? ????? ?? ????? ??????? ?????? ????? ?? ????? ???? ?????? ????,
    ????? ????? ???? ?? ?? ????? ?? ???? ????? ?? ????? ????,
    ?? ?????? ????? ???????? ????? ??????? ????? ?? ?????? ?????? ????.

    ?????? ????? ?????? ?????? ?? ????? ???? ???? ???? ????? ???’? ???? ???? ????? ?????? ????.

    Thread Starter liranrak

    (@liranrak)

    ?? ???? ?? ????? ?????

    ??? ??? ?? ??????, ?? ????? ??? ??? ?? ????? ????

    Plugin Author Condless

    (@condless)

    ?? ????? ????, ?????? ??? ????? ??? ?????? ?? ?? ????? ??????? ?????? ?????, ?? ????? ??????? ????? ????? ?? ????? ????? ???? ?????, ???? ???? ???? ??? ?? ????? ???? ????? ???? ????? ??? ????? ???????.

    ?????? ????? ???? ????? ????? ?? ????? ??????? ?????? ?????? ????? ????, ?? ??? ?????? ?? ?????.

    ???

    ??? ???? ?????? ??????? ??? ?? ??? ???? ?????? ??? ??? ??????

    Plugin Author Condless

    (@condless)

    ??? ??? ??? ???,
    ???????????? ?? ????? ?????? ??? ??? ????? ????? ?????? ?”? ???? ?????????? ?? ??? ?????, ?? ?? ???? ????? ?? ????? ?????.
    ??? ????? ?????, ???? ????? ??????? ??? ??? ??? ?? ??????, ?????? ?? ?????? ????? ?? ?? ??????? ???? ???????? ???? ???????, ??????? ?????? ?? ????? ?????? ??? ??????? ?????.
    ????? ??? ?? ????? ?????? ????? ????? ?? ???? ????? ????? ???

    ????

    Plugin Author Condless

    (@condless)

    ?????? ???? ??? ????? ??? ?????? ?? ????? ?????? ??????? ????? ????? ??? ?? ????? ????:

    add_filter( 'woocommerce_states', 'csz_checkout_restrict_woocommerce_states', 60 );
    function csz_checkout_restrict_woocommerce_states( $states ) {
    	if ( is_checkout() ) {
    		$new_states = array();
    		for ( $i = 0; $i < 100; $i++ ) {
    			$zone = WC_Shipping_Zones::get_zone( $i );
    			if ( $zone ) {
    				foreach ( $zone->get_zone_locations() as $zone_location ) {
    					switch ( $zone_location->type ) {
    						case 'country':
    							$new_states[ $zone_location->code ] = $states[ $zone_location->code ];
    							break;
    						case 'state':
    							$country  = substr( $zone_location->code, 0, 2 );
    							$city = substr( $zone_location->code, 3 );
    							$new_states[ $country ][ $city ] = $states[ $country ][ $city ];
    							break;
    					}
    				}
    			}
    		}
    		$states = $new_states;
    	}
    	return $states;
    }

    (example of how to display in the checkout only the cities configured in the Shipping Zones Settings)

    ???? ???? ???!?? ????????

    ?????? ?? ???? ?????? ?? ??? ?????? ?? ?? ????? ??????? ??? ????? ??? ??? ?? ?????? – ?? ????? ???????? ????? ?? ????? ?????? ?? ??’? ????

    ?? ????? ???? ?? ??? ?? ?? ?????-???? ?? ????? ??????? ??? ??? ?? ????? ?? ?????
    ?? ??? ???? ???? ??????? ?? ??????? ?????? ????? ?????

    ???”? ???? ???? ???? ???? ????? ?? ????? ?’????? ??? ?? ????? ????, ?? ???? ?? ??? ????? ????? ?? ????? ????? ?? ????? ?? ???? ?? ?????
    ????

    Plugin Author Condless

    (@condless)

    ???? ???? ???? ???,
    ?? ???? ??? ????? ??? ???? ???? ????,
    ??? ?? ??? ?”????? / ???” ????? ???? => ??????? => ?????? => ???? => ????? ?????, ???? ????? ????? ????? ????? ?????.
    ????? ?????? (?????) ??? ?? ?? ???? ?????? (???? ?????) ????? ?? ????? ?????? ????????.

    ??? ?? ?????? ???? ?? ????? ??????? “????? ?? ????? ?????? ????” ????? ??????? ???? ??? ???? ???? ????.

    ???? ????? ????? ????- ???? ??????? ???? ?? ??? ?????.

    ???? ???,

    ???? ??? ?? ???????, ??? ????? ???? ?????? ???? ??

    ???? ???? ?? ???? ????? ????? ??? ???? ?????? ??????? ?????? ???? ????? ??? ????

    ????? ????? ??? ???? ?????? ???? ???????? ?? ?????? ???????

    ???? ????,
    ??????

    Plugin Author Condless

    (@condless)

    ?????? ????,
    ??????????? ?? ????? (?????? ???? ????? ????? ???? ?? ???????) ???? ????? ????? ???? ???? ?????, ?? ??? ?????? ??? ??? ?? ???? ????? ????? ?????- ????? ???? ?????? ???????? ???????? ???? (???? ????? ?? ????? ?????, ??? “?????” ??? ???? ?????? ???? ???? ?????? ????).

    ???? ???????? ?? ?????? ?????? ???? ?????? ????? ???? ??:
    Conditional Shipping for WooCommerce

    ?? ?? ?? ????? ?????? ??? ????? ????? ??? ????? ?????

    ????,

    ???? ??? ?? ????? ?????!!
    ?????? ?”? ??????? ???? ?? ???????? ?????? ???? ?? ????

    ??? ???? ?????? ????? ???????? ???? ????? ?? ????? ???? ???? ????? ???? ????? ???????
    “?? ????? ?? ?????? ??? ????? ?? ???????? ??????.”

    ???? ???
    “??? ??????? ?????? ??, ???? ???? ????? ?????? ????”

    Plugin Author Condless

    (@condless)

    ???,
    ??? ???? ????? ???? ???? ?? ?? ????? ????? ????? ????? ?? ????? ?????, ?????? ????? ?????? ???? ???? ?? ???? ???? ?????? ?? ?????, ?? ?? ????? ????? ??????? ?????-???? ?????? ????.
    ???? ?????? ???? ?? ?????? ??? ????? ?????? ????? ????????? ?????? ?? ????? ?????

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘???? ????? ?????? ????’ is closed to new replies.