News:

Support the VirtueMart project and become a member

Main Menu

Problem multilanguage products

Started by Reijo, July 15, 2016, 14:34:16 PM

Previous topic - Next topic

Reijo


Tested Joomla 3.6.0, Virtuemart 3.0.17 and virtuemart 3.0.17v2, PHP7
When I add new product then this new product is published all languages. Now I unpublished product for example one language then this effects all languages and product is unpublished.
Modify message

Studio 42

You have a fallback language in vm3, so a product is always valid for all language.
If you don't want it, then you can disable it in the VM config.

Reijo

I did glean install Joomla3.6 and Virtuemart3.0.17.2. Confine multilingual and added  product categories and products in main language (DB tables added). Second language shows products and product categories. I did not add translation to second language. DB tables is empty second language.

Studio 42

I think that now, this cannot be disable. I don't know why. Check with the team leader Milbo, why you cannot disable untranslated products and categories in current release.

Miku

I think it has something to do with the issue I described in the topic below:
http://forum.virtuemart.net/index.php?topic=134897.0
Yes, as far as I know VM has been working this way from 3rd release :
Quote from: Studio 42 on July 15, 2016, 21:56:16 PM
You have a fallback language in vm3, so a product is always valid for all language.
and rather there is no option to change that in VM config:
Quote from: Studio 42 on July 15, 2016, 21:56:16 PM
If you don't want it, then you can disable it in the VM config.
The only way to "break" the fallback seems to be the hidden setting "prodOnlyWLang" http://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html. The problem is... it's not working. Although 
Quote from: Studio 42 on July 21, 2016, 18:25:27 PM
team leader Milbo
hasn't confirmed it yet. Anyway I know that the setting had been working in the previous VM releases. Now is not...

Milbo

You should answer me then. Your vmdebug showed the productOnlyWlang deactivated, so I cannot use the result.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

#6
Quote from: Milbo on July 21, 2016, 19:57:53 PM
You should answer me then.
Sorry, but I don't get it... I did answer you. Vmdebug showed the productOnlyWlang deactivated but as I wrote:
QuoteActually there's no difference in debugging result whether I use the 'prodOnlyWLang' or not
So whether we have productOnlyWlang=1 or whether the setting is absent from virtuemart.cfg the Vmdebug shows the same result -  productOnlyWlang deactivated. I thought it has proven the existence of some problem with that feature.  But now I'm confused...  Did I do something wrong??

Milbo

Just activate it and then show/ copy me the vmdebug.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

vmdebug My config and lang Var1:

1

Var2:

pl_pl

Var3:

en_gb

Var4:

3

Milbo

Okey, actually the same (sorry, you cant imagine, ...)

Quote from: Milbo on July 19, 2016, 23:08:52 PM
please check the product model around line 287 ( begin function sortSearchListQuery)

$langFback = ( !VmConfig::get('prodOnlyWLang',false) and VmConfig::$defaultLang!=VmConfig::$vmlang and VmConfig::$langCount>1 );


Looks like the result is wrong here for your case. You could enable the debug in VM config and use below

$langFback = ( !VmConfig::get('prodOnlyWLang',false) and VmConfig::$defaultLang!=VmConfig::$vmlang and VmConfig::$langCount>1 );
vmdebug('My config and lang',(int)VmConfig::get('prodOnlyWLang',false),VmConfig::$defaultLang,VmConfig::$vmlang,VmConfig::$langCount);


My first guess was, that the $langFback is set to true, does it work, when you hardcode it to "false"?

$langFback = false;
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

Quote from: Milbo on July 22, 2016, 08:57:56 AM
Okey, actually the same (sorry, you cant imagine, ...)
You mean you sorry that I am not able to understand some things and actually I didn't give you the thing you have expected to see? Yes, it can be because I'm not the programmer.
So to be clear as possible I described what I've done. Please correct me if I do sth wrong..
1.  placing productOnlyWlang=1 in virtuemart.cfg
2.  backend configuration saving
3. Vmdebug
-  for the primary language:
vmdebug My config and lang Var1:

1

Var2:

pl_pl

Var3:

pl_pl

Var4:

3


- for the second language (where the issue occurs)
1

Var2:

pl_pl

Var3:

en_gb

Var4:

3


4. Vmdebug for $langFback = false; so the code looks like:
$langFback = false;
vmdebug('My config and lang',(int)VmConfig::get('prodOnlyWLang',false),VmConfig::$defaultLang,VmConfig::$vmlang,VmConfig::$langCount);

Outcome: Vmdebug shows exactly the same values as in the point 3..




Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Miku

Yeep. You did  :) It works now. By the way.... I have one additional question about that 'productOnlyWlang' - Is it responsible only for products (as the name implies) or should do the trick also for categories? - because I see the problem for them too. But maybe it's just something wrong on my part...

Reijo

Ok virtuemart 3.0.17.4 removes untranslated products, but product catecoris is still there.

Milbo

uhm, usually not necessary. I wonder anyway, why you do not want to work with the fallback, which makes it a lot more commod. Btw, we have even a doubled fallback. For example,... pt-PT to pt-BR, when pt-BR not available use en-GB
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/