Author Topic: Selected (default) Product Option (attribute), 4.1.0.0  (Read 853 times)

Vladimir

  • Jr. Member
  • **
  • Posts: 12
    • View Profile
Selected (default) Product Option (attribute), 4.1.0.0
« on: December 11, 2009, 08:22:18 AM »
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:
Code: [Select]
<td >
<html:select name="AddToCartForm" property='<%= "valueId["+i+"]"%>' >
with:
Code: [Select]
<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...