$product_cats = get_the_terms( $product->get_id(), 'product_cat' );
if ($product_cats[3]->slug == 'obuv') {
$size = array( 40, 40, 'opacity' => 50, 'bfi_thumb' => true );
} else {
$size = array( 70, 55, 'opacity' => 50, 'bfi_thumb' => true );
}
wp_get_attachment_image_src( $attachment_id, $size );
$product_cats = get_the_terms( $product->get_id(), 'product_cat' );
if ($product_cats[3]->slug == 'obuv') {
$crop = true;
} else {
$crop = false;
}
return add_image_size( 'own_thumbnail', 70, 55, $crop );
не верится, приведите то самое место.
$arr = [];
$countries = [
"AU" => "Австралия",
"AT" => "Австрия",
"AZ" => "Азербайджан",
"AX" => "Аландские острова",
"AL" => "Албания",
"DZ" => "Алжир",
"VI" => "Виргинские Острова (США)",
"AS" => "Американское Самоа",
"BA" => "Босния и Герцеговина",
"BF" => "Буркина-Фасо",
"GY" => "Гайана",
"GM" => "Гамбия",
"GH" => "Гана",
"GI" => "Гибралтар",
"HN" => "Гондурас",
"HK" => "Гонконг",
"GD" => "Гренада",
"DO" => "Доминиканская Республика",
"SS" => "Южный Судан",
"JM" => "Ямайка",
"JP" => "Япония"
];
Далее создал цикл:
foreach ($countries as $country_key => $country){
$arr[ $country_key ] = $country;
}
add_filter( 'woocommerce_default_address_fields', 'awoohc_override_default_address_fields' );
function awoohc_override_default_address_fields( $address_fields ) {
$address_fields['number_post_office'] = array(
'label' => 'Номер отделения',
'placeholder' => '',
'required' => true,
'class' => array( 'form-row-last' ),
'clear' => true,
'priority' => 75,
);
return $address_fields;
}
add_action( 'woocommerce_checkout_update_order_meta', 'awoohc_checkout_field_update_order_meta' );
function awoohc_checkout_field_update_order_meta( $order_id ) {
if ( ! empty( $_POST['billing_number_post_office'] ) ) {
update_post_meta( $order_id, 'billing_number_post_office', sanitize_text_field( $_POST['billing_number_post_office'] ) );
}
}