Changeset 2839027
- Timestamp:
- 12/24/2022 09:28:23 PM (19 months ago)
- Location:
- podro-wp
- Files:
-
- 2 added
- 20 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
podro-wp/tags/1.0.5/README.txt
r2835533 r2839027 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 47 Stable tag: 1.0. 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 59 59 == Changelog == 60 60 61 62 63 61 64 = 1.0.4 - 2022-12-17 = 62 65 * Fix the integration with persian-woocommerce and persian-woocommerce-shipping plugins -
podro-wp/tags/1.0.5/admin/Enqueue.php
r2827875 r2839027 76 76 77 77 if ( is_cart() || is_checkout() || is_wc_endpoint_url( 'edit-address' ) ) { 78 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cit y-select.js';78 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cit.js'; 79 79 wp_enqueue_script( 80 80 'wc-city-select', -
podro-wp/tags/1.0.5/assets/js/city-select.js
r2827875 r2839027 92 92 var country = $container.find( '#billing_country, #shipping_country, #calc_shipping_country' ).val(); 93 93 var state = $( this ).val(); 94 95 $( document.body ).trigger( 'state_changing', [country, state, $container ] );94 if(state) 95 $( document.body ).trigger( 'state_changing', [country, state, $container ] ); 96 96 }); 97 97 … … 135 135 var placeholder = $citybox.attr( 'placeholder' ); 136 136 137 $citybox.parent().find( '.select2-container' ).remove();137 $citybox.parent().find( '.select2-container' ).remove(); 138 138 139 139 $citybox.replaceWith( '<input type="text" class="input-text" name="' + input_name + '" id="' + input_id + '" placeholder="' + placeholder + '" />' ); … … 158 158 } else { 159 159 $citybox.prop( 'disabled', false ); 160 160 161 } 161 162 -
podro-wp/tags/1.0.5/inc/MetaBox.php
r2835533 r2839027 138 138 $source_city = $woo_setting->get_store_city_code_from_options(); 139 139 $order_id = $order->get_id(); 140 $destination_city = $order->get_shipping_city(); 141 $destination_city = Location::get_city_by_name($destination_city); 142 $destination_address = $destination_city['name'] . ' ' . $order->get_billing_address_1() . ' ' . $order->get_billing_address_2(); 140 $destination_city_code = $order->get_shipping_city(); 141 142 $destination_city_name = (WooSetting::get_instance())->get_cities()[$destination_city_code]; 143 $destination_address = $destination_city_name . ' ' . $order->get_billing_address_1() . ' ' . $order->get_billing_address_2(); 143 144 if( mb_strlen($destination_address) > $this->address_length ) 144 145 $destination_address = mb_substr($destination_address, 0, $this->address_length); … … 207 208 <li> 208 209 <label for="pod_destination_city">مقصد</label> 209 <?php if( !Location::is_podro_city($destination_city ['code']) ){ ?>210 <?php if( !Location::is_podro_city($destination_city) ){ ?> 210 211 <span style="color:red">این شهر پادرویی نیست</span> 211 212 <?php } ?> 212 213 <textarea name="pod_destination_city" id="pod_destination_city" rows="6" maxlength="186"><?php echo esc_attr($destination_address); ?></textarea> 213 <input type="hidden" id="pod_destination_city_code" name="pod_destination_city_code" value="<?php echo esc_attr($destination_city ['code']); ?>">214 <input type="hidden" id="pod_destination_city_code" name="pod_destination_city_code" value="<?php echo esc_attr($destination_city); ?>"> 214 215 </li> 215 216 <li> … … 222 223 </li> 223 224 <li> 224 225 225 <label for="pod_comment">توضیحات<span id="pod-description-hint" class="dashicons dashicons-editor-help" style="width:50px"></span></label> 226 226 <textarea name="pod_customer_note" id="pod_customer_note" rows="6" maxlength="60"><?php echo esc_attr($customer_note); ?></textarea> … … 375 375 376 376 $destination_city_code = get_option('pod_destination_city_code'); 377 378 377 379 378 $pod_store_name = get_option('pod_store_name'); -
podro-wp/tags/1.0.5/inc/Setup.php
r2835533 r2839027 103 103 // Disable Persian Woocommerce shipping City Select 104 104 if ( function_exists( 'PWS' ) || class_exists('PWS_Core') || in_array( 'persian-woocommerce-shipping/woocommerce-shipping.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 105 remove_filter( 'woocommerce_form_field_shipping_city', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 106 remove_filter( 'woocommerce_form_field_billing_city', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 107 remove_filter( 'woocommerce_form_field_billing_district', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 108 remove_filter( 'woocommerce_form_field_shipping_district', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 109 remove_filter( 'manage_state_city_custom_column', [ \PWS_Core::class, 'edit_state_city_rows_taxonomy' ], 10 ); 110 remove_filter( 'manage_edit-state_city_columns', [ \PWS_Core::class, 'edit_state_city_columns_taxonomy' ], 10 ); 111 remove_filter( 'woocommerce_states', [ \PWS_Core::class, 'iran_states' ], 20 ); 112 remove_filter( 'wp_ajax_mahdiy_load_cities', [ \PWS_Core::class, 'load_cities_callback' ]); 113 remove_filter( 'wp_ajax_nopriv_mahdiy_load_cities', [ \PWS_Core::class, 'load_cities_callback' ]); 114 remove_filter( 'wp_ajax_nopriv_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 115 remove_filter( 'wp_ajax_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 116 remove_filter( 'wp_ajax_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 117 105 106 $pws = \PWS_Core::instance(); 107 108 109 // Filters 110 remove_filter( 'woocommerce_states', [ $pws, 'iran_states' ], 20, 1 ); 111 remove_filter( 'woocommerce_checkout_process', [ $pws, 'checkout_process' ], 20, 1 ); 118 112 119 113 … … 121 115 wp_dequeue_script( 'pwsCheckout' ); 122 116 }, 999999 ); 123 } 124 125 }); 117 118 119 120 } 121 122 }, 21); 126 123 127 124 if ( class_exists('WC_City_Select') ) { … … 154 151 require_once( PODRO_PLUGIN_ROOT . 'WC/Shipping_Method.php' ); 155 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 156 180 } 157 181 -
podro-wp/tags/1.0.5/vendor/autoload.php
r2835533 r2839027 10 10 require_once __DIR__ . '/composer/autoload_real.php'; 11 11 12 return ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36::getLoader();12 return ComposerAutoloaderInit::getLoader(); -
podro-wp/tags/1.0.5/vendor/composer/autoload_real.php
r2835533 r2839027 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc365 class ComposerAutoloaderInit 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
podro-wp/tags/1.0.5/vendor/composer/autoload_static.php
r2835533 r2839027 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit a6b1c83b94dd2573828decae8472dc367 class ComposerStaticInit 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 166 166 { 167 167 return \Closure::bind(function () use ($loader) { 168 $loader->prefixLengthsPsr4 = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$prefixLengthsPsr4;169 $loader->prefixDirsPsr4 = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$prefixDirsPsr4;170 $loader->classMap = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$classMap;168 $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4; 169 $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4; 170 $loader->classMap = ComposerStaticInit::$classMap; 171 171 172 172 }, null, ClassLoader::class); -
podro-wp/tags/1.0.5/vendor/composer/installed.php
r2835533 r2839027 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 9b98b0c2f7f19226599f4dc272de97625bff8837',8 'reference' => '', 9 9 'name' => 'khorshid/wp_podro', 10 10 'dev' => true, … … 35 35 'install_path' => __DIR__ . '/../../', 36 36 'aliases' => array(), 37 'reference' => ' 9b98b0c2f7f19226599f4dc272de97625bff8837',37 'reference' => '', 38 38 'dev_requirement' => false, 39 39 ), -
podro-wp/tags/1.0.5/wp-podro.php
r2835533 r2839027 10 10 * Plugin URI: https://khorshidlab.com/ 11 11 * Description: پادروپین؛ مارکتپلیس خدمات پستی است و به فروشگاههای آنلاین کمک میکند تا فرآیند ارسال سفارشهای اینترنتی را مدیریت کنند. در پادروپین، بدون مراجعه و یا ثبت قرارداد با شرکتهای پستی، میتوان سفارشهای اینترنتی را با هر یک از شرکتهای پستی ارسال کرد 12 * Version: 1.0. 412 * Version: 1.0. 13 13 * Author: Khorshid, Podro 14 14 * Author URI: https://khorshidlab.com/fa/ … … 37 37 */ 38 38 39 define( 'PODRO_VERSION', '1.0. 4' );39 define( 'PODRO_VERSION', '1.0.' ); 40 40 define( 'PODRO_SLUG', 'podro-wp' ); 41 41 define( 'PODRO_NAME', 'WP PODRO' ); -
podro-wp/trunk/README.txt
r2835533 r2839027 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 47 Stable tag: 1.0. 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 59 59 == Changelog == 60 60 61 62 63 61 64 = 1.0.4 - 2022-12-17 = 62 65 * Fix the integration with persian-woocommerce and persian-woocommerce-shipping plugins -
podro-wp/trunk/admin/Enqueue.php
r2827875 r2839027 76 76 77 77 if ( is_cart() || is_checkout() || is_wc_endpoint_url( 'edit-address' ) ) { 78 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cit y-select.js';78 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cit.js'; 79 79 wp_enqueue_script( 80 80 'wc-city-select', -
podro-wp/trunk/assets/js/city-select.js
r2827875 r2839027 92 92 var country = $container.find( '#billing_country, #shipping_country, #calc_shipping_country' ).val(); 93 93 var state = $( this ).val(); 94 95 $( document.body ).trigger( 'state_changing', [country, state, $container ] );94 if(state) 95 $( document.body ).trigger( 'state_changing', [country, state, $container ] ); 96 96 }); 97 97 … … 135 135 var placeholder = $citybox.attr( 'placeholder' ); 136 136 137 $citybox.parent().find( '.select2-container' ).remove();137 $citybox.parent().find( '.select2-container' ).remove(); 138 138 139 139 $citybox.replaceWith( '<input type="text" class="input-text" name="' + input_name + '" id="' + input_id + '" placeholder="' + placeholder + '" />' ); … … 158 158 } else { 159 159 $citybox.prop( 'disabled', false ); 160 160 161 } 161 162 -
podro-wp/trunk/inc/MetaBox.php
r2835533 r2839027 138 138 $source_city = $woo_setting->get_store_city_code_from_options(); 139 139 $order_id = $order->get_id(); 140 $destination_city = $order->get_shipping_city(); 141 $destination_city = Location::get_city_by_name($destination_city); 142 $destination_address = $destination_city['name'] . ' ' . $order->get_billing_address_1() . ' ' . $order->get_billing_address_2(); 140 $destination_city_code = $order->get_shipping_city(); 141 142 $destination_city_name = (WooSetting::get_instance())->get_cities()[$destination_city_code]; 143 $destination_address = $destination_city_name . ' ' . $order->get_billing_address_1() . ' ' . $order->get_billing_address_2(); 143 144 if( mb_strlen($destination_address) > $this->address_length ) 144 145 $destination_address = mb_substr($destination_address, 0, $this->address_length); … … 207 208 <li> 208 209 <label for="pod_destination_city">مقصد</label> 209 <?php if( !Location::is_podro_city($destination_city ['code']) ){ ?>210 <?php if( !Location::is_podro_city($destination_city) ){ ?> 210 211 <span style="color:red">این شهر پادرویی نیست</span> 211 212 <?php } ?> 212 213 <textarea name="pod_destination_city" id="pod_destination_city" rows="6" maxlength="186"><?php echo esc_attr($destination_address); ?></textarea> 213 <input type="hidden" id="pod_destination_city_code" name="pod_destination_city_code" value="<?php echo esc_attr($destination_city ['code']); ?>">214 <input type="hidden" id="pod_destination_city_code" name="pod_destination_city_code" value="<?php echo esc_attr($destination_city); ?>"> 214 215 </li> 215 216 <li> … … 222 223 </li> 223 224 <li> 224 225 225 <label for="pod_comment">توضیحات<span id="pod-description-hint" class="dashicons dashicons-editor-help" style="width:50px"></span></label> 226 226 <textarea name="pod_customer_note" id="pod_customer_note" rows="6" maxlength="60"><?php echo esc_attr($customer_note); ?></textarea> … … 375 375 376 376 $destination_city_code = get_option('pod_destination_city_code'); 377 378 377 379 378 $pod_store_name = get_option('pod_store_name'); -
podro-wp/trunk/inc/Setup.php
r2835533 r2839027 103 103 // Disable Persian Woocommerce shipping City Select 104 104 if ( function_exists( 'PWS' ) || class_exists('PWS_Core') || in_array( 'persian-woocommerce-shipping/woocommerce-shipping.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 105 remove_filter( 'woocommerce_form_field_shipping_city', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 106 remove_filter( 'woocommerce_form_field_billing_city', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 107 remove_filter( 'woocommerce_form_field_billing_district', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 108 remove_filter( 'woocommerce_form_field_shipping_district', [ \PWS_Core::class, 'checkout_cities_field' ], 11 ); 109 remove_filter( 'manage_state_city_custom_column', [ \PWS_Core::class, 'edit_state_city_rows_taxonomy' ], 10 ); 110 remove_filter( 'manage_edit-state_city_columns', [ \PWS_Core::class, 'edit_state_city_columns_taxonomy' ], 10 ); 111 remove_filter( 'woocommerce_states', [ \PWS_Core::class, 'iran_states' ], 20 ); 112 remove_filter( 'wp_ajax_mahdiy_load_cities', [ \PWS_Core::class, 'load_cities_callback' ]); 113 remove_filter( 'wp_ajax_nopriv_mahdiy_load_cities', [ \PWS_Core::class, 'load_cities_callback' ]); 114 remove_filter( 'wp_ajax_nopriv_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 115 remove_filter( 'wp_ajax_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 116 remove_filter( 'wp_ajax_mahdiy_load_districts', [ \PWS_Core::class, 'load_districts_callback' ]); 117 105 106 $pws = \PWS_Core::instance(); 107 108 109 // Filters 110 remove_filter( 'woocommerce_states', [ $pws, 'iran_states' ], 20, 1 ); 111 remove_filter( 'woocommerce_checkout_process', [ $pws, 'checkout_process' ], 20, 1 ); 118 112 119 113 … … 121 115 wp_dequeue_script( 'pwsCheckout' ); 122 116 }, 999999 ); 123 } 124 125 }); 117 118 119 120 } 121 122 }, 21); 126 123 127 124 if ( class_exists('WC_City_Select') ) { … … 154 151 require_once( PODRO_PLUGIN_ROOT . 'WC/Shipping_Method.php' ); 155 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 156 180 } 157 181 -
podro-wp/trunk/vendor/autoload.php
r2835533 r2839027 10 10 require_once __DIR__ . '/composer/autoload_real.php'; 11 11 12 return ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36::getLoader();12 return ComposerAutoloaderInit::getLoader(); -
podro-wp/trunk/vendor/composer/autoload_real.php
r2835533 r2839027 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc365 class ComposerAutoloaderInit 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit a6b1c83b94dd2573828decae8472dc36', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
podro-wp/trunk/vendor/composer/autoload_static.php
r2835533 r2839027 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit a6b1c83b94dd2573828decae8472dc367 class ComposerStaticInit 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 166 166 { 167 167 return \Closure::bind(function () use ($loader) { 168 $loader->prefixLengthsPsr4 = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$prefixLengthsPsr4;169 $loader->prefixDirsPsr4 = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$prefixDirsPsr4;170 $loader->classMap = ComposerStaticInit a6b1c83b94dd2573828decae8472dc36::$classMap;168 $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4; 169 $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4; 170 $loader->classMap = ComposerStaticInit::$classMap; 171 171 172 172 }, null, ClassLoader::class); -
podro-wp/trunk/vendor/composer/installed.php
r2835533 r2839027 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' 9b98b0c2f7f19226599f4dc272de97625bff8837',8 'reference' => '', 9 9 'name' => 'khorshid/wp_podro', 10 10 'dev' => true, … … 35 35 'install_path' => __DIR__ . '/../../', 36 36 'aliases' => array(), 37 'reference' => ' 9b98b0c2f7f19226599f4dc272de97625bff8837',37 'reference' => '', 38 38 'dev_requirement' => false, 39 39 ), -
podro-wp/trunk/wp-podro.php
r2835533 r2839027 10 10 * Plugin URI: https://khorshidlab.com/ 11 11 * Description: پادروپین؛ مارکتپلیس خدمات پستی است و به فروشگاههای آنلاین کمک میکند تا فرآیند ارسال سفارشهای اینترنتی را مدیریت کنند. در پادروپین، بدون مراجعه و یا ثبت قرارداد با شرکتهای پستی، میتوان سفارشهای اینترنتی را با هر یک از شرکتهای پستی ارسال کرد 12 * Version: 1.0. 412 * Version: 1.0. 13 13 * Author: Khorshid, Podro 14 14 * Author URI: https://khorshidlab.com/fa/ … … 37 37 */ 38 38 39 define( 'PODRO_VERSION', '1.0. 4' );39 define( 'PODRO_VERSION', '1.0.' ); 40 40 define( 'PODRO_SLUG', 'podro-wp' ); 41 41 define( 'PODRO_NAME', 'WP PODRO' );
Note: See TracChangeset
for help on using the changeset viewer.