Plugin Directory

Changeset 3055588


Ignore:
Timestamp:
03/20/2024 07:36:18 PM (2 years ago)
Author:
ascendedcrow
Message:

1.0.31: Added Sync Dropdown and Sync products Button.

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

Legend:

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

    r2825412 r3055588  
    22    $( document ).ready( function() {
    33        $( '#sync-wc-product' ).on( 'click', sync_woocommerce_to_bol);
     4        $( '#refresh-dropdowns' ).on( 'click', refresh_dropdown);
    45        $( '.shop-2-api-connect-save-sync' ).on( 'click', sync_woocommerce_to_bol);
    56        $('.content').show("slow");
     
    3031            }
    3132        });
    32     };
     33    }
     34
     35    function refresh_dropdown() {
     36        let data = {
     37            'action' : 'refresh_wc_dropdowns',
     38            'nonce'  : settings.nonce
     39        };
     40
     41        $.post( settings.ajaxurl, data, function( response ) {
     42            if ( response.success === true ) {
     43                alert('Dropdowns should be refreshed.')
     44            } else {
     45                alert("There was an error retrieving the data:" + response.data);
     46            }
     47        });
     48    }
    3349})( jQuery );
  • shop-2-api/trunk/includes/Api/Shop2ApiConnect.php

    r3034619 r3055588  
    352352        return wp_remote_post(
    353353            $this->shop_2_api_url . '/woocommerce/start_product_sync/',
     354            [
     355                'headers' => $this->header
     356            ]
     357        );
     358    }
     359    public function refresh_wc_dropdowns()
     360    {
     361        return wp_remote_post(
     362            $this->shop_2_api_url . '/woocommerce/refresh-dropdowns/',
    354363            [
    355364                'headers' => $this->header
  • shop-2-api/trunk/includes/Base/AjaxButtonActions.php

    r3034619 r3055588  
    5252        // Sync Woocommerce to Bol (sync_woocommerce_to_bol)
    5353        add_action('wp_ajax_sync_woocommerce_to_bol', array($this, 'sync_woocommerce_to_bol'));
     54
     55        // Refresh WooCommerce Dropdowns
     56        add_action('wp_ajax_refresh_wc_dropdowns', array($this, 'refresh_wc_dropdowns'));
    5457
    5558        // Register a free account on shop2api
     
    295298    }
    296299
     300    public function refresh_wc_dropdowns(): void
     301    {
     302        $shop_2_api_response = $this->shop_2_api_connections->refresh_wc_dropdowns();
     303        $this->handle_api_response($shop_2_api_response);
     304    }
     305
    297306    public function get_bol_connection_report(): void
    298307    {
  • shop-2-api/trunk/includes/Tables/Bol2WcOrderReport.php

    r2825412 r3055588  
    7979                if ($item['status'] == 'ERROR') {
    8080                    $last_html .= '<i data-reference="'.$item['reference'].'" id="order-report-icon-stop"  class = "material-icons order-report-icon-stop" style="font-size: 22px; cursor:pointer;" title="Do Not Sync (Remove from dashboard)">stop</i>';
    81                     $last_html .= '<i data-reference="'.$item['reference'].'" id="order-report-icon-retry" class = "material-icons order-report-icon-retry" style="font-size: 22px; cursor:pointer;" title="Retry After Error is fixed, this will set the status to PENDING">sync</i>';
     81                    $last_html .= '<i data-reference="'.$item['reference'].'" id="order-report-icon-retry" class = "material-icons order-report-icon-retry" style="font-size: 22px; cursor:pointer;" title="This will remove the order and will be retried.">retry</i>';
    8282                }
    8383                return wp_kses($last_html, $allowed_html);
  • shop-2-api/trunk/readme.txt

    r3034619 r3055588  
    33Plugin URI: https://wordpress.org/plugins/shop-2-api/
    44Tags: WooCommerce, Bol
    5 Stable Tag: 1.0.29.6
     5Stable Tag: 1.0.30.0
    66Requires at least: 5.0
    77Requires PHP: 7.2
     
    79792) Fix some Order screen bugs.
    8080
     81= 1.0.31 =
     821) Added Sync Dropdown and Sync products Button.
    8183
    8284== Instructions ==
  • shop-2-api/trunk/shop-2-api.php

    r3034619 r3055588  
    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.30.0
     7Version: 1.0.31.0
    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.30.0');
     36define ('VERSION', '1.0.31.0');
    3737
    3838// Register items in the project.
  • shop-2-api/trunk/templates/dashboard.php

    r2983482 r3055588  
    105105            </div>
    106106
    107             <div class="card inline" id='get-started-card-completed'>
     107            <div class="card inline" id='get-started-card-completed' style="min-height: 350px">
    108108                <h1 style="font-weight: bold;"><?php echo $offer_product_heading; ?></h1>
    109109                <div id="connection-completed" class="tooltip">
     
    141141            </div>
    142142
    143             <div class="card inline" id='order-card'>
     143            <div class="card inline" id='order-card' style="min-height: 350px">
    144144                <h1 style="font-weight: bold;"><?php echo $order_card_heading ; ?></h1>
    145145                <div id="shop2api-map-order-sync" class="tooltip">
     
    181181            </div>
    182182
     183            <div class="card inline" id='support-buttons' style="min-height: 350px">
     184                <h1 style="font-weight: bold;"><?php echo $support_card_heading ; ?></h1>
     185                <div>
     186                    <p>
     187                    <label for="sync-wc-product">Sync Products/Offers/Stock Manually</label>
     188                    </p>
     189                    <button id="sync-wc-product" class="shop-2-api-connect-save">Sync</button>
     190                </div>
     191                <div>
     192                    <p>
     193                        <label for="refresh-dropdowns">Refresh Category/Attribute Dropdowns</label>
     194                    </p>
     195                    <button id="refresh-dropdowns" class="shop-2-api-connect-save">Refresh</button>
     196                </div>
     197            </div>
     198
    183199            <div class="card inline" id='sync-summary-product-card'>
    184200                <h1>
     
    204220            </div>
    205221
    206             <div class="card inline" id='sync-summary-offer-card'>
     222            <div class="card inline" id='sync-summary-offer-card' >
    207223                <h1>
    208224                    <?php echo $sync_summary_offer ?>
  • shop-2-api/trunk/translation/shop2api_dashboard.php

    r2983482 r3055588  
    4343$order_card_stock_sync_tooltip = wp_kses(__("Sync stock after order was synced,"), $allowed_html);
    4444$order_card_stock_sync_active = wp_kses(__("Sync Stock After Order Synced"), $allowed_html);
     45
     46//Support Buttons
     47$support_card_heading = wp_kses(__("Support"), $allowed_html);
Note: See TracChangeset for help on using the changeset viewer.