ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÞÇÆãÉ ÇáãÏä Cities drop down
3 Level WooCommerce States & Cities drop down - Plugin Development in WordPress
How to add custom country in WooCommerce - How to add city and districts in WooCommerce
Replace the city text field by a dropdown of cities for a specific country in Woocommerce
Add dropdown list of cities in Woocommerce checkout page
Aramex: ERR52 - Destination Address - City name is invalid (s)
ÇáÑæÇÈØ
https://github.com/YTTechiePress/sta...ocoommerce.php
https://github.com/woocommerce/wooco.../countries.php
https://github.com/woocommerce/wooco...18n/states.php
In some specific cases, you might need to change the WooCommerce default country, state or region to better suit your needs. For example, if you are creating a city-specific service that delivers the orders only inside the city boundaries.
Woocommerce comes with the predefined country list as well as the states and regions. However, this list is not so accurate as you might need to limit the shipping zone to the city districts or municipalities.
The code need to be added in your theme's function.php file. There is no problems with this answer code as it's fully tested and works. You can also use the
Code Snippets plugin that woocommerce recommend. Using the theme editor is not recommended. You should use an external editor linked to your FTP software.
ßæÏ:
// Copy from here
/**
* Change the checkout city field to a dropdown field.
*/
function jeroen_sormani_change_city_to_dropdown( $fields ) {
$city_args = wp_parse_args( array(
'type' => 'select',
'options' => array(
'alexandria' => 'Alexandria',
'Awaied-Ras Souda' => 'Awaied-Ras Souda',
'Borg Al Arab City' => 'Borg Al Arab City',
'Sedi Kreir' => 'Sedi Kreir',
'Atfeah' => 'Atfeah',
'Badrashin' => 'Badrashin',
),
'input_class' => array(
'wc-enhanced-select',
)
), $fields['shipping']['shipping_city'] );
$fields['shipping']['shipping_city'] = $city_args;
$fields['billing']['billing_city'] = $city_args; // Also change for billing field
wc_enqueue_js( "
jQuery( ':input.wc-enhanced-select' ).filter( ':not(.enhanced)' ).each( function() {
var select2_args = { minimumResultsForSearch: 5 };
jQuery( this ).select2( select2_args ).addClass( 'enhanced' );
});" );
return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'jeroen_sormani_change_city_to_dropdown' );
ÖÚ ÇáßæÏ ÏÇÎá functions.php Ýì theme child Çæ ÖÚåÇ Ýì
Code Snippets plugin
ÇáßæÏ Ýì ÇáÇÚáì ßá ãÇ Úáíß ÝÚáå åæ æÖÚ city ÈÏÇÎáåÇ
ÈÇáÊÑÊíÈ Çáì ÊÑíÏå ãÚ ÇáÞíãÉ æíÞÇÈáåÇ ÇááÛÉ
ãáÍæÙÉ :
ÇåãíÉ Úãá Ðáß åæ Çä ÇÑÇãíßÓ áåÇ ÊæÒíÚÉ ãÍÏÏÉ Ýì ÍÓÇÈ shipping
íÊØáÈ Çä íßæä cities ÇáÎÇÕÉ ÈåÇ ãæÌæÏÉ ßÇÎÊíÇÑ select áÇä ÇáÈÏíá
åíßæä ÇáÚãíá íßÊÈ text ÇÓã city æÇáÊì íÌÈ Çä Êßæä ãÊØÇÈÞÉ ÊãÇãÇ ãÚ aramex
æÍÑÝ ÒÇÆÏ Çæ ãÓÇÝÉ ÒÇÆÏÉ åíÌÈ rate calculate íßæä ÎØÇ
Aramex: ERR52 - Destination Address - City name is invalid (s)
Ýì ÇáãÑÝÞÇÊ ãáÝ ÃÑÇãßÓ ÈÇáÊÞÓíã ÇáãÚÊãÏ áåã
ÇáãÑÌÚ:
https://silvawebdesigns.com/how-to-c...n-woocommerce/
https://stackoverflow.com/questions/...-checkout-page
https://stackoverflow.com/questions/...-country-in-wo
https://stackoverflow.com/questions/...-plugin-errors
https://wordathemes.com/add-city-and...n-woocommerce/
https://aceplugins.com/how-to-make-t...ld-a-dropdown/
https://xtemos.com/forums/topic/drop...erce-checkout/
ÇáãÝÖáÇÊ