private function _relistItems() { if ($this->ebay_profile->getConfiguration('EBAY_LISTING_DURATION') != 'GTC' && $this->ebay_profile->getConfiguration('EBAY_AUTOMATICALLY_RELIST') == 'on') { //We do relist automatically each day $this->ebay_profile->setConfiguration('EBAY_LAST_RELIST', date('Y-m-d')); $ebay = new EbayRequest(); $days = Tools::substr($this->ebay_profile->getConfiguration('EBAY_LISTING_DURATION'), 5); foreach (EbayProduct::getProducts($days, 10) as $item) { $new_item_id = $ebay->relistFixedPriceItem($item['itemID']); if (!$new_item_id) { $new_item_id = $item['id_product_ref']; } //Update of the product so that we don't take it in the next 10 products to relist ! EbayProduct::updateByIdProductRef($item['id_product_ref'], array('id_product_ref' => pSQL($new_item_id), 'date_upd' => date('Y-m-d h:i:s'))); } } }