From e9e405781d8dbf92819842c268bdc0b434c60936 Mon Sep 17 00:00:00 2001 From: Sergey Date: Mon, 4 Sep 2017 11:41:12 +0300 Subject: [PATCH] fix catalog formation (#25) --- MoySkladICMLParser.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/MoySkladICMLParser.php b/MoySkladICMLParser.php index f2bea37..9f1f261 100644 --- a/MoySkladICMLParser.php +++ b/MoySkladICMLParser.php @@ -281,11 +281,13 @@ class MoySkladICMLParser } else { $url = ''; } - - if ($url != '') { - $image = $this->requestImage($url); + + if (!empty($this->options['imgur'])) { + if ($url != '') { + $image = $this->requestImage($url); + } } - + $products[$assortiment['id']] = array( 'id' => !empty($assortiment['product']['externalCode']) ? ($assortiment['product']['externalCode'] . '#' . $assortiment['externalCode']) : @@ -559,6 +561,7 @@ class MoySkladICMLParser curl_setopt($curlHandler, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curlHandler, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curlHandler, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curlHandler, CURLOPT_TIMEOUT, self::TIMEOUT); curl_setopt($curlHandler, CURLOPT_CONNECTTIMEOUT, 60); curl_setopt($curlHandler, CURLOPT_HTTPHEADER, array(