Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2018
    Posts
    11
    Plugin Contributions
    0

    Default Display only selected products in the second language of the site

    Greetings,

    I use Zen Cart partly as a news platform. Any news is submitted through the catalog as categories/product. Then the front lists all the "products" in order to show the news.

    The problem: I have two languages - Bulgarian and English. My native users are interested in EVERYTHING submitted. The foreigners should only read selected (major) news, the minor ones just push these below.

    I was thinking of messing with the code. But I can't really get into the essence of the way news is displayed. Simply put - I wanted to do a DB check if the news is translated (second textarea contains anything) and if so only then display. Else don't, because currently it displays the picture and text/heading are empty.

    This is really important to my work and If someone is really interested in helping me, I can provide you with details.

    Thanks in advance!
    Last edited by honatto; 31 Oct 2018 at 10:18 PM.

  2. #2
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Display only selected products in the second language of the site

    You can accomplish this in a few ways:

    Option #1 - Language Groups
    Use the Twitch Wholesale Attributes with Product Control Switch and point the entire product filter system at a prefilter for languages which gives you:

    Custom Coded
    - language groups
    - news filter

    Out of the Box
    - product, wholesale, retail and guest groups
    - retains group pricing if you're using it

    These 'groups' wholesale for example could be a 'language group'. English = Retail Group, Bulgarian = Wholesale Group. You can then get really fancy with the news filter for these groups at the product level with the control switch - On/Off/Both groups.


    Option #2 - Secure News Data
    The same is possible with Twitch Restrict if you want to also restrict any public access to the data - data is filtered on the server behind closed doors before it is released to the HTML/PHP running the live site.

    There's also no limit on the 'Twitch' groups you could setup so it's already scalable :)


    Option #3 - Fast and Easy
    A third and exceptionally simple method is to add a language filter tied to a simple true/false gate for the news data before it is displayed on the site. This wouldn't be 'secure' in that the data would already make it to the output HTML/PHP. Visually it would look the part functionally other countries may find an interest in your news ;)
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

  3. #3
    Join Date
    Jun 2018
    Posts
    11
    Plugin Contributions
    0

    Default Re: Display only selected products in the second language of the site

    Thanks for the response, I actually took the easy path myself.

    Edit: includes/index_filters/default_filter.php
    Add the following code to all listing queues

    Code:
                     and pd.products_name != ''
    		 and pd.products_description IS NOT NULL
    		 and pd.products_description != ''
    The logic behind it: English user enters the website, only articles with value in name and description get shown.

    Downsides:
    1. It affects both languages, but the main language uses name / description.
    2. Articles can still be accessed through direct link and they will remain untranslated. - which can be fixed by putting "Not available in English." in the description and then adding this exception to the query above.
    3. I have "top articles" as in Top 1 and Top 2/3 and articles appear regardless of the query above => either more editting or just translate them always.
    4. Simple and practicle, but not sure if it can't brake anything. Testing it currently.


    - Feel free to suggest ideas or mention more possible outcomes I didn't take in account.
    Last edited by honatto; 11 Nov 2018 at 04:20 AM.

  4. #4
    Join Date
    Jun 2018
    Posts
    11
    Plugin Contributions
    0

    Default Re: Display only selected products in the second language of the site

    I can't edit the post above, but simply
    Code:
    and pd.products_name != ''
    is enough for my cause. I do sometimes put a title and type "expect more information soon".

  5. #5
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: Display only selected products in the second language of the site

    I think it is simpler to use the session language.

    like:
    PHP Code:
    AND pd.languages_id " . $_SESSION['languages_id'] . " 
    and not use the above from your post

 

 

Similar Threads

  1. Replies: 9
    Last Post: 5 Sep 2012, 04:34 PM
  2. Hiding a second currency when the second currency is selected as primary.
    By gamestuff in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 0
    Last Post: 30 Nov 2009, 09:01 PM
  3. Adding a second language to the store
    By CaroleAs in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 6 May 2009, 02:55 AM
  4. Replies: 3
    Last Post: 5 Dec 2006, 02:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR