本文整理汇总了PHP中ViewManager::getProductDifferences方法的典型用法代码示例。如果您正苦于以下问题:PHP ViewManager::getProductDifferences方法的具体用法?PHP ViewManager::getProductDifferences怎么用?PHP ViewManager::getProductDifferences使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewManager
的用法示例。
在下文中一共展示了ViewManager::getProductDifferences方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: firstStep
public function firstStep()
{
$new_products_manager = new ViewManager();
$tmp_manager = new UpdateTmpTables();
$insert_product = new PrestashopProduct();
$product_update = new ProductUpdate();
//prendo tutti i prodotti
$all_products = $new_products_manager->getAllProducts();
foreach ($all_products as $product) {
$array_reference = $product[0];
$key = $array_reference['Reference'];
asort($product[1]);
asort($product[2]);
$result = $product_update->productExists($key);
if (gettype($result) === "integer") {
foreach ($product[1] as $triple) {
$tmp_combination = $product[2];
$array_combination = $tmp_combination[$triple];
$tmp_code = $array_combination['Codici'];
$tmp_explode_code = explode(',', $tmp_code);
if ($product_update->colorSizeExists($key, $result, $tmp_explode_code[0], $tmp_explode_code[1]) == 1) {
$array_product = $insert_product->updateProductForPrestashop($product[0], (int) $result, $this->url_photo, $product[1], $product[2]);
$tmp_manager->insertTmpProducts($result, $key);
if (!empty($array_product[2])) {
foreach ($array_product[2] as $new_img) {
$new_photo_infos = explode(';', $new_img);
$tmp_manager->insertImageField($this->url_photo . $new_photo_infos[1], $array_product[0], $new_photo_infos[0]);
}
}
}
}
$url = $this->formatUrlPhoto($key);
$this->_updatePsImages($result, $url);
}
}
//prendo i prodotti nuovi
$newProducts = $new_products_manager->getNewProduct();
if (!empty($newProducts)) {
foreach ($newProducts as $product) {
$array_reference = $product[0];
$key = $array_reference['Reference'];
asort($product[1]);
asort($product[2]);
$array_product = $insert_product->insertProductForPrestashop($product[0], $this->url_photo, $product[1], $product[2]);
$array_images_id = $array_product[1];
for ($i = 0; $i < sizeof($array_images_id); $i++) {
$tmp = explode(';', $array_images_id[$i]);
if (empty($tmp)) {
break;
}
$tmp_manager->insertImageField($this->url_photo . $tmp[1], $array_product[0], $tmp[0]);
}
$tmp_manager->insertTmpProducts((int) $array_product[0], $key);
}
}
//differenze nei prodotti
$products_differences = $new_products_manager->getProductDifferences();
if (!empty($products_differences)) {
foreach ($products_differences as $product) {
$array_reference = $product[0];
$key = $array_reference['Reference'];
asort($product[1]);
asort($product[2]);
$array_product = $insert_product->updateProductForPrestashop($product[0], (int) $product[3], $this->url_photo, $product[1], $product[2]);
if (!empty($array_product[2])) {
foreach ($array_product[2] as $new_img) {
$new_photo_infos = explode(';', $new_img);
$tmp_manager->insertImageField($this->url_photo . $new_photo_infos[1], $array_product[0], $new_photo_infos[0]);
}
}
$tmp_manager->updateTmpProducts((int) $array_product[0], $key);
}
}
$this->logger->postMessage("Update finished! Cleaning up...", "DEBUG");
$buffer_manager = new ProductBufferTables();
$buffer_manager->freeBufferTable();
}