• Welcome to KonaKart Community Forum. Please login or sign up.
 

Selected (default) Product Option (attribute), 4.1.0.0

Started by Vladimir, December 11, 2009, 01:22:18 pm

Previous topic - Next topic

Vladimir

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...