Sha256: 2a8a9dc56177dcc362628d425b868f07359afe84281d3b2390ba3f991cd9b07e

Contents?: true

Size: 770 Bytes

Versions: 1

Compression:

Stored size: 770 Bytes

Contents

class Skr.Api.Components.SingleItemCart extends Skr.Api.Components.Base

    dataObjects:
        cart: 'props'

    item: -> @cart.skus.first()

    setQty: (ev) ->
        @item().qty = ev.target.value

    render: ->
        item = @item()
        return null unless item

        <table className="cart">
          <tbody>
            <tr>
              <td colSpan="4">{item.sku.description}</td>
              <td>{item.sku.display_price}</td>
            </tr>
            <tr>
              <th>Qty:</th>
              <td>
                  <input type="number" value={item.qty} onChange={@setQty} />
              </td>
              <th>Total:</th>
              <th colSpan="2">{item.display_total}</th>
            </tr>
          </tbody>
        </table>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-0.4.0 client/skr/api/Components/SingleItemCart.cjsx