Zen Cart Logo
Forums / General Questions / Showing products from different languages

Showing products from different languages

Locked

Views: 2,316

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
6 Feb 2009, 1:17 PM
#1
markus75 avatar

markus75

New Zenner

Join Date:
Aug 2008
Posts:
46
Plugin Contributions:
0

Showing products from different languages

My Zencart is showing products from different languages.
For example if i choose english language, i see products with other languages name.
And often i see listed the same product in 3-4 languages all together at the same time in the same page.
Why happens this?
How can i do to make the site show only products of the same language (the one i choose of course!) ??

Thanks in advance for your help! :smile:

6 Feb 2009, 9:39 PM
#2
tony_sar avatar

tony_sar

Totally Zenned

Join Date:
Jul 2006
Location:
Montreal, Canada
Posts:
2,276
Plugin Contributions:
0

Re: Showing products from different languages

if you mean new products side box , then i guess you can limit this box to show only one product.

I had the same issue with only two languages .. no matter which language i chose , side box would display products in multiple language. now i don't know if thats zencart bug , or is it done this way.

7 Feb 2009, 8:25 PM
#3
markus75 avatar

markus75

New Zenner

Join Date:
Aug 2008
Posts:
46
Plugin Contributions:
0

Re: Showing products from different languages

Yes i mean the "New Products" side box.
It shows sometimes only 1 product, repeated 3 times in different languages. Or sometimes 2 products, with a product repeated 2 times in different languages.

I want that this sidebox shows different products but always in the language selected for the site.
How do i do this?

15 Feb 2009, 8:24 PM
#4
angeloio avatar

angeloio

New Zenner

Join Date:
Nov 2008
Posts:
9
Plugin Contributions:
0

Re: Showing products from different languages

Hi Gyus,

Yes I confirm this is happening and (according to my opinion it is a bug and zen team should be notified...).

The problem is there because in file /includes/modules/sideboxes/whats_new.php there is a query and does not take into account the selected language.

Fix:

  1. First copy the file whats_new.php into /includes/modules/sideboxes/<MY_TEMPLATE>/ to ensure override mechanism compliance
  2. Secondly add the following line
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'

just before the line

and p.products_status = 1 " . $display_limit;

so in the end the whole query will be:

  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name,
                                              p.master_categories_id
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1 " . $display_limit;

That should do the trick...:smile: