get('', array('product_id')); foreach($remote_product as $tmp) { if($product->exists($tmp[0], " available=1 ") == false) { $product_net->delete($tmp[0]); // delete also the prices $local_pricesets = $priceset->get(''); foreach($local_pricesets as $tmp_priceset) { $tmp_price = $price_net->getPrice($tmp_priceset[0], $tmp[0]); if(count($tmp_price) > 0) $price_net->delete($tmp_price[0][0]); } $del_product_count++; } } // add products remote if newly available locally $remote_products = $product_net->get('', array('product_id')); $local_products = $product->get('', array('product_id'), " available=1 "); foreach($local_products as $tmp) { $found = false; foreach($remote_products as $remote_tmp) { if($remote_tmp[0] == $tmp[0]) { $found = true; break; } } $tmp_data = $product->get($tmp[0], array( "name", "details", "category_id", "tax_id", "available", "group_id", "order_number", "anmerkung")); if(!$found) { $product_net->create($tmp[0], $tmp_data[0]); $new_product_count++; } else { $product_net->update($tmp[0], $tmp_data[0]); } } $main_box->add(new NTKLabel("", "neue Produkte online: ".$new_product_count), 200, 0, "background-color: #dfe7f3;"); $main_box->add(new NTKLabel("", "online Produkte gelöscht: ".$del_product_count), 200, 0, "background-color: #dfe7f3;"); // check for prices on products $local_products = $product->get('', array('product_id'), " available=1 "); $local_pricesets = $priceset->get(''); foreach($local_products as $tmp) { foreach($local_pricesets as $tmp_priceset) { $tmp_price = $price->getPrice($tmp_priceset[0], $tmp[0]); if(count($tmp_price) <= 0) continue; if($price_net->exists($tmp_priceset[0], $tmp[0])) $price_net->update($tmp_priceset[0], $tmp[0], array_slice($tmp_price[0], 3)); else $price_net->create($tmp_priceset[0], $tmp[0], array_slice($tmp_price[0], 3)); } } ?>