Session array

The following is a very simple setup to enter items into a session. Clicking ‘add to cart’ is supposed to add the item rather than replace the item.
image

This is my code:

<section>
  <div class="container">
    <div class="row">
      <div class="col">
        <div class="table-responsive">
          <table class="table table-striped table-sm">
            <thead>
              <tr>
                <th>Product name</th>
              </tr>
            </thead>
            <tbody is="dmx-repeat" dmx-generator="bs4table" dmx-bind:repeat="scProducts.data.qryProduct" id="tableRepeat1">
              <tr>
                <td dmx-text="ProductName"></td>
                <td dmx-on:click="sessioncart.set('product',ProductName,{})">add to cart</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="col mt-5">
        <div id="repeatCart" is="dmx-repeat" dmx-bind:repeat="sessioncart.data">
          {{$value}}
        </div>
      </div>
    </div>
  </div>
</section>

Any help is greatly appreciated.

Community Page
Last updated: