private static function _updateMultiSkuItem($product_id, $data, $id_ebay_profile, $ebay, $date) { if ($ebay->reviseFixedPriceItemMultiSku($data)) { EbayProduct::updateByIdProductRef($data['itemID'], array('date_upd' => pSQL($date))); } // if product not on eBay as we expected we add it if ($ebay->errorCode == 291) { // We delete from DB and Add it on eBay EbayProduct::deleteByIdProductRef($data['itemID']); $ebay = EbaySynchronizer::_addMultiSkuItem($product_id, $data, $id_ebay_profile, $ebay, $date); } return $ebay; }
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'))); } } }