Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 07 19:09

    kilbot on master

    Updating translations for langu… (compare)

  • Dec 07 19:08

    kilbot on master

    Updating translations for langu… (compare)

  • Dec 07 19:04

    kilbot on master

    Updating translations for langu… (compare)

  • Dec 04 11:17
    kilbot synchronize #161
  • Dec 04 11:17

    kilbot on master

    customer api (compare)

  • Nov 10 16:28
    danilodorgam opened #224
  • Oct 30 07:06
    dependabot[bot] labeled #223
  • Oct 30 07:06
    dependabot[bot] opened #223
  • Oct 30 07:06

    dependabot[bot] on npm_and_yarn

    Bump lodash from 4.17.11 to 4.1… (compare)

  • Oct 18 07:05
    HDB8129 commented #42
  • Oct 07 04:35
    GhostRecon03 opened #222
  • Oct 06 09:35
    KevWal opened #221
  • Sep 21 13:29
    wake2ouk opened #220
  • Sep 11 16:32
    kilbot commented #218
  • Aug 29 16:57
    thomasmery unassigned #18
  • Aug 29 16:57
    thomasmery removed as member
  • Aug 29 16:56
    thomasmery removed as member
  • Aug 29 16:48
    itsDawn opened #219
  • Aug 28 09:06
    atxcowboy edited #218
  • Aug 28 09:05
    atxcowboy opened #218
Paul Kilmurray
@kilbot
so you should be able to command line to .html/wp-content/themes/twentysixteen/
Thomas Mery
@thomasmery
I'm there
getting back the changes from yesterday
Paul Kilmurray
@kilbot
then git clone https://github.com/thomasmery/wcpos-tutorial.git
Thomas Mery
@thomasmery
done
Paul Kilmurray
@kilbot
then update the functions file to correct the path
include ‘wcpos-tutorial/reports.php'
Thomas Mery
@thomasmery
ready
had to change the js enqueue url but that's done
Paul Kilmurray
@kilbot
ah .. I see .. I’m just cloning as well so I can code with you .. I’m making this up as I go along so hopefully everything goes smoothly :)
What we’ll do is get all the orders and display an sum of all order totals
this will let me cover a couple of important things
Thomas Mery
@thomasmery
great
Paul Kilmurray
@kilbot
sorry, now my docker is down :/
one sec
Thomas Mery
@thomasmery
no pb
Paul Kilmurray
@kilbot
ok, we’re back .. I stupid updated docker
mid-demo
ok .. so the data controllers are all in the entities folder
these are just Backbone Collections and Models
this will be different to most tutorials I imagine
but it makes sense to me, especially because data is used in different subapps
so it makes sense to keep it separate
there is an Entities Service
Thomas Mery
@thomasmery
they are shared
Paul Kilmurray
@kilbot
yep
Thomas Mery
@thomasmery
the service abstracts interacting with the different entities?
Paul Kilmurray
@kilbot
yeah, it just provides a standard API for entities
Thomas Mery
@thomasmery
ok
Paul Kilmurray
@kilbot
it does this through Backbone.Radio
this is a simple pubsub messaging library
Thomas Mery
@thomasmery
clear for me
Paul Kilmurray
@kilbot
Most of the sevices work like this … the service starts and has a Radio ‘channel'
then you ask the service for what you want
in our case, we will ask for an Orders collection
var orders = Radio.request(‘entities’, ‘orders’);
sorry that should be bb.Radio
so lets add that above the ReportsView
Thomas Mery
@thomasmery
so I shall create an initializefunction in my Route so something like this
like you do for the pos/products Route
Paul Kilmurray
@kilbot
actually, you’re right!
if it’s above the ReportsView it will return undefined because the app hasn’t started yet
in the Route.initialize is the correct spot for this
so everytime the reports route is triggered, it will get an instance of the orders collection
Thomas Mery
@thomasmery
blob
pushed what I did to the repo
Paul Kilmurray
@kilbot
cool, you managed to pick my bug .. the missing ‘get'
awesome, very impressed
so we’ll pass that into the Reports View as an option