Mari-art
@Mari-art
noob

Как смахинировать таблицу в form?

Ребят, подскажите.
Как решить вопрос с таблицой и тегом форм?
Ответ о том что в form вставлять tr нельзя я понял.
Но вот вставлять целую таблицу с одним полем не вариант.
Как выкрутится?
<div>
    <div class="card container mt-3">
        <div class="card-footer row">
            <div class="col-md-3">1</div>
            <div class="col-md-6">2</div>
            <div class="col-md-3">
                [[!msMiniCart]]
            </div>
        </div>
    </div>
</div>

<div class="table-responsive mt-3">
    <table class="table table-bordered border-dark container">
        <thead>
            <tr>
                <th scope="col">Изображение</th>
                <th scope="col" colspan="4">Наиминование</th>
            </tr>
        </thead>
        <tbody>
            [[!pdoPage?
                &parents=`[[~id]]`
                &element=`msProducts`
                &tpl=`tpl.ptsProducts`
                &tplPage=`@INLINE <li><a href="[[+href]]">[[+pageNo]]</a></li>`
                &tplPageWrapper=`@INLINE <div class="pagination"><ul class="pagination">[[+first]][[+prev]][[+pages]][[+next]][[+last]]</ul></div>`
                &tplPageActive=`@INLINE <li class="active"><a href="[[+href]]">[[+pageNo]]</a></li>`
                &tplPageFirst=`@INLINE <li class="control"><a href="[[+href]]">[[%pdopage_first]]</a></li>`
                &tplPageLast=`@INLINE <li class="control"><a href="[[+href]]">[[%pdopage_last]]</a></li>`
                &tplPagePrev=`@INLINE <li class="control"><a href="[[+href]]">&laquo;</a></li>`
                &tplPageNext=`@INLINE <li class="control"><a href="[[+href]]">&raquo;</a></li>`
                &tplPageSkip=`@INLINE <li class="disabled"><span>...</span></li>`
                &tplPageFirstEmpty=`@INLINE <li class="control"><span>[[%pdopage_first]]</span></li>`
                &tplPageLastEmpty=`@INLINE <li class="control"><span>[[%pdopage_last]]</span></li>`
                &tplPagePrevEmpty=`@INLINE <li class="disabled"><span>&laquo;</span></li>`
                &tplPageNextEmpty=`@INLINE <li class="disabled"><span>&raquo;</span></li>`
                ajaxTplMore=`@INLINE <button class="btn btn-default btn-more">[[%pdopage_more]]</button>`
            ]]
        </tbody>
        <tfoot>
            <tr>
                <th scope="row" colspan="5" class="text-center align-middle">
                    [[!+page.nav]]
                </th>
            </tr>
        </tfoot>
    </table>
</div>

tpl.ptsProducts
<tr class="ms2_product align-middle">
    <form method="post" class="ms2_form no-gutters">
        <input type="hidden" name="id" value="{$id}">
        <input type="hidden" name="count" value="1">
        <input type="hidden" name="options" value="[]">
        <th class="text-center">
            <a tabindex="0" class="btn btn-sm btn-outline-light text-body border" data-html="true" data-toggle="popover" data-placement="bottom" data-trigger="focus" title="" data-content='<a href="{$id | url}">
                {if $thumb?}
                    <img src="{$thumb}" class="mw-100" alt="{$pagetitle}" title="{$pagetitle}"/>
                {else}
                    <img src="{'assets_url' | option}components/minishop2/img/web/ms2_small.png"
                         srcset="{'assets_url' | option}components/minishop2/img/web/ms2_small@2x.png 2x"
                         class="mw-100" alt="{$pagetitle}" title="{$pagetitle}"/>
                {/if}
            </a>'>Просмотр <i class="far fa-image"></i></a>
        </th>
        <td>
            <a href="{$id | url}" class="font-weight-bold">{$pagetitle}</a>
        </td>
        <!--{if $introtext}
            <td>
                <small>{$introtext | truncate : 200}</small>
            </td>
        {/if}-->
        <td class="text-center">
            {if $new?}
                <span class="badge rounded-pill bg-primary">{'ms2_frontend_new' | lexicon}</span>
            {/if}
            {if $popular?}
                <span class="badge rounded-pill bg-danger">{'ms2_frontend_popular' | lexicon}</span>
            {/if}
            {if $favorite?}
                <span class="badge rounded-pill bg-warning text-dark">{'ms2_frontend_favorite' | lexicon}</span>
            {/if}
        </td>
        <td class="text-center table-success">
            <b class="price">{$price} {'ms2_frontend_currency' | lexicon}</b>
            {if $old_price?}
                <s class="old_price text-danger">{$old_price} {'ms2_frontend_currency' | lexicon}</s>
            {/if}
        </td>
        <td class="text-center">
            <button class="btn btn-outline-success btn-sm btn-block" type="submit" name="ms2_action" value="cart/add">
                {'ms2_frontend_add_to_cart' | lexicon}
            </button>
        </td>
    </form>
</tr>
  • Вопрос задан
  • 43 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы