Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

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

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 12-20-2008, 10:32 PM
  Gijs's Avatar 
Gijs Gijs is offline
 

eXpert
  
Join Date: Aug 2004
Location: Belgium
Posts: 295
 

Default 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
__________________
X-cart 4.1.11
PHP 5 MySQL 5
www.wheelpalace.eu
Reply With Quote
  #2  
Old 12-21-2008, 03:19 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default 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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:28 PM.

   

 
X-Cart forums © 2001-2020