Changeset 2665761
- Timestamp:
- 01/26/2022 10:54:20 AM (4 years ago)
- Location:
- kassa-at-for-woocommerce
- Files:
-
- 31 added
- 16 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/api-connection.php (added)
-
tags/1.1.0/create-menus.php (added)
-
tags/1.1.0/icon.png (added)
-
tags/1.1.0/kassa-at-for-woocommerce.php (added)
-
tags/1.1.0/kaw_screenshot_1.png (added)
-
tags/1.1.0/kaw_screenshot_2.png (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_AT.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_AT.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_CH.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_CH.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_CH_formal.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_CH_formal.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_DE.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_DE.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_DE_formal.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-de_DE_formal.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-hr.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-hr.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-hu_HU.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-hu_HU.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-pl_PL.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-pl_PL.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-sl_SI.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-sl_SI.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-tr_TR.mo (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce-tr_TR.po (added)
-
tags/1.1.0/languages/kassa-at-for-woocommerce.pot (added)
-
tags/1.1.0/readme.txt (added)
-
tags/1.1.0/stock-syncro.php (added)
-
trunk/api-connection.php (modified) (2 diffs)
-
trunk/create-menus.php (modified) (12 diffs)
-
trunk/kassa-at-for-woocommerce.php (modified) (8 diffs)
-
trunk/languages/kassa-at-for-woocommerce-de_AT.mo (modified) (previous)
-
trunk/languages/kassa-at-for-woocommerce-de_AT.po (modified) (11 diffs)
-
trunk/languages/kassa-at-for-woocommerce-de_CH.mo (modified) (previous)
-
trunk/languages/kassa-at-for-woocommerce-de_CH.po (modified) (11 diffs)
-
trunk/languages/kassa-at-for-woocommerce-de_CH_formal.mo (modified) (previous)
-
trunk/languages/kassa-at-for-woocommerce-de_CH_formal.po (modified) (11 diffs)
-
trunk/languages/kassa-at-for-woocommerce-de_DE.mo (modified) (previous)
-
trunk/languages/kassa-at-for-woocommerce-de_DE.po (modified) (11 diffs)
-
trunk/languages/kassa-at-for-woocommerce-de_DE_formal.mo (modified) (previous)
-
trunk/languages/kassa-at-for-woocommerce-de_DE_formal.po (modified) (11 diffs)
-
trunk/languages/kassa-at-for-woocommerce.pot (modified) (3 diffs)
-
trunk/readme.txt (modified) (6 diffs)
-
trunk/stock-syncro.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kassa-at-for-woocommerce/trunk/api-connection.php
r2604334 r2665761 35 35 $host = 'https://' . kaw_get_subdomain() . '.kassa.at'; 36 36 } elseif ( kaw_get_envirement_mode() === 'dev' ) { 37 $host = 'http://' . kaw_get_subdomain() . '.kassa.at.10.0.0. 3.nip.io:3000';37 $host = 'http://' . kaw_get_subdomain() . '.kassa.at.10.0.0.13.nip.io:3000'; 38 38 } 39 39 return $host; … … 77 77 $site = kaw_get_api_host() . '/api/' . kaw_get_api_version( 'v1' ) . $action; 78 78 79 kaw_log_data( 'API-CALL: [' . $method . '] ' . $site ); 80 kaw_log_data( $params ); 79 $args['method'] = $method; 80 $args['headers']['Authorization'] = get_option( 'kaw-key' ); 81 if ( 'GET' === $method ) { 82 $args['headers']['Content-Type'] = 'application/json'; 81 83 82 $args['method'] = $method; 83 $args['headers'] = array( 84 'Authorization' => get_option( 'kaw-key' ), 85 'Content-Type' => 'application/json', 86 ); 87 $args['body'] = $params; 88 $request = new WP_Http(); 89 $result = $request->request( $site, $args ); 84 } 85 $args['body'] = $params; 86 $request = new WP_Http(); 87 $result = $request->request( $site, $args ); 90 88 91 89 if ( is_wp_error( $result ) ) { 92 kaw_log_data( 'API-RESULT: (WP_Error) ' . wp_json_encode( $result ) );93 90 $result->length = '0'; 94 91 $json = $result; 95 92 } else { 96 kaw_log_data( 'API-RESULT: ' . $result['body'] );97 93 $json = json_decode( $result['body'] ); 98 94 } 99 95 96 kaw_log_data( 97 'API-CALL', 98 array( 99 'httpMethod' => $method, 100 'httpUrl' => $site, 101 'paramSting' => $params, 102 'kawKey' => get_option( 'kaw-key' ), 103 'result' => $json, 104 'location' => kaw_get_locationstring(), 105 ) 106 ); 107 100 108 return $json; 101 109 } -
kassa-at-for-woocommerce/trunk/create-menus.php
r2604306 r2665761 1 1 <?php 2 2 /** 3 * This File is responsible for doing the admin menu section for the KASSA.AT-connection. 3 * This File is responsible for doing the admin menu 4 * section for the KASSA.AT-connection. 4 5 * 5 6 * @package KASSA.AT For WooCommerce … … 14 15 */ 15 16 function kaw_create_menu() { 16 $kaw_site = strtoupper( get_option( 'kaw-site' ) );17 17 add_menu_page( 18 'KASSA.AT Optionen', /* page_title */ 19 'KASSA.AT', /* menu_title */ 20 'administrator', /* capability */ 21 'kaw_options', /* menu_slug */ 22 'kaw_create_kassa_at_options_page', /* function */ 23 plugins_url( 'kassa-at-for-woocommerce/icon.png' ) /* icon_url */ 18 'KASSA.AT', /* page_title */ 19 'KASSA.AT', /* menu_title */ 20 'administrator', /* capability */ 21 'kaw', /* menu_slug */ 22 'kaw_create_kassa_at_options_page', /* function */ 23 plugins_url( 'kassa-at-for-woocommerce/icon.png' ) /* icon_url */ 24 ); 25 26 add_submenu_page( 27 'kaw', /* parent_slug*/ 28 'KASSA.AT ' . __( 'Options', 'kassa-at-for-woocommerce' ), /* page_title */ 29 __( 'Options', 'kassa-at-for-woocommerce' ), /* menu_title */ 30 'administrator', /* capability */ 31 'kaw', /* menu_slug */ 32 'kaw_create_kassa_at_options_page' /* function */ 33 ); 34 35 add_submenu_page( 36 'kaw', /* parent_slug*/ 37 'KASSA.AT ' . __( 'Logs', 'kassa-at-for-woocommerce' ), /* page_title */ 38 __( 'Logs', 'kassa-at-for-woocommerce' ), /* menu_title */ 39 'administrator', /* capability */ 40 'kaw_logs', /* menu_slug */ 41 'kaw_get_log_page_content' /* function */ 24 42 ); 25 43 } … … 35 53 36 54 kaw_maybe_save_data(); 37 kaw_maybe_delete_data();38 55 if ( isset( $_POST['submit_hidden'] ) && 'Z' === sanitize_text_field( wp_unslash( $_POST['submit_hidden'] ) ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['_wpnonce'] ) ) ) ) { 39 56 kaw_synchronize_k_to_w(); 40 57 } 41 58 42 kaw_get_ page_content();59 kaw_get_main_page_content(); 43 60 } 44 61 … … 53 70 54 71 if ( get_option( 'kaw-warehouse' ) ) { 72 $old_warehouse = get_option( 'kaw-warehouse' ); 55 73 update_option( 'kaw-warehouse', $opt_val ); 56 74 } else { 75 $old_warehouse = ''; 57 76 add_option( 'kaw-warehouse', $opt_val ); 58 77 } 59 kaw_log_data( 'DATA-UPDATED: "kaw-warehouse" = ' . $opt_val ); 78 kaw_log_data( 79 'DATA-UPDATE', 80 array( 81 'message' => 'Connected warehouse updated', 82 'key' => 'kaw-warehouse', 83 'original' => $old_warehouse, 84 'updated' => $opt_val, 85 'location' => kaw_get_locationstring(), 86 ) 87 ); 60 88 } 61 89 } … … 65 93 66 94 if ( get_option( 'kaw-subdomain' ) ) { 95 $old_subdomain = get_option( 'kaw-subdomain' ); 67 96 update_option( 'kaw-subdomain', $subdomain_string ); 68 97 } else { 98 $old_subdomain = ''; 69 99 add_option( 'kaw-subdomain', $subdomain_string ); 70 100 } 71 kaw_log_data( 'DATA-UPDATED: "kaw-subdomain" = ' . $subdomain_string ); 101 kaw_log_data( 102 'SYSTEM', 103 array( 104 'message' => 'Connection to KASSA.AT established.', 105 'location' => kaw_get_locationstring(), 106 ) 107 ); 108 kaw_log_data( 109 'DATA-UPDATE', 110 array( 111 'message' => 'Connected subdomain updated', 112 'key' => 'kaw-subdomain', 113 'original' => $old_subdomain, 114 'updated' => $subdomain_string, 115 'location' => kaw_get_locationstring(), 116 ) 117 ); 72 118 } 73 119 … … 89 135 90 136 /** 91 * De termine if the user wanted to delete his connection to the KASSA.AT account92 * and if so, delete theentries from the database.137 * Delete the connection to KASSA.AT and remove 138 * the most important entries from the database. 93 139 */ 94 function kaw_maybe_delete_data() { 95 if ( isset( $_GET['delete_kaw'] ) ) { 96 delete_option( 'kaw-key' ); 97 delete_option( 'kaw-warehouse' ); 98 delete_option( 'kaw-subdomain' ); 99 100 if ( get_option( 'kaw-message-active' ) ) { 101 update_option( 'kaw-message-active', 1 ); 102 } else { 103 add_option( 'kaw-message-active', 1 ); 104 } 105 kaw_log_data( 'DATA-DELETED: "kaw-key"' ); 106 kaw_log_data( 'DATA-DELETED: "kaw-subdomain"' ); 107 kaw_log_data( 'DATA-DELETED: "kaw-warehouse"' ); 140 function kaw_delete_connection() { 141 delete_option( 'kaw-key' ); 142 delete_option( 'kaw-warehouse' ); 143 delete_option( 'kaw-subdomain' ); 144 145 if ( get_option( 'kaw-message-active' ) ) { 146 update_option( 'kaw-message-active', 1 ); 147 } else { 148 add_option( 'kaw-message-active', 1 ); 108 149 } 150 kaw_log_data( 151 'SYSTEM', 152 array( 153 'message' => 'Connection to KASSA.AT removed.', 154 'location' => kaw_get_locationstring(), 155 ) 156 ); 157 158 wp_send_json_success(); 109 159 } 160 add_action( 'wp_ajax_kaw_delete_connection', 'kaw_delete_connection' ); 161 162 163 /** 164 * A function to grab the kaw logfile and return its content as json. 165 * Meant to be called via ajax. 166 */ 167 function kaw_reload_log_file() { 168 $logfile = kaw_check_for_log_file(); 169 $contentstr = file_get_contents( $logfile ); // phpcs:ignore 170 $contentjson = json_decode( $contentstr ); 171 wp_send_json_success( $contentjson ); 172 } 173 add_action( 'wp_ajax_kaw_reload_log_file', 'kaw_reload_log_file' ); 110 174 111 175 /** … … 113 177 * Including HTML, JS and a little bit of PHP. 114 178 */ 115 function kaw_get_ page_content() {179 function kaw_get_main_page_content() { 116 180 $key_isset = get_option( 'kaw-key' ); 117 181 $kaw_warehouse = get_option( 'kaw-warehouse' ); … … 126 190 <script type="text/javascript"> 127 191 window.onload = function () { 128 if ("<?php echo esc_attr( $key_isset ); ?>") { 129 if ("<?php echo esc_attr( $kaw_warehouse ); ?>") { 130 document.getElementById("kaw-warehouse").value = "<?php echo esc_attr( $kaw_warehouse ); ?>"; 131 } 132 } else { 133 if ("<?php echo esc_attr( $state ); ?>" == "dev") { 134 var domain = "http://www.kassa.at.10.0.0.3.nip.io:3000"; 135 } else if ("<?php echo esc_attr( $state ); ?>" == "pro") { 136 var domain = "https://wp.kassa.at"; 137 } 138 document.getElementById("connect-to-kaw-form").action = domain + "/api/v1/authentications/authenticate"; 139 document.getElementById("kaw-create-link").href = domain + "/companies/new"; 140 document.getElementById("hidden-field-return-path").value = window.location.href.split("&")[0]; 141 } 142 <?php if ( isset( $_GET['key'] ) ) { ?> 192 <?php if ( isset( $_GET['key'] /* phpcs:ignore*/ ) ) { ?> 143 193 window.location.href = window.location.href.split("&")[0]; 144 194 <?php } ?> 145 <?php if ( isset( $_GET['delete_kaw'] ) ) { ?>195 <?php if ( isset( $_GET['delete_kaw'] /* phpcs:ignore */ ) ) { ?> 146 196 window.location.href = window.location.href.split("&")[0]; 147 197 <?php } ?> 148 198 } 199 200 function kaw_change_sync_enabeling( checkbox ) { 201 checkbox = jQuery( checkbox ); 202 203 let field = checkbox.data( 'field' ); 204 let mode = checkbox.is( ':checked' ); 205 206 jQuery.ajax({ 207 type: 'POST', 208 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 209 data: { 210 action: 'kaw_activate_synchro_option', 211 field: field, 212 mode: mode 213 } 214 }); 215 } 216 217 function kaw_delete_connection() { 218 jQuery.ajax({ 219 type: 'POST', 220 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 221 data: { 222 action: 'kaw_delete_connection' 223 }, 224 success: function () { 225 location.reload(); 226 } 227 }); 228 } 149 229 </script> 150 230 151 <div style="height: 50px"></div>231 <div style="height: 50px"></div> 152 232 <h1><?php esc_attr_e( 'KASSA.AT connection:', 'kassa-at-for-woocommerce' ); ?></h1> 153 233 <?php if ( $key_isset ) : ?> … … 155 235 <?php esc_attr_e( 'You are already connected to a KASSA.AT account.', 'kassa-at-for-woocommerce' ); ?> 156 236 (<?php echo esc_attr( get_option( 'kaw-subdomain' ) ); ?>)<br /> 157 <a href="?page=kaw_options&delete_kaw=true" id="delete_kaw_key">237 <a onclick="kaw_delete_connection()" style="cursor: pointer;" id="delete_kaw_key"> 158 238 <?php esc_attr_e( 'Remove connection to KASSA.AT.', 'kassa-at-for-woocommerce' ); ?> 159 239 </a> 160 240 </p> 161 241 <?php else : ?> 162 <form id="connect-to-kaw-form" action="https://www.kassa.at" method="get"> 163 <input id="hidden-field-return-path" name="return_path" type="hidden" value=""> 242 <?php $url = ( isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ) ? 'https://' : 'http://'; ?> 243 <?php $url .= ( isset( $_SERVER['HTTP_HOST'] ) && isset( $_SERVER['REQUEST_URI'] ) ) ? esc_attr( $_SERVER['HTTP_HOST'] ) . esc_attr( $_SERVER['REQUEST_URI'] ) : ''; /* phpcs:ignore */ ?> 244 245 <form id="connect-to-kaw-form" action="<?php echo esc_url( preg_replace( '/\/\/[^.]*\./', '//wp.', kaw_get_api_host(), 1 ) ); ?>/api/v1/authentications/authenticate" method="get"> 246 <input id="hidden-field-return-path" name="return_path" type="hidden" value="<?php echo esc_url( $url ); ?>"> 164 247 <input name="description" type="hidden" value="Woocommerce Plugin"> 165 248 <button type="submit" name="Submit" class="button-primary"> … … 168 251 </form> 169 252 <br /> 170 <a id="kaw-create-link" href=" https://kassa.at/companies/new" target="_blank">253 <a id="kaw-create-link" href="<?php echo esc_url( preg_replace( '/\/\/[^.]*\./', '//wp.', kaw_get_api_host(), 1 ) ); ?>/companies/new" target="_blank"> 171 254 <?php esc_attr_e( 'Dont have a KASSA.AT account? Create one!', 'kassa-at-for-woocommerce' ); ?> 172 255 </a> … … 182 265 <select name="kaw-warehouse" id="kaw-warehouse"> 183 266 <?php foreach ( $kaw_warehouses->details as &$warehouse ) { ?> 184 <option value="<?php echo esc_attr( $warehouse->id ); ?>" ><?php echo esc_attr( $warehouse->description ); ?></option>267 <option value="<?php echo esc_attr( $warehouse->id ); ?>" <?php echo ( esc_attr( $warehouse->id ) === get_option( 'kaw-warehouse' ) ) ? 'selected' : ''; ?>><?php echo esc_attr( $warehouse->description ); ?></option> 185 268 <?php } ?> 186 269 </select> … … 206 289 </tr> 207 290 </table> 291 <table> 292 <tr> 293 <td> 294 <input id="kaw-synchronize-at-singleproduct" type="checkbox" onchange="kaw_change_sync_enabeling( this )" data-field="kaw-synchronize-at-singleproduct" <?php echo ( ! get_option( 'kaw-synchronize-at-singleproduct' ) || get_option( 'kaw-synchronize-at-singleproduct' ) === 'enabled' ) ? 'checked' : ''; ?>> 295 </td> 296 <td> 297 <label for="kaw-synchronize-at-singleproduct"><?php esc_attr_e( 'Synchronize on the Single Product Page!', 'kassa-at-for-woocommerce' ); ?></label> 298 </td> 299 </tr> 300 301 <tr> 302 <td> 303 <input id="kaw-synchronize-at-cart" type="checkbox" onchange="kaw_change_sync_enabeling( this )" data-field="kaw-synchronize-at-cart" <?php echo ( ! get_option( 'kaw-synchronize-at-cart' ) || get_option( 'kaw-synchronize-at-cart' ) === 'enabled' ) ? 'checked' : ''; ?>> 304 </td> 305 <td> 306 <label for="kaw-synchronize-at-cart"><?php esc_attr_e( 'Synchronize on the Cart Page!', 'kassa-at-for-woocommerce' ); ?></label> 307 </td> 308 </tr> 309 310 <tr style="display: none"> 311 <td> 312 <input id="kaw-synchronize-on-order" type="checkbox" onchange="kaw_change_sync_enabeling( this )" data-field="kaw-synchronize-on-order" <?php echo ( ! get_option( 'kaw-synchronize-on-order' ) || get_option( 'kaw-synchronize-on-order' ) === 'enabled' ) ? 'checked' : ''; ?> disabled> 313 </td> 314 <td> 315 <label for="kaw-synchronize-on-order"><?php esc_attr_e( 'Synchronize when the order is received!', 'kassa-at-for-woocommerce' ); ?></label> 316 </td> 317 </tr> 318 </table> 208 319 <br /> 209 320 <?php endif; ?> 210 321 <?php } ?> 322 323 <?php 324 /** 325 * Creating the HTML code for the log-page in the admin-menu for KASSA.AT. 326 * Including HTML, JS, css and PHP. 327 */ 328 function kaw_get_log_page_content() { 329 ?> 330 <style media="screen"> 331 div.kawlog-lineno { 332 text-align: center; 333 background-color: rgba(0,0,0,0.1); 334 color: #888; 335 } 336 337 div.kawlog-row { 338 min-height: 25px; 339 } 340 341 div.kawlog-row.kawlog-row-primary { 342 border-top: rgba(0,0,0,0.1) 1px solid; 343 } 344 345 div#kawlog-container { 346 display: flex; 347 flex-direction: column; 348 height: 400px; 349 overflow: auto; 350 width: 99%; 351 white-space: nowrap; 352 border: 1px #bbb solid; 353 padding: 5px; 354 border-radius: 3px; 355 max-width: 1280px; 356 background-color: #fff; 357 } 358 359 table.kaw-option-table thead { 360 font-weight: bold; 361 } 362 363 table.kaw-option-table td { 364 padding: 8px 16px; 365 border: rgba(0,0,0,0.1) 1px solid; 366 } 367 </style> 368 369 <script type="text/javascript"> 370 function kawlog_reload() { 371 jQuery.ajax({ 372 type: 'GET', 373 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 374 data: { 375 action: 'kaw_reload_log_file' 376 }, 377 success: function( data ) { 378 let currentDate = new Date(); 379 let refreshDateTime = ( ( currentDate.getDate() < 10 ) ? '0' : '' ) + currentDate.getDate() + '.' + ( ( currentDate.getMonth() < 10 ) ? '0' : '' ) + ( currentDate.getMonth() + 1 ) + '.' + currentDate.getFullYear() + ' ' + ( ( currentDate.getHours() < 10 ) ? '0' : '' ) + currentDate.getHours() + ':' + ( ( currentDate.getMinutes() < 10 ) ? '0' : '' ) + currentDate.getMinutes() + ':' + ( ( currentDate.getSeconds() < 10 ) ? '0' : '' ) + currentDate.getSeconds(); 380 jQuery( 'span#kawlog-reload-time' ).attr( 'title', refreshDateTime ); 381 jQuery( 'span#kawlog-reload-time' ).text( refreshDateTime.split( ' ' )[1] ); 382 document.getElementById( 'kawlog-container' ).innerHTML = ''; 383 384 var kawloghtml = ''; 385 data.data.forEach((log, line) => { 386 line = parseInt( line ) + 1; 387 kawloghtml += "<div class='kawlog-row kawlog-row-primary' style='display: flex; flex-wrap: nowrap; cursor: pointer;' onclick='jQuery( \"div#kaw_logs_extra_info_" + line + "\" ).slideToggle()'>"; 388 kawloghtml += "<div class='kawlog-lineno' style='width: 50px;'>" + line + "</div>"; 389 kawloghtml += "<div style='width: 150px'>" + log.datetime + "</div>"; 390 kawloghtml += "<div style='width: 100px'>" + log.type + "</div>"; 391 if ( log.type === 'API-CALL' ) { 392 kawloghtml += "<div style='width: calc(100% - 300px)'>[" + log.data.httpMethod + "] " + log.data.httpUrl + "</div>"; 393 } else if ( log.type === 'API-ERROR' ) { 394 kawloghtml += "<div style='width: calc(100% - 300px)'>" + log.data.message + "</div>"; 395 } else if ( log.type === 'DATA-UPDATE' ) { 396 kawloghtml += "<div style='width: calc(100% - 300px)'>[" + log.data.message + "] " + log.data.key + "</div>"; 397 } else if ( log.type === 'SYSTEM' ) { 398 kawloghtml += "<div style='width: calc(100% - 300px)'>" + log.data.message + "</div>"; 399 } 400 kawloghtml += "</div>"; 401 402 kawloghtml += "<div id='kaw_logs_extra_info_" + line + "' style='display: none;'>"; 403 kawloghtml += "<div style='display: flex; flex-direction: column;'>"; 404 let linestart = "<div class='kawlog-row' style='display: flex; flex-direction: auto;'><div class='kawlog-lineno' style='width: 50px;'></div><div style='width: 150px'></div>"; 405 if ( log.type === 'API-CALL' ) { 406 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Parameters', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + JSON.stringify( log.data.params ) + "</div></div>"; 407 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'API-Key', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.kawKey + "</div></div>"; 408 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Result', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + JSON.stringify( log.data.result ) + "</div></div>"; 409 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.location + "</div></div>"; 410 } else if ( log.type === 'API-ERROR' ) { 411 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.location + "</div></div>"; 412 } else if ( log.type === 'DATA-UPDATE' ) { 413 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Changes', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.original + " => " + log.data.updated + " (" + log.data.key + ")</div></div>"; 414 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.location + "</div></div>"; 415 } else if ( log.type === 'SYSTEM' ) { 416 kawloghtml += linestart + "<div style='width: 100px'><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style='width: calc(100% - 300px)'>" + log.data.location + "</div></div>"; 417 } 418 419 kawloghtml += "</div>"; 420 kawloghtml += "</div>"; 421 }); 422 document.getElementById( 'kawlog-container' ).innerHTML = kawloghtml; 423 } 424 }); 425 } 426 427 function kawlog_enable( btn ) { 428 btn = jQuery( btn ); 429 var mode = ''; 430 if ( btn.data( 'currentstate' ) === 'enabled' ) { 431 // disable logs 432 mode = 'disable'; 433 } else if ( btn.data( 'currentstate' ) === 'disabled' ) { 434 // enable logs 435 mode = 'enable'; 436 } 437 438 jQuery.ajax({ 439 type: 'POST', 440 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 441 data: { 442 action: 'kaw_activate_logging', 443 mode: mode 444 }, 445 success: function( data ) { 446 if ( data.data === false ) { 447 btn.html( btn.data( 'enabletext' ) ); 448 btn.data( 'currentstate', 'disabled' ); 449 } else if ( data.data === true ) { 450 btn.html( btn.data( 'disabletext' ) ); 451 btn.data( 'currentstate', 'enabled' ); 452 } 453 454 kawlog_reload(); 455 } 456 }); 457 } 458 459 function kawlog_delete() { 460 jQuery.ajax({ 461 type: 'POST', 462 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 463 data: { 464 action: 'kaw_delete_logfile' 465 }, 466 success: function( data ) { 467 if ( data.success === true ) { 468 kawlog_reload(); 469 } 470 } 471 }); 472 } 473 474 function kawlog_download() { 475 jQuery.ajax({ 476 type: 'GET', 477 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 478 data: { 479 action: 'kaw_reload_log_file' 480 }, 481 success: function( data ) { 482 var dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent( JSON.stringify( data.data, null, '\t' ) ); 483 var dlAnchorElem = document.createElement( 'a' ); 484 dlAnchorElem.setAttribute( 'href', dataStr ); 485 dlAnchorElem.setAttribute( 'download', 'KAW-Logfile.json' ); 486 document.body.appendChild( dlAnchorElem ); 487 dlAnchorElem.click(); 488 dlAnchorElem.remove(); 489 } 490 }); 491 } 492 493 function kawlog_size_save() { 494 let select = jQuery( 'select#kawlog-size-select' ) 495 jQuery.ajax({ 496 type: 'POST', 497 url: '<?php echo esc_url( get_admin_url() . 'admin-ajax.php' ); ?>', 498 data: { 499 action: 'kaw_logfile_change_size', 500 size: select.val() 501 }, 502 success: function( data ) { 503 if ( data.success === true ) { 504 kawlog_reload(); 505 } 506 } 507 }); 508 } 509 </script> 510 511 <h1><?php esc_attr_e( 'Plugin Logs:', 'kassa-at-for-woocommerce' ); ?></h1> 512 <div style="display: flex; justify-content: space-between; width: 99%; max-width: 1280px;"> 513 <div style="width: calc((100% / 3) - 50px); min-width:230px; text-align: left;"> 514 <button class="button-secondary" type="button" onclick="kawlog_reload()"><?php esc_attr_e( 'Reload logfile', 'kassa-at-for-woocommerce' ); ?></button> 515 <span id="kawlog-reload-title"><?php esc_attr_e( 'Refreshed', 'kassa-at-for-woocommerce' ); ?>: </span> 516 <span id="kawlog-reload-time">-</span> 517 </div> 518 519 <div style="width: calc((100% / 3) + 100px); min-width:350px; text-align: center;"> 520 <button id="kawlog_enable_btn" class="button-secondary" onclick="kawlog_enable( this )" data-currentstate="<?php echo kaw_enable_log() ? 'enabled' : 'disabled'; ?>" data-enabletext="<?php esc_attr_e( 'Enable Logging', 'kassa-at-for-woocommerce' ); ?>" data-disabletext="<?php esc_attr_e( 'Disable Logging', 'kassa-at-for-woocommerce' ); ?>"> 521 <?php kaw_enable_log() ? esc_attr_e( 'Disable Logging', 'kassa-at-for-woocommerce' ) : esc_attr_e( 'Enable Logging', 'kassa-at-for-woocommerce' ); ?> 522 </button> 523 <button id="kawlog_delete_btn" class="button-secondary" type="button" onclick="kawlog_delete()"><?php esc_attr_e( 'Delete logfile', 'kassa-at-for-woocommerce' ); ?></button> 524 <button id="kawlog_download_btn" class="button-secondary" type="button" onclick="kawlog_download()"><?php esc_attr_e( 'Download logfile', 'kassa-at-for-woocommerce' ); ?></button> 525 </div> 526 527 <div style="width: calc((100% / 3) - 50px); min-width:175px; text-align: right;"> 528 <select id="kawlog-size-select" name="kawlog-size" title="<?php esc_html_e( 'Limit kaw-log length', 'kassa-at-for-woocommerce' ); ?>"> 529 <option value="500" <?php echo ( intval( get_option( 'kaw-logging-size' ) ) === 500 ) ? 'selected' : ''; ?>>500 <?php esc_attr_e( 'lines', 'kassa-at-for-woocommerce' ); ?></option> 530 <option value="1000" <?php echo ( ! get_option( 'kaw-logging-size' ) || intval( get_option( 'kaw-logging-size' ) ) === 1000 ) ? 'selected' : ''; ?>>1000 <?php esc_attr_e( 'lines', 'kassa-at-for-woocommerce' ); ?></option> 531 <option value="2000" <?php echo ( intval( get_option( 'kaw-logging-size' ) ) === 2000 ) ? 'selected' : ''; ?>>2000 <?php esc_attr_e( 'lines', 'kassa-at-for-woocommerce' ); ?></option> 532 <option value="5000" <?php echo ( intval( get_option( 'kaw-logging-size' ) ) === 5000 ) ? 'selected' : ''; ?>>5000 <?php esc_attr_e( 'lines', 'kassa-at-for-woocommerce' ); ?></option> 533 <?php if ( get_option( 'kaw-logging-size' ) && ( ! in_array( strval( get_option( 'kaw-logging-size' ) ), array( '500', '1000', '2000', '5000' ), true ) ) ) : ?> 534 <option value="<?php echo esc_html( get_option( 'kaw-logging-size' ) ); ?>" selected><?php echo esc_html( get_option( 'kaw-logging-size' ) ); ?> <?php esc_attr_e( 'lines', 'kassa-at-for-woocommerce' ); ?></option> 535 <?php endif; ?> 536 </select> 537 <button id="kawlog_size_save_btn" class="button-secondary" onclick="kawlog_size_save()" title="<?php esc_attr_e( 'Limit kaw-log length', 'kassa-at-for-woocommerce' ); ?>"><?php esc_attr_e( 'Save', 'kassa-at-for-woocommerce' ); ?></button> 538 </div> 539 </div> 540 541 <?php $logfile = kaw_check_for_log_file(); ?> 542 <?php $json_logdata = json_decode( file_get_contents( $logfile ) ); /* phpcs:ignore */ ?> 543 <div id="kawlog-container" style="margin: 10px 0px 50px 0px;"> 544 <?php foreach ( $json_logdata as $line => $log ) { ?> 545 <div class="kawlog-row kawlog-row-primary" style="display: flex; flex-wrap: nowrap; cursor: pointer;" onclick="jQuery( 'div#kaw_logs_extra_info_<?php echo esc_html( $line + 1 ); ?>' ).slideToggle()"> 546 <div class="kawlog-lineno" style="width: 50px;" ><?php echo esc_attr( $line + 1 ); ?></div> 547 <div style="width: 150px"><?php echo esc_attr( $log->datetime ); ?></div> 548 <div style="width: 100px"><?php echo esc_attr( $log->type ); ?></div> 549 <?php if ( 'API-CALL' === $log->type ) : ?> 550 <div style="width: calc(100% - 300px)">[<?php echo esc_attr( $log->data->httpMethod ); ?>] <?php echo esc_attr( $log->data->httpUrl ); ?></div> 551 <?php elseif ( 'API-ERROR' === $log->type ) : ?> 552 <div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->message ); ?></div> 553 <?php elseif ( 'DATA-UPDATE' === $log->type ) : ?> 554 <div style="width: calc(100% - 300px)">[<?php echo esc_attr( $log->data->message ); ?>] <?php echo esc_attr( $log->data->key ); ?></div> 555 <?php elseif ( 'SYSTEM' === $log->type ) : ?> 556 <div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->message ); ?></div> 557 <?php endif; ?> 558 </div> 559 <div id="kaw_logs_extra_info_<?php echo esc_html( $line + 1 ); ?>" style="display: none;"> 560 <div style="display: flex; flex-direction: column;"> 561 <?php if ( 'API-CALL' === $log->type ) : ?> 562 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Parameters', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_html( wp_json_encode( (array) $log->data->params ) ); ?></div></div> 563 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'API-Key', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->kawKey ); ?></div></div> 564 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Result', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_html( wp_json_encode( (array) $log->data->result ) ); ?></div></div> 565 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->location ); ?></div></div> 566 <?php elseif ( 'API-ERROR' === $log->type ) : ?> 567 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->location ); ?></div></div> 568 <?php elseif ( 'DATA-UPDATE' === $log->type ) : ?> 569 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Changes', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->original ); ?> => <?php echo esc_attr( $log->data->updated ); ?> (<?php echo esc_attr( $log->data->key ); ?>)</div></div> 570 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->location ); ?></div></div> 571 <?php elseif ( 'SYSTEM' === $log->type ) : ?> 572 <div class="kawlog-row" style="display: flex; flex-direction: auto;"><div class="kawlog-lineno" style="width: 50px;"></div><div style="width: 150px"></div><div style="width: 100px"><?php esc_attr_e( 'Location', 'kassa-at-for-woocommerce' ); ?>: </div><div style="width: calc(100% - 300px)"><?php echo esc_attr( $log->data->location ); ?></div></div> 573 <?php endif; ?> 574 </div> 575 </div> 576 <?php } ?> 577 </div> 578 579 <h1><?php esc_attr_e( 'Database options', 'kassa-at-for-woocommerce' ); ?></h1> 580 <table class="kaw-option-table"> 581 <thead> 582 <tr> 583 <td><?php esc_attr_e( 'Creator', 'kassa-at-for-woocommerce' ); ?></td> 584 <td><?php esc_attr_e( 'Option-name', 'kassa-at-for-woocommerce' ); ?></td> 585 <td><?php esc_attr_e( 'Option-value', 'kassa-at-for-woocommerce' ); ?></td> 586 </tr> 587 </thead> 588 <tbody> 589 <tr> 590 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 591 <td>kaw-subdomain</td> 592 <td><?php echo get_option( 'kaw-subdomain' ) ? esc_attr( get_option( 'kaw-subdomain' ) ) : 'not set'; ?></td> 593 </tr> 594 <tr> 595 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 596 <td>kaw-key</td> 597 <td><?php echo get_option( 'kaw-key' ) ? esc_attr( get_option( 'kaw-key' ) ) : 'not set'; ?></td> 598 </tr> 599 <tr> 600 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 601 <td>kaw-warehouse</td> 602 <td><?php echo get_option( 'kaw-warehouse' ) ? esc_attr( get_option( 'kaw-warehouse' ) ) : 'not set'; ?></td> 603 </tr> 604 <tr> 605 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 606 <td>kaw-message-active</td> 607 <td><?php echo get_option( 'kaw-message-active' ) ? esc_attr( get_option( 'kaw-message-active' ) ) : 'not set'; ?></td> 608 </tr> 609 <tr> 610 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 611 <td>kaw-logging</td> 612 <td><?php echo get_option( 'kaw-logging' ) ? esc_attr( get_option( 'kaw-logging' ) ) : 'not set'; ?></td> 613 </tr> 614 <tr> 615 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 616 <td>kaw-logging-size</td> 617 <td><?php echo get_option( 'kaw-logging-size' ) ? esc_attr( get_option( 'kaw-logging-size' ) ) : 'not set'; ?></td> 618 </tr> 619 <tr> 620 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 621 <td>kaw-synchronize-at-singleproduct</td> 622 <td><?php echo get_option( 'kaw-synchronize-at-singleproduct' ) ? esc_attr( get_option( 'kaw-synchronize-at-singleproduct' ) ) : 'not set'; ?></td> 623 </tr> 624 <tr> 625 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 626 <td>kaw-synchronize-at-cart</td> 627 <td><?php echo get_option( 'kaw-synchronize-at-cart' ) ? esc_attr( get_option( 'kaw-synchronize-at-cart' ) ) : 'not set'; ?></td> 628 </tr> 629 <tr> 630 <td><?php esc_attr_e( 'KASSA.AT For WooCommerce', 'kassa-at-for-woocommerce' ); ?></td> 631 <td>kaw-synchronize-on-order</td> 632 <td><?php echo get_option( 'kaw-synchronize-on-order' ) ? esc_attr( get_option( 'kaw-synchronize-on-order' ) ) : 'not set'; ?></td> 633 </tr> 634 <tr> 635 <td>WooCommerce</td> 636 <td>woocommerce_manage_stock</td> 637 <td><?php echo get_option( 'woocommerce_manage_stock' ) ? esc_attr( get_option( 'woocommerce_manage_stock' ) ) : 'not set'; ?></td> 638 </tr> 639 </tbody> 640 </table> 641 <?php } ?> -
kassa-at-for-woocommerce/trunk/kassa-at-for-woocommerce.php
r2611428 r2665761 5 5 * Domain Path: /languages 6 6 * Description: An API Plugin which corresponds with a KASSA.AT account to synchronize online and offline stock-changes. 7 * Version: 1. 0.27 * Version: 1.1.0 8 8 * Author: Faxonline GmbH 9 9 * Author URI: https://www.kassa.at … … 11 11 * @package KASSA.AT For WooCommerce 12 12 * 13 * WC requires at least: 4.0.114 * WC tested up to: 5.7.013 * WC requires at least: 5.4.0 14 * WC tested up to: 6.1.1 15 15 */ 16 16 … … 23 23 /** 24 24 * Maybe create the custom logging folder and file. 25 * Returning the log_file 25 * Returning the log_file path. 26 * 27 * @return string 26 28 */ 27 29 function kaw_check_for_log_file() { 30 28 31 $uploads = wp_upload_dir( null, false ); 29 32 $logs_dir = $uploads['basedir'] . '/kaw-logs'; … … 33 36 } 34 37 35 $file = fopen( $logs_dir . '/log.log', 'a+' ); 36 return $file; 37 } 38 39 /** 40 * Return a boolean value to indicate if the log_file should blur out data. 41 * 42 * @return bool 43 */ 44 function kaw_get_api_log_crypto() { 45 return false; 38 if ( ! file_exists( $logs_dir . '/log.json' ) ) { 39 $file = fopen( $logs_dir . '/log.json', 'a+' ); /* phpcs:ignore */ 40 fwrite( $file, wp_json_encode( array() ) ); /* phpcs:ignore */ 41 fclose( $file ); /* phpcs:ignore */ 42 } 43 44 $filename = $logs_dir . '/log.json'; 45 return $filename; 46 46 } 47 47 … … 49 49 * Asks for the log file and writes whatever is in $data to it. 50 50 * 51 * @param mixed $data The things that should be written in the log_file. 52 */ 53 function kaw_log_data( $data ) { 54 if ( kaw_enable_log() ) { 55 $file = kaw_check_for_log_file(); 56 $written_data = kaw_check_log_text( $data ); 57 $written_data = gmdate( 'd-m-Y H:i:s' ) . ' ' . $written_data . PHP_EOL; 58 fwrite( $file, $written_data ); 59 fclose( $file ); 60 } 61 } 62 63 /** 64 * Converts other datatypes to a string and maybe blurs out data if wanted. 65 * 66 * @param mixed $data The things that should be written in the log_file. 67 * @return string 68 */ 69 function kaw_check_log_text( $data ) { 70 switch ( gettype( $data ) ) { 71 case 'string': 72 break; 73 case 'array': 74 $data = '[' . implode( 75 ', ', 76 array_map( 77 function ( $v, $k ) { 78 return sprintf( "'%s'='%s'", $k, $v ); 79 }, 80 $data, 81 array_keys( $data ) 82 ) 83 ) . ']'; 84 break; 85 case 'boolean': 86 $data = $data ? 'true' : 'false'; 87 break; 88 case 'integer': 89 $data = strval( $data ); 90 break; 91 case 'double': 92 $data = strval( $data ); 93 break; 94 case 'NULL': 95 $data = 'NULL'; 96 break; 97 default: 98 $data = 'Error: Unable to print the value.'; 99 break; 100 } 101 102 if ( kaw_get_api_log_crypto() ) { 103 $data = preg_replace( '/"details":\[{.*}\]/', '"details":[***]', $data ); 104 $data = preg_replace( '/:\/\/.+\.kassa.at/', '://***.kassa.at', $data ); 105 } 106 107 return $data; 108 } 109 110 /** 111 * Enable / Disable the kaw_logs! 51 * @param string $type The type of log-entry. Can be 'API-CALL', 'API-ERROR', 'DATA-UPDATE' or 'SYSTEM'. 52 * @param array $data The things that should be written in the log_file. 53 * @param boolean $force Forces logging to be written to logfile even if logging is disabled. 54 */ 55 function kaw_log_data( $type, $data, $force = false ) { 56 if ( kaw_enable_log() || $force ) { 57 $logfile = kaw_check_for_log_file(); 58 $filestring = file_get_contents( $logfile ); /* phpcs:ignore */ 59 $filejson = json_decode( $filestring ); 60 array_unshift( 61 $filejson, 62 array( 63 'datetime' => gmdate( 'd-m-Y H:i:s' ), 64 'type' => $type, 65 'data' => kaw_log_data_formating( $type, $data ), 66 ) 67 ); 68 $filejson = kaw_cut_log( $filejson ); 69 $fileresult = wp_json_encode( $filejson ); 70 file_put_contents( $logfile, $fileresult ); /* phpcs:ignore */ 71 } 72 } 73 74 /** 75 * Brings the data in the correct Format for writing it into the logfile. 76 * 77 * @param string $type The type of log-entry. Can be 'API-CALL', 'API-ERROR', 'DATA-UPDATE' or 'SYSTEM'. 78 * @param array $data The values that should be written in the log_file. 79 * @return array 80 */ 81 function kaw_log_data_formating( $type, $data ) { 82 switch ( $type ) { 83 case 'API-CALL': 84 return array( 85 'httpMethod' => $data['httpMethod'], 86 'httpUrl' => $data['httpUrl'], 87 'params' => $data['paramSting'], 88 'kawKey' => $data['kawKey'], 89 'result' => $data['result'], 90 'location' => $data['location'], 91 ); 92 93 case 'API-ERROR': 94 return array( 95 'message' => $data['message'], 96 'location' => $data['location'], 97 ); 98 99 case 'DATA-UPDATE': 100 return array( 101 'message' => $data['message'], 102 'key' => $data['key'], 103 'original' => $data['original'], 104 'updated' => $data['updated'], 105 'location' => $data['location'], 106 ); 107 108 case 'SYSTEM': 109 return array( 110 'message' => $data['message'], 111 'location' => $data['location'], 112 ); 113 } 114 } 115 116 /** 117 * Performing the act of trimming the logfile to the correct length before 118 * saving its content back to the file. The default length is 1000 entries 119 * but it can be a different length whitch would be 120 * stored in the wp_option 'kaw-logging-size'! 121 * 122 * @param array $json The content of the logfile that should be trimmed. 123 * @return array 124 */ 125 function kaw_cut_log( $json ) { 126 $requested_size = get_option( 'kaw-logging-size' ); 127 if ( ! $requested_size ) { 128 $requested_size = 1000; 129 } 130 131 update_option( 'logging-info', count( $json ) ); 132 133 if ( count( $json ) > $requested_size ) { 134 $json = array_slice( $json, 0, $requested_size ); 135 } 136 137 return $json; 138 } 139 140 /** 141 * Checking if the kaw logging is enabled or disabled. Default is enabled, 142 * but the user can change that with value stored in the wp_option 'kaw-logging'! 143 * 144 * This function is overruled if the function 145 * kaw_log_data (which calls this function) got $force as true! 146 * 147 * @return boolean 112 148 */ 113 149 function kaw_enable_log() { 150 if ( get_option( 'kaw-logging' ) ) { 151 if ( get_option( 'kaw-logging' ) === 'enabled' ) { 152 return true; 153 } elseif ( get_option( 'kaw-logging' ) === 'disabled' ) { 154 return false; 155 } 156 } 157 114 158 return true; 115 159 } 160 161 /** 162 * Enabling or disabling the logging of kaw logs. 163 * Called via ajax this function updates (or creates) the wp_option 'kaw-logging' 164 * to stop or start again logging all non-forced loggings. 165 * In the end it forces a log-entry to keep track of activating and deactivating the logging. 166 */ 167 function kaw_activate_logging() { 168 $mode = ( isset( $_POST['mode'] ) ) ? sanitize_text_field( wp_unslash( $_POST['mode'] ) ) : 'disable'; /* phpcs:ignore */ 169 170 if ( 'enable' === $mode ) { 171 $val = 'enabled'; 172 } else { 173 $val = 'disabled'; 174 } 175 176 if ( get_option( 'kaw-logging' ) ) { 177 update_option( 'kaw-logging', $val ); 178 } else { 179 add_option( 'kaw-logging', $val ); 180 } 181 kaw_log_data( 182 'SYSTEM', 183 array( 184 'message' => 'Logging ' . $val . '.', 185 'location' => kaw_get_locationstring(), 186 ), 187 true 188 ); 189 190 wp_send_json_success( kaw_enable_log() ); 191 } 192 add_action( 'wp_ajax_kaw_activate_logging', 'kaw_activate_logging' ); 193 194 /** 195 * Called via ajax this function gets a number and stores that number in the 196 * wp_option 'kaw-logging-size'. This value is used to 197 * trim the logfile in the process of writing to it. 198 * In the end it forces a log-entry to save the updating of the logging-size. 199 */ 200 function kaw_logfile_change_size() { 201 $val = ( isset( $_POST['size'] ) ) ? sanitize_text_field( wp_unslash( $_POST['size'] ) ) : '1000'; /* phpcs:ignore */ 202 203 if ( get_option( 'kaw-logging-size' ) ) { 204 update_option( 'kaw-logging-size', $val ); 205 } else { 206 add_option( 'kaw-logging-size', $val ); 207 } 208 209 kaw_log_data( 210 'SYSTEM', 211 array( 212 'message' => 'Logging length changed to: ' . $val, 213 'location' => kaw_get_locationstring(), 214 ), 215 true 216 ); 217 218 wp_send_json_success(); 219 } 220 add_action( 'wp_ajax_kaw_logfile_change_size', 'kaw_logfile_change_size' ); 221 222 /** 223 * Deletes the kaw-logfile, deletes the kaw-log folder, 224 * then creates both of them again and 225 * forces a log-entry, that says that the logfile was cleared. 226 */ 227 function kaw_delete_logfile() { 228 $uploads = wp_upload_dir( null, false ); 229 $logs_dir = $uploads['basedir'] . '/kaw-logs'; 230 231 if ( file_exists( $logs_dir . '/log.json' ) ) { 232 unlink( $logs_dir . '/log.json' ); 233 } 234 235 if ( is_dir( $logs_dir ) ) { 236 rmdir( $logs_dir ); 237 } 238 kaw_log_data( 239 'SYSTEM', 240 array( 241 'message' => 'Logfile cleared.', 242 'location' => kaw_get_locationstring(), 243 ), 244 true 245 ); 246 247 wp_send_json_success(); 248 } 249 add_action( 'wp_ajax_kaw_delete_logfile', 'kaw_delete_logfile' ); 116 250 117 251 /** … … 128 262 */ 129 263 function kaw_plugin_activate() { 130 kaw_log_data( '######################################################################' ); 131 kaw_log_data( '############################### Plugin ###############################' ); 132 kaw_log_data( '##################### "KASSA.AT Für Woocommerce" #####################' ); 133 kaw_log_data( '############################# activated ##############################' ); 134 kaw_log_data( '######################################################################' ); 264 kaw_log_data( 265 'SYSTEM', 266 array( 267 'message' => 'Plugin KASSA.AT For WooCommerce activated.', 268 'location' => kaw_get_locationstring(), 269 ), 270 true 271 ); 135 272 add_option( 'kaw-message-active', 1 ); 136 273 } … … 141 278 */ 142 279 function kaw_plugin_deactivate() { 143 kaw_log_data( '######################################################################' ); 144 kaw_log_data( '############################### Plugin ###############################' ); 145 kaw_log_data( '##################### "KASSA.AT Für Woocommerce" #####################' ); 146 kaw_log_data( '############################ deactivated #############################' ); 147 kaw_log_data( '######################################################################' ); 280 kaw_log_data( 281 'SYSTEM', 282 array( 283 'message' => 'Plugin KASSA.AT For WooCommerce deactivated.', 284 'location' => kaw_get_locationstring(), 285 ), 286 true 287 ); 148 288 delete_option( 'kaw-message-active' ); 149 289 } … … 209 349 add_action( 'wp_ajax_my_dismiss_notice', 'kaw_update_kaw_message_active' ); 210 350 351 /** 352 * Get the current Filename and Linenumber! 353 */ 354 function kaw_get_locationstring() { 355 $bt = debug_backtrace(); /* phpcs:ignore */ 356 $caller = array_shift( $bt ); 357 if ( count( explode( 'wp-content', $caller['file'] ) ) === 2 ) { 358 $path = '/wp-content' . explode( 'wp-content', $caller['file'] )[1]; 359 } else { 360 $path = $caller['file']; 361 } 362 return $path . ':' . $caller['line']; 363 } 364 211 365 require 'api-connection.php'; 212 366 require 'create-menus.php'; -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce-de_AT.po
r2450545 r2665761 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"4 "POT-Creation-Date: 202 0-12-29 09:23+0100\n"5 "PO-Revision-Date: 202 0-12-29 09:24+0100\n"3 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 4 "POT-Creation-Date: 2022-01-24 10:34+0100\n" 5 "PO-Revision-Date: 2022-01-24 20:58+0100\n" 6 6 "Last-Translator: manuelschultz\n" 7 7 "Language-Team: KASSA.AT\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-3: stock-syncro.php\n" 20 20 21 #: create-menus.php:33 21 #: create-menus.php:28 create-menus.php:29 22 msgid "Options" 23 msgstr "Optionen" 24 25 #: create-menus.php:37 create-menus.php:38 26 msgid "Logs" 27 msgstr "Logs" 28 29 #: create-menus.php:51 22 30 msgid "You do not have sufficient permissions to access this page." 23 31 msgstr "" 24 32 "Sie haben nicht die nötigen Berechtigungen um auf die Seite zuzugreifen." 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "Verbindung zu KASSA.AT:" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 msgstr "Sie sind bereits mit eine r KASSA.AT-Konto.verbunden."33 34 #: create-menus.php: 15840 msgstr "Sie sind bereits mit einem KASSA.AT-Konto verbunden." 41 42 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "Entfernen Sie die Verbindung zu KASSA.AT." 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "Mit KASSA.AT Verbinden" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "Haben Sie kein KASSA.AT-Konto? Erstellen Sie eines!" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "Synchronisieren Sie den Lagerstand:" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "Wählen Sie ein Lager:" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "Änderungen speichern!" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "Lagerstände mit KASSA.AT synchronisieren." 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "KASSA.AT-Daten als Master verwenden" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "Synchronisieren!" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "Synchronisieren auf der Produktseite!" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "Synchronisieren im Einkaufswagen!" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "Synchronisieren wenn eine Bestellung eingeht!" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "Parameter" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "API-Schlüssel" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "Ergebnis" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "Ort" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "Änderungen" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "Plugin Logs:" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "Logdatei neu laden" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "Aktualisiert" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "Logging aktivieren" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "Logging deaktivieren" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "Logdatei leeren" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "Logdatei herunterladen" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "Zeilen" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "Länge der Logdatei begrenzen" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "Speichern" 152 153 #: create-menus.php:577 154 msgid "Database options" 155 msgstr "Datenbank Optionen" 156 157 #: create-menus.php:581 158 msgid "Creator" 159 msgstr "Ersteller" 160 161 #: create-menus.php:582 162 msgid "Option-name" 163 msgstr "Name der Option" 164 165 #: create-menus.php:583 166 msgid "Option-value" 167 msgstr "Wert der Option" 168 169 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 170 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 171 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 172 msgid "KASSA.AT For WooCommerce" 173 msgstr "KASSA.AT Für WooCommerce" 174 175 #: kassa-at-for-woocommerce.php:316 71 176 msgid "Please follow these instructions to use the plugin:" 72 177 msgstr "Bitte folgen Sie den Anweisungen, um das Plugin einzurichten:" 73 178 74 #: kassa-at-for-woocommerce.php: 171179 #: kassa-at-for-woocommerce.php:320 75 180 #, php-format 76 181 msgid "" … … 81 186 "a>." 82 187 83 #: kassa-at-for-woocommerce.php: 172188 #: kassa-at-for-woocommerce.php:321 84 189 msgid "" 85 190 "Use the Button \"Connect with KASSA.AT account\" to connect to the register-" … … 89 194 "herzustellen." 90 195 91 #: kassa-at-for-woocommerce.php: 176196 #: kassa-at-for-woocommerce.php:325 92 197 msgid "" 93 198 "Login the KASSA.AT site and create your articles. Note that in order to have " … … 99 204 "später noch wichtig)." 100 205 101 #: kassa-at-for-woocommerce.php: 177206 #: kassa-at-for-woocommerce.php:326 102 207 msgid "" 103 208 "In your KASSA.AT account, create a warehouse and assign the articles to it." … … 106 211 "mit Ihren Artikeln." 107 212 108 #: kassa-at-for-woocommerce.php: 178213 #: kassa-at-for-woocommerce.php:327 109 214 msgid "" 110 215 "Go back to your WordPress page, choose your register-warehouse from your " … … 114 219 "das Sie eben befüllt haben." 115 220 116 #: kassa-at-for-woocommerce.php: 179221 #: kassa-at-for-woocommerce.php:328 117 222 msgid "" 118 223 "Go to your woocommerce-article section and create or edit your articles, use " … … 125 230 "eintragen und aktivieren Sie \"Lagerbestand verwalten\"." 126 231 127 #: kassa-at-for-woocommerce.php: 180232 #: kassa-at-for-woocommerce.php:329 128 233 msgid "" 129 234 "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!" … … 133 238 "Sie auf den \"Synchronisieren!\"-Knopf." 134 239 135 #: kassa-at-for-woocommerce.php: 182240 #: kassa-at-for-woocommerce.php:331 136 241 msgid "" 137 242 "And here we go. Whenever a customer buys anything in your local store or a " … … 145 250 "Blick haben können." 146 251 147 #: kassa-at-for-woocommerce.php: 188252 #: kassa-at-for-woocommerce.php:337 148 253 #, php-format 149 254 msgid "If you have any questions with the setting up, feel free to %s." 150 255 msgstr "Wenn Sie irgendwelche Fragen haben, %s." 151 256 152 #: kassa-at-for-woocommerce.php: 192257 #: kassa-at-for-woocommerce.php:341 153 258 msgid "contact us" 154 259 msgstr "kontaktieren Sie uns" 155 260 156 #: stock-syncro.php: 96261 #: stock-syncro.php:149 157 262 #, php-format 158 263 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce-de_CH.po
r2450545 r2665761 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"4 "POT-Creation-Date: 202 0-12-29 09:25+0100\n"5 "PO-Revision-Date: 202 0-12-29 09:25+0100\n"3 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 4 "POT-Creation-Date: 2022-01-24 12:52+0100\n" 5 "PO-Revision-Date: 2022-01-24 20:59+0100\n" 6 6 "Last-Translator: manuelschultz\n" 7 7 "Language-Team: KASSA.AT\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-3: stock-syncro.php\n" 20 20 21 #: create-menus.php:33 21 #: create-menus.php:28 create-menus.php:29 22 msgid "Options" 23 msgstr "Optionen" 24 25 #: create-menus.php:37 create-menus.php:38 26 msgid "Logs" 27 msgstr "Logs" 28 29 #: create-menus.php:51 22 30 msgid "You do not have sufficient permissions to access this page." 23 31 msgstr "" 24 32 "Sie haben nicht die nötigen Berechtigungen um auf die Seite zuzugreifen." 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "Verbindung zu KASSA.AT:" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 msgstr "Sie sind bereits mit eine r KASSA.AT-Konto.verbunden."33 34 #: create-menus.php: 15840 msgstr "Sie sind bereits mit einem KASSA.AT-Konto verbunden." 41 42 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "Entfernen Sie die Verbindung zu KASSA.AT." 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "Mit KASSA.AT Verbinden" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "Haben Sie kein KASSA.AT-Konto? Erstellen Sie eines!" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "Synchronisieren Sie den Lagerstand:" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "Wählen Sie ein Lager:" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "Änderungen speichern!" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "Lagerstände mit KASSA.AT synchronisieren." 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "KASSA.AT-Daten als Master verwenden" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "Synchronisieren!" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "Synchronisieren auf der Produktseite!" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "Synchronisieren im Einkaufswagen!" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "Synchronisieren wenn eine Bestellung eingeht!" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "Parameter" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "API-Schlüssel" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "Ergebnis" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "Ort" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "Änderungen" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "Plugin Logs:" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "Logdatei neu laden" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "Aktualisiert" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "Logging aktivieren" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "Logging deaktivieren" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "Logdatei leeren" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "Logdatei herunterladen" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "Zeilen" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "Länge der Logdatei begrenzen" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "Speichern" 152 153 #: create-menus.php:577 154 msgid "Database options" 155 msgstr "Datenbank Optionen" 156 157 #: create-menus.php:581 158 msgid "Creator" 159 msgstr "Ersteller" 160 161 #: create-menus.php:582 162 msgid "Option-name" 163 msgstr "Name der Option" 164 165 #: create-menus.php:583 166 msgid "Option-value" 167 msgstr "Wert der Option" 168 169 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 170 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 171 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 172 msgid "KASSA.AT For WooCommerce" 173 msgstr "KASSA.AT Für WooCommerce" 174 175 #: kassa-at-for-woocommerce.php:316 71 176 msgid "Please follow these instructions to use the plugin:" 72 177 msgstr "Bitte folgen Sie den Anweisungen, um das Plugin einzurichten:" 73 178 74 #: kassa-at-for-woocommerce.php: 171179 #: kassa-at-for-woocommerce.php:320 75 180 #, php-format 76 181 msgid "" … … 81 186 "a>." 82 187 83 #: kassa-at-for-woocommerce.php: 172188 #: kassa-at-for-woocommerce.php:321 84 189 msgid "" 85 190 "Use the Button \"Connect with KASSA.AT account\" to connect to the register-" … … 89 194 "herzustellen." 90 195 91 #: kassa-at-for-woocommerce.php: 176196 #: kassa-at-for-woocommerce.php:325 92 197 msgid "" 93 198 "Login the KASSA.AT site and create your articles. Note that in order to have " … … 99 204 "später noch wichtig)." 100 205 101 #: kassa-at-for-woocommerce.php: 177206 #: kassa-at-for-woocommerce.php:326 102 207 msgid "" 103 208 "In your KASSA.AT account, create a warehouse and assign the articles to it." … … 106 211 "mit Ihren Artikeln." 107 212 108 #: kassa-at-for-woocommerce.php: 178213 #: kassa-at-for-woocommerce.php:327 109 214 msgid "" 110 215 "Go back to your WordPress page, choose your register-warehouse from your " … … 114 219 "das Sie eben befüllt haben." 115 220 116 #: kassa-at-for-woocommerce.php: 179221 #: kassa-at-for-woocommerce.php:328 117 222 msgid "" 118 223 "Go to your woocommerce-article section and create or edit your articles, use " … … 125 230 "eintragen und aktivieren Sie \"Lagerbestand verwalten\"." 126 231 127 #: kassa-at-for-woocommerce.php: 180232 #: kassa-at-for-woocommerce.php:329 128 233 msgid "" 129 234 "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!" … … 133 238 "Sie auf den \"Synchronisieren!\"-Knopf." 134 239 135 #: kassa-at-for-woocommerce.php: 182240 #: kassa-at-for-woocommerce.php:331 136 241 msgid "" 137 242 "And here we go. Whenever a customer buys anything in your local store or a " … … 145 250 "Blick haben können." 146 251 147 #: kassa-at-for-woocommerce.php: 188252 #: kassa-at-for-woocommerce.php:337 148 253 #, php-format 149 254 msgid "If you have any questions with the setting up, feel free to %s." 150 255 msgstr "Wenn Sie irgendwelche Fragen haben, %s." 151 256 152 #: kassa-at-for-woocommerce.php: 192257 #: kassa-at-for-woocommerce.php:341 153 258 msgid "contact us" 154 259 msgstr "kontaktieren Sie uns" 155 260 156 #: stock-syncro.php: 96261 #: stock-syncro.php:149 157 262 #, php-format 158 263 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce-de_CH_formal.po
r2450545 r2665761 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"4 "POT-Creation-Date: 202 0-12-29 09:26+0100\n"5 "PO-Revision-Date: 202 0-12-29 09:26+0100\n"3 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 4 "POT-Creation-Date: 2022-01-24 10:36+0100\n" 5 "PO-Revision-Date: 2022-01-24 20:59+0100\n" 6 6 "Last-Translator: manuelschultz\n" 7 7 "Language-Team: KASSA.AT\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-3: stock-syncro.php\n" 20 20 21 #: create-menus.php:33 21 #: create-menus.php:28 create-menus.php:29 22 msgid "Options" 23 msgstr "Optionen" 24 25 #: create-menus.php:37 create-menus.php:38 26 msgid "Logs" 27 msgstr "Logs" 28 29 #: create-menus.php:51 22 30 msgid "You do not have sufficient permissions to access this page." 23 31 msgstr "" 24 32 "Sie haben nicht die nötigen Berechtigungen um auf die Seite zuzugreifen." 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "Verbindung zu KASSA.AT:" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 msgstr "Sie sind bereits mit eine r KASSA.AT-Konto.verbunden."33 34 #: create-menus.php: 15840 msgstr "Sie sind bereits mit einem KASSA.AT-Konto verbunden." 41 42 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "Entfernen Sie die Verbindung zu KASSA.AT." 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "Mit KASSA.AT Verbinden" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "Haben Sie kein KASSA.AT-Konto? Erstellen Sie eines!" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "Synchronisieren Sie den Lagerstand:" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "Wählen Sie ein Lager:" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "Änderungen speichern!" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "Lagerstände mit KASSA.AT synchronisieren." 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "KASSA.AT-Daten als Master verwenden" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "Synchronisieren!" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "Synchronisieren auf der Produktseite!" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "Synchronisieren im Einkaufswagen!" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "Synchronisieren wenn eine Bestellung eingeht!" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "Parameter" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "API-Schlüssel" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "Ergebnis" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "Ort" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "Änderungen" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "Plugin Logs:" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "Logdatei neu laden" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "Aktualisiert" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "Logging aktivieren" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "Logging deaktivieren" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "Logdatei leeren" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "Logdatei herunterladen" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "Zeilen" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "Länge der Logdatei begrenzen" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "Speichern" 152 153 #: create-menus.php:577 154 msgid "Database options" 155 msgstr "Datenbank Optionen" 156 157 #: create-menus.php:581 158 msgid "Creator" 159 msgstr "Ersteller" 160 161 #: create-menus.php:582 162 msgid "Option-name" 163 msgstr "Name der Option" 164 165 #: create-menus.php:583 166 msgid "Option-value" 167 msgstr "Wert der Option" 168 169 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 170 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 171 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 172 msgid "KASSA.AT For WooCommerce" 173 msgstr "KASSA.AT Für WooCommerce" 174 175 #: kassa-at-for-woocommerce.php:316 71 176 msgid "Please follow these instructions to use the plugin:" 72 177 msgstr "Bitte folgen Sie den Anweisungen, um das Plugin einzurichten:" 73 178 74 #: kassa-at-for-woocommerce.php: 171179 #: kassa-at-for-woocommerce.php:320 75 180 #, php-format 76 181 msgid "" … … 81 186 "a>." 82 187 83 #: kassa-at-for-woocommerce.php: 172188 #: kassa-at-for-woocommerce.php:321 84 189 msgid "" 85 190 "Use the Button \"Connect with KASSA.AT account\" to connect to the register-" … … 89 194 "herzustellen." 90 195 91 #: kassa-at-for-woocommerce.php: 176196 #: kassa-at-for-woocommerce.php:325 92 197 msgid "" 93 198 "Login the KASSA.AT site and create your articles. Note that in order to have " … … 99 204 "später noch wichtig)." 100 205 101 #: kassa-at-for-woocommerce.php: 177206 #: kassa-at-for-woocommerce.php:326 102 207 msgid "" 103 208 "In your KASSA.AT account, create a warehouse and assign the articles to it." … … 106 211 "mit Ihren Artikeln." 107 212 108 #: kassa-at-for-woocommerce.php: 178213 #: kassa-at-for-woocommerce.php:327 109 214 msgid "" 110 215 "Go back to your WordPress page, choose your register-warehouse from your " … … 114 219 "das Sie eben befüllt haben." 115 220 116 #: kassa-at-for-woocommerce.php: 179221 #: kassa-at-for-woocommerce.php:328 117 222 msgid "" 118 223 "Go to your woocommerce-article section and create or edit your articles, use " … … 125 230 "eintragen und aktivieren Sie \"Lagerbestand verwalten\"." 126 231 127 #: kassa-at-for-woocommerce.php: 180232 #: kassa-at-for-woocommerce.php:329 128 233 msgid "" 129 234 "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!" … … 133 238 "Sie auf den \"Synchronisieren!\"-Knopf." 134 239 135 #: kassa-at-for-woocommerce.php: 182240 #: kassa-at-for-woocommerce.php:331 136 241 msgid "" 137 242 "And here we go. Whenever a customer buys anything in your local store or a " … … 145 250 "Blick haben können." 146 251 147 #: kassa-at-for-woocommerce.php: 188252 #: kassa-at-for-woocommerce.php:337 148 253 #, php-format 149 254 msgid "If you have any questions with the setting up, feel free to %s." 150 255 msgstr "Wenn Sie irgendwelche Fragen haben, %s." 151 256 152 #: kassa-at-for-woocommerce.php: 192257 #: kassa-at-for-woocommerce.php:341 153 258 msgid "contact us" 154 259 msgstr "kontaktieren Sie uns" 155 260 156 #: stock-syncro.php: 96261 #: stock-syncro.php:149 157 262 #, php-format 158 263 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce-de_DE.po
r2450545 r2665761 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"4 "POT-Creation-Date: 202 0-12-29 09:27+0100\n"5 "PO-Revision-Date: 202 0-12-29 09:27+0100\n"3 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 4 "POT-Creation-Date: 2022-01-24 10:36+0100\n" 5 "PO-Revision-Date: 2022-01-24 21:00+0100\n" 6 6 "Last-Translator: manuelschultz\n" 7 7 "Language-Team: KASSA.AT\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-3: stock-syncro.php\n" 20 20 21 #: create-menus.php:33 21 #: create-menus.php:28 create-menus.php:29 22 msgid "Options" 23 msgstr "Optionen" 24 25 #: create-menus.php:37 create-menus.php:38 26 msgid "Logs" 27 msgstr "Logs" 28 29 #: create-menus.php:51 22 30 msgid "You do not have sufficient permissions to access this page." 23 31 msgstr "" 24 32 "Sie haben nicht die nötigen Berechtigungen um auf die Seite zuzugreifen." 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "Verbindung zu KASSA.AT:" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 msgstr "Sie sind bereits mit eine r KASSA.AT-Konto.verbunden."33 34 #: create-menus.php: 15840 msgstr "Sie sind bereits mit einem KASSA.AT-Konto verbunden." 41 42 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "Entfernen Sie die Verbindung zu KASSA.AT." 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "Mit KASSA.AT Verbinden" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "Haben Sie kein KASSA.AT-Konto? Erstellen Sie eines!" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "Synchronisieren Sie den Lagerstand:" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "Wählen Sie ein Lager:" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "Änderungen speichern!" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "Lagerstände mit KASSA.AT synchronisieren." 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "KASSA.AT-Daten als Master verwenden" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "Synchronisieren!" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "Synchronisieren auf der Produktseite!" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "Synchronisieren im Einkaufswagen!" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "Synchronisieren wenn eine Bestellung eingeht!" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "Parameter" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "API-Schlüssel" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "Ergebnis" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "Ort" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "Änderungen" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "Plugin Logs:" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "Logdatei neu laden" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "Aktualisiert" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "Logging aktivieren" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "Logging deaktivieren" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "Logdatei leeren" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "Logdatei herunterladen" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "Zeilen" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "Länge der Logdatei begrenzen" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "Speichern" 152 153 #: create-menus.php:577 154 msgid "Database options" 155 msgstr "Datenbank Optionen" 156 157 #: create-menus.php:581 158 msgid "Creator" 159 msgstr "Ersteller" 160 161 #: create-menus.php:582 162 msgid "Option-name" 163 msgstr "Name der Option" 164 165 #: create-menus.php:583 166 msgid "Option-value" 167 msgstr "Wert der Option" 168 169 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 170 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 171 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 172 msgid "KASSA.AT For WooCommerce" 173 msgstr "KASSA.AT Für WooCommerce" 174 175 #: kassa-at-for-woocommerce.php:316 71 176 msgid "Please follow these instructions to use the plugin:" 72 177 msgstr "Bitte folgen Sie den Anweisungen, um das Plugin einzurichten:" 73 178 74 #: kassa-at-for-woocommerce.php: 171179 #: kassa-at-for-woocommerce.php:320 75 180 #, php-format 76 181 msgid "" … … 81 186 "a>." 82 187 83 #: kassa-at-for-woocommerce.php: 172188 #: kassa-at-for-woocommerce.php:321 84 189 msgid "" 85 190 "Use the Button \"Connect with KASSA.AT account\" to connect to the register-" … … 89 194 "herzustellen." 90 195 91 #: kassa-at-for-woocommerce.php: 176196 #: kassa-at-for-woocommerce.php:325 92 197 msgid "" 93 198 "Login the KASSA.AT site and create your articles. Note that in order to have " … … 99 204 "später noch wichtig)." 100 205 101 #: kassa-at-for-woocommerce.php: 177206 #: kassa-at-for-woocommerce.php:326 102 207 msgid "" 103 208 "In your KASSA.AT account, create a warehouse and assign the articles to it." … … 106 211 "mit Ihren Artikeln." 107 212 108 #: kassa-at-for-woocommerce.php: 178213 #: kassa-at-for-woocommerce.php:327 109 214 msgid "" 110 215 "Go back to your WordPress page, choose your register-warehouse from your " … … 114 219 "das Sie eben befüllt haben." 115 220 116 #: kassa-at-for-woocommerce.php: 179221 #: kassa-at-for-woocommerce.php:328 117 222 msgid "" 118 223 "Go to your woocommerce-article section and create or edit your articles, use " … … 125 230 "eintragen und aktivieren Sie \"Lagerbestand verwalten\"." 126 231 127 #: kassa-at-for-woocommerce.php: 180232 #: kassa-at-for-woocommerce.php:329 128 233 msgid "" 129 234 "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!" … … 133 238 "Sie auf den \"Synchronisieren!\"-Knopf." 134 239 135 #: kassa-at-for-woocommerce.php: 182240 #: kassa-at-for-woocommerce.php:331 136 241 msgid "" 137 242 "And here we go. Whenever a customer buys anything in your local store or a " … … 145 250 "Blick haben können." 146 251 147 #: kassa-at-for-woocommerce.php: 188252 #: kassa-at-for-woocommerce.php:337 148 253 #, php-format 149 254 msgid "If you have any questions with the setting up, feel free to %s." 150 255 msgstr "Wenn Sie irgendwelche Fragen haben, %s." 151 256 152 #: kassa-at-for-woocommerce.php: 192257 #: kassa-at-for-woocommerce.php:341 153 258 msgid "contact us" 154 259 msgstr "kontaktieren Sie uns" 155 260 156 #: stock-syncro.php: 96261 #: stock-syncro.php:149 157 262 #, php-format 158 263 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce-de_DE_formal.po
r2450545 r2665761 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"4 "POT-Creation-Date: 202 0-12-29 09:28+0100\n"5 "PO-Revision-Date: 202 0-12-29 09:28+0100\n"3 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 4 "POT-Creation-Date: 2022-01-20 09:32+0100\n" 5 "PO-Revision-Date: 2022-01-24 21:00+0100\n" 6 6 "Last-Translator: manuelschultz\n" 7 7 "Language-Team: KASSA.AT\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 19 19 "X-Poedit-SearchPath-3: stock-syncro.php\n" 20 20 21 #: create-menus.php:33 21 #: create-menus.php:28 create-menus.php:29 22 msgid "Options" 23 msgstr "Optionen" 24 25 #: create-menus.php:37 create-menus.php:38 26 msgid "Logs" 27 msgstr "Logs" 28 29 #: create-menus.php:51 22 30 msgid "You do not have sufficient permissions to access this page." 23 31 msgstr "" 24 32 "Sie haben nicht die nötigen Berechtigungen um auf die Seite zuzugreifen." 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "Verbindung zu KASSA.AT:" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 msgstr "Sie sind bereits mit eine r KASSA.AT-Konto.verbunden."33 34 #: create-menus.php: 15840 msgstr "Sie sind bereits mit einem KASSA.AT-Konto verbunden." 41 42 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "Entfernen Sie die Verbindung zu KASSA.AT." 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "Mit KASSA.AT Verbinden" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "Haben Sie kein KASSA.AT-Konto? Erstellen Sie eines!" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "Synchronisieren Sie den Lagerstand:" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "Wählen Sie ein Lager:" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "Änderungen speichern!" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "Lagerstände mit KASSA.AT synchronisieren." 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "KASSA.AT-Daten als Master verwenden" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "Synchronisieren!" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "Synchronisieren auf der Produktseite!" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "Synchronisieren im Einkaufswagen!" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "Synchronisieren wenn eine Bestellung eingeht!" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "Parameter" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "API-Schlüssel" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "Ergebnis" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "Ort" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "Änderungen" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "Plugin Logs:" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "Logdatei neu laden" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "Aktualisiert" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "Logging aktivieren" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "Logging deaktivieren" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "Logdatei leeren" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "Logdatei herunterladen" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "Zeilen" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "Länge der Logdatei begrenzen" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "Speichern" 152 153 #: create-menus.php:581 154 msgid "Creator" 155 msgstr "Ersteller" 156 157 #: create-menus.php:582 158 msgid "Option-name" 159 msgstr "Name der Option" 160 161 #: create-menus.php:583 162 msgid "Option-value" 163 msgstr "Wert der Option" 164 165 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 166 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 167 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 168 msgid "KASSA.AT For WooCommerce" 169 msgstr "KASSA.AT Für WooCommerce" 170 171 #: kassa-at-for-woocommerce.php:315 71 172 msgid "Please follow these instructions to use the plugin:" 72 173 msgstr "Bitte folgen Sie den Anweisungen, um das Plugin einzurichten:" 73 174 74 #: kassa-at-for-woocommerce.php: 171175 #: kassa-at-for-woocommerce.php:319 75 176 #, php-format 76 177 msgid "" … … 81 182 "a>." 82 183 83 #: kassa-at-for-woocommerce.php: 172184 #: kassa-at-for-woocommerce.php:320 84 185 msgid "" 85 186 "Use the Button \"Connect with KASSA.AT account\" to connect to the register-" … … 89 190 "herzustellen." 90 191 91 #: kassa-at-for-woocommerce.php: 176192 #: kassa-at-for-woocommerce.php:324 92 193 msgid "" 93 194 "Login the KASSA.AT site and create your articles. Note that in order to have " … … 99 200 "später noch wichtig)." 100 201 101 #: kassa-at-for-woocommerce.php: 177202 #: kassa-at-for-woocommerce.php:325 102 203 msgid "" 103 204 "In your KASSA.AT account, create a warehouse and assign the articles to it." … … 106 207 "mit Ihren Artikeln." 107 208 108 #: kassa-at-for-woocommerce.php: 178209 #: kassa-at-for-woocommerce.php:326 109 210 msgid "" 110 211 "Go back to your WordPress page, choose your register-warehouse from your " … … 114 215 "das Sie eben befüllt haben." 115 216 116 #: kassa-at-for-woocommerce.php: 179217 #: kassa-at-for-woocommerce.php:327 117 218 msgid "" 118 219 "Go to your woocommerce-article section and create or edit your articles, use " … … 125 226 "eintragen und aktivieren Sie \"Lagerbestand verwalten\"." 126 227 127 #: kassa-at-for-woocommerce.php: 180228 #: kassa-at-for-woocommerce.php:328 128 229 msgid "" 129 230 "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!" … … 133 234 "Sie auf den \"Synchronisieren!\"-Knopf." 134 235 135 #: kassa-at-for-woocommerce.php: 182236 #: kassa-at-for-woocommerce.php:330 136 237 msgid "" 137 238 "And here we go. Whenever a customer buys anything in your local store or a " … … 145 246 "Blick haben können." 146 247 147 #: kassa-at-for-woocommerce.php: 188248 #: kassa-at-for-woocommerce.php:336 148 249 #, php-format 149 250 msgid "If you have any questions with the setting up, feel free to %s." 150 251 msgstr "Wenn Sie irgendwelche Fragen haben, %s." 151 252 152 #: kassa-at-for-woocommerce.php: 192253 #: kassa-at-for-woocommerce.php:340 153 254 msgid "contact us" 154 255 msgstr "kontaktieren Sie uns" 155 256 156 #: stock-syncro.php: 96257 #: stock-syncro.php:149 157 258 #, php-format 158 259 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/languages/kassa-at-for-woocommerce.pot
r2450545 r2665761 2 2 msgid "" 3 3 msgstr "" 4 "Project-Id-Version: KASSA.AT For WooCommerce 1. 0.0\n"5 "POT-Creation-Date: 202 0-12-29 09:22+0100\n"4 "Project-Id-Version: KASSA.AT For WooCommerce 1.1.0\n" 5 "POT-Creation-Date: 2022-01-24 12:51+0100\n" 6 6 "PO-Revision-Date: 2020-09-22 15:49+0200\n" 7 7 "Last-Translator: manuelschultz\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "X-Generator: Poedit 2.4.2\n"12 "X-Generator: Poedit 3.0\n" 13 13 "X-Poedit-Basepath: ..\n" 14 14 "Plural-Forms: nplurals=2; plural=(n != 1);\n" … … 20 20 "X-Poedit-SearchPath-3: stock-syncro.php\n" 21 21 22 #: create-menus.php:33 22 #: create-menus.php:28 create-menus.php:29 23 msgid "Options" 24 msgstr "" 25 26 #: create-menus.php:37 create-menus.php:38 27 msgid "Logs" 28 msgstr "" 29 30 #: create-menus.php:51 23 31 msgid "You do not have sufficient permissions to access this page." 24 32 msgstr "" 25 33 26 #: create-menus.php: 15234 #: create-menus.php:232 27 35 msgid "KASSA.AT connection:" 28 36 msgstr "" 29 37 30 #: create-menus.php: 15538 #: create-menus.php:235 31 39 msgid "You are already connected to a KASSA.AT account." 32 40 msgstr "" 33 41 34 #: create-menus.php: 15842 #: create-menus.php:238 35 43 msgid "Remove connection to KASSA.AT." 36 44 msgstr "" 37 45 38 #: create-menus.php: 16646 #: create-menus.php:248 39 47 msgid "Connect with KASSA.AT account" 40 48 msgstr "" 41 49 42 #: create-menus.php: 17150 #: create-menus.php:253 43 51 msgid "Dont have a KASSA.AT account? Create one!" 44 52 msgstr "" 45 53 46 #: create-menus.php: 17754 #: create-menus.php:259 47 55 msgid "Synchronize Stocks:" 48 56 msgstr "" 49 57 50 #: create-menus.php: 17858 #: create-menus.php:260 51 59 msgid "Choose warehouse:" 52 60 msgstr "" 53 61 54 #: create-menus.php: 18862 #: create-menus.php:270 55 63 msgid "Save changes!" 56 64 msgstr "" 57 65 58 #: create-menus.php: 19566 #: create-menus.php:277 59 67 msgid "Synchronize stocks with KASSA.AT." 60 68 msgstr "" 61 69 62 #: create-menus.php: 19670 #: create-menus.php:278 63 71 msgid "Use KASSA.AT-data" 64 72 msgstr "" 65 73 66 #: create-menus.php:2 0374 #: create-menus.php:285 67 75 msgid "Synchronize!" 68 76 msgstr "" 69 77 70 #: kassa-at-for-woocommerce.php:167 78 #: create-menus.php:296 79 msgid "Synchronize on the Single Product Page!" 80 msgstr "" 81 82 #: create-menus.php:305 83 msgid "Synchronize on the Cart Page!" 84 msgstr "" 85 86 #: create-menus.php:314 87 msgid "Synchronize when the order is received!" 88 msgstr "" 89 90 #: create-menus.php:404 create-menus.php:560 91 msgid "Parameters" 92 msgstr "" 93 94 #: create-menus.php:405 create-menus.php:561 95 msgid "API-Key" 96 msgstr "" 97 98 #: create-menus.php:406 create-menus.php:562 99 msgid "Result" 100 msgstr "" 101 102 #: create-menus.php:407 create-menus.php:409 create-menus.php:412 103 #: create-menus.php:414 create-menus.php:563 create-menus.php:565 104 #: create-menus.php:568 create-menus.php:570 105 msgid "Location" 106 msgstr "" 107 108 #: create-menus.php:411 create-menus.php:567 109 msgid "Changes" 110 msgstr "" 111 112 #: create-menus.php:509 113 msgid "Plugin Logs:" 114 msgstr "" 115 116 #: create-menus.php:512 117 msgid "Reload logfile" 118 msgstr "" 119 120 #: create-menus.php:513 121 msgid "Refreshed" 122 msgstr "" 123 124 #: create-menus.php:518 create-menus.php:519 125 msgid "Enable Logging" 126 msgstr "" 127 128 #: create-menus.php:518 create-menus.php:519 129 msgid "Disable Logging" 130 msgstr "" 131 132 #: create-menus.php:521 133 msgid "Delete logfile" 134 msgstr "" 135 136 #: create-menus.php:522 137 msgid "Download logfile" 138 msgstr "" 139 140 #: create-menus.php:527 create-menus.php:528 create-menus.php:529 141 #: create-menus.php:530 create-menus.php:532 142 msgid "lines" 143 msgstr "" 144 145 #: create-menus.php:535 146 msgid "Limit kaw-log length" 147 msgstr "" 148 149 #: create-menus.php:535 150 msgid "Save" 151 msgstr "" 152 153 #: create-menus.php:577 154 msgid "Database options" 155 msgstr "" 156 157 #: create-menus.php:581 158 msgid "Creator" 159 msgstr "" 160 161 #: create-menus.php:582 162 msgid "Option-name" 163 msgstr "" 164 165 #: create-menus.php:583 166 msgid "Option-value" 167 msgstr "" 168 169 #: create-menus.php:588 create-menus.php:593 create-menus.php:598 170 #: create-menus.php:603 create-menus.php:608 create-menus.php:613 171 #: create-menus.php:618 create-menus.php:623 create-menus.php:628 172 msgid "KASSA.AT For WooCommerce" 173 msgstr "" 174 175 #: kassa-at-for-woocommerce.php:316 71 176 msgid "Please follow these instructions to use the plugin:" 72 177 msgstr "" 73 178 74 #: kassa-at-for-woocommerce.php: 171179 #: kassa-at-for-woocommerce.php:320 75 180 #, php-format 76 181 msgid "If you don't have a KASSA.AT account please create one <a href=\"%s\">here</a>." 77 182 msgstr "" 78 183 79 #: kassa-at-for-woocommerce.php: 172184 #: kassa-at-for-woocommerce.php:321 80 185 msgid "Use the Button \"Connect with KASSA.AT account\" to connect to the register-service." 81 186 msgstr "" 82 187 83 #: kassa-at-for-woocommerce.php: 176188 #: kassa-at-for-woocommerce.php:325 84 189 msgid "Login the KASSA.AT site and create your articles. Note that in order to have connect the WP-site and the KASSA.AT-account, you need to fill in the \"Artikelnummer\"-field with your article numbers." 85 190 msgstr "" 86 191 87 #: kassa-at-for-woocommerce.php: 177192 #: kassa-at-for-woocommerce.php:326 88 193 msgid "In your KASSA.AT account, create a warehouse and assign the articles to it." 89 194 msgstr "" 90 195 91 #: kassa-at-for-woocommerce.php: 178196 #: kassa-at-for-woocommerce.php:327 92 197 msgid "Go back to your WordPress page, choose your register-warehouse from your KASSA.AT's warehouses." 93 198 msgstr "" 94 199 95 #: kassa-at-for-woocommerce.php: 179200 #: kassa-at-for-woocommerce.php:328 96 201 msgid "Go to your woocommerce-article section and create or edit your articles, use the article-number from your KASSA.AT-articles in the \"SKU\"-field and activate stock-management." 97 202 msgstr "" 98 203 99 #: kassa-at-for-woocommerce.php: 180204 #: kassa-at-for-woocommerce.php:329 100 205 msgid "Go to the KASSA.AT-menu in your wordpress-site and press the \"Synchronize!\" Button." 101 206 msgstr "" 102 207 103 #: kassa-at-for-woocommerce.php: 182208 #: kassa-at-for-woocommerce.php:331 104 209 msgid "And here we go. Whenever a customer buys anything in your local store or a customer orders something in your online-store, your KASSA.AT-service will have trace of that and will always check, that the onlineshop displays the correct amount of items in stock." 105 210 msgstr "" 106 211 107 #: kassa-at-for-woocommerce.php: 188212 #: kassa-at-for-woocommerce.php:337 108 213 #, php-format 109 214 msgid "If you have any questions with the setting up, feel free to %s." 110 215 msgstr "" 111 216 112 #: kassa-at-for-woocommerce.php: 192217 #: kassa-at-for-woocommerce.php:341 113 218 msgid "contact us" 114 219 msgstr "" 115 220 116 #: stock-syncro.php: 96221 #: stock-syncro.php:149 117 222 #, php-format 118 223 msgid "Woocommerce Invoice: %s" -
kassa-at-for-woocommerce/trunk/readme.txt
r2611428 r2665761 3 3 Tags: woocommerce, stock-management, stock, kassa.at, kasse.pro, lager, lagerhaltung 4 4 Donate link: http://kassa.at 5 Requires at least: 5. 46 Tested up to: 5. 8.15 Requires at least: 5.7 6 Tested up to: 5.9 7 7 Requires PHP: 7.0.33 8 Stable tag: 1. 0.28 Stable tag: 1.1.0 9 9 License: GPLv3 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 15 15 This Plugin is only useable with an account for KASSA.AT! 16 16 If you dont have one, you can get one inside of the plugin. 17 The plugin synchronizes automatically the stock amounts between the onlineshop and the KASSA.AT System. 17 18 18 19 = Features = 19 20 * Logging in to KASSA.AT 20 21 * Choosing a warehouse, the stocks should synchronize with. 21 * Stock amounts are queried whenever a visitor enters the Site of an article to have the correct numbers here.22 * Stock amounts are queried whenever a visitor enters the Page of an article to have the correct numbers here. 22 23 * Stock amounts are queried whenever a visitor enters his cart, so we have the right amount of stock here too. 23 24 * Whenever a customer completes an order your KASSA.AT account will register that and will adapt to the new stock amounts. … … 26 27 This plugin only works with a KASSA.AT account and requires WooCommerce. 27 28 The serialnumber in WC-products must equal articlenumber in KASSA.AT-articles 29 You can find a detailed handbook for this plugin on [our website](https://kassa.at/plugin-fuer-woocommerce/). 28 30 29 31 = Supported languages = 30 32 * German (de_AT, de_DE, de_DE_formal, de_CH, de_CH_formal) 31 33 * English (Default language) 32 * Turkish (automatic translation) 33 * Hungarian (automatic translation) 34 * Slovenian (automatic translation) 35 * Croatian (automatic translation) 36 * Polish (automatic translation) 34 * Turkish (automatic translation) (< 100%) 35 * Hungarian (automatic translation) (< 100%) 36 * Slovenian (automatic translation) (< 100%) 37 * Croatian (automatic translation) (< 100%) 38 * Polish (automatic translation) (< 100%) 37 39 38 40 == Installation == … … 40 42 1. Upload and extract the "kassa-at-for-woocommerce" archive to the "/wp-content/plugins/" directory (inside a folder named after the archive). 41 43 2. Activate the plugin through the "Plugins" menu in WordPress. 44 45 = Automatic installation = 46 1. Find the Plugin in the "Plugins" > "Add new" section of your wordpress site. 47 2. Click on "Install now". 48 3. Wait until the plugin is installed. 49 4. Activate the plugin. 42 50 43 51 == Set up == … … 58 66 No. The plugin is based on a woocommerce-shop. 59 67 60 = What should I do when I'm selling from germany? =68 = I don't need the synchronization every time, and it slows down my server, how can I limit the synchronization attempts? = 61 69 62 The plugin "KASSA.AT for WooCommerce" is only for austrian shops (for the austrian financialdepartment). 63 If you are located in germany try out our similar product for german customers: "KASSE.PRO for WooCommerce" 70 There are options for disabling the synchronization at different pages. Read more about that in the handbook. 64 71 65 72 == Changelog == 73 74 = 1.1.0 (2022-01-26) = 75 * Added Functions to disable synchronization on single product page and cart individually. 76 * Added Logging for debugging and error-management purposes. 77 Added functions to customize the logs (Log disabling; Log deleting; Log downloading; Log length defining) 78 * Displaying importent database entries beneath the logs. 66 79 67 80 = 1.0.2 (2021-10-08) = … … 80 93 == Upgrade Notice == 81 94 95 = 1.1.0 = 96 * You can disable specific synchronizations now. 97 * There are error logs helping in finding the error if one occurs. 98 82 99 = 1.0.2 = 83 100 * Site doesn't require reload to synchronize stocks. -
kassa-at-for-woocommerce/trunk/stock-syncro.php
r2611428 r2665761 11 11 exit; // Exit if accessed directly! 12 12 } 13 14 /** 15 * Activates or deactivates different parts of the Code so the user 16 * can decide when he want the stocks to synchronize. 17 * 18 * There are three times that he can enable or disable individually ( 19 * - 'kaw-synchronize-at-singleproduct', 20 * - 'kaw-synchronize-at-cart', 21 * - 'kaw-synchronize-on-order'. 22 * 23 * The function writes eighter 'enabled' or 'disabled' in the correct wp_option 24 * and forces a logentry about the change. 25 */ 26 function kaw_activate_synchro_option() { 27 if ( ! isset( $_POST['mode'] ) || ! isset( $_POST['field'] ) ) { /* phpcs:ignore */ 28 wp_send_json_error(); 29 } 30 31 if ( $_POST['mode'] == 'true' ) { /* phpcs:ignore */ 32 $val = 'enabled'; 33 } else { 34 $val = 'disabled'; 35 } 36 37 $field = $_POST['field']; /* phpcs:ignore */ 38 39 if ( get_option( $field ) ) { 40 update_option( $field, $val ); 41 } else { 42 add_option( $field, $val ); 43 } 44 45 kaw_log_data( 46 'SYSTEM', 47 array( 48 'message' => $val . ' the synchronization: ' . $field, 49 'location' => kaw_get_locationstring(), 50 ), 51 true 52 ); 53 54 wp_send_json_success(); 55 } 56 add_action( 'wp_ajax_kaw_activate_synchro_option', 'kaw_activate_synchro_option' ); 13 57 14 58 /** … … 30 74 ); 31 75 if ( 1 !== $inventory->length ) { 32 kaw_log_data( 'STOCK-UPDATE-ERROR: Wrong number of found entries {' . strval( $inventory->length ) . '}' ); 76 kaw_log_data( 77 'API-ERROR', 78 array( 79 'message' => 'Wrong number of found entries {' . strval( $inventory->length ) . '}', 80 'location' => kaw_get_locationstring(), 81 ) 82 ); 33 83 return false; 34 84 } else { … … 48 98 49 99 if ( ! $order || get_option( 'woocommerce_manage_stock' ) !== 'yes' ) { 100 return; 101 } 102 103 if ( get_option( 'kaw-synchronize-on-order' ) === 'disabled' ) { 50 104 return; 51 105 } … … 89 143 'POST', 90 144 $inventories_path . '/' . $inventory_id . '/movements', 91 wp_json_encode( 92 array( 93 'quantity' => $qty, 94 /* translators: The placeholder %s is to send the order-id! */ 95 'text' => sprintf( esc_attr( __( 'Woocommerce Invoice: %s', 'kassa-at-for-woocommerce' ) ), esc_attr( $order->id ) ), 96 'type' => 'decrease', 97 ) 145 array( 146 'quantity' => $qty, 147 /* translators: The placeholder %s is to send the order-id! */ 148 'text' => sprintf( esc_attr( __( 'Woocommerce Invoice: %s', 'kassa-at-for-woocommerce' ) ), esc_attr( $order->id ) ), 149 'type' => 'decrease', 98 150 ) 99 151 ); … … 107 159 */ 108 160 function kaw_synchronize_k_to_w() { 109 kaw_log_data( 'MANUAL-STOCK-UPDATE' );110 161 $args = array( 111 162 'post_type' => array( 'product', 'product_variation' ), 112 'meta_query' => array( 163 'meta_query' => array( /* phpcs:ignore */ 113 164 array( 114 165 'key' => '_manage_stock', … … 125 176 global $product; 126 177 $stock_amount = kaw_get_stock_amount( $product ); 127 echo '-';128 echo $stock_amount;129 echo '-';130 178 $old_stock = get_post_meta( $product->get_id(), '_stock' ); 131 echo implode( ", ", $old_stock );132 // echo $old_stock;133 179 134 180 if ( $stock_amount ) { 135 181 update_post_meta( $product->get_id(), '_stock', $stock_amount ); 136 kaw_log_data( 'STOCK-UPDATED: article{' . $product->get_name() . ' (' . $product->get_sku() . ')}, stock_change{' . strval( $old_stock[0] ) . ' -> ' . strval( $stock_amount ) . '}' ); 182 kaw_log_data( 183 'DATA-UPDATE', 184 array( 185 'message' => 'Stock amount updated ', 186 'key' => $product->get_name() . ' (' . $product->get_sku() . ')', 187 'original' => strval( $old_stock[0] ), 188 'updated' => strval( $stock_amount ), 189 'location' => kaw_get_locationstring(), 190 ) 191 ); 137 192 kaw_update_stock_status( $product, $old_stock[0], $stock_amount ); 138 193 } … … 150 205 global $product; 151 206 152 if ( ! isset( $_GET['sync'] ) ) { 153 $actual_link = ( true === isset( $_SERVER['HTTP_HOST'] ) ? esc_url_raw( wp_unslash( $_SERVER['HTTP_HOST'] ) ) : '' ) 154 . ( true === isset( $_SERVER['REQUEST_URI'] ) ? esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '' ); 155 if ( strpos( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '?' ) !== false ) { 156 $actual_link .= '&sync=true'; 157 } else { 158 $actual_link .= '?sync=true'; 159 } 160 161 $stock_amount = kaw_get_stock_amount( $product ); 162 $old_stock = get_post_meta( $product->get_id(), '_stock' ); 163 164 if ( $stock_amount ) { 165 $product->set_stock( $stock_amount ); 166 kaw_log_data( 'STOCK-UPDATED: article{' . $product->get_name() . ' (' . $product->get_sku() . ')}, stock_change{' . strval( $old_stock[0] ) . ' -> ' . strval( $stock_amount ) . '}' ); 167 kaw_update_stock_status( $product, $old_stock[0], $stock_amount ); 168 } 169 170 $variations = $product->get_children(); 171 foreach ( $variations as $value ) { 172 $variation = new WC_Product_Variation( $value ); 173 if ( get_post_meta( $variation->get_id(), '_manage_stock' ) ) { 174 $stock_amount = kaw_get_stock_amount( $variation ); 175 $old_stock = get_post_meta( $variation->get_id(), '_stock' ); 176 177 if ( $stock_amount ) { 178 $variation->set_stock( $stock_amount ); 179 update_post_meta( $variation->get_id(), '_stock', $stock_amount ); 180 kaw_log_data( 'STOCK-UPDATED: article{' . $variation->get_name() . ' (' . $variation->get_sku() . ')}, stock_change{' . strval( $old_stock[0] ) . ' -> ' . strval( $stock_amount ) . '}' ); 181 kaw_update_stock_status( $variation, $old_stock[0], $stock_amount ); 182 } 207 if ( get_option( 'kaw-synchronize-at-singleproduct' ) === 'disabled' ) { 208 return; 209 } 210 211 $stock_amount = kaw_get_stock_amount( $product ); 212 $old_stock = get_post_meta( $product->get_id(), '_stock' ); 213 214 if ( $stock_amount ) { 215 $product->set_stock( $stock_amount ); 216 kaw_log_data( 217 'DATA-UPDATE', 218 array( 219 'message' => 'Stock amount updated ', 220 'key' => $product->get_name() . ' (' . $product->get_sku() . ')', 221 'original' => strval( $old_stock[0] ), 222 'updated' => strval( $stock_amount ), 223 'location' => kaw_get_locationstring(), 224 ) 225 ); 226 kaw_update_stock_status( $product, $old_stock[0], $stock_amount ); 227 } 228 229 $variations = $product->get_children(); 230 foreach ( $variations as $value ) { 231 $variation = new WC_Product_Variation( $value ); 232 if ( get_post_meta( $variation->get_id(), '_manage_stock' ) ) { 233 $stock_amount = kaw_get_stock_amount( $variation ); 234 $old_stock = get_post_meta( $variation->get_id(), '_stock' ); 235 236 if ( $stock_amount ) { 237 $variation->set_stock( $stock_amount ); 238 update_post_meta( $variation->get_id(), '_stock', $stock_amount ); 239 kaw_log_data( 240 'DATA-UPDATE', 241 array( 242 'message' => 'Stock amount updated ', 243 'key' => $variation->get_name() . ' (' . $variation->get_sku() . ')', 244 'original' => strval( $old_stock[0] ), 245 'updated' => strval( $stock_amount ), 246 'location' => kaw_get_locationstring(), 247 ) 248 ); 249 kaw_update_stock_status( $variation, $old_stock[0], $stock_amount ); 183 250 } 184 251 } … … 198 265 199 266 if ( get_option( 'woocommerce_manage_stock' ) !== 'yes' ) { 267 return; 268 } 269 270 if ( get_option( 'kaw-synchronize-at-cart' ) === 'disabled' ) { 200 271 return; 201 272 } … … 215 286 if ( $stock_amount ) { 216 287 $product->set_stock( $stock_amount ); 217 kaw_log_data( 'STOCK-UPDATED: article{' . $product->get_name() . ' (' . $product->get_sku() . ')}, stock_change{' . strval( $old_stock[0] ) . ' -> ' . strval( $stock_amount ) . '}' ); 288 kaw_log_data( 289 'DATA-UPDATE', 290 array( 291 'message' => 'Stock amount updated ', 292 'key' => $product->get_name() . ' (' . $product->get_sku() . ')', 293 'original' => strval( $old_stock[0] ), 294 'updated' => strval( $stock_amount ), 295 'location' => kaw_get_locationstring(), 296 ) 297 ); 218 298 kaw_update_stock_status( $product, $old_stock[0], $stock_amount ); 219 299 } … … 251 331 if ( isset( $status ) ) { 252 332 $old_status = $product->get_stock_status(); 253 // update_post_meta( $product->get_id(), '_stock_status', $status );254 333 $product->set_stock_status( $status ); 255 kaw_log_data( 'STOCK-STATUS-UPDATED: article{' . $product->get_name() . ' (' . $product->get_sku() . ')}, status{' . $old_status . ' -> ' . $status . '}' ); 256 } 257 } 334 kaw_log_data( 335 'DATA-UPDATE', 336 array( 337 'message' => 'Stock status updated', 338 'key' => $product->get_name() . ' (' . $product->get_sku() . ')', 339 'original' => $old_status, 340 'updated' => $status, 341 'location' => kaw_get_locationstring(), 342 ) 343 ); 344 } 345 }
Note: See TracChangeset
for help on using the changeset viewer.