function ebay_load_ads() { $paged = isset($_POST['paged']) ? $_POST['paged'] : 1; $args = array('post_type' => CE_AD_POSTTYPE, 'meta_key' => 'ce_ebay_item_id', 'paged' => $paged, 'meta_query' => array(array('key' => 'ce_ebay_item_id', 'value' => 1, 'compare' => '>='))); $ads = CE_Ads::query($args); $items = array(); $paginator_html = ce_ebay_pagination($ads, $paged); $current = array('EUR' => '€', 'USD' => '$', 'CAD' => 'CA $', 'GBP' => '£', 'SGD' => 'S$', 'PHP' => '₱', 'AUD' => 'AU $', 'PLN' => 'zł', 'CHF' => 'CHF', 'INR' => 'INR'); if ($ads->have_posts()) { $price_key = CE_ET_PRICE; while ($ads->have_posts()) { $ads->the_post(); global $post; $ad = CE_Ads::convert($post); if (isset($ad->location[0])) { $ad->et_location = $ad->location[0]->name; } $currentcy = get_post_meta($ad->ID, 'et_currency', true); $nt = isset($current[$currentcy]) ? $current[$currentcy] : $currentcy; $ad->price = $nt . $ad->{$price_key}; $items[] = $ad; } $resp = array('success' => true, 'msg' => __('List ads imported from ebay.com', ET_DOMAIN), 'data' => $items, 'paging' => $paginator_html); } else { $resp = array('success' => false, 'msg' => __('Your list is empty.')); } wp_send_json($resp); }
_e('Date', ET_DOMAIN); ?> </th> </tr> </thead> <tbody> <?php // 'meta_query' => array( // array( // 'key' => 'ce_ebay_item_id', // 'value' => 1, // 'compare'=> '>=', // )) $args = array('post_type' => CE_AD_POSTTYPE, 'meta_key' => 'ce_ebay_item_id', 'meta_query' => array(array('key' => 'ce_ebay_item_id', 'value' => '', 'compare' => 'NOT EXISTS'))); $current = array('EUR' => '€', 'USD' => '$', 'CAD' => 'CA $', 'GBP' => '£', 'SGD' => 'S$', 'PHP' => '₱', 'AUD' => 'AU $', 'PLN' => 'zł', 'CHF' => 'CHF', 'INR' => 'INR'); $ads = CE_Ads::query($args); if ($ads->have_posts()) { while ($ads->have_posts()) { $ads->the_post(); global $post; $ad = CE_Ads::convert($post); $currentcy = get_post_meta($ad->ID, 'et_currency', true); $price_key = CE_ET_PRICE; ?> <tr class="item-static"> <td><input type="checkbox" id="<?php the_ID(); ?> " value="<?php the_ID(); ?>