K
K
Kalwin UA2020-09-10 16:23:10
MODX
Kalwin UA, 2020-09-10 16:23:10

How to swipe a table in a form?

Guys, tell me.
How to solve the issue with table and form tag?
I understood the answer that it is impossible to insert tr into the form .
But inserting an entire table with one field is not an option.
How to get out?

<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">
                
            </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>
            
        </tbody>
        <tfoot>
            <tr>
                <th scope="row" colspan="5" class="text-center align-middle">
                    
                </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/[email protected] 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>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question