Changeset 2982442
- Timestamp:
- 10/23/2023 07:22:02 AM (2 years ago)
- Location:
- shop-2-api/trunk
- Files:
-
- 12 edited
-
assets/bol2api_category_mapping_scripts.js (modified) (4 diffs)
-
assets/shop2api_order.js (modified) (1 diff)
-
includes/Api/Shop2ApiConnect.php (modified) (2 diffs)
-
includes/Base/AjaxButtonActions.php (modified) (1 diff)
-
includes/Base/Enqueue.php (modified) (1 diff)
-
includes/Base/EnqueueWC.php (modified) (2 diffs)
-
includes/Tables/WcCategorySelection.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
shop-2-api.php (modified) (2 diffs)
-
templates/bol-order-sync.php (modified) (1 diff)
-
templates/dashboard.php (modified) (2 diffs)
-
translation/shop2api_dashboard.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
shop-2-api/trunk/assets/bol2api_category_mapping_scripts.js
r2832543 r2982442 8 8 // Add click and change events 9 9 $('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); 10 11 11 12 // Save Data … … 24 25 } 25 26 27 function handle_bol_txt_change() { 28 update_cost_values(this); 29 } 30 26 31 // Handle Bol Category change 27 32 function handle_bol_cat_change() { 33 $(this).attr("data-old_value", $(this).val()); 28 34 update_saved_bol_category_data(this); 29 35 } … … 89 95 } 90 96 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 91 109 function update_saved_bol_category_data(dropdown_changed) { 92 110 let prev_bol_cat_id = String($(dropdown_changed).data('old_value')); … … 124 142 } 125 143 } 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); 135 145 136 146 if (Object.keys(saved_bol_category_data).includes(prev_bol_cat_id)) { -
shop-2-api/trunk/assets/shop2api_order.js
r2905836 r2982442 113 113 $('#orders-stock-sync').prop('checked', order_data.sync_stock); 114 114 $('#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); 115 117 116 118 document.getElementById("orders-ean").value = order_data.woocommerce_ean_category; -
shop-2-api/trunk/includes/Api/Shop2ApiConnect.php
r2979697 r2982442 488 488 public function set_order_data( 489 489 $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 491 492 ) 492 493 { … … 516 517 "use_bol_price" => ($use_bol_price != ''), 517 518 "sync_stock" => ($stock_sync != ''), 519 "alert_on_order_fail" => ($alert_on_order_fail != ''), 520 "alert_email" => $alert_email, 518 521 ]; 519 522 -
shop-2-api/trunk/includes/Base/AjaxButtonActions.php
r2962006 r2982442 337 337 $_POST['orders-ean'], $_POST['orders-combideals-active'], $_POST['orders-combideal-ean-value'], 338 338 $_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'] 340 340 ); 341 341 -
shop-2-api/trunk/includes/Base/Enqueue.php
r2979381 r2982442 131 131 $message = json_decode(wp_remote_retrieve_body($response), true); 132 132 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); 134 134 } 135 135 } -
shop-2-api/trunk/includes/Base/EnqueueWC.php
r2975851 r2982442 47 47 // Add Bol Order Id in the Order List 48 48 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' )); 49 50 add_action( 'manage_shop_order_posts_custom_column', array($this, 'display_custom_metadata_column_value'), 10, 2 ); 50 51 … … 52 53 add_action( 'woocommerce_order_status_changed', array($this,'woocommerce_send_order'), 10, 3 ); 53 54 } 55 56 // Make searchable 57 function make_order_id_searchable( $meta_keys ) { 58 $meta_keys[] = 'bol_order_id'; 59 return $meta_keys; 60 } 61 54 62 /** 55 63 * Custom function to be executed when order status changes -
shop-2-api/trunk/includes/Tables/WcCategorySelection.php
r2979697 r2982442 131 131 } 132 132 } 133 // return var_dump($data); 133 134 return wp_kses('<input type="number" value="'.esc_attr($val).'" class="wc-category-table-fields"/> €', $this->allowed_html); 134 135 case 'bol_commission': -
shop-2-api/trunk/readme.txt
r2979697 r2982442 3 3 Plugin URI: https://wordpress.org/plugins/shop-2-api/ 4 4 Tags: WooCommerce, Bol 5 Stable Tag: 1.0.2 7.25 Stable Tag: 1.0.28.1 6 6 Requires at least: 5.0 7 7 Requires PHP: 7.2 … … 154 154 5) Fix bug which can cause a php error. 155 155 156 = 1.0.28 = 157 1) Added Order Id For Searching 158 2) Fix bug with category mapping 159 3) Dashboard Changes 160 4) Added Alert on Order Failing Option 161 162 156 163 == Instructions == 157 164 1) 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 5 5 Plugin URI: https://wordpress.org/plugins/shop-2-api/ 6 6 Description: 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.2 7.27 Version: 1.0.28.1 8 8 Requires at least: 5.0 9 9 Requires PHP: 7.2 … … 34 34 define('SHOP2API_PLUGIN_URL', plugin_dir_url( __FILE__ )); 35 35 define('SHOP2API_PLUGIN', plugin_basename( __FILE__ )); 36 define ('VERSION', '1.0.2 7.2');36 define ('VERSION', '1.0.28.1'); 37 37 38 38 // Register items in the project. -
shop-2-api/trunk/templates/bol-order-sync.php
r2905836 r2982442 133 133 </td> 134 134 </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> 135 160 </tbody> 136 161 </table> -
shop-2-api/trunk/templates/dashboard.php
r2975851 r2982442 106 106 107 107 <div class="card inline" id='get-started-card-completed'> 108 <h1 style="font-weight: bold;"><?php echo $offer_product_heading; ?></h1> 108 109 <div id="connection-completed" class="tooltip"> 109 110 <span class="tooltiptext tooltip-right"><?php echo $reconnect; ?></span> … … 140 141 </div> 141 142 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 142 159 <div class="card inline" id='sync-summary-product-card'> 143 160 <h1> -
shop-2-api/trunk/translation/shop2api_dashboard.php
r2975851 r2982442 32 32 $sync_summary_order = wp_kses(__("Sync Summary Orders"), $allowed_html); 33 33 $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.