Plugin Directory

Changeset 2982442


Ignore:
Timestamp:
10/23/2023 07:22:02 AM (2 years ago)
Author:
ascendedcrow
Message:

Version = 1.0.28.1 =

Location:
shop-2-api/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • shop-2-api/trunk/assets/bol2api_category_mapping_scripts.js

    r2832543 r2982442  
    88        // Add click and change events
    99        $('tr').on('click', 'td select', handle_wc_cat_click).on('change', 'td select', handle_bol_cat_change);
     10        $('tr').on('click', 'td input', handle_bol_txt_change).on('change', 'td input', handle_bol_txt_change);
    1011
    1112        // Save Data
     
    2425    }
    2526
     27    function handle_bol_txt_change() {
     28        update_cost_values(this);
     29    }
     30
    2631    // Handle Bol Category change
    2732    function handle_bol_cat_change() {
     33        $(this).attr("data-old_value", $(this).val());
    2834        update_saved_bol_category_data(this);
    2935    }
     
    8995    }
    9096
     97    function update_cost_values(item_changed) {
     98        // Add commission and shipping
     99        let table_row = $(item_changed).parents('tr');
     100        let bol_cat_id = table_row.find('select').val();
     101        if (bol_cat_id !== "") {
     102            let bol_commission_amount = table_row.find('.bol_commission input').val();
     103            let bol_shipping_cost = table_row.find('.bol_shipping_cost  input').val();
     104            saved_bol_category_data[bol_cat_id]['bol_commission'] = bol_commission_amount;
     105            saved_bol_category_data[bol_cat_id]['bol_shipping'] = bol_shipping_cost;
     106        }
     107    }
     108
    91109    function update_saved_bol_category_data(dropdown_changed) {
    92110        let prev_bol_cat_id = String($(dropdown_changed).data('old_value'));
     
    124142            }
    125143        }
    126 
    127         // Add commission and shipping
    128         if (new_bol_cat_id !== "") {
    129             let table_row = $(dropdown_changed).parents('tr');
    130             let bol_commission_amount = table_row.find('.bol_commission input').val();
    131             let bol_shipping_cost = table_row.find('.bol_shipping_cost  input').val();
    132             saved_bol_category_data[new_bol_cat_id]['bol_commission'] = bol_commission_amount;
    133             saved_bol_category_data[new_bol_cat_id]['bol_shipping'] = bol_shipping_cost;
    134         }
     144        update_cost_values(dropdown_changed);
    135145
    136146        if (Object.keys(saved_bol_category_data).includes(prev_bol_cat_id)) {
  • shop-2-api/trunk/assets/shop2api_order.js

    r2905836 r2982442  
    113113            $('#orders-stock-sync').prop('checked', order_data.sync_stock);
    114114            $('#orders-email').val(order_data.order_email);
     115            $('#orders-alert-email').val(order_data.alert_email);
     116            $('#orders-alert-on-order-fail').prop('checked', order_data.alert_on_order_fail);
    115117
    116118            document.getElementById("orders-ean").value = order_data.woocommerce_ean_category;
  • shop-2-api/trunk/includes/Api/Shop2ApiConnect.php

    r2979697 r2982442  
    488488    public function set_order_data(
    489489        $active, $status, $paid, $woocommerce_ean_field, $woocommerce_ean_category, $combideal_active,
    490         $combideal_ean_field, $combideal_ean_category, $order_email, $use_bol_price, $stock_sync
     490        $combideal_ean_field, $combideal_ean_category, $order_email, $use_bol_price, $stock_sync, $alert_on_order_fail,
     491        $alert_email
    491492    )
    492493    {
     
    516517            "use_bol_price" => ($use_bol_price != ''),
    517518            "sync_stock" => ($stock_sync != ''),
     519            "alert_on_order_fail" => ($alert_on_order_fail != ''),
     520            "alert_email" => $alert_email,
    518521        ];
    519522
  • shop-2-api/trunk/includes/Base/AjaxButtonActions.php

    r2962006 r2982442  
    337337            $_POST['orders-ean'], $_POST['orders-combideals-active'], $_POST['orders-combideal-ean-value'],
    338338            $_POST['orders-combideal-ean'], $_POST['orders-email'], $_POST['orders-use-bol-price'],
    339             $_POST['orders-stock-sync']
     339            $_POST['orders-stock-sync'], $_POST['orders-alert-on-order-fail'], $_POST['orders-alert-email']
    340340        );
    341341
  • shop-2-api/trunk/includes/Base/Enqueue.php

    r2979381 r2982442  
    131131            $message = json_decode(wp_remote_retrieve_body($response), true);
    132132            if ($message != '') {
    133                 echo wp_kses('<div class="notice notice-warning is-dismissible"><p>' . $message . '</p></div>', $allowed_html);
     133                echo wp_kses('<div class="notice notice-warning is-dismissible" id="shop2api-user-message"><p>' . $message . '</p></div>', $allowed_html);
    134134            }
    135135        }
  • shop-2-api/trunk/includes/Base/EnqueueWC.php

    r2975851 r2982442  
    4747        // Add Bol Order Id in the Order List
    4848        add_filter( 'manage_edit-shop_order_columns', array($this, 'add_custom_metadata_column_to_order_list' ));
     49        add_filter( 'woocommerce_shop_order_search_fields', array($this, 'make_order_id_searchable' ));
    4950        add_action( 'manage_shop_order_posts_custom_column',  array($this, 'display_custom_metadata_column_value'), 10, 2 );
    5051
     
    5253        add_action( 'woocommerce_order_status_changed',  array($this,'woocommerce_send_order'), 10, 3 );
    5354    }
     55
     56    // Make searchable
     57    function make_order_id_searchable( $meta_keys ) {
     58        $meta_keys[] = 'bol_order_id';
     59        return $meta_keys;
     60    }
     61
    5462    /**
    5563     * Custom function to be executed when order status changes
  • shop-2-api/trunk/includes/Tables/WcCategorySelection.php

    r2979697 r2982442  
    131131                    }
    132132                }
     133//                return var_dump($data);
    133134                return wp_kses('<input type="number" value="'.esc_attr($val).'" class="wc-category-table-fields"/> &euro;', $this->allowed_html);
    134135            case 'bol_commission':
  • shop-2-api/trunk/readme.txt

    r2979697 r2982442  
    33Plugin URI: https://wordpress.org/plugins/shop-2-api/
    44Tags: WooCommerce, Bol
    5 Stable Tag: 1.0.27.2
     5Stable Tag: 1.0.28.1
    66Requires at least: 5.0
    77Requires PHP: 7.2
     
    1541545) Fix bug which can cause a php error.
    155155
     156= 1.0.28 =
     1571) Added Order Id For Searching
     1582) Fix bug with category mapping
     1593) Dashboard Changes
     1604) Added Alert on Order Failing Option
     161
     162
    156163== Instructions ==
    1571641) After installing Shop2Api, a new menu item will be available in your WordPress installation, you can continue and click on it and enter your e-mail address.
  • shop-2-api/trunk/shop-2-api.php

    r2979697 r2982442  
    55Plugin URI: https://wordpress.org/plugins/shop-2-api/
    66Description: The plugin Shop2Api will sync products between e-Commerce platforms. The current supported e-Commerce platforms are WooCommerce to Bol.com, and we are working on Amazon, Shopify and others.  We added a koopblok service so that you can check if you lower your price can you get koopblok.
    7 Version: 1.0.27.2
     7Version: 1.0.28.1
    88Requires at least: 5.0
    99Requires PHP:      7.2
     
    3434define('SHOP2API_PLUGIN_URL', plugin_dir_url( __FILE__ ));
    3535define('SHOP2API_PLUGIN', plugin_basename( __FILE__ ));
    36 define ('VERSION', '1.0.27.2');
     36define ('VERSION', '1.0.28.1');
    3737
    3838// Register items in the project.
  • shop-2-api/trunk/templates/bol-order-sync.php

    r2905836 r2982442  
    133133                </td>
    134134            </tr>
     135            <tr>
     136                <td title="If there is a failure on the order is will send an e-mail with the detail of the order." style="padding: 15px 0px 0px 0px;">
     137                    <span class="dashicons dashicons-info-outline"></span>
     138                </td>
     139                <td>
     140                    <label for="orders-active">Alert on Order Failing</label>
     141                </td>
     142                <td>
     143                    <input type="checkbox" name="orders-alert-on-order-fail" id="orders-alert-on-order-fail"/>
     144                    <span id="stock-sync" class="error-message"></span>
     145                </td>
     146                <td></td>
     147            </tr>
     148            <tr>
     149                <td title="The E-Mail that that will be used when sending order alerts" style="padding: 15px 0px 0px 0px;">
     150                    <span class="dashicons dashicons-info-outline"></span>
     151                </td>
     152                <td>
     153                    <label for="orders-email">Order Alert E-Mail</label>
     154                </td>
     155                <td>
     156                    <input name="orders-alert-email" id="orders-alert-email" type="email"/>
     157                    <span id="orders-alert-email" class="error-message"></span>
     158                </td>
     159            </tr>
    135160            </tbody>
    136161        </table>
  • shop-2-api/trunk/templates/dashboard.php

    r2975851 r2982442  
    106106
    107107            <div class="card inline" id='get-started-card-completed'>
     108                <h1 style="font-weight: bold;"><?php echo $offer_product_heading; ?></h1>
    108109                <div id="connection-completed" class="tooltip">
    109110                    <span class="tooltiptext tooltip-right"><?php echo $reconnect; ?></span>
     
    140141            </div>
    141142
     143            <div class="card inline" id='order-card'>
     144                <h1 style="font-weight: bold;"><?php echo $order_card_heading ; ?></h1>
     145                <div id="map-wc-fields-to-bol" class="tooltip">
     146                    <span class="tooltiptext tooltip-right">
     147                        <?php echo $order_card_enabled_tooltip; ?>
     148                    </span>
     149                    <a href='<?php echo admin_url('admin'); ?>.php?page=shop2api_bol_order_service'>
     150                        <h3>
     151                            <span class="dashicons dashicons-yes-alt item-completed list-icons"></span>
     152                            <?php echo $order_card_active ?> <span
     153                                    style="color: #008CBA"><?php echo $click_here; ?></span>
     154                        </h3>
     155                    </a>
     156                </div>
     157            </div>
     158
    142159            <div class="card inline" id='sync-summary-product-card'>
    143160                <h1>
  • shop-2-api/trunk/translation/shop2api_dashboard.php

    r2975851 r2982442  
    3232$sync_summary_order = wp_kses(__("Sync Summary Orders"), $allowed_html);
    3333$orders_synced = wp_kses(__("Orders Synced"), $allowed_html);
     34$offer_product_heading = wp_kses(__("Sync Products/Offers"), $allowed_html);
     35$order_card_heading = wp_kses(__("Sync Orders/Stock"), $allowed_html);
     36$order_card_enabled_tooltip = wp_kses(__("Enable this to sync orders or stock"), $allowed_html);
     37$order_card_active = wp_kses(__("Enable Order Sync"), $allowed_html);
Note: See TracChangeset for help on using the changeset viewer.