Changeset 2846187
- Timestamp:
- 01/10/2023 01:57:39 PM (19 months ago)
- Location:
- podro-wp
- Files:
-
- 4 added
- 32 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
podro-wp/tags/1.0.6/README.txt
r2839027 r2846187 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 57 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 64 65 61 66 = 1.0.5 - 2022-12-25 = 62 67 * Fix the cities js conflict in checkout page -
podro-wp/tags/1.0.6/admin/Enqueue.php
r2839027 r2846187 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/cities.js'; 78 79 if ( function_exists( 'PWS' ) || class_exists('PWS_Core') || in_array( 'persian-woocommerce-shipping/woocommerce-shipping.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 80 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cities.js'; 81 }else{ 82 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/only-podro-cities.js'; 83 } 84 85 86 79 87 wp_enqueue_script( 80 88 'wc-city-select', -
podro-wp/tags/1.0.6/admin/views/pages/api-key-settings.php
r2835533 r2846187 2 2 $credentials_status = get_option( 'podro_plugin_status' ); 3 3 $credentials = get_option( 'podro_plugin_credentials', true ); 4 5 6 7 4 8 5 9 ?> … … 13 17 <h1><?php esc_html_e( 'تنظیمات عمومی پادرو', 'podro-wp' ) ?></h1> 14 18 <h3><?php esc_html_e( 'پیکربندی اتصال به پادرو پین', 'podro-wp' ) ?></h3> 15 <form class="wp_podro-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=' . PODRO_SLUG )); ?>"> 19 <form class="wp_podro-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=' . PODRO_SETTINGS_PAGE_SLUG )); ?>"> 20 16 21 <div class="pdo-box"> 17 22 <label for="pdo_email">ایمیل</label> … … 22 27 <input type="password" name="pdo_password" id="pdo_password" autocomplete="off"> 23 28 </div> 29 30 31 32 33 24 34 <h3><?php esc_html_e( 'تنظیمات فروشگاه', 'podro-wp' ) ?></h3> 35 36 37 38 25 39 <div class="pdo-box"> 26 40 … … 28 42 <?php 29 43 $provinces = \WP_PODRO\Engine\WooSetting::get_provinces(); 30 echo "<select aria-label='شهر' class='wc-enhanced-select' id='podro_store_ location' name='podro_store_location' style='width:325px;' >";44 echo "<select aria-label='شهر' class='wc-enhanced-select' id='podro_store_' style='width:325px;' >"; 31 45 foreach($provinces as $province){ 32 46 echo "<optgroup label='".esc_attr($province['name'])."'>"; 33 47 foreach ($province['cities'] as $key=>$city) 34 if(get_option(' woocommerce_store_city') == $key)48 if(get_option('_store_city') == $key) 35 49 echo "<option selected value='". esc_attr($key)."'>".esc_attr($city)."</option>"; 36 50 else … … 48 62 </div> 49 63 <div class="pdo-box"> 50 <a class="get-api-key" href="https://podro.com/plugin-pin/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('دریافت کلید API', 'podro-wp'); ?></a> 64 <label for="pdo_address">آدرس</label> 65 <textarea name="podro_store_address" id="podro_store_address" ><?php echo esc_attr( $store_address ?? '' ) ?></textarea> 51 66 </div> 52 <button type="submit" class="button button-primary" name="config_podro_ api_key" value="1"><?php esc_html_e( "ذخیره", 'podro-wp' ) ?></button>67 <button type="submit" class="button button-primary" name="config_podro_" value="1"><?php esc_html_e( "ذخیره", 'podro-wp' ) ?></button> 53 68 </form> 54 69 </div> -
podro-wp/tags/1.0.6/assets/css/admin.css
r2835533 r2846187 1 @font-face{font-family:IRANSansX;font-style:normal;font-weight:bold;src:url("../fonts/woff/IRANSansX-bold.woff") format("woff"),url("../fonts/woff2/IRANSansX-bold.woff2") format("woff2")}@font-face{font-family:IRANSansX;font-style:normal;font-weight:normal;src:url("../fonts/woff/IRANSansX-regular.woff") format("woff"),url("../fonts/woff2/IRANSansX-regular.woff2") format("woff2")}.pod-wrap,.toplevel_page_podro-wp,.pdo-wrapper,#woocommerce-order-podro,#woocommerce-order-podro h2,.pod-wrap h1,.pod-wrap h2,.pod-wrap h3{font-family:IRANSansX}#adminmenu #toplevel_page_podro-wp>a img{width:18px}.pod-footer{background-color:#883df2;border-radius:5px;padding:15px;display:flex;align-items:center;max-width:1202px;width:calc(100% - 30px);color:#fff}.pod-footer .pod-footer-links{width:70%;float:left}.pod-footer .pod-footer-links ul{width:100%}.pod-footer .pod-footer-links ul li{display:inline-block;margin-inline-end:15px;margin-bottom:0}.pod-footer .pod-footer-links ul li a{color:#fff;opacity:.7;text-decoration:none !important}.pod-footer .pod-footer-social{width:30%;float:right}.pod-footer .pod-footer-social .footer__social-icons{float:right;width:180px;text-align:left;direction:ltr;flex-direction:row;justify-content:space-between;display:flex}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link{display:block}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link svg{width:30px;height:30px}.pdo-wrapper{max-width:1232px;width:100%}.pdo-wrapper .pdo-card{max-width:1232px;width:calc(100% - 48px);background:#fff;background-color:#fff;box-shadow:0 2px 5px rgba(0,0,0,0.05);border-radius:5px;padding:24px;margin-bottom:20px}.pdo-box{width:390px;display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.pdo-box label{display:inline-block;height:22px;cursor:pointer;font-weight:bold}.pdo-box input{width:325px;text-align:left;direction:ltr}.pdo-box .get-api-key{display:block;width:100%;text-align:right;margin-top:10px;text-decoration:none !important}pre.xdebug-var-dump{margin-left:320px}.delivery_options{display:flex;margin-bottom:10px}.delivery_options .delivery_option{display:flex;align-items:center;flex-direction:column;padding:16px 12px;margin-bottom:10px;border:solid #bcbcbc 1px;border-radius:10px;margin-right:16px;width:136px}.delivery_options .delivery_option label{text-align:center}.delivery_options .delivery_option img{max-height:28px}ul.pod-delivery-step{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:20px;margin-top:0}ul.pod-delivery-step li{display:flex;flex-direction:column;width:100%}ul.pod-delivery-step li.pod-dimension{background:#efefef;padding:10px;width:calc(100% - 20px);flex-wrap:wrap;flex-direction:row;margin-top:10px}ul.pod-delivery-step li.pod-dimension p{margin-top:0;width:100%}ul.pod-delivery-step li.pod-dimension>div{display:flex;flex-direction:column;width:33.33%}.pod-delivery-step-button{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#883df2;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-cancel{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#b1b1b1;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-step-2-wrapper{display:flex;flex-direction:column}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option{display:flex;flex-direction:row;flex-wrap:wrap;width:calc( 100% - 40px);align-items:center;margin-bottom:12px;border-radius:12px;background-color:#f3f3f3;padding:20px;border:solid 1px transparent;cursor:pointer}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option input{margin-left:10px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active:checked::before{background-color:#883df2}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_delivery_option,.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_pickup_option{display:flex;align-items:center;flex-wrap:wrap}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label img{max-width:50px;max-height:40px;margin-left:4px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label>p{flex:1 1 100%;margin:4px 0}.pod-pickup-step-3-option-wrapper,.pod-delivery-step-3-option-wrapper{display:flex;flex-wrap:wrap}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option{padding:10px;margin-inline-end:10px;margin-bottom:10px;box-shadow:0px 0px 11px -1px #893df24d;border-radius:6px;cursor:pointer}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option input{display:none}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-hide{display:none}.pod-show{display:block}.pod-flex{display:flex}.rtl .delivery_options .delivery_option label{margin:0 0 0 16px}select[name="pod_delivery_option_day"]{display:block;width:100%;margin-bottom:20px}#woocommerce-order-podro .inside{padding-top:12px}#woocommerce-order-podro #loading-circle{display:none;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:50px;height:50px;border:8px solid #f3f3f3;border-top:8px solid #893df2;border-radius:50%;animation:spin 0.6s ease-in infinite}#woocommerce-order-podro #lock-modal{display:none;background-color:#06282e9e;opacity:1;position:absolute;top:-6px;left:0;right:0;bottom:0}#woocommerce-order-podro h3,#woocommerce-order-podro h4{margin-top:0}input.pod-error,select.pod-error{border:solid 1px #ff0000}.pod_order_details{width:100%}.pod_order_details tbody tr td{padding:10px;background-color:#efefef}.pod_order_details tbody tr th{padding:2px 10px;background-color:#caa3ff}.pdo-about{font-size:18px}.rtl .pod-footer .pod-footer-social{float:left}.rtl .pod-footer .pod-footer-social .footer__social-icons{float:left}#get_order_pdf,.get_order_pdf,#pod-cancel-order,.pod-cancel-order{cursor:pointer}1 @font-face{font-family:IRANSansX;font-style:normal;font-weight:bold;src:url("../fonts/woff/IRANSansX-bold.woff") format("woff"),url("../fonts/woff2/IRANSansX-bold.woff2") format("woff2")}@font-face{font-family:IRANSansX;font-style:normal;font-weight:normal;src:url("../fonts/woff/IRANSansX-regular.woff") format("woff"),url("../fonts/woff2/IRANSansX-regular.woff2") format("woff2")}.pod-wrap,.toplevel_page_podro-wp,.pdo-wrapper,#woocommerce-order-podro,#woocommerce-order-podro h2,.pod-wrap h1,.pod-wrap h2,.pod-wrap h3{font-family:IRANSansX}#adminmenu #toplevel_page_podro-wp>a img{width:18px}.pod-footer{background-color:#883df2;border-radius:5px;padding:15px;display:flex;align-items:center;max-width:1202px;width:calc(100% - 30px);color:#fff}.pod-footer .pod-footer-links{width:70%;float:left}.pod-footer .pod-footer-links ul{width:100%}.pod-footer .pod-footer-links ul li{display:inline-block;margin-inline-end:15px;margin-bottom:0}.pod-footer .pod-footer-links ul li a{color:#fff;opacity:.7;text-decoration:none !important}.pod-footer .pod-footer-social{width:30%;float:right}.pod-footer .pod-footer-social .footer__social-icons{float:right;width:180px;text-align:left;direction:ltr;flex-direction:row;justify-content:space-between;display:flex}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link{display:block}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link svg{width:30px;height:30px}.pdo-wrapper{max-width:1232px;width:100%}.pdo-wrapper .pdo-card{max-width:1232px;width:calc(100% - 48px);background:#fff;background-color:#fff;box-shadow:0 2px 5px rgba(0,0,0,0.05);border-radius:5px;padding:24px;margin-bottom:20px}.pdo-box{width:390px;display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.pdo-box label{display:inline-block;height:22px;cursor:pointer;font-weight:bold}.pdo-box input{width:325px;text-align:left;direction:ltr}.pdo-box .get-api-key{display:block;width:100%;text-align:right;margin-top:10px;text-decoration:none !important}pre.xdebug-var-dump{margin-left:320px}.delivery_options{display:flex;margin-bottom:10px}.delivery_options .delivery_option{display:flex;align-items:center;flex-direction:column;padding:16px 12px;margin-bottom:10px;border:solid #bcbcbc 1px;border-radius:10px;margin-right:16px;width:136px}.delivery_options .delivery_option label{text-align:center}.delivery_options .delivery_option img{max-height:28px}ul.pod-delivery-step{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:20px;margin-top:0}ul.pod-delivery-step li{display:flex;flex-direction:column;width:100%}ul.pod-delivery-step li.pod-dimension{background:#efefef;padding:10px;width:calc(100% - 20px);flex-wrap:wrap;flex-direction:row;margin-top:10px}ul.pod-delivery-step li.pod-dimension p{margin-top:0;width:100%}ul.pod-delivery-step li.pod-dimension>div{display:flex;flex-direction:column;width:33.33%}.pod-delivery-step-button{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#883df2;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-cancel{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#b1b1b1;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-step-2-wrapper{display:flex;flex-direction:column}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option{display:flex;flex-direction:row;flex-wrap:wrap;width:calc( 100% - 40px);align-items:center;margin-bottom:12px;border-radius:12px;background-color:#f3f3f3;padding:20px;border:solid 1px transparent;cursor:pointer}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option input{margin-left:10px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active:checked::before{background-color:#883df2}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_delivery_option,.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_pickup_option{display:flex;align-items:center;flex-wrap:wrap}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label img{max-width:50px;max-height:40px;margin-left:4px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label>p{flex:1 1 100%;margin:4px 0}.pod-pickup-step-3-option-wrapper,.pod-delivery-step-3-option-wrapper{display:flex;flex-wrap:wrap}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option{padding:10px;margin-inline-end:10px;margin-bottom:10px;box-shadow:0px 0px 11px -1px #893df24d;border-radius:6px;cursor:pointer}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option input{display:none}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-hide{display:none}.pod-show{display:block}.pod-flex{display:flex}.rtl .delivery_options .delivery_option label{margin:0 0 0 16px}select[name="pod_delivery_option_day"]{display:block;width:100%;margin-bottom:20px}#woocommerce-order-podro .inside{padding-top:12px}#woocommerce-order-podro #loading-circle{display:none;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:50px;height:50px;border:8px solid #f3f3f3;border-top:8px solid #893df2;border-radius:50%;animation:spin 0.6s ease-in infinite}#woocommerce-order-podro #lock-modal{display:none;background-color:#06282e9e;opacity:1;position:absolute;top:-6px;left:0;right:0;bottom:0}#woocommerce-order-podro h3,#woocommerce-order-podro h4{margin-top:0}input.pod-error,select.pod-error{border:solid 1px #ff0000}.pod_order_details{width:100%}.pod_order_details tbody tr td{padding:10px;background-color:#efefef}.pod_order_details tbody tr th{padding:2px 10px;background-color:#caa3ff}.pdo-about{font-size:18px}.rtl .pod-footer .pod-footer-social{float:left}.rtl .pod-footer .pod-footer-social .footer__social-icons{float:left}#get_order_pdf,.get_order_pdf,#pod-cancel-order,.pod-cancel-order{cursor:pointer} -
podro-wp/tags/1.0.6/assets/js/cities.js
r2839027 r2846187 1 1 jQuery(document).ready(function(){ 2 2 3 jQuery('body').on('country_to_state_changed', function(p1,country){4 3 5 if( 'IR' == country ){ 6 // 7 jQuery('input#billing_city').replaceWith('<select id="billing_city" name="billing_city"></select>'); 8 jQuery('input#shipping_city').replaceWith('<select id="shipping_city" name="shipping_city"></select>'); 9 jQuery('select#billing_city').selectWoo(); 10 jQuery('select#shipping_city').selectWoo(); 11 getCities(); 4 const data = { 5 action:'get_podro_cities', 6 method:'post' 7 } 8 ajaxRequest(data, podro_cities_callback, null); 9 let cities = []; 10 function podro_cities_callback(response, element){ 11 cities = response; 12 13 } 14 15 jQuery('#billing_city').on('change', function(){ 16 17 if( !is_this_podro_city(cities,jQuery(this).find('option:selected').text())){ 18 jQuery("[id*='podro_method']").prop('disabled', true); 19 jQuery("[id*='podro_method']").prop('checked',false); 20 jQuery("[id*='podro_method']").removeAttr('checked'); 21 const count = jQuery(this).find('#shipping_method input[type=radio]:checked').length; 22 if(count > 0) 23 return; 24 if(!jQuery('#shipping_method input[type=radio]:checked').attr('id')) 25 jQuery("[id*='podro_method']").parent().next('li').find("input[type=radio]").prop('checked',true); 12 26 }else{ 13 jQuery('#billing_city').parent().find('.select2').remove(); 14 jQuery('#shipping_city').parent().find('.select2').remove(); 15 jQuery('#billing_city').replaceWith('<input type="text" name="billing_city" id="billing_city" class="input-text "/>'); 16 jQuery('#shipping_city').replaceWith('<input type="text" name="shipping_city" id="shipping_city" class="input-text "/>'); 27 jQuery("[id*='podro_method']").prop('disabled',false); 28 17 29 } 18 30 }); 19 31 20 function getCities(){ 21 jQuery('#billing_state, body').change(function(){ 22 const province_code = jQuery(this).val(); 23 const element = jQuery('#billing_city'); 24 if(!province_code) 32 jQuery('body').on('updated_checkout', function() { 33 if( !is_this_podro_city(cities,jQuery('#billing_city').find('option:selected').text())){ 34 35 jQuery("[id*='podro_method']").prop('disabled', true); 36 jQuery("[id*='podro_method']").prop('checked',false); 37 jQuery("[id*='podro_method']").removeAttr('checked'); 38 const count = jQuery(this).find('#shipping_method input[type=radio]:checked').length; 39 if(count > 0) 25 40 return; 26 const data = {27 action:'get_podro_cities_by_province',28 //security: wp_podro_ajax_object.security,29 province: province_code30 };31 41 32 ajaxRequest(data, callbackGetCities, element); 42 43 if(!jQuery('#shipping_method input[type=radio]:checked').attr('id')) 44 jQuery("[id*='podro_method']").parent().next('li').find("input[type=radio]").prop('checked',true); 45 }else{ 46 jQuery("[id*='podro_method']").prop('disabled',false); 47 48 49 } 50 }); 51 52 53 function is_this_podro_city(city_list, name){ 54 55 let result = false; 56 Object.keys(city_list).forEach(key => { 57 58 if( city_list[key] === name ){ 59 result = true; 60 return result; 61 } 62 33 63 34 64 }); 65 66 35 67 36 jQuery('#shipping_state, body').change(function(){37 const province_code = jQuery(this).val();38 const element = jQuery('#shipping_city');39 if(!province_code)40 return;41 const data = {42 action:'get_podro_cities_by_province',43 //security: wp_podro_ajax_object.security,44 province: province_code45 };46 47 ajaxRequest(data, callbackGetCities, element);48 });49 50 }51 68 52 69 function callbackGetCities(response, element){ … … 59 76 60 77 Object.keys(cities).forEach(function(key) { 61 console.log('Key : ' + key + ', Value : ' + cities[key]) 78 62 79 element.append(`<option value='${key}'>${cities[key]}</option>`); 63 80 -
podro-wp/tags/1.0.6/inc/Api_Key.php
r2835533 r2846187 77 77 public static function set_pdo_api_key() { 78 78 79 if( ! isset( $_POST[ 'config_podro_api_key' ] ) ) { 80 return; 81 } 82 update_option('woocommerce_store_city', sanitize_text_field($_POST['podro_store_location'])); 83 $pdo_email = sanitize_email( $_POST[ 'pdo_email' ] ); 84 $pdo_password = sanitize_text_field( $_POST[ 'pdo_password' ] ); 85 if ( $pdo_email == null || $pdo_password == null || ( ! empty( $pdo_email ) && !empty( $pdo_password ) && $pdo_password === "**************" ) ) { 86 add_action( 'admin_notices', function () { 87 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 79 80 81 if( isset( $_POST[ 'config_podro_api_key' ] ) ) { 82 $pdo_email = sanitize_email( $_POST[ 'pdo_email' ] ); 83 $pdo_password = sanitize_text_field( $_POST[ 'pdo_password' ] ); 84 if ( $pdo_email == null || $pdo_password == null || ( ! empty( $pdo_email ) && !empty( $pdo_password ) && $pdo_password === "**************" ) ) { 85 add_action( 'admin_notices', function () { 86 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 88 87 <p>'. esc_html__( "لطفا موارد موردنیاز را وارد کنید.", 'podro-wp' ) .'</p> 88 89 89 </div>'); 90 } );91 return false;92 }90 } ); 91 return false; 92 } 93 93 94 if ( !$token = self::validate_api_key( $pdo_email, (new Encryption)->encrypt($pdo_password) ) ) {95 return false;96 }94 if ( !$token = self::validate_api_key( $pdo_email, (new Encryption)->encrypt($pdo_password) ) ) { 95 return false; 96 } 97 97 98 $save_settings = update_option( 'podro_api_key', (new Encryption)->encrypt($token) );98 $save_settings = update_option( 'podro_api_key', (new Encryption)->encrypt($token) ); 99 99 100 if( $save_settings ) {101 update_option( 'podro_plugin_status', 'connected');102 update_option( 'podro_plugin_credentials', [103 'email' => $pdo_email,104 'password' => (new Encryption)->encrypt($pdo_password),105 ]);100 if( $save_settings ) { 101 update_option( 'podro_plugin_status', 'connected'); 102 update_option( 'podro_plugin_credentials', [ 103 'email' => $pdo_email, 104 'password' => (new Encryption)->encrypt($pdo_password), 105 ]); 106 106 107 wp_redirect( home_url( '/wp-admin/admin.php?page=' . PODRO_SLUG ) ); 107 wp_redirect( home_url( '/wp-admin/admin.php?page=' . PODRO_SETTINGS_PAGE_SLUG ) ); 108 109 add_action( 'admin_notices', function () { 110 echo wp_kses_post('<div class="notice notice-success is-dismissible"> 111 <p>'. esc_html__( "تنظیمات ذخیره شد.", 'wp-podro' ) .'</p> 112 </div>'); 113 } ); 114 } 115 }else if( isset($_POST['config_podro_store_info']) ){ 116 117 if( empty($_POST['podro_store_name']) || empty($_POST['podro_store_address']) ){ 118 add_action( 'admin_notices', function () { 119 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 120 <p>'. esc_html__( "نام فروشگاه، شهرو آدرس نمی تواند خالی باشد", 'wp-podro' ) .'</p> 121 </div>'); 122 } ); 123 return false; 124 } 125 126 update_option('podro_store_name', sanitize_text_field($_POST['podro_store_name']??'')); 127 update_option('podro_store_city', sanitize_text_field($_POST['podro_store_city']??'')); 128 update_option('podro_store_address', sanitize_text_field($_POST['podro_store_address']??'')); 129 108 130 109 131 add_action( 'admin_notices', function () { … … 111 133 <p>'. esc_html__( "تنظیمات ذخیره شد.", 'podro-wp' ) .'</p> 112 134 </div>'); 113 } 135 }); 114 136 } 137 115 138 116 139 } -
podro-wp/tags/1.0.6/inc/MetaBox.php
r2839027 r2846187 136 136 $woo_setting = WooSetting::get_instance(); 137 137 138 $source_city = $woo_setting->get_store_city_code_from_options(); 138 139 139 $order_id = $order->get_id(); 140 140 $destination_city_code = $order->get_shipping_city(); 141 142 143 144 145 146 147 148 141 149 142 150 $destination_city_name = (WooSetting::get_instance())->get_cities()[$destination_city_code]; … … 144 152 if( mb_strlen($destination_address) > $this->address_length ) 145 153 $destination_address = mb_substr($destination_address, 0, $this->address_length); 146 $store_address = $woo_setting->get_store_city() . ' ' . get_option( 'woocommerce_store_address' ) . get_option( 'woocommerce_store_address_2' ); 154 155 156 $pod_source_city_code = $woo_setting->get_store_city_code_from_options(); 157 $pod_store_address = mb_substr($woo_setting->get_store_city() . ' ' . $woo_setting->get_store_address() , 0 , $this->address_length) ; 158 $pod_store_name = mb_substr( $woo_setting->get_store_name(), 0, $this->store_name_length ); 147 159 148 160 $total_weight = 0; … … 183 195 $user_billing_family = $order->get_billing_last_name(); 184 196 185 $store_name = $this->get_store_name(); 197 186 198 $customer_note = $order->get_customer_note(); 187 199 188 $option_pod_source_city = get_option('pod_source_city',false); 189 $option_pod_store_name = get_option('pod_store_name',false); 190 191 $option_pod_source_city = ( false == $option_pod_source_city ) ? $store_address : $option_pod_source_city; 192 $option_pod_store_name = ( false == $option_pod_store_name ) ? $store_name : $option_pod_store_name; 200 201 193 202 194 203 … … 198 207 <li> 199 208 <label for="pod_store_name">نام فروشگاه</label> 200 <input type="text" name="pod_store_name" id="pod_store_name" maxlength="60" value="<?php echo esc_attr($ option_pod_store_name); ?>" />209 <input type="text" name="pod_store_name" id="pod_store_name" maxlength="60" value="<?php echo esc_attr($pod_store_name); ?>" /> 201 210 </li> 202 211 <li> 203 212 <label for="pod_source_city">مبدا</label> 204 <textarea name="pod_source_city" id="pod_source_city" rows="6"><?php echo esc_attr($ option_pod_source_city); ?></textarea>205 <?php if (empty($ store_address)) echo '<p style="color:red">'. esc_html__('لطفا آدرس فروشگاه را از تنظیمات ووکامرس وارد کنید.', 'podro-wp') .'</p>' ; ?>206 <input type="hidden" id="pod_source_city_code" name="pod_source_city_code" value="<?php echo esc_attr($ source_city); ?>">213 <textarea name="pod_source_city" id="pod_source_city" rows="6"><?php echo esc_attr($); ?></textarea> 214 <?php if (empty($store_address)) echo '<p style="color:red">'. esc_html__('لطفا آدرس فروشگاه را از تنظیمات ووکامرس وارد کنید.', 'podro-wp') .'</p>' ; ?> 215 <input type="hidden" id="pod_source_city_code" name="pod_source_city_code" value="<?php echo esc_attr($); ?>"> 207 216 </li> 208 217 <li> -
podro-wp/tags/1.0.6/inc/Podro_Order_Table.php
r2835533 r2846187 105 105 foreach ($orders as $order){ 106 106 107 if ( $order['status'] == 'لغو شده') { 108 $cancel_order = 'از پیش لغو شده'; 107 if ( $order['status'] == 'درحال پردازش' || 108 $order['status'] == 'ثبت اولیه' || 109 $order['status'] == 'در حال بررسی تاخیر' ) { 110 $cancel_order = '<a class="pod-cancel-order" data-order_id="' . $order['id'] . '">لغو ارسال</a>'; 109 111 } else { 110 $cancel_order = '<a class="pod-cancel-order" data-order_id="' . $order['id'] . '">لغو ارسال</a>';112 $cancel_order = ; 111 113 } 112 114 -
podro-wp/tags/1.0.6/inc/Setup.php
r2839027 r2846187 17 17 * @link https://github.com/KhorshidLab/WP-Podro 18 18 */ 19 20 19 21 use WP_PODRO\Admin\Enqueue; 20 22 use WP_PODRO\Engine\API\V1\Payments; 23 21 24 22 25 class Setup { … … 85 88 * @access private 86 89 */ 90 91 92 93 94 95 96 97 98 87 99 private function load_dependencies() { 88 100 … … 91 103 $this->loader = new Loader(); 92 104 93 add_action('woocommerce_loaded', function(){ 94 95 96 // Disable Persian Woocommerce City Select 97 if ( function_exists( 'PW' ) && PW()->get_options( 'enable_iran_cities' ) != 'no' ) { 98 $settings = PW()->get_options(); 99 $settings['enable_iran_cities'] = 'no'; 100 update_option( 'PW_Options', $settings ); 101 } 102 103 // Disable Persian Woocommerce shipping City Select 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 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 ); 112 113 114 add_action( 'wp_enqueue_scripts', function() { 115 wp_dequeue_script( 'pwsCheckout' ); 116 }, 999999 ); 117 118 119 120 } 121 122 }, 21); 123 124 if ( class_exists('WC_City_Select') ) { 125 126 $WC_City_Select = new WC_City_Select; 127 128 $this->loader->add_filter( 'woocommerce_billing_fields', $WC_City_Select, 'billing_fields', 999999, 2 ); 129 $this->loader->add_filter( 'woocommerce_shipping_fields', $WC_City_Select, 'shipping_fields', 999999, 2 ); 130 $this->loader->add_filter( 'woocommerce_form_field_city', $WC_City_Select, 'form_field_city', 999999, 4 ); 131 132 } 105 106 107 add_action( 'wp_ajax_nopriv_get_podro_cities', [$this, 'podro_get_cities'] ); 108 add_action( 'wp_ajax_get_podro_cities', [$this, 'podro_get_cities'] ); 109 110 133 111 134 112 $this->loader->add_action( 'admin_init', $Api_Key, 'set_pdo_api_key' ); … … 269 247 __( 'تنظیمات', 'podro-wp' ), 270 248 'manage_options', 271 PODRO_S LUG . '-settings',249 PODRO_S, 272 250 [$this, 'settings_page'], 273 251 ); -
podro-wp/tags/1.0.6/inc/WooSetting.php
r2827875 r2846187 356 356 '0006'=>'ساوه', 357 357 '0005'=>'دلیجان', 358 '0101'=>' آستارا',359 '0103'=>'بندر انزلی',358 '0101'=>'آستارا', 359 '0103'=>'بندرانزلی', 360 360 '0105'=>'رشت', 361 361 '0111'=>'لاهیجان', … … 367 367 '0206'=>'رامسر', 368 368 '0207'=>'ساری', 369 '0210'=>'قائم 369 '0210'=>'قائمشهر', 370 370 '0214'=>'نور', 371 371 '0215'=>'نوشهر', … … 392 392 '0808'=>'کرمان', 393 393 '0908'=>'سبزوار', 394 '0916'=>'مشهد ',394 '0916'=>'مشهد', 395 395 '0917'=>'نیشابور', 396 396 '1002'=>'اصفهان', 397 397 '1009'=>'شهرضا', 398 398 '1010'=>'کاشان', 399 '1018'=>'آران و بیدگل',399 '1018'=>'آران وبیدگل', 400 400 '1102'=>'چابهار', 401 401 '1105'=>'زاهدان', … … 405 405 '1401'=>'بروجن', 406 406 '1402'=>'شهرکرد', 407 '1503'=>'خرم 407 '1503'=>'خرمآباد', 408 408 '1601'=>'ایلام', 409 409 '1703'=>'گچساران', 410 '1801'=>'ب وشهر',410 '1801'=>'بوشهر', 411 411 '1810'=>'عسلویه', 412 412 '1901'=>'ابهر', … … 419 419 '2105'=>'یزد', 420 420 '2106'=>'میبد', 421 '2202'=>'بندر عباس',421 '2202'=>'بندرعباس', 422 422 '2204'=>'قشم', 423 423 '2301'=>'تهران', … … 430 430 '2705'=>'گرگان', 431 431 '2710'=>'آزادشهر', 432 '2706'=>'گنبدکاو س',432 '2706'=>'گنبدکاوس', 433 433 '2802'=>'بجنورد', 434 434 '2901'=>'بیرجند', … … 442 442 } 443 443 444 445 446 447 448 449 444 450 public function get_store_city(){ 445 451 $current_city = $this->get_store_city_code_from_options(); … … 448 454 449 455 public function get_store_city_code_from_options(){ 450 return get_option('woocommerce_store_city',0); 456 return get_option('podro_store_city',0); 457 } 458 459 public function get_store_address(){ 460 return get_option('podro_store_address', ''); 461 } 462 public function get_store_name(){ 463 return get_option('podro_store_name', ''); 451 464 } 452 465 -
podro-wp/tags/1.0.6/vendor/autoload.php
r2839027 r2846187 10 10 require_once __DIR__ . '/composer/autoload_real.php'; 11 11 12 return ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d097::getLoader();12 return ComposerAutoloaderInit::getLoader(); -
podro-wp/tags/1.0.6/vendor/composer/autoload_classmap.php
r2827875 r2846187 119 119 'WP_PODRO\\Engine\\API\\V1\\Routes' => $baseDir . '/inc/API/V1/Routes.php', 120 120 'WP_PODRO\\Engine\\Api_Key' => $baseDir . '/inc/Api_Key.php', 121 121 122 'WP_PODRO\\Engine\\Loader' => $baseDir . '/inc/Loader.php', 122 123 'WP_PODRO\\Engine\\Location' => $baseDir . '/inc/Location.php', -
podro-wp/tags/1.0.6/vendor/composer/autoload_real.php
r2839027 r2846187 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d0975 class ComposerAutoloaderInit 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d097', '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 b472f25f5c4461cfd343527deda3d097', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit b472f25f5c4461cfd343527deda3d097::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
podro-wp/tags/1.0.6/vendor/composer/autoload_static.php
r2839027 r2846187 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit b472f25f5c4461cfd343527deda3d0977 class ComposerStaticInit 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 152 152 'WP_PODRO\\Engine\\API\\V1\\Routes' => __DIR__ . '/../..' . '/inc/API/V1/Routes.php', 153 153 'WP_PODRO\\Engine\\Api_Key' => __DIR__ . '/../..' . '/inc/Api_Key.php', 154 154 155 'WP_PODRO\\Engine\\Loader' => __DIR__ . '/../..' . '/inc/Loader.php', 155 156 'WP_PODRO\\Engine\\Location' => __DIR__ . '/../..' . '/inc/Location.php', … … 166 167 { 167 168 return \Closure::bind(function () use ($loader) { 168 $loader->prefixLengthsPsr4 = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$prefixLengthsPsr4;169 $loader->prefixDirsPsr4 = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$prefixDirsPsr4;170 $loader->classMap = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$classMap;169 $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4; 170 $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4; 171 $loader->classMap = ComposerStaticInit::$classMap; 171 172 172 173 }, null, ClassLoader::class); -
podro-wp/tags/1.0.6/vendor/composer/installed.php
r2839027 r2846187 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' e61c7f2401dc8fba00d50b7d6356693315103128',8 'reference' => '', 9 9 'name' => 'khorshid/wp_podro', 10 10 'dev' => true, … … 35 35 'install_path' => __DIR__ . '/../../', 36 36 'aliases' => array(), 37 'reference' => ' e61c7f2401dc8fba00d50b7d6356693315103128',37 'reference' => '', 38 38 'dev_requirement' => false, 39 39 ), -
podro-wp/tags/1.0.6/wp-podro.php
r2839027 r2846187 10 10 * Plugin URI: https://khorshidlab.com/ 11 11 * Description: پادروپین؛ مارکتپلیس خدمات پستی است و به فروشگاههای آنلاین کمک می��ند تا فرآیند ارسال سفارشهای اینترنتی را مدیریت کنند. در پادروپین، بدون مراجعه و یا ثبت قرارداد با شرکتهای پستی، میتوان سفارشهای اینترنتی را با هر یک از شرکتهای پستی ارسال کرد 12 * Version: 1.0. 512 * 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. 5' );39 define( 'PODRO_VERSION', '1.0.' ); 40 40 define( 'PODRO_SLUG', 'podro-wp' ); 41 42 41 43 define( 'PODRO_NAME', 'WP PODRO' ); 42 44 define( 'PODRO_PLUGIN_ROOT', plugin_dir_path( __FILE__ ) ); -
podro-wp/trunk/README.txt
r2839027 r2846187 5 5 Tested up to: 6.1 6 6 Requires PHP: 7.2 7 Stable tag: 1.0. 57 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 64 65 61 66 = 1.0.5 - 2022-12-25 = 62 67 * Fix the cities js conflict in checkout page -
podro-wp/trunk/admin/Enqueue.php
r2839027 r2846187 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/cities.js'; 78 79 if ( function_exists( 'PWS' ) || class_exists('PWS_Core') || in_array( 'persian-woocommerce-shipping/woocommerce-shipping.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 80 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/cities.js'; 81 }else{ 82 $city_select_path = PODRO_PLUGIN_ROOT_URL . 'assets/js/only-podro-cities.js'; 83 } 84 85 86 79 87 wp_enqueue_script( 80 88 'wc-city-select', -
podro-wp/trunk/admin/views/pages/api-key-settings.php
r2835533 r2846187 2 2 $credentials_status = get_option( 'podro_plugin_status' ); 3 3 $credentials = get_option( 'podro_plugin_credentials', true ); 4 5 6 7 4 8 5 9 ?> … … 13 17 <h1><?php esc_html_e( 'تنظیمات عمومی پادرو', 'podro-wp' ) ?></h1> 14 18 <h3><?php esc_html_e( 'پیکربندی اتصال به پادرو پین', 'podro-wp' ) ?></h3> 15 <form class="wp_podro-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=' . PODRO_SLUG )); ?>"> 19 <form class="wp_podro-config-form" method="post" action="<?php echo esc_url(admin_url( '/admin.php?page=' . PODRO_SETTINGS_PAGE_SLUG )); ?>"> 20 16 21 <div class="pdo-box"> 17 22 <label for="pdo_email">ایمیل</label> … … 22 27 <input type="password" name="pdo_password" id="pdo_password" autocomplete="off"> 23 28 </div> 29 30 31 32 33 24 34 <h3><?php esc_html_e( 'تنظیمات فروشگاه', 'podro-wp' ) ?></h3> 35 36 37 38 25 39 <div class="pdo-box"> 26 40 … … 28 42 <?php 29 43 $provinces = \WP_PODRO\Engine\WooSetting::get_provinces(); 30 echo "<select aria-label='شهر' class='wc-enhanced-select' id='podro_store_ location' name='podro_store_location' style='width:325px;' >";44 echo "<select aria-label='شهر' class='wc-enhanced-select' id='podro_store_' style='width:325px;' >"; 31 45 foreach($provinces as $province){ 32 46 echo "<optgroup label='".esc_attr($province['name'])."'>"; 33 47 foreach ($province['cities'] as $key=>$city) 34 if(get_option(' woocommerce_store_city') == $key)48 if(get_option('_store_city') == $key) 35 49 echo "<option selected value='". esc_attr($key)."'>".esc_attr($city)."</option>"; 36 50 else … … 48 62 </div> 49 63 <div class="pdo-box"> 50 <a class="get-api-key" href="https://podro.com/plugin-pin/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('دریافت کلید API', 'podro-wp'); ?></a> 64 <label for="pdo_address">آدرس</label> 65 <textarea name="podro_store_address" id="podro_store_address" ><?php echo esc_attr( $store_address ?? '' ) ?></textarea> 51 66 </div> 52 <button type="submit" class="button button-primary" name="config_podro_ api_key" value="1"><?php esc_html_e( "ذخیره", 'podro-wp' ) ?></button>67 <button type="submit" class="button button-primary" name="config_podro_" value="1"><?php esc_html_e( "ذخیره", 'podro-wp' ) ?></button> 53 68 </form> 54 69 </div> -
podro-wp/trunk/assets/css/admin.css
r2835533 r2846187 1 @font-face{font-family:IRANSansX;font-style:normal;font-weight:bold;src:url("../fonts/woff/IRANSansX-bold.woff") format("woff"),url("../fonts/woff2/IRANSansX-bold.woff2") format("woff2")}@font-face{font-family:IRANSansX;font-style:normal;font-weight:normal;src:url("../fonts/woff/IRANSansX-regular.woff") format("woff"),url("../fonts/woff2/IRANSansX-regular.woff2") format("woff2")}.pod-wrap,.toplevel_page_podro-wp,.pdo-wrapper,#woocommerce-order-podro,#woocommerce-order-podro h2,.pod-wrap h1,.pod-wrap h2,.pod-wrap h3{font-family:IRANSansX}#adminmenu #toplevel_page_podro-wp>a img{width:18px}.pod-footer{background-color:#883df2;border-radius:5px;padding:15px;display:flex;align-items:center;max-width:1202px;width:calc(100% - 30px);color:#fff}.pod-footer .pod-footer-links{width:70%;float:left}.pod-footer .pod-footer-links ul{width:100%}.pod-footer .pod-footer-links ul li{display:inline-block;margin-inline-end:15px;margin-bottom:0}.pod-footer .pod-footer-links ul li a{color:#fff;opacity:.7;text-decoration:none !important}.pod-footer .pod-footer-social{width:30%;float:right}.pod-footer .pod-footer-social .footer__social-icons{float:right;width:180px;text-align:left;direction:ltr;flex-direction:row;justify-content:space-between;display:flex}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link{display:block}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link svg{width:30px;height:30px}.pdo-wrapper{max-width:1232px;width:100%}.pdo-wrapper .pdo-card{max-width:1232px;width:calc(100% - 48px);background:#fff;background-color:#fff;box-shadow:0 2px 5px rgba(0,0,0,0.05);border-radius:5px;padding:24px;margin-bottom:20px}.pdo-box{width:390px;display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.pdo-box label{display:inline-block;height:22px;cursor:pointer;font-weight:bold}.pdo-box input{width:325px;text-align:left;direction:ltr}.pdo-box .get-api-key{display:block;width:100%;text-align:right;margin-top:10px;text-decoration:none !important}pre.xdebug-var-dump{margin-left:320px}.delivery_options{display:flex;margin-bottom:10px}.delivery_options .delivery_option{display:flex;align-items:center;flex-direction:column;padding:16px 12px;margin-bottom:10px;border:solid #bcbcbc 1px;border-radius:10px;margin-right:16px;width:136px}.delivery_options .delivery_option label{text-align:center}.delivery_options .delivery_option img{max-height:28px}ul.pod-delivery-step{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:20px;margin-top:0}ul.pod-delivery-step li{display:flex;flex-direction:column;width:100%}ul.pod-delivery-step li.pod-dimension{background:#efefef;padding:10px;width:calc(100% - 20px);flex-wrap:wrap;flex-direction:row;margin-top:10px}ul.pod-delivery-step li.pod-dimension p{margin-top:0;width:100%}ul.pod-delivery-step li.pod-dimension>div{display:flex;flex-direction:column;width:33.33%}.pod-delivery-step-button{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#883df2;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-cancel{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#b1b1b1;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-step-2-wrapper{display:flex;flex-direction:column}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option{display:flex;flex-direction:row;flex-wrap:wrap;width:calc( 100% - 40px);align-items:center;margin-bottom:12px;border-radius:12px;background-color:#f3f3f3;padding:20px;border:solid 1px transparent;cursor:pointer}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option input{margin-left:10px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active:checked::before{background-color:#883df2}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_delivery_option,.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_pickup_option{display:flex;align-items:center;flex-wrap:wrap}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label img{max-width:50px;max-height:40px;margin-left:4px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label>p{flex:1 1 100%;margin:4px 0}.pod-pickup-step-3-option-wrapper,.pod-delivery-step-3-option-wrapper{display:flex;flex-wrap:wrap}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option{padding:10px;margin-inline-end:10px;margin-bottom:10px;box-shadow:0px 0px 11px -1px #893df24d;border-radius:6px;cursor:pointer}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option input{display:none}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-hide{display:none}.pod-show{display:block}.pod-flex{display:flex}.rtl .delivery_options .delivery_option label{margin:0 0 0 16px}select[name="pod_delivery_option_day"]{display:block;width:100%;margin-bottom:20px}#woocommerce-order-podro .inside{padding-top:12px}#woocommerce-order-podro #loading-circle{display:none;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:50px;height:50px;border:8px solid #f3f3f3;border-top:8px solid #893df2;border-radius:50%;animation:spin 0.6s ease-in infinite}#woocommerce-order-podro #lock-modal{display:none;background-color:#06282e9e;opacity:1;position:absolute;top:-6px;left:0;right:0;bottom:0}#woocommerce-order-podro h3,#woocommerce-order-podro h4{margin-top:0}input.pod-error,select.pod-error{border:solid 1px #ff0000}.pod_order_details{width:100%}.pod_order_details tbody tr td{padding:10px;background-color:#efefef}.pod_order_details tbody tr th{padding:2px 10px;background-color:#caa3ff}.pdo-about{font-size:18px}.rtl .pod-footer .pod-footer-social{float:left}.rtl .pod-footer .pod-footer-social .footer__social-icons{float:left}#get_order_pdf,.get_order_pdf,#pod-cancel-order,.pod-cancel-order{cursor:pointer}1 @font-face{font-family:IRANSansX;font-style:normal;font-weight:bold;src:url("../fonts/woff/IRANSansX-bold.woff") format("woff"),url("../fonts/woff2/IRANSansX-bold.woff2") format("woff2")}@font-face{font-family:IRANSansX;font-style:normal;font-weight:normal;src:url("../fonts/woff/IRANSansX-regular.woff") format("woff"),url("../fonts/woff2/IRANSansX-regular.woff2") format("woff2")}.pod-wrap,.toplevel_page_podro-wp,.pdo-wrapper,#woocommerce-order-podro,#woocommerce-order-podro h2,.pod-wrap h1,.pod-wrap h2,.pod-wrap h3{font-family:IRANSansX}#adminmenu #toplevel_page_podro-wp>a img{width:18px}.pod-footer{background-color:#883df2;border-radius:5px;padding:15px;display:flex;align-items:center;max-width:1202px;width:calc(100% - 30px);color:#fff}.pod-footer .pod-footer-links{width:70%;float:left}.pod-footer .pod-footer-links ul{width:100%}.pod-footer .pod-footer-links ul li{display:inline-block;margin-inline-end:15px;margin-bottom:0}.pod-footer .pod-footer-links ul li a{color:#fff;opacity:.7;text-decoration:none !important}.pod-footer .pod-footer-social{width:30%;float:right}.pod-footer .pod-footer-social .footer__social-icons{float:right;width:180px;text-align:left;direction:ltr;flex-direction:row;justify-content:space-between;display:flex}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link{display:block}.pod-footer .pod-footer-social .footer__social-icons .footer__social-icons__link svg{width:30px;height:30px}.pdo-wrapper{max-width:1232px;width:100%}.pdo-wrapper .pdo-card{max-width:1232px;width:calc(100% - 48px);background:#fff;background-color:#fff;box-shadow:0 2px 5px rgba(0,0,0,0.05);border-radius:5px;padding:24px;margin-bottom:20px}.pdo-box{width:390px;display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.pdo-box label{display:inline-block;height:22px;cursor:pointer;font-weight:bold}.pdo-box input{width:325px;text-align:left;direction:ltr}.pdo-box .get-api-key{display:block;width:100%;text-align:right;margin-top:10px;text-decoration:none !important}pre.xdebug-var-dump{margin-left:320px}.delivery_options{display:flex;margin-bottom:10px}.delivery_options .delivery_option{display:flex;align-items:center;flex-direction:column;padding:16px 12px;margin-bottom:10px;border:solid #bcbcbc 1px;border-radius:10px;margin-right:16px;width:136px}.delivery_options .delivery_option label{text-align:center}.delivery_options .delivery_option img{max-height:28px}ul.pod-delivery-step{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:20px;margin-top:0}ul.pod-delivery-step li{display:flex;flex-direction:column;width:100%}ul.pod-delivery-step li.pod-dimension{background:#efefef;padding:10px;width:calc(100% - 20px);flex-wrap:wrap;flex-direction:row;margin-top:10px}ul.pod-delivery-step li.pod-dimension p{margin-top:0;width:100%}ul.pod-delivery-step li.pod-dimension>div{display:flex;flex-direction:column;width:33.33%}.pod-delivery-step-button{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#883df2;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-cancel{display:flex;align-items:center;justify-content:center;margin-top:10px;margin-bottom:10px;width:100%;max-width:100%;max-height:100%;cursor:pointer;background-color:#b1b1b1;color:#fff;border:none;border-radius:5px;padding:10px;font-size:14px;font-weight:bold;text-decoration:none !important}.pod-delivery-step-2-wrapper{display:flex;flex-direction:column}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option{display:flex;flex-direction:row;flex-wrap:wrap;width:calc( 100% - 40px);align-items:center;margin-bottom:12px;border-radius:12px;background-color:#f3f3f3;padding:20px;border:solid 1px transparent;cursor:pointer}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option input{margin-left:10px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option.active:checked::before{background-color:#883df2}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_delivery_option,.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label .pod_pickup_option{display:flex;align-items:center;flex-wrap:wrap}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label img{max-width:50px;max-height:40px;margin-left:4px}.pod-delivery-step-2-wrapper .pod-delivery-step-2-option label>p{flex:1 1 100%;margin:4px 0}.pod-pickup-step-3-option-wrapper,.pod-delivery-step-3-option-wrapper{display:flex;flex-wrap:wrap}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option{padding:10px;margin-inline-end:10px;margin-bottom:10px;box-shadow:0px 0px 11px -1px #893df24d;border-radius:6px;cursor:pointer}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option input,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option input{display:none}.pod-pickup-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-pickup-step-3-option-wrapper .pod-delivery-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-pickup-step-3-option.active,.pod-delivery-step-3-option-wrapper .pod-delivery-step-3-option.active{border:solid 1px #893df2;box-shadow:0px 0px 11px -1px #893df24d}.pod-hide{display:none}.pod-show{display:block}.pod-flex{display:flex}.rtl .delivery_options .delivery_option label{margin:0 0 0 16px}select[name="pod_delivery_option_day"]{display:block;width:100%;margin-bottom:20px}#woocommerce-order-podro .inside{padding-top:12px}#woocommerce-order-podro #loading-circle{display:none;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:50px;height:50px;border:8px solid #f3f3f3;border-top:8px solid #893df2;border-radius:50%;animation:spin 0.6s ease-in infinite}#woocommerce-order-podro #lock-modal{display:none;background-color:#06282e9e;opacity:1;position:absolute;top:-6px;left:0;right:0;bottom:0}#woocommerce-order-podro h3,#woocommerce-order-podro h4{margin-top:0}input.pod-error,select.pod-error{border:solid 1px #ff0000}.pod_order_details{width:100%}.pod_order_details tbody tr td{padding:10px;background-color:#efefef}.pod_order_details tbody tr th{padding:2px 10px;background-color:#caa3ff}.pdo-about{font-size:18px}.rtl .pod-footer .pod-footer-social{float:left}.rtl .pod-footer .pod-footer-social .footer__social-icons{float:left}#get_order_pdf,.get_order_pdf,#pod-cancel-order,.pod-cancel-order{cursor:pointer} -
podro-wp/trunk/assets/js/cities.js
r2839027 r2846187 1 1 jQuery(document).ready(function(){ 2 2 3 jQuery('body').on('country_to_state_changed', function(p1,country){4 3 5 if( 'IR' == country ){ 6 // 7 jQuery('input#billing_city').replaceWith('<select id="billing_city" name="billing_city"></select>'); 8 jQuery('input#shipping_city').replaceWith('<select id="shipping_city" name="shipping_city"></select>'); 9 jQuery('select#billing_city').selectWoo(); 10 jQuery('select#shipping_city').selectWoo(); 11 getCities(); 4 const data = { 5 action:'get_podro_cities', 6 method:'post' 7 } 8 ajaxRequest(data, podro_cities_callback, null); 9 let cities = []; 10 function podro_cities_callback(response, element){ 11 cities = response; 12 13 } 14 15 jQuery('#billing_city').on('change', function(){ 16 17 if( !is_this_podro_city(cities,jQuery(this).find('option:selected').text())){ 18 jQuery("[id*='podro_method']").prop('disabled', true); 19 jQuery("[id*='podro_method']").prop('checked',false); 20 jQuery("[id*='podro_method']").removeAttr('checked'); 21 const count = jQuery(this).find('#shipping_method input[type=radio]:checked').length; 22 if(count > 0) 23 return; 24 if(!jQuery('#shipping_method input[type=radio]:checked').attr('id')) 25 jQuery("[id*='podro_method']").parent().next('li').find("input[type=radio]").prop('checked',true); 12 26 }else{ 13 jQuery('#billing_city').parent().find('.select2').remove(); 14 jQuery('#shipping_city').parent().find('.select2').remove(); 15 jQuery('#billing_city').replaceWith('<input type="text" name="billing_city" id="billing_city" class="input-text "/>'); 16 jQuery('#shipping_city').replaceWith('<input type="text" name="shipping_city" id="shipping_city" class="input-text "/>'); 27 jQuery("[id*='podro_method']").prop('disabled',false); 28 17 29 } 18 30 }); 19 31 20 function getCities(){ 21 jQuery('#billing_state, body').change(function(){ 22 const province_code = jQuery(this).val(); 23 const element = jQuery('#billing_city'); 24 if(!province_code) 32 jQuery('body').on('updated_checkout', function() { 33 if( !is_this_podro_city(cities,jQuery('#billing_city').find('option:selected').text())){ 34 35 jQuery("[id*='podro_method']").prop('disabled', true); 36 jQuery("[id*='podro_method']").prop('checked',false); 37 jQuery("[id*='podro_method']").removeAttr('checked'); 38 const count = jQuery(this).find('#shipping_method input[type=radio]:checked').length; 39 if(count > 0) 25 40 return; 26 const data = {27 action:'get_podro_cities_by_province',28 //security: wp_podro_ajax_object.security,29 province: province_code30 };31 41 32 ajaxRequest(data, callbackGetCities, element); 42 43 if(!jQuery('#shipping_method input[type=radio]:checked').attr('id')) 44 jQuery("[id*='podro_method']").parent().next('li').find("input[type=radio]").prop('checked',true); 45 }else{ 46 jQuery("[id*='podro_method']").prop('disabled',false); 47 48 49 } 50 }); 51 52 53 function is_this_podro_city(city_list, name){ 54 55 let result = false; 56 Object.keys(city_list).forEach(key => { 57 58 if( city_list[key] === name ){ 59 result = true; 60 return result; 61 } 62 33 63 34 64 }); 65 66 35 67 36 jQuery('#shipping_state, body').change(function(){37 const province_code = jQuery(this).val();38 const element = jQuery('#shipping_city');39 if(!province_code)40 return;41 const data = {42 action:'get_podro_cities_by_province',43 //security: wp_podro_ajax_object.security,44 province: province_code45 };46 47 ajaxRequest(data, callbackGetCities, element);48 });49 50 }51 68 52 69 function callbackGetCities(response, element){ … … 59 76 60 77 Object.keys(cities).forEach(function(key) { 61 console.log('Key : ' + key + ', Value : ' + cities[key]) 78 62 79 element.append(`<option value='${key}'>${cities[key]}</option>`); 63 80 -
podro-wp/trunk/inc/Api_Key.php
r2835533 r2846187 77 77 public static function set_pdo_api_key() { 78 78 79 if( ! isset( $_POST[ 'config_podro_api_key' ] ) ) { 80 return; 81 } 82 update_option('woocommerce_store_city', sanitize_text_field($_POST['podro_store_location'])); 83 $pdo_email = sanitize_email( $_POST[ 'pdo_email' ] ); 84 $pdo_password = sanitize_text_field( $_POST[ 'pdo_password' ] ); 85 if ( $pdo_email == null || $pdo_password == null || ( ! empty( $pdo_email ) && !empty( $pdo_password ) && $pdo_password === "**************" ) ) { 86 add_action( 'admin_notices', function () { 87 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 79 80 81 if( isset( $_POST[ 'config_podro_api_key' ] ) ) { 82 $pdo_email = sanitize_email( $_POST[ 'pdo_email' ] ); 83 $pdo_password = sanitize_text_field( $_POST[ 'pdo_password' ] ); 84 if ( $pdo_email == null || $pdo_password == null || ( ! empty( $pdo_email ) && !empty( $pdo_password ) && $pdo_password === "**************" ) ) { 85 add_action( 'admin_notices', function () { 86 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 88 87 <p>'. esc_html__( "لطفا موارد موردنیاز را وارد کنید.", 'podro-wp' ) .'</p> 88 89 89 </div>'); 90 } );91 return false;92 }90 } ); 91 return false; 92 } 93 93 94 if ( !$token = self::validate_api_key( $pdo_email, (new Encryption)->encrypt($pdo_password) ) ) {95 return false;96 }94 if ( !$token = self::validate_api_key( $pdo_email, (new Encryption)->encrypt($pdo_password) ) ) { 95 return false; 96 } 97 97 98 $save_settings = update_option( 'podro_api_key', (new Encryption)->encrypt($token) );98 $save_settings = update_option( 'podro_api_key', (new Encryption)->encrypt($token) ); 99 99 100 if( $save_settings ) {101 update_option( 'podro_plugin_status', 'connected');102 update_option( 'podro_plugin_credentials', [103 'email' => $pdo_email,104 'password' => (new Encryption)->encrypt($pdo_password),105 ]);100 if( $save_settings ) { 101 update_option( 'podro_plugin_status', 'connected'); 102 update_option( 'podro_plugin_credentials', [ 103 'email' => $pdo_email, 104 'password' => (new Encryption)->encrypt($pdo_password), 105 ]); 106 106 107 wp_redirect( home_url( '/wp-admin/admin.php?page=' . PODRO_SLUG ) ); 107 wp_redirect( home_url( '/wp-admin/admin.php?page=' . PODRO_SETTINGS_PAGE_SLUG ) ); 108 109 add_action( 'admin_notices', function () { 110 echo wp_kses_post('<div class="notice notice-success is-dismissible"> 111 <p>'. esc_html__( "تنظیمات ذخیره شد.", 'wp-podro' ) .'</p> 112 </div>'); 113 } ); 114 } 115 }else if( isset($_POST['config_podro_store_info']) ){ 116 117 if( empty($_POST['podro_store_name']) || empty($_POST['podro_store_address']) ){ 118 add_action( 'admin_notices', function () { 119 echo wp_kses_post('<div class="notice notice-error is-dismissible"> 120 <p>'. esc_html__( "نام فروشگاه، شهرو آدرس نمی تواند خالی باشد", 'wp-podro' ) .'</p> 121 </div>'); 122 } ); 123 return false; 124 } 125 126 update_option('podro_store_name', sanitize_text_field($_POST['podro_store_name']??'')); 127 update_option('podro_store_city', sanitize_text_field($_POST['podro_store_city']??'')); 128 update_option('podro_store_address', sanitize_text_field($_POST['podro_store_address']??'')); 129 108 130 109 131 add_action( 'admin_notices', function () { … … 111 133 <p>'. esc_html__( "تنظیمات ذخیره شد.", 'podro-wp' ) .'</p> 112 134 </div>'); 113 } 135 }); 114 136 } 137 115 138 116 139 } -
podro-wp/trunk/inc/MetaBox.php
r2839027 r2846187 136 136 $woo_setting = WooSetting::get_instance(); 137 137 138 $source_city = $woo_setting->get_store_city_code_from_options(); 138 139 139 $order_id = $order->get_id(); 140 140 $destination_city_code = $order->get_shipping_city(); 141 142 143 144 145 146 147 148 141 149 142 150 $destination_city_name = (WooSetting::get_instance())->get_cities()[$destination_city_code]; … … 144 152 if( mb_strlen($destination_address) > $this->address_length ) 145 153 $destination_address = mb_substr($destination_address, 0, $this->address_length); 146 $store_address = $woo_setting->get_store_city() . ' ' . get_option( 'woocommerce_store_address' ) . get_option( 'woocommerce_store_address_2' ); 154 155 156 $pod_source_city_code = $woo_setting->get_store_city_code_from_options(); 157 $pod_store_address = mb_substr($woo_setting->get_store_city() . ' ' . $woo_setting->get_store_address() , 0 , $this->address_length) ; 158 $pod_store_name = mb_substr( $woo_setting->get_store_name(), 0, $this->store_name_length ); 147 159 148 160 $total_weight = 0; … … 183 195 $user_billing_family = $order->get_billing_last_name(); 184 196 185 $store_name = $this->get_store_name(); 197 186 198 $customer_note = $order->get_customer_note(); 187 199 188 $option_pod_source_city = get_option('pod_source_city',false); 189 $option_pod_store_name = get_option('pod_store_name',false); 190 191 $option_pod_source_city = ( false == $option_pod_source_city ) ? $store_address : $option_pod_source_city; 192 $option_pod_store_name = ( false == $option_pod_store_name ) ? $store_name : $option_pod_store_name; 200 201 193 202 194 203 … … 198 207 <li> 199 208 <label for="pod_store_name">نام فروشگاه</label> 200 <input type="text" name="pod_store_name" id="pod_store_name" maxlength="60" value="<?php echo esc_attr($ option_pod_store_name); ?>" />209 <input type="text" name="pod_store_name" id="pod_store_name" maxlength="60" value="<?php echo esc_attr($pod_store_name); ?>" /> 201 210 </li> 202 211 <li> 203 212 <label for="pod_source_city">مبدا</label> 204 <textarea name="pod_source_city" id="pod_source_city" rows="6"><?php echo esc_attr($ option_pod_source_city); ?></textarea>205 <?php if (empty($ store_address)) echo '<p style="color:red">'. esc_html__('لطفا آدرس فروشگاه را از تنظیمات ووکامرس وارد کنید.', 'podro-wp') .'</p>' ; ?>206 <input type="hidden" id="pod_source_city_code" name="pod_source_city_code" value="<?php echo esc_attr($ source_city); ?>">213 <textarea name="pod_source_city" id="pod_source_city" rows="6"><?php echo esc_attr($); ?></textarea> 214 <?php if (empty($store_address)) echo '<p style="color:red">'. esc_html__('لطفا آدرس فروشگاه را از تنظیمات ووکامرس وارد کنید.', 'podro-wp') .'</p>' ; ?> 215 <input type="hidden" id="pod_source_city_code" name="pod_source_city_code" value="<?php echo esc_attr($); ?>"> 207 216 </li> 208 217 <li> -
podro-wp/trunk/inc/Podro_Order_Table.php
r2835533 r2846187 105 105 foreach ($orders as $order){ 106 106 107 if ( $order['status'] == 'لغو شده') { 108 $cancel_order = 'از پیش لغو شده'; 107 if ( $order['status'] == 'درحال پردازش' || 108 $order['status'] == 'ثبت اولیه' || 109 $order['status'] == 'در حال بررسی تاخیر' ) { 110 $cancel_order = '<a class="pod-cancel-order" data-order_id="' . $order['id'] . '">لغو ارسال</a>'; 109 111 } else { 110 $cancel_order = '<a class="pod-cancel-order" data-order_id="' . $order['id'] . '">لغو ارسال</a>';112 $cancel_order = ; 111 113 } 112 114 -
podro-wp/trunk/inc/Setup.php
r2839027 r2846187 17 17 * @link https://github.com/KhorshidLab/WP-Podro 18 18 */ 19 20 19 21 use WP_PODRO\Admin\Enqueue; 20 22 use WP_PODRO\Engine\API\V1\Payments; 23 21 24 22 25 class Setup { … … 85 88 * @access private 86 89 */ 90 91 92 93 94 95 96 97 98 87 99 private function load_dependencies() { 88 100 … … 91 103 $this->loader = new Loader(); 92 104 93 add_action('woocommerce_loaded', function(){ 94 95 96 // Disable Persian Woocommerce City Select 97 if ( function_exists( 'PW' ) && PW()->get_options( 'enable_iran_cities' ) != 'no' ) { 98 $settings = PW()->get_options(); 99 $settings['enable_iran_cities'] = 'no'; 100 update_option( 'PW_Options', $settings ); 101 } 102 103 // Disable Persian Woocommerce shipping City Select 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 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 ); 112 113 114 add_action( 'wp_enqueue_scripts', function() { 115 wp_dequeue_script( 'pwsCheckout' ); 116 }, 999999 ); 117 118 119 120 } 121 122 }, 21); 123 124 if ( class_exists('WC_City_Select') ) { 125 126 $WC_City_Select = new WC_City_Select; 127 128 $this->loader->add_filter( 'woocommerce_billing_fields', $WC_City_Select, 'billing_fields', 999999, 2 ); 129 $this->loader->add_filter( 'woocommerce_shipping_fields', $WC_City_Select, 'shipping_fields', 999999, 2 ); 130 $this->loader->add_filter( 'woocommerce_form_field_city', $WC_City_Select, 'form_field_city', 999999, 4 ); 131 132 } 105 106 107 add_action( 'wp_ajax_nopriv_get_podro_cities', [$this, 'podro_get_cities'] ); 108 add_action( 'wp_ajax_get_podro_cities', [$this, 'podro_get_cities'] ); 109 110 133 111 134 112 $this->loader->add_action( 'admin_init', $Api_Key, 'set_pdo_api_key' ); … … 269 247 __( 'تنظیمات', 'podro-wp' ), 270 248 'manage_options', 271 PODRO_S LUG . '-settings',249 PODRO_S, 272 250 [$this, 'settings_page'], 273 251 ); -
podro-wp/trunk/inc/WooSetting.php
r2827875 r2846187 356 356 '0006'=>'ساوه', 357 357 '0005'=>'دلیجان', 358 '0101'=>' آستارا',359 '0103'=>'بندر انزلی',358 '0101'=>'آستارا', 359 '0103'=>'بندرانزلی', 360 360 '0105'=>'رشت', 361 361 '0111'=>'لاهیجان', … … 367 367 '0206'=>'رامسر', 368 368 '0207'=>'ساری', 369 '0210'=>'قائم 369 '0210'=>'قائمشهر', 370 370 '0214'=>'نور', 371 371 '0215'=>'نوشهر', … … 392 392 '0808'=>'کرمان', 393 393 '0908'=>'سبزوار', 394 '0916'=>'مشهد ',394 '0916'=>'مشهد', 395 395 '0917'=>'نیشابور', 396 396 '1002'=>'اصفهان', 397 397 '1009'=>'شهرضا', 398 398 '1010'=>'کاشان', 399 '1018'=>'آران و بیدگل',399 '1018'=>'آران وبیدگل', 400 400 '1102'=>'چابهار', 401 401 '1105'=>'زاهدان', … … 405 405 '1401'=>'بروجن', 406 406 '1402'=>'شهرکرد', 407 '1503'=>'خرم 407 '1503'=>'خرمآباد', 408 408 '1601'=>'ایلام', 409 409 '1703'=>'گچساران', 410 '1801'=>'ب وشهر',410 '1801'=>'بوشهر', 411 411 '1810'=>'عسلویه', 412 412 '1901'=>'ابهر', … … 419 419 '2105'=>'یزد', 420 420 '2106'=>'میبد', 421 '2202'=>'بندر عباس',421 '2202'=>'بندرعباس', 422 422 '2204'=>'قشم', 423 423 '2301'=>'تهران', … … 430 430 '2705'=>'گرگان', 431 431 '2710'=>'آزادشهر', 432 '2706'=>'گنبدکاو س',432 '2706'=>'گنبدکاوس', 433 433 '2802'=>'بجنورد', 434 434 '2901'=>'بیرجند', … … 442 442 } 443 443 444 445 446 447 448 449 444 450 public function get_store_city(){ 445 451 $current_city = $this->get_store_city_code_from_options(); … … 448 454 449 455 public function get_store_city_code_from_options(){ 450 return get_option('woocommerce_store_city',0); 456 return get_option('podro_store_city',0); 457 } 458 459 public function get_store_address(){ 460 return get_option('podro_store_address', ''); 461 } 462 public function get_store_name(){ 463 return get_option('podro_store_name', ''); 451 464 } 452 465 -
podro-wp/trunk/vendor/autoload.php
r2839027 r2846187 10 10 require_once __DIR__ . '/composer/autoload_real.php'; 11 11 12 return ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d097::getLoader();12 return ComposerAutoloaderInit::getLoader(); -
podro-wp/trunk/vendor/composer/autoload_classmap.php
r2827875 r2846187 119 119 'WP_PODRO\\Engine\\API\\V1\\Routes' => $baseDir . '/inc/API/V1/Routes.php', 120 120 'WP_PODRO\\Engine\\Api_Key' => $baseDir . '/inc/Api_Key.php', 121 121 122 'WP_PODRO\\Engine\\Loader' => $baseDir . '/inc/Loader.php', 122 123 'WP_PODRO\\Engine\\Location' => $baseDir . '/inc/Location.php', -
podro-wp/trunk/vendor/composer/autoload_real.php
r2839027 r2846187 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d0975 class ComposerAutoloaderInit 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit b472f25f5c4461cfd343527deda3d097', '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 b472f25f5c4461cfd343527deda3d097', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit b472f25f5c4461cfd343527deda3d097::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
r2839027 r2846187 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit b472f25f5c4461cfd343527deda3d0977 class ComposerStaticInit 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 152 152 'WP_PODRO\\Engine\\API\\V1\\Routes' => __DIR__ . '/../..' . '/inc/API/V1/Routes.php', 153 153 'WP_PODRO\\Engine\\Api_Key' => __DIR__ . '/../..' . '/inc/Api_Key.php', 154 154 155 'WP_PODRO\\Engine\\Loader' => __DIR__ . '/../..' . '/inc/Loader.php', 155 156 'WP_PODRO\\Engine\\Location' => __DIR__ . '/../..' . '/inc/Location.php', … … 166 167 { 167 168 return \Closure::bind(function () use ($loader) { 168 $loader->prefixLengthsPsr4 = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$prefixLengthsPsr4;169 $loader->prefixDirsPsr4 = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$prefixDirsPsr4;170 $loader->classMap = ComposerStaticInit b472f25f5c4461cfd343527deda3d097::$classMap;169 $loader->prefixLengthsPsr4 = ComposerStaticInit::$prefixLengthsPsr4; 170 $loader->prefixDirsPsr4 = ComposerStaticInit::$prefixDirsPsr4; 171 $loader->classMap = ComposerStaticInit::$classMap; 171 172 172 173 }, null, ClassLoader::class); -
podro-wp/trunk/vendor/composer/installed.php
r2839027 r2846187 6 6 'install_path' => __DIR__ . '/../../', 7 7 'aliases' => array(), 8 'reference' => ' e61c7f2401dc8fba00d50b7d6356693315103128',8 'reference' => '', 9 9 'name' => 'khorshid/wp_podro', 10 10 'dev' => true, … … 35 35 'install_path' => __DIR__ . '/../../', 36 36 'aliases' => array(), 37 'reference' => ' e61c7f2401dc8fba00d50b7d6356693315103128',37 'reference' => '', 38 38 'dev_requirement' => false, 39 39 ), -
podro-wp/trunk/wp-podro.php
r2839027 r2846187 10 10 * Plugin URI: https://khorshidlab.com/ 11 11 * Description: پادروپین؛ مارکتپلیس خدمات پستی است و به فروشگاههای آنلاین کمک میکند تا فرآیند ارسال سفارشهای اینترنتی را مدیریت کنند. در پادروپین، بدون مراجعه و یا ثبت قرارداد با شرکتهای پستی، میتوان سفارشهای اینترنتی را با هر یک از شرکتهای پستی ارسال کرد 12 * Version: 1.0. 512 * 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. 5' );39 define( 'PODRO_VERSION', '1.0.' ); 40 40 define( 'PODRO_SLUG', 'podro-wp' ); 41 42 41 43 define( 'PODRO_NAME', 'WP PODRO' ); 42 44 define( 'PODRO_PLUGIN_ROOT', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.