Plugin Directory

Changeset 3034808


Ignore:
Timestamp:
02/12/2024 08:49:45 PM (14 months ago)
Author:
ok9xnirab
Message:

v1.0.6 released.

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  
    127127        const zone = $('#pathao_zone').val();
    128128        const area = $('#pathao_area').val();
     129        const item_description = $('#pathao_item_description').val();
    129130        const special_instruction = $('#pathao_special_instruction').val();
    130131        const amount = parseFloat($('#pathao_amount').val());
     
    249250                area: area,
    250251                special_instruction: special_instruction,
     252                item_description: item_description,
    251253                item_weight: item_weight,
    252254                item_type: item_type,
     
    254256            },
    255257            success: function (res) {
    256                 $('#pathao_submit_shipping').prop('disabled', false);
    257                 $('.pathao-shipping-spinner').removeClass('is-active');
    258258                if (res.success) {
    259259                    $.toast({
     
    267267                    }, 3000);
    268268                } else {
     269                    $('#pathao_submit_shipping').prop('disabled', false);
     270                    $('.pathao-shipping-spinner').removeClass('is-active');
    269271                    const errors = res.errors;
    270272                    $.each(errors, function (key, value) {
     
    279281            },
    280282            error: function (error) {
     283                $('#pathao_submit_shipping').prop('disabled', false);
     284                $('.pathao-shipping-spinner').removeClass('is-active');
    281285                console.log(error);
    282286            },
  • integration-of-pathao-for-woocommerce/trunk/includes/Admin/Order.php

    r3013075 r3034808  
    112112        $cities = $cities && 'success' === $cities->type ? $cities->data->data : array();
    113113
    114         $amount = $order->get_total();
     114        $amount = $order->has_status( 'paid' ) ? 0 : $order->get_total();
    115115
    116116        $total_weight = 0;
  • integration-of-pathao-for-woocommerce/trunk/includes/Admin/views/pathao-shipping.php

    r3013075 r3034808  
    4949    <p class="form-field">
    5050        <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>
    5256    </p>
    5357    <p class="form-field">
  • integration-of-pathao-for-woocommerce/trunk/includes/Ajax.php

    r3013075 r3034808  
    119119     */
    120120    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'] ) ) {
    122122            $order_id            = sanitize_text_field( wp_unslash( $_POST['order_id'] ) );
    123123            $store               = sdevs_pathao_store_id();
     
    125125            $zone                = sanitize_text_field( wp_unslash( $_POST['zone'] ) );
    126126            $area                = sanitize_text_field( wp_unslash( $_POST['area'] ) );
     127            $item_description    = trim( sanitize_text_field( wp_unslash( $_POST['item_description'] ) ) );
    127128            $special_instruction = trim( sanitize_text_field( wp_unslash( $_POST['special_instruction'] ) ) );
    128129            $delivery_type       = sanitize_text_field( wp_unslash( $_POST['delivery_type'] ) );
     
    131132            $item_weight         = sanitize_text_field( wp_unslash( $_POST['item_weight'] ) );
    132133
    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 );
    134135
    135136            if ( 'error' === $res->type ) {
     
    177178     * @param string|int $area Area Id.
    178179     * @param string     $special_instruction instructions.
     180     * @param string     $item_description item instructions.
    179181     * @param string     $delivery_type Normal or On-Demand.
    180182     * @param string     $item_type document or parcel.
     
    184186     * @return mixed
    185187     */
    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 ) {
    187189        $base_url     = sdevs_pathao_base_url();
    188190        $access_token = get_option( 'pathao_access_token' );
     
    214216            'item_type'           => $item_type,
    215217            'special_instruction' => $special_instruction,
     218            'item_description'    => $item_description,
    216219            'item_quantity'       => $order->get_item_count(),
    217220            'item_weight'         => $item_weight,
  • integration-of-pathao-for-woocommerce/trunk/includes/Assets.php

    r2985736 r3034808  
    11<?php
    2 
    32/**
    43 * Scripts and Styles Class.
     
    1211 * Scripts and Styles Class
    1312 */
    14 class Assets
    15 {
     13class Assets {
    1614
    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    }
    3229
    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    }
    4541
    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;
    6156
    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    }
    6560
    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;
    7973
    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    }
    8377
    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/';
    9487
    95         $scripts = [
    96             'pathao_toast_script' => array(
    97                 'src' => $plugin_js_assets_path . 'jquery.toast.min.js',
    98                 'deps' => array('jquery'),
    99                 'in_footer' => true
    100             ),
    101             'pathao_admin_script' => array(
    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        );
    107100
    108         return $scripts;
    109     }
     101        return $scripts;
     102    }
    110103
    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/';
    121113
    122         $styles = [
    123             "pathao_toast_styles" => [
    124                 'src' => $plugin_css_assets_path . 'jquery.toast.min.css',
    125             ]
    126         ];
     114        $styles = array(
     115            'pathao_toast_styles' => array(
     116                'src' => $plugin_css_assets_path . 'jquery.toast.min.css',
     117            ),
     118        );
    127119
    128         return $styles;
    129     }
     120        return $styles;
     121    }
    130122}
  • integration-of-pathao-for-woocommerce/trunk/integration-of-pathao-for-wc.php

    r3013075 r3034808  
    44 * Plugin URI: https://springdevs.com/plugin/pathao
    55 * Description: Pathao integration for WooCommerce
    6  * Version: 1.0.5
     6 * Version: 1.0.6
    77 * Author: SpringDevs
    88 * Author URI: https://springdevs.com
     
    6262     * @since 1.0.0
    6363     */
    64     const VERSION = '1.0.5';
     64    const VERSION = '1.0.6';
    6565
    6666    /**
  • integration-of-pathao-for-woocommerce/trunk/readme.txt

    r3013075 r3034808  
    55Requires at least: 4.0 
    66Tested up to: 6.4 
    7 Stable tag: 1.0.5
     7Stable tag: 1.0.6
    88Requires PHP: 7.0 
    99License: GPLv2 or later 
     
    2020
    2121
    22 ## 👉👉 Features
     22## Features
    2323
    24 ### 💝 Free 💝
     24### Free
    2525
    26261.  Sent order to Pathao
    27272.  Track pathao order status from woocommerce order page
    2828
    29 ### 🔥🔥 Premium 🔥🔥
     29### Premium
    3030
    3131Explore our [Premium Version here](https://springdevs.com/plugin/pathao).
     
    38386.  More Customizable.
    3939
    40 ## 👉👉 Why should you choose us?
     40## Why should you choose us?
    41411. Easy and simple installation process
    42422. Fully automatic delivery charge calculation
     
    7373== Changelog ==
    7474
     75 = 1.0.6 =
     76
     77*   Item description field added.
     78
    7579 = 1.0.5 =
    7680
  • integration-of-pathao-for-woocommerce/trunk/vendor/composer/installed.php

    r3013075 r3034808  
    44        'pretty_version' => 'dev-next',
    55        'version' => 'dev-next',
    6         'reference' => '592ef33e09c502c499a127c391f1f62d01b62582',
     6        'reference' => '5dd2a3bc1b58cfb2662b9f86ea23e06ac65b11e5',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-next',
    1515            'version' => 'dev-next',
    16             'reference' => '592ef33e09c502c499a127c391f1f62d01b62582',
     16            'reference' => '5dd2a3bc1b58cfb2662b9f86ea23e06ac65b11e5',
    1717            'type' => 'wordpress-plugin',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.