From 7a131af6f084c4957a144ac237593cff6e31c70c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 6 Dec 2016 10:40:57 +0200 Subject: [PATCH] remarketing --- console/controllers/FeedController.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/console/controllers/FeedController.php b/console/controllers/FeedController.php index dae5a63..f1972d9 100644 --- a/console/controllers/FeedController.php +++ b/console/controllers/FeedController.php @@ -38,7 +38,7 @@ class FeedController extends Controller $url = Url::to(['catalog/product', 'product' => $product]); if($this->checkUrl($url)){ print $this->count++ . "\n"; - $content .= $url."\r\n"; + $content[] = [$url]; } } @@ -50,15 +50,13 @@ class FeedController extends Controller $handle = fopen($dirName .'/'. $filename, "w"); - $content = 'ID, ID2, Item Category, Item title, Item description, Price'."\r\n"; + $content[] = ['ID', 'ID2', 'Item Category', 'Item title', 'Item description', 'Price']; foreach ($this->getProducts() as $product) { $this->createRow($product, $content); } - $content .= ''; - - fwrite($handle, $content); + fputcsv($handle, $content); fclose($handle); print $dirName .'/'. $filename; -- libgit2 0.21.4