+ ÅäÔÇÁ ãæÖæÚ ÌÏíÏ
ÇáäÊÇÆÌ 1 Åáì 2 ãä 2

ãÔÇåÏÉ ÇáãæÇÖíÚ

  1. #1
    Status
    Offline
    ÇáÕæÑÉ ÇáÑãÒíÉ Rise Company
    Engineering and Technology
    ÊÇÑíÎ ÇáÊÓÌíá
    Apr 2014
    ÇáÏæáÉ
    Egypt
    ÇáãÔÇÑßÇÊ
    4,628
    ãÚÏá ÊÞííã ÇáãÓÊæì
    10

    ÇÝÊÑÇÖí ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÞÇÆãÉ ÇáãÏä Cities drop down


    ææÑÏÈÑíÓ 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/


    ÇáãáÝÇÊ ÇáãÑÝÞÉ ÇáãáÝÇÊ ÇáãÑÝÞÉ
    ------------------------------------------------------------------------
    ÔÑßÉ ÑÇíÒ ááåäÏÓÉ æ ÇáÊßäæáæÌíÇ Rise Company for Engineering & Technology
    ------------------------------------------------------------------------
    Web Hosting | Web Designing | E-Marketing

    ÑÞã # 1 Ýì ÎÏãÇÊ ÇáÔÑßÇÊ Business Services

    ÇÓÊÖÇÝÉ ãæÇÞÚ Web Hosting - Úãá Çíãíá ÔÑßÉ Business Emails

    ÊÕãíã ãæÞÚ ÔÑßÉ Web Design - ÊÓæíÞ ÇáßÊÑæäì Úáì ÌæÌá Google Adwords

    www.rise.company | www.rise.company/emails

    ãáÍæÙÉ : ÌãíÚ ÎÏãÇÊäÇ ãÎÕÕÉ ááÔÑßÇÊ ÝÞØ æÛíÑ ãÊÇÍÉ ááÇÝÑÇÏ
    æáíÓ áäÇ Çì ãäÊÌÇÊ Çæ ÕíÇäÉ äåÇÆíÇ! íÑÌì ÇáÇäÊÈÇå Çáì Ðáß.



ÇáãæÇÖíÚ ÇáãÊÔÇÈåå

  1. ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÈáæÌä Plugin Èäß ãÕÑ banquemisr
    ÈæÇÓØÉ Rise Company Ýí ÇáãäÊÏì ÞÓã ææÑÏÈÑíÓ WordPress
    ãÔÇÑßÇÊ: 0
    ÂÎÑ ãÔÇÑßÉ: 12-03-2022, 00:31
  2. ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÈáæÌä Plugin ÇáÈäß ÇáÇåáì
    ÈæÇÓØÉ Rise Company Ýí ÇáãäÊÏì ÞÓã ææÑÏÈÑíÓ WordPress
    ãÔÇÑßÇÊ: 0
    ÂÎÑ ãÔÇÑßÉ: 08-03-2022, 14:59
  3. ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÓÊÑÇíÈ stripe hooks events
    ÈæÇÓØÉ Rise Company Ýí ÇáãäÊÏì ÞÓã ææÑÏÈÑíÓ WordPress
    ãÔÇÑßÇÊ: 0
    ÂÎÑ ãÔÇÑßÉ: 01-01-2022, 08:18
  4. ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ãÔßáÉ Add To Cart áÇ íÚãá
    ÈæÇÓØÉ Rise Company Ýí ÇáãäÊÏì ÞÓã ææÑÏÈÑíÓ WordPress
    ãÔÇÑßÇÊ: 0
    ÂÎÑ ãÔÇÑßÉ: 04-05-2021, 05:23
  5. ææÑÏÈÑíÓ WordPress ææßæãÑÓ WooCommerce ÇÒÇáÉ ÇáßãíÉ Quantity Field
    ÈæÇÓØÉ Rise Company Ýí ÇáãäÊÏì ÞÓã ææÑÏÈÑíÓ WordPress
    ãÔÇÑßÇÊ: 0
    ÂÎÑ ãÔÇÑßÉ: 20-04-2021, 04:15

ÇáãÝÖáÇÊ

ÇáãÝÖáÇÊ

ÖæÇÈØ ÇáãÔÇÑßÉ

  • áÇ ÊÓÊØíÚ ÅÖÇÝÉ ãæÇÖíÚ ÌÏíÏÉ
  • áÇ ÊÓÊØíÚ ÇáÑÏ Úáì ÇáãæÇÖíÚ
  • áÇ ÊÓÊØíÚ ÅÑÝÇÞ ãáÝÇÊ
  • áÇ ÊÓÊØíÚ ÊÚÏíá ãÔÇÑßÇÊß
  •