0

SimpleCart サイトのカート ページに表示されるように、製品に関連付けたテレビ (重量、寸法など) が必要です。

問題は、これを行う方法がわからないことです。SimpleCart カートがどのように構築されているのか理解できず、これに関するドキュメントもありません。

カート出力チャンク内の各製品に関連付けられたテレビを表示する方法を知っている人はいますか?

カートのスニペットには、カートからデータを取得してチャンクに入れる次のコードがあります。

$sc = $modx->getService('simplecart','SimpleCart',$modx->getOption('simplecart.core_path',null,$modx->getOption('core_path').'components/simplecart/').'model/simplecart/',$scriptProperties);
if (!($sc instanceof SimpleCart)) return '';
 
$controller = $sc->loadController('Cart');
$output = $controller->run($scriptProperties);

出力チャンクは次のようになります。

<div id="simplecart">

    <form action="[[~[[*id]]]]" method="post" id="form_cartoverview">
        <input type="hidden" name="updatecart" value="true" />

        <table>
          <tr>
            <th class="desc">[[%simplecart.cart.description]]</th>
            <th class="price">[[%simplecart.cart.price]]</th>
            <th class="quantity">[[%simplecart.cart.quantity]]</th>
            [[+cart.total.vat_total:notempty=`<th class="quantity">[[%simplecart.cart.vat]]</th>`:isempty=``]]
            <th class="subtotal">[[%simplecart.cart.subtotal]]</th>
            <th> </th>
          </tr>

            [[+cart.wrapper]]

          [[+cart.total.discount:notempty=`<tr class="total first discount">
            <td colspan="[[+cart.total.vat_total:notempty=`3`:isempty=`2`]]"> </td>
            <td class="label">[[%simplecart.cart.discount]]</td>
            <td class="value">- [[+cart.total.discount_formatted]]</td>
            <td class="extra">[[+cart.total.discount_percent:notempty=`([[+cart.total.discount_percent]]%)`:isempty=` `]]</td>
          </tr>`:isempty=``]]

        [[+cart.total.vat_total:notempty=`
          <tr class="total [[+cart.total.discount:notempty=`second`:isempty=`first`]]">
            <td colspan="3"> </td>
            <td class="label">[[%simplecart.cart.total_ex_vat]]</td>
            <td class="value">[[+cart.total.price_ex_vat_formatted]]</td>
            <td class="extra"> </td>
          </tr>
          [[+cart.vat_rates]]
          <tr class="total [[+cart.total.discount:notempty=`third`:isempty=`second`]]">
            <td colspan="3"> </td>
            <td class="label">[[%simplecart.cart.total_vat]]</td>
            <td class="value">[[+cart.total.vat_total_formatted]]</td>
            <td class="extra"> </td>
          </tr>
          <tr class="total [[+cart.total.discount:notempty=`fourth`:isempty=`third`]]">
            <td colspan="3"> </td>
            <td class="label">[[%simplecart.cart.total_in_vat]]</td>
            <td class="value">[[+cart.total.price_formatted]]</td>
            <td class="extra"> </td>
          </tr>
        `:isempty=`
          <tr class="total [[+cart.total.discount:notempty=`second`:isempty=`first`]]">
            <td colspan="2"> </td>
            <td class="label">[[%simplecart.cart.total]]</td>
            <td class="value">[[+cart.total.price_formatted]]</td>
            <td class="extra"> </td>
          </tr>
        `]]
        </table>

        <div class="submit">
            <input type="submit" value="[[%simplecart.cart.update]]" />
        </div>
    </form>
4

2 に答える 2

0

(試行錯誤により) 使用する必要があることがわかりました。

[[+product.tv.name_of_tv]]
于 2015-07-16T07:57:11.217 に答える