開発メモ

開発用のメモです。

規格を ラジオボックスで選択

<?php
    function LC_Page_Products_Detail_action_after ( LC_Page_Ex $objPage ) {
        $objProduct = new SC_Product_Ex ( );
        $objQuery = SC_Query_Ex :: getSingletonInstance ( );

        $objPage -> arrProductsClasses = $objProduct -> getProductsClassFullByProductId ( $objPage -> arrProduct [ "product_id" ] );
<!--▼規格▼-->
<!--{if $tpl_classcat_find1}-->
<div class="classlist">
    <table>
        <!--{*
        <tr>
        <th>選択</th>
        <th>規格</th>
        <th>型番</th>
        <th>販売価格</th>
        </tr>
        *}-->
        <!--{foreach key=key item=row from=$arrProductsClasses}-->
        <tr style="border-bottom: dashed 1px #CCC;">
            <td valign="middle" align="center">
                <input type="radio" value="<!--{$row.product_class_id}-->" name="product_class_id"
                onclick="
                $('#sale_price').html($('<span></span>').text('<!--{$row.price02|number_format}-->' + '円(税抜)'));
                $('#normal_price').html($('<span></span>').text('<!--{$row.price01|number_format}-->' + '円(税抜)'));
                $('#point').html($('<span></span>').text('<!--{$row.price02|sfPrePoint:$arrProduct.point_rate|number_format}-->' + ' Point'));
                $('#classcategory_id1').val('<!--{$row.classcategory_id1|h}-->');
                $('#classcategory_id2').val('<!--{$row.classcategory_id2|h}-->');
                ">
            </td>
            <td valign="middle" align="center">
                <!--{$row.class_name1}-->
                <!--{":"}-->
                <!--{$row.classcategory_name1}-->
                <!--{if $row.classcategory_name2}-->
                <br />
                <!--{$row.class_name2}-->
                <!--{":"}-->
                <!--{$row.classcategory_name2}-->
                <!--{/if}-->
            </td>
            <td valign="middle" align="center" nowrap="nowrap" style="display: none;">
                <!--{$row.product_code}-->
            </td>
            <td valign="middle" align="center">
                <span>
                    <!--{$row.price02|number_format}-->
                    <span></span></span>
            </td>
        </tr>
        <!--{/foreach}-->
    </table>
</div>
<!--{else}-->
<input type="hidden" name="product_class_id"    value="<!--{$tpl_product_class_id}-->" id="product_class_id" />
<!--{/if}-->
<input type="hidden" name="classcategory_id1" id="classcategory_id1" value="0" />
<input type="hidden" name="classcategory_id2" id="classcategory_id2" value="0" />
<!--▲規格▲-->
Twitter: @asahina_alice