Product option selection will postback and reset options

Jogchem Andre Oord asked on June 5, 2014 09:19

I copied the following transformation from the demo e-commerce site to my own site:

<%@ Register Src="~/CMSModules/Ecommerce/Controls/ProductOptions/ShoppingCartItemSelector.ascx" TagName="CartItemSelector" TagPrefix="uc1" %>
<div class="productDetail">
  <p>    
    <%# Localize(Eval("SKUShortDescription")) %>
  </p>
  <div class="productInfo whiteBox">
    <table>      
      <% // Show pricing details according to saving %>
      <% if(GetSKUPriceSaving() > 0){ %>
      <tr>
          <td class="label">
             <span class="retailPrice">List price: </span>
          </td>
          <td>
              <span class="lineThrough"><%# GetSKUFormattedOriginalPrice() %></span>
          </td>
       </tr>
       <tr>
          <td class="label">
               <span class="yourPrice">Your price: </span>
          </td>
          <td>
               <span><%# GetSKUFormattedPrice() %></span>
          </td>
       </tr>
       <tr>
          <td class="label">
              <span class="instantSavings">You save: </span>
          </td>
          <td>
              <span><%# GetSKUFormattedPriceSaving() + " (" + GetSKUPriceSaving(true) + "%)"  %></span>
          </td>
        </tr>
      <% } %>

   </table>

   <uc1:CartItemSelector id="addItem" runat="server" SKUID='<%# EvalInteger("SKUID") %>' SKUEnabled='<%# EvalBool("SKUEnabled") %>' AddToCartTooltip="Add to cart" AddToCartLinkText="Add to cart" ShowWishlistLink="true" AddToWishlistLinkText="Add to wishlist" ShowUnitsTextBox="true" AlwaysShowTotalPrice="true" TotalPriceLabel="Total price:" ShowProductOptions="true" StockVisible="true" UnavailableVariantInfoEnabled="false" UsedInProductDetail="true" CssClassNormal="normal" CssClassFade="fade" />
  </div>   
</div>

I have a product with a few product options (attributes). When I select one of the options in the webshop, it will cause a postback to the server, but the selected option will return to the default one.

How do I fix this?

Recent Answers


Brenden Kehren answered on June 5, 2014 22:25

On the webpart showing the products, check the Use Update Panel box.

1 votesVote for this answer Mark as a Correct answer

Jogchem Andre Oord answered on June 6, 2014 04:41

Thanks. That fixed it.

0 votesVote for this answer Mark as a Correct answer

Jogchem Andre Oord answered on June 6, 2014 13:11

Sorry, didn't fix it. It prevents the page from performing a postback, but the selected value is reset...

0 votesVote for this answer Mark as a Correct answer

Josef Dvorak answered on June 17, 2014 10:16 (last edited on June 17, 2014 10:16)

Hello Jogchem,

Are you using a regular Repeater web part and ShoppingCartItemSelector control? Have they been customized in any way? If so, can you test using the stock ones? Are there any third party JavaScripts, which could be doing this? Can you try to temporarily assign a completely blank template to this document, set it as a master page, and use a repeater with same settings set?

Please let me know if it helps, or if any of these actions had any effect.

0 votesVote for this answer Mark as a Correct answer

Jogchem Andre Oord answered on June 17, 2014 10:27

It's working now. I had to use the exact same webpart that is being used in the demo store.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.