According to this documentation, ® is not a recognized character in the table in order to be escaped from the regular expression: https://support.google.com/webmasters/answer/183668lfairban wrote:Thank you so much for your help.
Reverting back to original and swapping out the application for text did not get rid of the error.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
$output .= '<image:caption>' . $product['name'] . '</image:caption>';
$output .= '<image:title>' . $product['name'] . '</image:title>';
However, by following the instructions from this page: https://www.google.com/schemas/sitemap-image/1.1 , the following:
Code: Select all
$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
Code: Select all
$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xsi:schemaLocation="https://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd">';
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
<?php
class ControllerExtensionFeedGoogleSitemap extends Controller {
public function index() {
if ($this->config->get('google_sitemap_status')) {
$output = '<?xml version="1.0" encoding="UTF-8"?>';
$output .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
$this->load->model('catalog/product');
$this->load->model('tool/image');
$products = $this->model_catalog_product->getProducts();
foreach ($products as $product) {
if ($product['image']) {
$output .= '<url>';
$output .= '<loc><![CDATA[' . htmlspecialchars($this->url->link('product/product', 'product_id=' . $product['product_id']), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<lastmod><![CDATA[' . date('Y-m-d\TH:i:sP', strtotime($product['date_modified'])) . ']]></lastmod>';
$output .= '<priority><![CDATA[1.0]]></priority>';
$output .= '<image:image>';
$output .= '<image:loc><![CDATA[' . $this->model_tool_image->resize($product['image'], $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height')) . ']]></image:loc>';
$output .= '<image:caption><![CDATA[' . htmlspecialchars($product['name'], ENT_QUOTES, 'UTF-8', true) . ']]></image:caption>';
$output .= '<image:title><![CDATA[' . htmlspecialchars($product['name'], ENT_QUOTES, 'UTF-8', true) . ']]></image:title>';
$output .= '</image:image>';
$output .= '</url>';
}
}
$this->load->model('catalog/category');
$output .= $this->getCategories(0);
$this->load->model('catalog/manufacturer');
$manufacturers = $this->model_catalog_manufacturer->getManufacturers();
foreach ($manufacturers as $manufacturer) {
$output .= '<url>';
$output .= '<loc><![CDATA[' . htmlspecialchars($this->url->link('product/manufacturer/info', 'manufacturer_id=' . $manufacturer['manufacturer_id']), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<priority><![CDATA[0.7]]></priority>';
$output .= '</url>';
$products = $this->model_catalog_product->getProducts(array('filter_manufacturer_id' => $manufacturer['manufacturer_id']));
foreach ($products as $product) {
$output .= '<url>';
$output .= '<loc><![CDATA[' . htmlspecialchars($this->url->link('product/product', 'manufacturer_id=' . $manufacturer['manufacturer_id'] . '&product_id=' . $product['product_id']), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<priority><![CDATA[1.0]]></priority>';
$output .= '</url>';
}
}
$this->load->model('catalog/information');
$informations = $this->model_catalog_information->getInformations();
foreach ($informations as $information) {
$output .= '<url>';
$output .= '<loc>><![CDATA[' . htmlspecialchars($this->url->link('information/information', 'information_id=' . $information['information_id']), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<priority><![CDATA[0.5]]></priority>';
$output .= '</url>';
}
$output .= '</urlset>';
$this->response->addHeader('Content-Type: application/xml');
$this->response->setOutput($output);
}
}
protected function getCategories($parent_id, $current_path = '') {
$output = '';
$results = $this->model_catalog_category->getCategories($parent_id);
foreach ($results as $result) {
if (!$current_path) {
$new_path = $result['category_id'];
} else {
$new_path = $current_path . '_' . $result['category_id'];
}
$output .= '<url>';
$output .= '<loc><![CDATA[' . htmlspecialchars($this->url->link('product/category', 'path=' . $new_path), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<priority><![CDATA[0.7]]></priority>';
$output .= '</url>';
$products = $this->model_catalog_product->getProducts(array('filter_category_id' => $result['category_id']));
foreach ($products as $product) {
$output .= '<url>';
$output .= '<loc><![CDATA[' . htmlspecialchars($this->url->link('product/product', 'path=' . $new_path . '&product_id=' . $product['product_id']), ENT_QUOTES, 'UTF-8', true) . ']]></loc>';
$output .= '<changefreq><![CDATA[weekly]]></changefreq>';
$output .= '<priority><![CDATA[1.0]]></priority>';
$output .= '</url>';
}
$output .= $this->getCategories($result['category_id'], $new_path);
}
return $output;
}
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Yes, the entire file.lfairban wrote:Was this last solution a replacement of the entire Google feed code?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
An interesting theory. Although, it seem that both answers, mine and the CDATA parsing would be incomplete solution according to this page on Stackoverflow: http://stackoverflow.com/questions/1282 ... s-vs-cdata .uksitebuilder wrote:Easier to wrap the text content inside the tags in <![CDATA[ and ]]> tags
I will make the change above and see if that fixes the issue officially.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I am experiencing two issues with my search on my storefront.
I have product codes (Models) containing forward slash, hyphen and full stop (period). If I enter AQST52/13 for example...the search results displays the correct product at the top of the search results. However, the results also display any other product with "/13".
Ideally, I would like that when the user inputs a product code, then only that product will display as a result or if the user enters "AQST" then all products with that attribute are displayed. I believe the issue is with the values after the forward slash, hyphen or full stop.
The other problem I have is that if the user enters the product code in the incorrect case...then the product is not being listed as the first result but is instead being displayed further down the page.
Other than that, if a user searches by product name the search works well...but in the industry product codes are key.
To recap:
1.I would like case sensitivity turned off in relation to search by model
2.I require assistance in relation to product codes containing /,- and .
Please help....
Users browsing this forum: No registered users and 33 guests