Announcement

Collapse
No announcement yet.

OUSM with Atrributes and Attribute templates - Upsale

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OUSM with Atrributes and Attribute templates - Upsale

    Hello all
    I am on mIva 9 so I am reposting something that I posted by mistake on the old thread in miva 5.5

    I am struggling with getting attributes to work on the OUSM page.

    They show up just perfect - in right order in nice arrays etc. This is just like in my PROD page. The code I modified for use in OUSM.

    But when I select anything it still puts up the Missing Required Attributes page

    There must be something I am missing. If someone could help - it would be fantastic.
    Thanks very much
    Sam

    My code below

    <input type="hidden" name="Product[&mvt:upsold_product:index;]:Attribute_Count" value="&mvte:global:Product_Attribute_Count;" />
    <mvt:foreach iterator="attribute" array="attributes">
    <table cellpadding="0" cellspacing="0" border="0">
    <mvt:if expr="l.settings:attribute:template_code NE 0">
    <input type="hidden" name="Product_Attributes[&mvt:attribute:index;]:template_code" value="&mvte:attribute:template_code;" />
    </mvt:if>

    <input type="hidden" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:code" value="&mvte:attribute:code;">


    <mvt:if expr = "l.settings:attribute:type EQ 'checkbox'">
    <tr>
    <td align="left" valign="top"><mvt:if expr = "g.Product_Attributes[l.settings:attribute:index]:value">
    <input type="checkbox" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" value="Yes" checked>
    <mvt:else>
    <input type="checkbox" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" value="Yes">
    </mvt:if>
    <mvt:if expr="l.settings:attribute:image"> <img src="&mvte:attribute:image;" alt="&mvte:attribute:raw_prompt;">
    <mvt:else>
    <mvt:if expr="l.settings:attribute:required"> <b>&mvt:attribute:prompt;</b>
    <mvt:else>
    <b>&mvt:attribute:prompt;</b> </mvt:if>
    </mvt:if>
    </td>
    </tr>
    <mvt:else>
    <tr>
    <td align="left" valign="top">
    <mvt:if expr="l.settings:attribute:image"> <img src="&mvte:attribute:image;" alt="&mvte:attribute:raw_prompt;">
    <mvt:else>
    <mvt:if expr="l.settings:attribute:required"> <b>&mvt:attribute:prompt;</b>
    <mvt:else>
    <b>&mvt:attribute:prompt;</b> </mvt:if>
    </mvt:if></td>
    </tr>
    <tr>
    <mvt:if expr="l.settings:attribute:type EQ 'text'">
    <td align="left" valign="top">
    <input type="text" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" value="&mvte:attribute:value;" size=40></td>
    <mvt:elseif expr="l.settings:attribute:type EQ 'memo'">
    <td align="left" valign="top">
    <textarea name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" rows=10 cols=58 wrap="on">&mvte:attribute:value;</textarea>
    </td>
    <mvt:elseif expr="l.settings:attribute:type EQ 'radio'">
    <td align="left" valign="top"><table border=0>
    <tr>
    <mvt:foreach iterator="option" array="attribute:options">
    <td valign="top" align="center" width="60">
    <mvt:if expr="( ( g.Product_Attributes[l.settings:attribute:index]:value EQ 0 ) AND ( l.settings:option:id EQ l.settings:attribute:default_id ) ) OR
    ( g.Product_Attributes[l.settings:attribute:index]:value EQ l.settings:option:code )">
    <input type="radio" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" value="&mvte:option:code;" checked="checked">
    <br clear="all">
    <mvt:else>
    <input type="radio" name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value" value="&mvte:option:code;">

    <br clear="all">
    </mvt:if>
    <mvt:if expr="l.settings:option:image"> <img style="height:40px;" src="&mvte:option:image;" alt="&mvte:option:prompt;" title="&mvte:option:prompt;"> <br clear="all">
    <mvt:comment> ADDING CAPTION TO COLORS </mvt:comment>
    <div style="font-size:11px;">&mvte:option:prompt; </div>
    <mvt:else>
    <div style="font-size:11px;">&mvte:option:prompt;</div>
    </mvt:if>
    </td>
    <mvt:if expr="(pos2 MOD 6) EQ 0">
    </tr>
    <tr>
    </mvt:if>
    </mvt:foreach>
    </tr>
    </table></td>
    <mvt:elseif expr="( l.settings:attribute:type EQ 'select' ) OR ( l.settings:attribute:type EQ 'swatch-select' )">
    <td align="left" valign="top"><select name="Product[&mvt:upsold_product:index;]:Attributes[&mvt:attribute:index;]:value">

    <mvt:foreach iterator="option" array="attribute:options"> <img src="&mvte:option:image;" alt="&mvte:option:prompt;" title="&mvte:option:prompt;" class="swatches" /> </mvt:foreach>

    <!-- trying to separate dropdown -->
    <br>



    <mvt:foreach iterator="option" array="attribute:options">
    <mvt:if expr="( ( g.Product_Attributes[l.settings:attribute:index]:value EQ 0 ) AND ( l.settings:option:id EQ l.settings:attribute:default_id ) ) OR ( g.Product_Attributes[l.settings:attribute:index]:value EQ l.settings:option:code )">
    <option value="&mvte:option:code;" selected>&mvte:option:prompt;</option>
    <mvt:else>
    <option value="&mvte:option:code;">&mvte:option:prompt; Add &mvte:option:price;</option>
    </mvt:if>
    </mvt:foreach>
    </select></td>
    </mvt:if>
    </tr>
    </mvt:if>
    </table>
    </mvt:foreach>
Working...
X