get_results( "SELECT id_hesabix FROM {$wpdb->prefix}hesabix WHERE obj_type = 'product' GROUP BY id_hesabix HAVING COUNT(id_hesabix) > 1" ); $ids = array(); foreach ($rows as $row) $ids[] = $row->id_hesabix; $idsStr = implode(',', $ids); $rows = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}hesabix WHERE obj_type = 'product' AND id_hesabix IN ($idsStr) ORDER BY id_hesabix" ) ); $i = 0; self::hesabix_plugin_header(); ?>
#
id_hesabix; ?> id_ps; ?> id_ps_attribute; ?>

get_results( $wpdb->prepare( "SELECT post.ID, post.post_title, post.post_parent, post.post_excerpt, wc.sku FROM {$wpdb->posts} AS post LEFT OUTER JOIN {$wpdb->prefix}wc_product_meta_lookup AS wc ON post.ID = wc.product_id WHERE post.post_type IN ('product', 'product_variation') AND post.post_status IN ('publish', 'private') ORDER BY post.post_title ASC LIMIT %d, %d", $offset, $rpp ) ); $totalCount = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->posts} AS post LEFT OUTER JOIN {$wpdb->prefix}wc_product_meta_lookup AS wc ON post.ID = wc.product_id WHERE post.post_type IN ('product', 'product_variation') AND post.post_status IN ('publish', 'private')" ); $links = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}hesabix WHERE obj_type = 'product'" ); foreach ($rows as $r) { if ($r->post_excerpt) $r->post_title = $r->post_title . ' [' . $r->post_excerpt . ']'; } foreach ($links as $link) { foreach ($rows as $r) { if ($r->ID == $link->id_ps && $link->id_ps_attribute == 0) { $r->id_hesabix = $link->id_hesabix; } else if ($r->ID == $link->id_ps_attribute) { $r->id_hesabix = $link->id_hesabix; } } } return array("data" => $rows, "totalCount" => $totalCount); } public static function hesabix_plugin_page() { $iconsArray = [ 'home', 'cog', 'box-open', 'users', 'file-invoice-dollar', 'sync-alt', 'file-alt', 'cog' ]; if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { $setting_tabs = apply_filters('hesabix_setting_tab', array( 'home' => __('Home', 'hesabix'), 'api' => __('API', 'hesabix'), 'catalog' => __('Catalog', 'hesabix'), 'customers' => __('Customers', 'hesabix'), 'invoice' => __('Invoice', 'hesabix'), 'sync' => __('Sync', 'hesabix'), 'log' => __('Log', 'hesabix'), 'extra' => __('Extra Settings', 'hesabix') )); $current_tab = (isset($_GET['tab'])) ? wc_clean($_GET['tab']) : 'home'; ?>
$label) { $iconUrl = HESABIX_PLUGIN_URL . "assets/img/icons/$iconsArray[$i].svg"; $i++; $active_class = ($current_tab == $name) ? 'active' : ''; echo ''; } ?>
$setting_tabvalue) { switch ($setting_tabkey) { case $current_tab: do_action('hesabix_' . $setting_tabkey . '_setting_save_field'); do_action('hesabix_' . $setting_tabkey . '_setting'); break; } } ?>