Opencart Facebook XML Oluşturucu
Tüm Blog YazılarıMerhabalar,
Bu modülü ücretsiz sunmak istedim. Temel seviyede işinizi görecektir. İndirimli fiyatı, marka adı gibi bilgileri gösteriyor.
Erişim URL'i: //siteadi.com/index.php?route=extension/facebook
catalog/controller/extension/facebook.php içine aşağıdaki kodları ekleyin.
<?php class ControllerExtensionFacebook extends Controller { public function index() { ini_set("display_errors", 1); if ($this->config->get('xmlfeed_status') || 1) { $output = '<?xml version="1.0" encoding="UTF-8" ?>' . '<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0">'; $output .= '<channel>'; $output .= '<title>FSKGrup Ürünler XML</title>'; $output .= '<link>https://www.fskgrup.com</link>'; $output .= '<description>FSKGrup ürünleri</description>'; $this->load->model('catalog/product'); $this->load->model('catalog/manufacturer'); $this->load->model('catalog/category'); $this->load->model('tool/image'); $products = $this->model_catalog_product->getProducts(["start" => 0, "limit" => 99999999]); foreach ($products as $product) { if ($product['image']) { $price = $this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')); $manufacturer = $this->model_catalog_manufacturer->getManufacturer($product['manufacturer_id']); $specialPrice = $price = ""; if ($product['special']) { $specialPrice = $this->tax->calculate($product['special'], $product['tax_class_id'], $this->config->get('config_tax')); } $images = HTTPS_SERVER . "image/" . $product['image']; $availability = "out of stock"; if ((int) $product['quantity'] > 0) { $availability = "in stock"; } $product['description'] = html_entity_decode($product['description'], ENT_QUOTES, 'UTF-8'); $output .= '<item>'; $output .= '<id>' . $product['product_id'] . '</id>' . ''; $output .= '<sku>' . $product['model'] . '</sku>'; $output .= '<gtin>' . $product['model'] . '</gtin>'; $output .= '<title><![CDATA[' . trim($product['name']) . ']]></title>'; $output .= '<link><![CDATA[' . $this->url->link('product/product', 'product_id=' . $product['product_id']) . ']]></link>'; $output .= '<status>' . $product['status'] . '</status>'; $output .= '<availability>' . $availability . '</availability>'; $output .= '<manufacturer><![CDATA[' . $manufacturer["name"] . ']]></manufacturer>'; $output .= '<brand><![CDATA[' . $manufacturer["name"] . ']]></brand>'; $output .= '<condition>new</condition>'; $output .= '<model>' . $product['model'] . '</model>'; $output .= '<price>' . (empty($specialPrice) ? $price : $specialPrice) . '</price>'; $output .= '<special_price>' . $specialPrice . '</special_price>'; $output .= '<description><![CDATA[' . $product['description'] . ']]></description>'; $output .= '<image_link><![CDATA[' . $images . ']]></image_link>'; $output .= '</item>'; } } $output .= '</channel>'; $output .= '</rss>'; $this->response->addHeader('Content-Type: application/xml'); $this->response->setOutput($output); } } }