Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Как добавить фото товара в RSS ленту? [Решено]


Tamerlan

Recommended Posts

Подскажите пожалуйста как в RSS feed вместе с описанием товара вывести и его фото?

Использую Google Base feed. Проапдейтил google_base пхпшник и вставил enclosure тэг:

$output .= '</description>';// item image[color=#0000FF]if ($product['image']) {	$output .= '<enclosure url= "' . image_resize($product['image'], 500, 500) . '" type="image/jpeg" />';} else {	$output .= '<enclosure url= "'. image_resize('no_image.jpg', 500, 500) . '" type="image/jpeg" />';}[/color]// item image$output .= '<guid>' . $product['product_id'] . '</guid>';

но фото товара отображается как приатаченный файл, а не как картинка.

Просветите плз. как нормально правильно отобразить картинку. Полдня уже ломаю голову.

Надіслати
Поділитися на інших сайтах


  • 4 months later...

Если еще актуально :(

меняем поле description на

if ($product['image']) {$output .= '<description>' . '<img src="' . $this->model_tool_image->resize($product['image'], 300, 300) . '">' . $product['description'] . '</description>';} else {$output .= '<description>' . $product['description'] . '</description>';}
Надіслати
Поділитися на інших сайтах

  • 1 year later...

поставил модуль RSS. Все выводит кроме картинок

config->get('latest_products_rss_status')) { 	    $output = ''; 	    $output .= ''; 	    $output .= ''; 	    $output .= '' . $this->config->get('config_name') . ''; 	    $output .= '' . $this->config->get('config_meta_description') . ''; 	    $output .= '' . HTTP_SERVER . '';  	    $this->load->model('catalog/product'); 	    $this->load->model('localisation/currency');  	     	    $limit = $this->config->get('latest_products_rss_limit') ? $this->config->get('latest_products_rss_limit') : 100; 	     	    $products = $this->model_catalog_product->getLatestProducts($limit);  	    if (isset($this->request->get['currency'])) { 		$currency = $this->request->get['currency']; 	    } 	    else { 		$currency = $this->currency->getCode(); 	    }  	    foreach ($products as $product) { 		if ($product['description']) { 		    $output .= ''; 		    $output .= '' . html_entity_decode($product['name'], ENT_QUOTES, 'UTF-8') . ''; 		    $output .= '' . HTTP_SERVER . 'index.php?route=product/product&product_id=' . $product['product_id'] . '';  		    $special = $this->model_catalog_product->getProductSpecial($product['product_id']);  		    if ($special) { 			$price = $this->currency->format($this->tax->calculate($special, $product['tax_class_id']), $currency, FALSE, TRUE); 		    } else { 			$price = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id']), $currency, FALSE, TRUE); 		    }  		    $p = htmlspecialchars('[b]Price: ' . $price . '[/b]

');  		    $output .= '' . $p . $product['description'] . ''; 		     		    $output .= ''; 		} 	    }  	    $output .= ''; 	    $output .= '';  	    $this->response->addHeader('Content-Type: application/rss+xml'); 	    $this->response->setOutput($output, 0); 	}     } }  ?>

подскажите в какую строку прописать код картинок

Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку

×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.