cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Default Value for Currency and Unit in PriceRow

Former Member
0 Likes
1,123

Hi everyone,

I want to set default Values for currency and unit in price row as i create a new price row. i dont want to choose everytime the currency because the currency is always Euro. How can i do that? should i change the any xml file, or i need to implement it.?

Thanks in advance

View Entire Topic
Former Member
0 Likes

Hi Adil,

You can achieve it by extending those types in yourextension-items.xml. Just add <defaultvalue> for the desired attributes (see items.xml reference article).
For Currency it would be something like (Currency documentation😞

 <attribute generate="true" autocreate="true" qualifier="currency" type="Currency">
             <defaultvalue>
                     new de.hybris.order.calculation.money.Currency(yourDesiredCurrencyIsocode, digits)
             </defaultvalue>
             <persistence type="property" qualifier=""/>
             <modifiers read="true" write="true" search="true" encrypted="false" optional="false" removable="false" initial="true" unique="false" private="false" partof="false"/>
         </attribute>

For Unit (javadoc😞

 <attribute generate="true" autocreate="true" qualifier="unit" type="Unit">
             <defaultvalue>
                     new de.hybris.platform.jalo.product.Unit()
             </defaultvalue>
             <persistence type="property" qualifier=""/>
             <modifiers read="true" write="true" search="true" encrypted="false" optional="false" removable="false" initial="true" unique="false" private="false" partof="false"/>
         </attribute>

For Unit you might need to use unitService (javadoc, most likely getUnitForCode()) instead of the constructor.

Hope this helps.
Best Regards,

Former Member
0 Likes

can one implement this im Backoffice config.xml?

Former Member
0 Likes

You could probably overwrite Configurable Flow Wizard Widget for the PriceRow type to implement it via Backoffice.