Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 02 12:29
    ikbel opened #253
  • Jan 27 09:16
    Vellimack commented #25
  • Dec 17 2021 10:36
    protechcode opened #252
  • Nov 04 2021 13:05
    kilbot synchronize #214
  • Nov 04 2021 13:05

    kilbot on 0.4

    0.4.26 remove old docker, use wp-env i… (compare)

  • Oct 17 2021 14:38
    kilbot closed #251
  • Oct 17 2021 14:38
    kilbot commented #251
  • Sep 29 2021 00:47
    zidingz opened #251
  • Sep 24 2021 07:53
    m-zat commented #244
  • Sep 24 2021 07:38
    rleegwater commented #244
  • Sep 15 2021 06:07
    m-zat commented #244
  • Sep 09 2021 10:19
    m-zat commented #244
  • Sep 09 2021 08:51
    m-zat commented #244
  • Aug 07 2021 08:53
    kilbot commented #250
  • Aug 07 2021 07:01
    m-zat opened #250
  • Aug 04 2021 08:26
    kilbot synchronize #161
  • Aug 04 2021 08:26

    kilbot on master

    Update README.md (compare)

  • Aug 04 2021 08:21
    kilbot synchronize #161
  • Aug 04 2021 08:21

    kilbot on master

    Create archive-notice.svg (compare)

  • Jul 11 2021 09:50
    ajgw opened #249
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
Thomas Mery
@thomasmery
mmm not so :) I actually copied from pos/products/route.js
but thanks ;)
ok on to the View
Paul Kilmurray
@kilbot
ie:
{
  collection: this.collection
}
Thomas Mery
@thomasmery
ok, I guess I have to render after fetch has finished