foreach ($features->find('ul[id=highLights] li') as $feature_item) { //echo "item ".$i."-->".$feature_item."</br>"; if ($i == 0) { $conDataAll .= $feature_item->plaintext; } else { $conDataAll .= "," . $feature_item->plaintext; } $i++; } //echo $conDataAll."</br>"; $SingleProduct->SetProductFeatures($conDataAll); } else { $SingleProduct->SetProductFeatures("NA"); } /* echo 'This is NOT SOLD OUT PRODUCT'; echo '<pre>'; print_r($SingleProduct); echo '<pre>'; */ //echo $SingleProduct->GetProductDetailUrl(); echo "<hr></br>"; echo $SingleProduct->GetProductPrice() . "dis-price" . $SingleProduct->GetProductBeforeDiscounePrice() . "dis_percen" . $SingleProduct->GetDiscountDetails() . "</br>" . "EMI Has:" . $SingleProduct->GetEmi() . "EMI Details" . $SingleProduct->GetEmiDetails() . "Features : " . $SingleProduct->GetProductFeatures() . "HREF: " . $SingleProduct->GetProductDetailUrl(); echo "<hr></br>"; } $DataAccess = new DataaccessHelper(); clsProductsManager::InsertProducts($SingleProduct); } $counter++; } echo "Total inserted :" . $counter * 3; //echo 'Last : '. date('Y-m-d') ."\n";
foreach ($pageData->find('div[class=product-list] div[class=one-product-box]') as $singleProduct) { //echo $singleProduct."</br></hr>"; /*foreach($singleProduct->find('div[class=name] a') as $nameAndURL) foreach($singleProduct->find('div[class=image] a') as $Imageurl) { echo $nameAndURL->innertext.">> ".$nameAndURL->href; echo "Image URL :".$Imageurl->href; echo "</br>"; } foreach($singleProduct->find('div[class=image] a') as $Imageurl) */ foreach ($singleProduct->find('div[class=name] a') as $nameAndURL) { //echo "Image URL :".$Imageurl->href; $productObj = new Product(); $productObj->MakeProduct("", $nameAndURL->href); $productid = clsProductsManager::InsertProducts($productObj); echo "inserted to id : " . $productid . "->>>>" . $nameAndURL->innertext . ">> " . $nameAndURL->href; echo "</br>"; GetProductDetails($nameAndURL->href, $productid); } break; echo "<hr>"; } function GetProductDetails($URL, $productID) { $productDetailsObj = new ProductDetails(); $productDetails = file_get_html($URL); //echo $productDetails; foreach ($productDetails->find('div[class=product-info]') as $productINFO) { //echo $productINFO; foreach ($productINFO->find('div[class=left] div[class=image] a img[id=image]') as $leftData) {
function UTCInsertProducts($products) { clsProductsManager::InsertProducts($products); }