VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: matevzp2 on September 22, 2016, 12:33:49 PM

Title: different pdf for same product in multilingual shop
Post by: matevzp2 on September 22, 2016, 12:33:49 PM
Hello everyone.
I have a website with 3.0.18 VirtueMart. I Use 4 languages. For products I use custom field to show pdf.

Right now i set pdf in english for description of product.

I want to ask if I am able to set a different pdf (different language) for other languages, and how to make that.

Thanks, Matevz
Title: Re: different pdf for same product in multilingual shop
Post by: baoquocmt159 on September 26, 2016, 09:47:31 AM
Quote from: matevzp2 on September 22, 2016, 12:33:49 PM
Hello everyone.
I have a website with 3.0.18 VirtueMart. I Use 4 languages. For products I use custom field to show pdf.

Right now i set pdf in english for description of product.

I want to ask if I am able to set a different pdf (different language) for other languages, and how to make that.

Thanks, Matevz

Hello,

I think you should create an plugin to do this, if not please email me baoquocmt159@gmail.com i can help you.

Thank you !
Title: Re: different pdf for same product in multilingual shop
Post by: GJC Web Design on September 26, 2016, 12:48:08 PM
how about name each pdf

pdf1_en-gb.pdf
pdf1_it-it.pdf   etc

in the custom field write   pdf_xxxxx.pdf

and in the template do a str_replace for the xxxx with the current lang code when u display the custom field
Title: Re: different pdf for same product in multilingual shop
Post by: Ghost on September 26, 2016, 13:35:08 PM
Haven't tried it but sounds like this plugin should do what you need http://extensions.virtuemart.net/products/multilingual-translatable-custom-fields-detail.
Title: Re: different pdf for same product in multilingual shop
Post by: matevzp2 on October 15, 2016, 12:44:57 PM
Quote from: GJC Web Design on September 26, 2016, 12:48:08 PM
how about name each pdf

pdf1_en-gb.pdf
pdf1_it-it.pdf   etc

in the custom field write   pdf_xxxxx.pdf

and in the template do a str_replace for the xxxx with the current lang code when u display the custom field

Hi, can you please repeat me instructions what i need to do in template because i didnt understand everything.
Thanks
Title: Re: different pdf for same product in multilingual shop
Post by: GJC Web Design on October 15, 2016, 13:49:58 PM
in the template detect the current lang code

in the display of the custom field do a str replace of the xxx for the lang code
Title: Re: different pdf for same product in multilingual shop
Post by: jenkinhill on October 15, 2016, 17:09:31 PM
http://www.w3schools.com/php/func_string_str_replace.asp