Base Tag Library
Note: We have updated our folder structure in Neto 6 and this has not been updated on all tweaks yet. More info.

extra_options

Simple product options available for users to influence a SKU during purchase

Example

[%extra_options id:'[@sku@]'%]
    [%param *header%]
        <h4>Available Options</h4>
    [%/param%]
    [%param *number_option%]
        <label>[@name@]</label>
        <input name="extra[@count@]" id="productextra[@count@]" rel="[@SKU@]" value="">
    [%/param%]
    [%param *text_option%]
        <label>[@name@]</label>
        <textarea name="extra[@count@]" class="form-control" id="productextra[@count@]" rel="[@SKU@]" cols="20"></textarea>
    [%/param%]
    [%param *select_option%]
        <label>[@name@]</label>
        <select name="extra[@count@]" class="form-control" id="productextra[@count@]" rel="[@SKU@]">[@choices@]</select>
    [%/param%]
    [%param *choices%]
        <option type="text" class="form-control" value="[@option_id@]">
            [%nohtml%][@text@][%end nohtml%]
            [%if [@price@] != 0%]
                (+ [%FORMAT type:'currency'%][@price@][%END FORMAT%])
            [%/if%]
        </option>
    [%/param%]
    [%param *footer%]
        <input type="hidden" name="extras" value="[@total_options@]"/>
    [%/param%]
[%/extra_options%]

Usage

The extra options tag loads options loaded to a product that don't have inventoried options. By adding an extra option, lets say "Gift message" on the text_option type, this will accept user input for a single product on a single order. The sample code is how it appears in the default template set, and loads each option available for a product using extra products and repeats for each option of the same type.

If you'd like to show the user product options that do have inventory (Ie. Are their own SKU's in neto), you'll want to use the variations system and its relative tags.

Different formatting for the same extra options type

Frequently you may need to apply specific formatting to different options that share the same type. For minor changes, you can always rely on the [@name@] attribute to make a class that will identify that block. However, for more advanced formatting changes you can use an if statement to format a unique block.

In our example, we have 2 text options, "Name" and "Message" and we want to introduce a text block specific to the message, therefore our code would look like this :

[%extra_options id:'[@sku@]'%]
    [%param *header%]
        <h4>Available Options</h4>
    [%/param%]
    [%param *text_option%]
        [%if [@name@] eq 'Message'%]
            <label>[@name@]</label>
            <p>Text block specific to the "Message" option</p>
            <textarea name="extra[@count@]" class="form-control" id="productextra[@count@]" rel="[@SKU@]" cols="20"></textarea>
        [%else%]
            <label>[@name@]</label>
            <textarea name="extra[@count@]" class="form-control" id="productextra[@count@]" rel="[@SKU@]" cols="20"></textarea>
        [%/if%]
    [%/param%]
    [%param *footer%]
        <input type="hidden" name="extras" value="[@total_options@]"/>
    [%/param%]
[%/extra_options%]

extra_options Parameters

Name Options Description
id:'' String The SKU of the item you'd like to query for the extra options
number_option HTML & b@se tags Field for collecting an integer for the product option
text_option HTML & b@se tags Field for collecting a string for the product option
select_option HTML & b@se tags Field for collecting data from the user as defined in neto with pre-determined options, shown as a select form function
choices HTML & b@se tags Field for collecting data from the user as defined in neto with pre-determined options, shown as option form function
header HTML & b@se tags Renders a single usable space above the body
footer HTML & b@se tags Renders a single usable space below the body
ifempty:'' HTML & b@se tags If the extra_options returns no results, it'll load this block instead

extra_options Data Tags

Name Description
[@count@] An incremental count that runs each array. Critical component for tracking which extras to add to the sku via the form.
[@name@] The option name
[@choices@] For the select_option param, prints the select options
[@option_id@] For the choices param, is the unique ID to identify which choice is parsed to the form
[@text@] For the choices param, is the label text to identify the option
[@price@] The "attribute value" which adds an additional price for the option to the cost of the SKU.
[@total_options@] A summation of the extra options selected for final tally at the end of the form to parse all the options forward.