Plugin Directory

Changeset 2747151


Ignore:
Timestamp:
06/23/2022 03:00:14 PM (4 years ago)
Author:
aribhour
Message:

this is the best

Location:
linet-erp-woocommerce-integration/trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-autoloader.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-inventory.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-invoice.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-line-item-manager.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-logger.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-order-actions.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment-manager.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-payment.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-map.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings-yith-map.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-settings.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    456456  $value = $_POST['value'];
    457457
     458  if($key ==="id"){
     459    $post_id = $value;
     460    $product=wc_get_product($post_id);
     461
     462    if(!empty($product))
     463     echo $product->delete(true);
     464
     465    echo delete_post_meta($post_id,"_linet_id");
     466    echo delete_post_meta($post_id,"_sku");
     467    echo wc_delete_product_transients($post_id);
     468
     469    return true;
     470
     471  }
     472
    458473  $query = "SELECT post_id FROM $wpdb->postmeta where meta_key=%s AND meta_value=%s";
    459474  $posts = $wpdb->get_col($wpdb->prepare($query,$key,$value));
     
    547562  foreach($products as $index=>$product){
    548563    $arr['sku'.$index]= array(
    549       'title' => __('duplicate sku', 'wc-linet')." <br /><a data-key='_sku' data-value='$product->meta_value' onclick=\"linet.deleteProd(this);\" href='#'>Delete</a>",
     564      'title' => __('duplicate sku', 'wc-linet')." <br /><a data-key='_sku' data-value='$product->meta_value' onclick=\"linet.deleteProd(event,this);\" href=''>Delete</a>",
    550565      'default' => '',
    551566      'type' => 'none',
     
    558573  foreach($products as $index => $product){
    559574    $arr['linet_id'.$index] = array(
    560       'title' => __('duplicate linet_id', 'wc-linet')." <br /><a data-key='_linet_id' data-value='$product->meta_value' onclick=\"linet.deleteProd(this);\" href='#'>Delete</a>",
     575      'title' => __('duplicate linet_id', 'wc-linet')." <br /><a data-key='_linet_id' data-value='$product->meta_value' onclick=\"linet.deleteProd(event,this);\" href=''>Delete</a>",
    561576      'default' => '',
    562577      'type' => 'none',
     
    564579    );
    565580  }
     581 
    566582
    567583  $query = "SELECT ID,post_title,meta_value FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON post_id=ID AND meta_key = '_wp_attachment_metadata' where post_type='attachment' AND meta_value is null";
     
    569585  foreach($attachments as $index=>$attachment){
    570586    $arr['attachment'.$index]= array(
    571       'title' => __('attachment metadata missing', 'wc-linet')." <br /><a data-id='$attachment->ID' onclick=\"linet.deleteAttachment(this);\" href='#'>Delete</a>",
     587      'title' => __('attachment metadata missing', 'wc-linet')." <br /><a data-id='$attachment->ID' onclick=\"linet.deleteAttachment(this);\" href=''>Delete</a>",
    572588      'default' => '',
    573589      'type' => 'none',
    574       'description' => "<a data-id='$attachment->ID' data-file='$attachment->post_title' onclick=\"linet.calcAttachment(this);\" href='#'>$attachment->post_title</a>",
     590      'description' => "<a data-id='$attachment->ID' data-file='$attachment->post_title' onclick=\"linet.calcAttachment(this);\" href=''>$attachment->post_title</a>",
    575591    );
    576592  }
     593
     594
     595
     596
     597
     598
     599
     600
     601  $query = "select a.* ,meta_id.`meta_value` as meta_id,meta_sku.`meta_value` as meta_sku
     602
     603  FROM
     604  (
     605  SELECT  count(`id`) as inst,max(`id`) as lasty,`post_type`,`post_title`,`post_excerpt`,`post_parent`
     606  FROM $wpdb->posts
     607
     608
     609  where
     610  `post_parent` in (SELECT DISTINCT `post_parent` FROM $wpdb->posts WHERE `post_type`='product_variation') and `post_parent`!=0
     611  and post_type='product_variation'
     612  GROUP by `post_parent`,`post_excerpt` 
     613  HAVING inst>1 
     614  ORDER BY $wpdb->posts.`post_parent` ASC
     615
     616  ) a
     617
     618  LEFT JOIN $wpdb->postmeta meta_sku on meta_sku.`meta_key`='_sku' AND meta_sku.`post_id`=a.lasty
     619  LEFT JOIN $wpdb->postmeta meta_id on meta_id.`meta_key`='_linet_id' AND meta_id.`post_id`=a.lasty";
     620
     621$products = $wpdb->get_results($query);
     622foreach($products as $index => $product){
     623  $arr['vari'.$index] = array(
     624    'title' => __('duplicate product_variation', 'wc-linet')." <br /><a data-key='id' data-value='$product->lasty' onclick=\"linet.deleteProd(event,this);\" href=''>Delete</a>",
     625    'default' => '',
     626    'type' => 'none',
     627    'description' => "post_id: ".$product->lasty." post_parent: ".$product->post_parent." linet_id:".$product->meta_id." sku:".$product->meta_sku." count: ".$product->inst,
     628  );
     629}
     630
     631
     632 
    577633  $scanned_directory = array();
    578634  if(is_dir(WC_LOG_DIR)){
     
    585641    if(strpos($file,'linet')===0 ||strpos($file,'fatal-errors')===0 )
    586642      $arr['file'.$index]= array(
    587         'title' => __('Log File', 'wc-linet')."<br /><a data-name='$file'  onclick=\"linet.deleteFile(this);\" href='#'>Delete</a>",
     643        'title' => __('Log File', 'wc-linet')."<br /><a data-name='$file'  onclick=\"linet.deleteFile(event,this);\" href='#'>Delete</a>",
    588644        'default' => '',
    589645        'type' => 'none',
     
    10191075        },
    10201076
    1021         deleteProd: function (obj) {
     1077        deleteProd: function (e,obj) {
     1078          console.log(obj);console.log(jQuery(obj).data());
     1079          e.preventDefault();
     1080
     1081
    10221082          var key = jQuery(obj).data('key');
    10231083          var value = jQuery(obj).data('value');
     
    10351095          return false;
    10361096        },
    1037         deleteFile: function (obj) {
     1097        deleteFile: function (e,obj) {
     1098          e.preventDefault();
     1099
    10381100          var name = jQuery(obj).data('name');
    10391101          jQuery(obj).parent().parent().hide();
  • linet-erp-woocommerce-integration/trunk/classes/class-wc-li-sns.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/readme.txt

    r2747055 r2747151  
    4747== Changelog ==
    4848
     49= 2022.06.23 - version 3.1.3 =
     50
     51* better delete handler
     52* product vartion duplcate finder
     53
    4954= 2022.06.23 - version 3.1.2 =
    5055
  • linet-erp-woocommerce-integration/trunk/woo-includes/class-wc-dependencies.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woo-includes/woo-functions.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
  • linet-erp-woocommerce-integration/trunk/woocommerce-linet.php

    r2747055 r2747151  
    66  Author: Speedcomp
    77  Author URI: http://www.linet.org.il
    8   Version: 3.1.2
     8  Version: 3.1.3
    99  Text Domain: wc-linet
    1010  Domain Path: /languages/
     
    4444 */
    4545class WC_Linet {
    46   const VERSION = '3.1.2';
     46  const VERSION = '3.1.3';
    4747  /**
    4848   * The constructor
Note: See TracChangeset for help on using the changeset viewer.