string(1) "5"
["KbAmzPriceAmountFormatted"]=>
string(6) "£6.90"
["KbAmzPriceAmount"]=>
string(3) "6.9"
*/
$storage = get_post_meta($post->ID, '_KbAmazonDropShipManagerStorageHistory', true);
$importStorage = get_post_meta($post->ID, '_KbAmazonDropShipManagerImportStorage', true);
$importPrice = '';
if (isset($importStorage['KbAmzPriceAmountFormatted'])) {
$importPrice = sprintf(
'%s ',
$importStorage['KbAmzPriceAmountFormatted']
);
}
echo '
';
echo $opts['index'];
echo ' | ';
echo '';
edit_post_link($post->ID, '', '', $post->ID);
echo ' | ';
echo '';
echo ' ';
echo getKbAmz()->getProductImages($post->ID)->getFirst(null, true, array('style' => 'max-height:25px;width:auto;'));
echo ' ';
echo ' | ';
$asin = get_post_meta($post->ID, 'KbAmzASIN', true);
echo sprintf(
' %s | ',
$post->ID,
$asin,
get_post_meta($post->ID, 'KbAmzDetailPageURL', true)
);
echo sprintf(
'%s | ',
$post->post_title
);
$formattedPrice = get_post_meta($post->ID, 'KbAmzPriceAmountFormatted', true);
$quantity = get_post_meta($post->ID, 'KbAmzOfferSummary.TotalNew', true);
$oldPrice = '';
$oldQuantity = '';
if ($storage && $storage['KbAmzPriceAmountFormatted'] != $formattedPrice) {
$oldPrice = sprintf(
'%s ',
$storage['KbAmzPriceAmountFormatted']
);
}
if ($storage && $storage['KbAmzOfferSummary.TotalNew'] != $quantity) {
$oldQuantity = sprintf(
'%s ',
$storage['KbAmzOfferSummary.TotalNew']
);
}
echo sprintf(
'%s | ',
$importPrice
);
echo sprintf(
'%s%s | ',
$oldPrice,
$formattedPrice
);
echo sprintf(
'%s%s | ',
$oldQuantity,
$quantity
);
$time = get_post_meta($post->ID, 'KbAmzLastUpdateTime', true);
echo sprintf(
'%s | ',
human_time_diff(strtotime($post->post_modified))
);
if (!isset($opts['refresh']) || $opts['refresh']) {
echo sprintf(
' | ',
$asin,
$post->ID
);
}
if (!isset($opts['remove']) || $opts['remove']) {
echo sprintf(
' | ',
$post->ID
);
}
return ob_get_clean();
}
function getKbDropShipManagerPosts()
{
$args = array(
'posts_per_page' => -1,
'offset' => 0,
'orderby' => 'post_modified',
'order' => 'DESC',
// 'meta_key' => 'KbAmzLastUpdateTime',
'post_type' => 'post',
'post_status' => 'any',
'meta_query' => array(
array(
'key' => 'KbAmzDropShipManager',
'value' => 1,
),
),
);
return get_posts($args);
}
function getKbAmazonDropShipManagerPluginUrl($append = null)
{
return plugins_url($append, __FILE__ );
}