KonaKart Community Forum

General Category => Miscellaneous => Topic started by: Vladimir on December 11, 2009, 01:22:18 pm

Title: Selected (default) Product Option (attribute), 4.1.0.0
Post by: Vladimir on December 11, 2009, 01:22:18 pm
This modification make choice in product option combobox, bases on option (concrete product attribute) with Price=0.
This makes it possible to display the default configuration and price of the product, which has attributes.
In ProductDetailsBody.jsp replace the:

<td >
<html:select name="AddToCartForm" property='<%= "valueId["+i+"]"%>' >

with:

<td >
<% int selectedId = 0;
for (ProdOption option : ((ProdOptionContainer) optContainer).getOptValues()) {
    if (0 == option.getPriceExTax().intValue()) {
          selectedId = option.getId();
}
}%>
<html:select name="AddToCartForm" property='<%= "valueId["+i+"]"%>' value='<%=""+selectedId%>'>



PS its dirty, but its friday evening here, in Kazakhstan, and I'm already tired...