We have a bilingual Welsh / English store. Is it possible to have a different category image that changes depending on the language used by the customer?
We have a bilingual Welsh / English store. Is it possible to have a different category image that changes depending on the language used by the customer?
I think there's an answer in one of the Similar Threads at the bottom of this page,
Sure it is if each language can be independently identified, ie. en for English and say de for German (Deutsch).
One way this could be accomplished is through image files being placed on the server having the filename modified to include the language identifier. Another by having the applicable image(s) in a sub-directory. One thing to consider is how to address the absence of such image noting that an image would have to exist for each language and/or some fallback process if such language image was not present.
Additionally to consider is the process to be used to place the image(s) on the server. This could be accomplished by uploading each language specific image through the admin following the naming convention determined suitable and then identifying the path of the "default" image whether that image is uploaded or not. (important part here is that the categories table has the path to a filename that would be manipulated as necessary to provide the "language" specific file path.
As to how/where to make these changes, the centralized location to apply the modification throughout the store would be the includes/functions/functions_lookup.php file specifically in the zen_get_categories_image function. This way the templates could be left alone and all such image paths would be provided for use.
Also, because the language is session variable dependent and discussing file paths, would suggest that there be some appropriate filepath verification on the resulting path to prevent session manipulation providing access to undesirable areas/files. This may already be relatively handled on initial load of each page, but is something to consider.
To piggy back on the previous post, looks like DrByte provided something tangible in the related posts: https://www.zen-cart.com/showthread....nt-on-language
Last edited by mc12345678; 4 Apr 2018 at 01:42 PM.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Thanks for your help both.
Bookmarks