Forum

The forum is a free service supported by community members. Please consider opening a support ticket if you need timely help.

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Jan 2011 10:05 PM by  Steve L
Add Multiple Options to Cart
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages


New Member


Posts:
New Member


--
27 Jan 2011 12:52 AM
    I'm building a new site, and the client wants the ability to add multiple product options to the cart with a single click. That means a product with 5 options would need 5 Option text boxes and 5 Quantity text boxes, and the Add to Cart button would have to insert all the user-selected options with a single click.

    Is it possible to do this with the Revindex Storefront? And, if not, how much would it cost to have such functionality added?

    Thanks.
    0


    Veteran Member


    Posts:2972
    Veteran Member


    --
    27 Jan 2011 03:05 AM
    hi Saunan,

    If your client doesn't care about inventory count and just want to collect the order information for the 5 options selected and their quantities, then you can simply use the Dynamic Form extension under Product. In the Dynamic Form, you just need to write the ASP.NET controls for the 5 dropdown boxes and 5 text boxes. You can even add ASP.NET validator controls next to each quantity textbox to make them required fields.

    Thanks,
    0


    New Member


    Posts:
    New Member


    --
    27 Jan 2011 08:32 PM
    Thanks very much for the reply. I've discussed this with one of our ASP.NET developers, and it looks straightforward enough. It's nice to know that the module has this flexibility built in.

    I don't expect you to support a product you haven't even sold to me yet, but how much code are we talking about? Anything is possible in Visual Studio (we're using 2008), but how complicated can we get with the Dynamic Form extension? I hope I'm not being obtuse... For instance:

    * Could the code create a dynamic number of controls based on the number of product variants?
    * Would an "out of stock" message be possible when using dynamic controls?

    Is there an example of simple code anywhere that I could look at? The manual mentions Checkout.DynamicFormCode, dynamic controls in the Display Templates, and the Extension field for Distributors, Manufacturers, etc. I don't see any information on using Dynamic Form Extension in the way we're discussing.

    If you could provide a rudimentary example of code that would display one simple variant, that would be great. If the answer is no, I'll understand.

    Thanks.

    -- Steve
    0


    Veteran Member


    Posts:2972
    Veteran Member


    --
    27 Jan 2011 10:05 PM

    I'm glad to help. You don't need Visual Studio, you just need to know basic ASP.NET or HTML to make use of it. And you're right you can also use Display Templates to achieve more customizations. These are all 1st class features supported by the software so it won't be a hack.

    In this thread we're talking about Dynamic Form Code. Currently, you can put standard ASP.NET form controls and HTML/Javascript but not .NET code. For example, you can put the Dynamic Form code under Product or ProductVariant. If you put on the Product level, it will show for all variants. If you put at the ProductVariant level, it will only show when that variant is selected.

    Here's an example, suppose you sell t-shirts and you want to capture the Size, Color selection and allow your customer to write a little text to be printed on the shirt. Notice the example below uses dropdown lists, textboxes and validators. The data collected here becomes part of the order detail in clean XML and is piped to your various custom business rules that form your entire shopping cart flow that you can trigger on. This opens up a world of flexibility to present and capture any data even if you just know a bit of HTML, Javascript or ASP.NET, as long as you stay creative.

    <table cellpadding="3" cellspacing="0" style="width: 100%">
    <tr>
    <td style="width: 80px">
    <b>Size:</b>
    </td>
    <td>
    <asp:DropDownList ID="MySizeDropDownList" runat="server" Width="100px">
    <asp:ListItem>S</asp:ListItem>
    <asp:ListItem>M</asp:ListItem>
    <asp:ListItem>L</asp:ListItem>
    <asp:ListItem>XL</asp:ListItem>
    </asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td>
    <b>Color:</b>
    </td>
    <td>
    <asp:DropDownList ID="MyColorDropDownList" runat="server" Width="100px">
    <asp:ListItem>Red</asp:ListItem>
    <asp:ListItem>Green</asp:ListItem>
    <asp:ListItem>Blue</asp:ListItem>
    </asp:DropDownList>
    </td>
    </tr>
    <tr>
    <td>
    <b>Print Word:</b></td>
    <td>
    <asp:TextBox ID="MyPrintWordTextBox" runat="server" Width="100px"></asp:TextBox>
    <asp:RequiredFieldValidator ID="MyRequiredFieldValidator" runat="server" ControlToValidate="MyPrintWordTextBox">Word is required.</asp:RequiredFieldValidator>
    </td>
    </tr>
    </table>

    0
    You are not authorized to post a reply.