Changeset 3034808
- Timestamp:
- 02/12/2024 08:49:45 PM (14 months ago)
- Location:
- integration-of-pathao-for-woocommerce/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
integration-of-pathao-for-woocommerce/trunk/assets/js/admin.js
r2985736 r3034808 127 127 const zone = $('#pathao_zone').val(); 128 128 const area = $('#pathao_area').val(); 129 const item_description = $('#pathao_item_description').val(); 129 130 const special_instruction = $('#pathao_special_instruction').val(); 130 131 const amount = parseFloat($('#pathao_amount').val()); … … 249 250 area: area, 250 251 special_instruction: special_instruction, 252 item_description: item_description, 251 253 item_weight: item_weight, 252 254 item_type: item_type, … … 254 256 }, 255 257 success: function (res) { 256 $('#pathao_submit_shipping').prop('disabled', false);257 $('.pathao-shipping-spinner').removeClass('is-active');258 258 if (res.success) { 259 259 $.toast({ … … 267 267 }, 3000); 268 268 } else { 269 $('#pathao_submit_shipping').prop('disabled', false); 270 $('.pathao-shipping-spinner').removeClass('is-active'); 269 271 const errors = res.errors; 270 272 $.each(errors, function (key, value) { … … 279 281 }, 280 282 error: function (error) { 283 $('#pathao_submit_shipping').prop('disabled', false); 284 $('.pathao-shipping-spinner').removeClass('is-active'); 281 285 console.log(error); 282 286 }, -
integration-of-pathao-for-woocommerce/trunk/includes/Admin/Order.php
r3013075 r3034808 112 112 $cities = $cities && 'success' === $cities->type ? $cities->data->data : array(); 113 113 114 $amount = $order-> get_total();114 $amount = $order->has_status( 'paid' ) ? 0 : $order->get_total(); 115 115 116 116 $total_weight = 0; -
integration-of-pathao-for-woocommerce/trunk/includes/Admin/views/pathao-shipping.php
r3013075 r3034808 49 49 <p class="form-field"> 50 50 <label for="pathao_amount"><b>Amount to Collect</b></label> 51 <input type="text" value="<?php echo esc_html( $amount ); ?>" id="pathao_amount" name="pathao_amount" /> 51 <input type="text" value="<?php echo esc_html( round( $amount ) ); ?>" id="pathao_amount" name="pathao_amount" /> 52 </p> 53 <p class="form-field"> 54 <label for="pathao_item_description"><b>Item Description</b></label> 55 <textarea style="width: 100%;" id="pathao_item_description" name="pathao_item_description"></textarea> 52 56 </p> 53 57 <p class="form-field"> -
integration-of-pathao-for-woocommerce/trunk/includes/Ajax.php
r3013075 r3034808 119 119 */ 120 120 public function send_order_to_pathao() { 121 if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'pathao_send_order' ) && isset( $_POST['order_id'] ) && isset( $_POST['city'] ) && isset( $_POST['zone'] ) && isset( $_POST['area'] ) && isset( $_POST['special_instruction'] ) && isset( $_POST['delivery_type'] ) && isset( $_POST['item_type'] ) && isset( $_POST['amount'] ) && isset( $_POST['item_weight'] ) ) {121 if ( isset( $_POST['nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'pathao_send_order' ) && isset( $_POST['order_id'] ) && isset( $_POST['city'] ) && isset( $_POST['zone'] ) && isset( $_POST['area'] ) && isset( $_POST['special_instruction'], $_POST['item_description'] ) && isset( $_POST['delivery_type'] ) && isset( $_POST['item_type'] ) && isset( $_POST['amount'] ) && isset( $_POST['item_weight'] ) ) { 122 122 $order_id = sanitize_text_field( wp_unslash( $_POST['order_id'] ) ); 123 123 $store = sdevs_pathao_store_id(); … … 125 125 $zone = sanitize_text_field( wp_unslash( $_POST['zone'] ) ); 126 126 $area = sanitize_text_field( wp_unslash( $_POST['area'] ) ); 127 $item_description = trim( sanitize_text_field( wp_unslash( $_POST['item_description'] ) ) ); 127 128 $special_instruction = trim( sanitize_text_field( wp_unslash( $_POST['special_instruction'] ) ) ); 128 129 $delivery_type = sanitize_text_field( wp_unslash( $_POST['delivery_type'] ) ); … … 131 132 $item_weight = sanitize_text_field( wp_unslash( $_POST['item_weight'] ) ); 132 133 133 $res = $this->send_order( $order_id, $store, $city, $zone, $area, $special_instruction, $ delivery_type, $item_type, $amount, $item_weight );134 $res = $this->send_order( $order_id, $store, $city, $zone, $area, $special_instruction, $item_description, $delivery_type, $item_type, $amount, $item_weight ); 134 135 135 136 if ( 'error' === $res->type ) { … … 177 178 * @param string|int $area Area Id. 178 179 * @param string $special_instruction instructions. 180 * @param string $item_description item instructions. 179 181 * @param string $delivery_type Normal or On-Demand. 180 182 * @param string $item_type document or parcel. … … 184 186 * @return mixed 185 187 */ 186 public function send_order( $order_id, $store, $city, $zone, $area, $special_instruction, $ delivery_type, $item_type, $amount, $item_weight ) {188 public function send_order( $order_id, $store, $city, $zone, $area, $special_instruction, $item_description, $delivery_type, $item_type, $amount, $item_weight ) { 187 189 $base_url = sdevs_pathao_base_url(); 188 190 $access_token = get_option( 'pathao_access_token' ); … … 214 216 'item_type' => $item_type, 215 217 'special_instruction' => $special_instruction, 218 'item_description' => $item_description, 216 219 'item_quantity' => $order->get_item_count(), 217 220 'item_weight' => $item_weight, -
integration-of-pathao-for-woocommerce/trunk/includes/Assets.php
r2985736 r3034808 1 1 <?php 2 3 2 /** 4 3 * Scripts and Styles Class. … … 12 11 * Scripts and Styles Class 13 12 */ 14 class Assets 15 { 13 class Assets { 16 14 17 /** 18 * Assets constructor. 19 * 20 * @since 1.0.0 21 * 22 * @return void 23 */ 24 public function __construct() 25 { 26 if (is_admin()) { 27 add_action('admin_enqueue_scripts', [$this, 'register'], 5); 28 } else { 29 add_action('wp_enqueue_scripts', [$this, 'register'], 5); 30 } 31 } 15 /** 16 * Assets constructor. 17 * 18 * @since 1.0.0 19 * 20 * @return void 21 */ 22 public function __construct() { 23 if ( is_admin() ) { 24 add_action( 'admin_enqueue_scripts', array( $this, 'register' ), 5 ); 25 } else { 26 add_action( 'wp_enqueue_scripts', array( $this, 'register' ), 5 ); 27 } 28 } 32 29 33 /** 34 * Register our app scripts and styles 35 * 36 * @since 1.0.0 37 * 38 * @return void 39 */ 40 public function register() 41 { 42 $this->register_scripts($this->get_scripts()); 43 $this->register_styles($this->get_styles()); 44 } 30 /** 31 * Register our app scripts and styles 32 * 33 * @since 1.0.0 34 * 35 * @return void 36 */ 37 public function register() { 38 $this->register_scripts( $this->get_scripts() ); 39 $this->register_styles( $this->get_styles() ); 40 } 45 41 46 /** 47 * Register scripts 48 * 49 * @param array $scripts 50 * 51 * @since 1.0.0 52 * 53 * @return void 54 */ 55 private function register_scripts($scripts) 56 { 57 foreach ($scripts as $handle => $script) { 58 $deps = $script['deps'] ?? false; 59 $in_footer = $script['in_footer'] ?? false; 60 $version = $script['version'] ?? SDEVS_PATHAO_VERSION; 42 /** 43 * Register scripts 44 * 45 * @param array $scripts 46 * 47 * @since 1.0.0 48 * 49 * @return void 50 */ 51 private function register_scripts( $scripts ) { 52 foreach ( $scripts as $handle => $script ) { 53 $deps = $script['deps'] ?? false; 54 $in_footer = $script['in_footer'] ?? false; 55 $version = $script['version'] ?? SDEVS_PATHAO_VERSION; 61 56 62 wp_register_script($handle, $script['src'], $deps, $version, $in_footer);63 64 57 wp_register_script( $handle, $script['src'], $deps, $version, $in_footer ); 58 } 59 } 65 60 66 /** 67 * Register styles 68 * 69 * @param array $styles 70 * 71 * @since 1.0.0 72 * 73 * @return void 74 */ 75 public function register_styles($styles) 76 { 77 foreach ($styles as $handle => $style) { 78 $deps = $style['deps'] ?? false; 61 /** 62 * Register styles 63 * 64 * @param array $styles 65 * 66 * @since 1.0.0 67 * 68 * @return void 69 */ 70 public function register_styles( $styles ) { 71 foreach ( $styles as $handle => $style ) { 72 $deps = $style['deps'] ?? false; 79 73 80 wp_register_style($handle, $style['src'], $deps, SDEVS_PATHAO_VERSION);81 82 74 wp_register_style( $handle, $style['src'], $deps, SDEVS_PATHAO_VERSION ); 75 } 76 } 83 77 84 /** 85 * Get all registered scripts 86 * 87 * @since 1.0.0 88 * 89 * @return array 90 */ 91 public function get_scripts() 92 { 93 $plugin_js_assets_path = SDEVS_PATHAO_ASSETS . '/js/'; 78 /** 79 * Get all registered scripts 80 * 81 * @since 1.0.0 82 * 83 * @return array 84 */ 85 public function get_scripts() { 86 $plugin_js_assets_path = SDEVS_PATHAO_ASSETS . '/js/'; 94 87 95 $scripts = [ 96 97 'src'=> $plugin_js_assets_path . 'jquery.toast.min.js',98 'deps' => array('jquery'),99 'in_footer' => true 100 101 102 'src'=> $plugin_js_assets_path . 'admin.js',103 'deps' => array('jquery', 'pathao_toast_script'),104 'in_footer' => true 105 ) 106 ];88 $scripts = array( 89 'pathao_toast_script' => array( 90 'src' => $plugin_js_assets_path . 'jquery.toast.min.js', 91 'deps' => array( 'jquery' ), 92 'in_footer' => true, 93 ), 94 'pathao_admin_script' => array( 95 'src' => $plugin_js_assets_path . 'admin.js', 96 'deps' => array( 'jquery', 'pathao_toast_script' ), 97 'in_footer' => true, 98 ), 99 ); 107 100 108 109 101 return $scripts; 102 } 110 103 111 /** 112 * Get registered styles 113 * 114 * @since 1.0.0 115 * 116 * @return array 117 */ 118 public function get_styles() 119 { 120 $plugin_css_assets_path = SDEVS_PATHAO_ASSETS . '/css/'; 104 /** 105 * Get registered styles 106 * 107 * @since 1.0.0 108 * 109 * @return array 110 */ 111 public function get_styles() { 112 $plugin_css_assets_path = SDEVS_PATHAO_ASSETS . '/css/'; 121 113 122 $styles = [ 123 "pathao_toast_styles" => [ 124 125 ] 126 ];114 $styles = array( 115 'pathao_toast_styles' => array( 116 'src' => $plugin_css_assets_path . 'jquery.toast.min.css', 117 ), 118 ); 127 119 128 129 120 return $styles; 121 } 130 122 } -
integration-of-pathao-for-woocommerce/trunk/integration-of-pathao-for-wc.php
r3013075 r3034808 4 4 * Plugin URI: https://springdevs.com/plugin/pathao 5 5 * Description: Pathao integration for WooCommerce 6 * Version: 1.0. 56 * Version: 1.0.6 7 7 * Author: SpringDevs 8 8 * Author URI: https://springdevs.com … … 62 62 * @since 1.0.0 63 63 */ 64 const VERSION = '1.0. 5';64 const VERSION = '1.0.6'; 65 65 66 66 /** -
integration-of-pathao-for-woocommerce/trunk/readme.txt
r3013075 r3034808 5 5 Requires at least: 4.0 6 6 Tested up to: 6.4 7 Stable tag: 1.0. 57 Stable tag: 1.0.6 8 8 Requires PHP: 7.0 9 9 License: GPLv2 or later … … 20 20 21 21 22 ## 👉👉Features22 ## Features 23 23 24 ### 💠Free ðŸ’24 ### Free 25 25 26 26 1. Sent order to Pathao 27 27 2. Track pathao order status from woocommerce order page 28 28 29 ### 🔥🔥 Premium 🔥🔥29 ### Premium 30 30 31 31 Explore our [Premium Version here](https://springdevs.com/plugin/pathao). … … 38 38 6. More Customizable. 39 39 40 ## 👉👉Why should you choose us?40 ## Why should you choose us? 41 41 1. Easy and simple installation process 42 42 2. Fully automatic delivery charge calculation … … 73 73 == Changelog == 74 74 75 = 1.0.6 = 76 77 * Item description field added. 78 75 79 = 1.0.5 = 76 80 -
integration-of-pathao-for-woocommerce/trunk/vendor/composer/installed.php
r3013075 r3034808 4 4 'pretty_version' => 'dev-next', 5 5 'version' => 'dev-next', 6 'reference' => '5 92ef33e09c502c499a127c391f1f62d01b62582',6 'reference' => '5dd2a3bc1b58cfb2662b9f86ea23e06ac65b11e5', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-next', 15 15 'version' => 'dev-next', 16 'reference' => '5 92ef33e09c502c499a127c391f1f62d01b62582',16 'reference' => '5dd2a3bc1b58cfb2662b9f86ea23e06ac65b11e5', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.