VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: Mister Paul on September 04, 2019, 17:45:43 PM

Title: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: Mister Paul on September 04, 2019, 17:45:43 PM
Hi,

In category listed products and in product page I see this text : COM_VIRTUEMART_UNIT_SYMBOL_pièce:
https://www.cjoint.com/doc/19_09/IIeptTPShiU_Capture-2019-09-04-à-17.15.36.jpg (https://www.cjoint.com/doc/19_09/IIeptTPShiU_Capture-2019-09-04-%C3%A0-17.15.36.jpg)
https://www.cjoint.com/data/IIepvnAlDmU_Capture-2019-09-04-à-17.15.01.jpg (https://www.cjoint.com/data/IIepvnAlDmU_Capture-2019-09-04-%C3%A0-17.15.01.jpg)

I don't know how I could act on this text:
- I can't know why this extra line is displayed: I don't see any checkbox with the option to show the price per item. And other products from other categories don't have this extraline.
- If I try to edit the language file /language/fr-FR/fr-FR.com_virtuemart.ini on this line: COM_VIRTUEMART_UNIT_SYMBOL_PIECE="pièce"
it doesn't affects the displayed text
(by the way I don't have any /language/en-GB/en-GB.com_virtuemart.ini but I have /components/com_virtuemart/languages/en-GB/en-GB.com_virtuemart.ini)

Any help?
:-[

Thanks
Paul
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: StefanSTS on September 04, 2019, 18:25:24 PM
Check in VM config what is written in the field for applicable units. Maybe send a screenshot like in the attachment.
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: Mister Paul on September 04, 2019, 19:27:21 PM
You put me on the way. Thanks!

I had to uncheck "Unit price" on configuration.
So now we don't see anymore this "COM_VIRTUEMART_UNIT_SYMBOL_pièce" in the page.
Perhaps some en-GB files are missing...

By the way, for "Applicable units", I have "KG,100G,M,SM,CUBM,L,100ML,P".
Not your "KG,100G,M,SM,CUBM,L,100ML,PC,AL"
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: StefanSTS on September 04, 2019, 20:30:52 PM
Looks like strtoupper() is not working on your special character.

The full string should be in uppercase, but the accent breaks the function.
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: Milbo on September 04, 2019, 21:23:02 PM
I cannot access the images anylonger.
$unitPriceDescription = vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', vmText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.strtoupper($product->product_unit)));

the product_unit should be here PC or AL, but not Piece or so.
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: StefanSTS on September 05, 2019, 00:41:44 AM
Quote from: Mister Paul on September 04, 2019, 19:27:21 PM

By the way, for "Applicable units", I have "KG,100G,M,SM,CUBM,L,100ML,P".
Not your "KG,100G,M,SM,CUBM,L,100ML,PC,AL"

Is it possible, that the pièce is hidden behind that "...100ML,P...(here somewhere)", because the input field is too short?

My AL is a fictuous unit called Alumni to show how to make "your own" units like here:
https://php72.sts-hosting.de/vm3/de/diverses/alumni-einheit-detail
Title: Re: Displayed: COM_VIRTUEMART_UNIT_SYMBOL_pièce
Post by: Mister Paul on September 05, 2019, 09:40:53 AM
For me the images are displayed by clicking on the link.

I modified /components/com_virtuemart/sublayouts/prices.php with your code.
I get now: Prix / COM_VIRTUEMART_UNIT_SYMBOL_PIèCE:

I made some Google PHP research and replaced your code by:$unitPriceDescription = vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', vmText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.strtoupper(\Transliterator::create('NFD; [:Nonspacing Mark:] Remove; NFC')
->transliterate($product->product_unit))));


I don't know if that's the best way to do,
but it works fine now.

Thank you Stefan & Milbo!