$category->save(); } $stmt->close(); } */ $stmt = SqlQuery::select($cube_db, 'cubecart_inventory'); if ($stmt) { $result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { $product = new Product($db); $product->loadByExtId($row['productId']); // import new product if (!$product->is_loaded) { $product->data['product_ext_id'] = $row['productId']; $product->data['product_name'] = myTrim(convertEncoding($row['name'])); $product->data['product_price'] = parseFloat($row['price']); $category = loadCategory($row['cat_id']); if (isset($category)) { $product->data['product_category_id'] = $category->ival('category_id'); } $new++; } else { $updated++; } $product->data['product_description'] = convertEncoding($row['description']); $product->data['product_image'] = $row['image']; $product->save(); } $stmt->close(); } echo sprintf('Imported %s new, %s updated.', $new, $updated);
?> <div class="col-xs-12"> <div class="panel panel-info"> <div class="panel-heading"><?php echo tep_get_infopages_title($homepage['infopages_id']); ?> </div> <div class="panel-body"> <?php echo tep_get_infopages_description($homepage['infopages_id']); ?> </div> </div> </div> <?php loadBox('specials'); ?> <?php loadBox('home_products'); } else { if (isset($_GET['products_is'])) { loadProduct($_GET['products_is']); } if (isset($_GET['cPath'])) { loadCategory($_GET['cPath']); } if (isset($_GET['page'])) { loadPage($_GET['page']); } }