X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Third Party Add-Ons for X-Cart 4 (https://forum.x-cart.com/forumdisplay.php?f=45)
-   -   A solution on how to make XC SEO - Basic Multi-lingual (https://forum.x-cart.com/showthread.php?t=44357)

Gijs 12-20-2008 10:32 PM

A solution on how to make XC SEO - Basic Multi-lingual
 
Hi,

You can easily modify XC SEO to be put out correct multi-lingual html-files for categories, manufacturers and products
by adding a $variable to contain the shop's language and using the langauage versions of the sql-tables.



Edit outputfilter.seo.php as follows:

1) Create a language variable:

Put after:

Code:

if ( !defined('XCART_START') ) { header('Location: ../'); die('Access denied'); }

the following line:

Code:

$language_shop = $GLOBALS['store_language'];


2) Edit the section: # Generate filename for a category page

Change:

Code:

function _category_filename($options) {
                global $sql_tbl;

                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT category
                                                                                        FROM ' . $sql_tbl['categories'] . '
                                                                                        WHERE categoryid="' . $options['cat'] . '"');

To:

Code:

function _category_filename($options) {
                global $sql_tbl, $language_shop;
                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT category
                                                                                        FROM ' . $sql_tbl['categories_lng'] . '
                                                                                        WHERE categoryid="' . $options['cat'] . '" AND code="' . $language_shop .'"');


3) Edit the section: # Generate filename for a manufacturers page

Change:

Code:

               
function _manufacturer_filename($options) {
                global $sql_tbl;

                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT manufacturer
                                                                                        FROM ' . $sql_tbl['manufacturers'] . '
                                                                                        WHERE manufacturerid="' . $options['manufacturerid'] . '"');



To:

Code:

function _manufacturer_filename($options) {
                global $sql_tbl, $language_shop;

                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT manufacturer
                                                                                        FROM ' . $sql_tbl['manufacturers_lng'] . '
                                                                                        WHERE manufacturerid="' . $options['manufacturerid'] . '" AND code="' . $language_shop .'"');
               


4) Edit the section: # Generate filename for a product page

Change:
Code:

function _product_filename($options) {
                global $sql_tbl;

                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT product
                                                                                          FROM ' . $sql_tbl['products'] . '
                                                                                          WHERE productid = "' . $options['productid'] . '"');


To:

Code:

function _product_filename($options) {
                global $sql_tbl, $language_shop;

                if (!$options['result_title'])
                        $options['result_title'] = func_query_first_cell('SELECT product
                                                                                          FROM ' . $sql_tbl['products_lng'] . '
                                                                                          WHERE productid = "' . $options['productid'] . '" AND code="' . $language_shop .'"');



Note:
Works fine in x-cart 4.1.11 with XC SEO Basic.
Possibly, it should work with the other version of XC SEO (Pro, ...)

My 2 cents,

Gijs

balinor 12-21-2008 03:19 AM

Re: A solution on how to make XC SEO - Basic Multi-lingual
 
Moving to Third Party Add-Ons. FYI, the mod author is no longer present, or supporting their product, so anyone reading this should be advised to NOT purchase/install it if they are thinking about doing so.


All times are GMT -8. The time now is 09:14 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.