Esempio n. 1
0
 function woo_ce_product_item($product, $product_id)
 {
     $product->ebay_item_id = WPLE_ListingQueryHelper::getEbayIDFromPostID($product_id);
     $product->ebay_status = WPLE_ListingQueryHelper::getStatusFromPostID($product_id);
     return $product;
 }
 function wpl_post_row_actions($actions, $post)
 {
     // skip if this is not a WC product
     if ($post->post_type == 'product') {
         // get listing status
         $status = WPLE_ListingQueryHelper::getStatusFromPostID($post->ID);
         // skip if listing exists
         if ($status) {
             return $actions;
         }
         // TODO: check if product is in stock and not currently published on eBay!
         // if ( ! get_post_meta( $post->ID, '_ebay_item_id', true ) )
         $actions['prepare_auction'] = "<a title='" . esc_attr(__('Prepare this product to be listed on eBay.', 'wplister')) . "' href='" . wp_nonce_url(admin_url('admin.php?page=wplister' . '&amp;action=wpl_prepare_single_listing&amp;product_id=' . $post->ID), 'prepare_listing_' . $post->ID) . "'>" . __('List on eBay', 'wplister') . "</a>";
     }
     return $actions;
 }