These are chat archives for reactioncommerce/reaction

13th
May 2019
Loan Laux
@loan-laux
May 13 05:51
That's amazing @richardkeller411. I recall that @soomro30 is working on something similar (for automotive parts pulled from an API), but skipped using Reaction for now. Maybe both of you could link up.
Alexander Bach
@AlexanderBachSchmidt
May 13 11:16
Hey there! Where do you handle creating new shipping methods? Specifically if I want to have some restrictions on destination
Loan Laux
@loan-laux
May 13 11:18
@AlexanderBachSchmidt You'll have to register a getFulfillmentMethodsWithQuotes function in your register.js under functionsByType, and in this function you'll get the order object passed as an argument. Look up the flat rates plugin for an example of what I'm saying.
reaction/imports/plugins/included/shipping-rates/server/no-meteor/getFulfillmentMethodsWithQuotes.js
Alexander Bach
@AlexanderBachSchmidt
May 13 11:22
@loan-laux Thanks! So I would need to duplicate that file and then register it in the register file?
Loan Laux
@loan-laux
May 13 11:23
Simply creating your own plugin and registering your own getFulfillmentMethodsWithQuotes function. Better to keep things separated.
Alexander Bach
@AlexanderBachSchmidt
May 13 11:23
OK! So it's basically the whole shipping-rates folder I need to duplicate?
Loan Laux
@loan-laux
May 13 11:23
When looking for fulfillment rates, Reaction will call all of the registered getFulfillmentMethodsWithQuotes, regardless of which plugin they're defined in.
I wouldn't necessarily advise duplicating the shipping-rates plugin as it may be a bit too much... Simply get some inspiration from it and work your way to what you're trying to build. Unless you really want to keep all the shipping-rates stuff and add things on top of it, of course. In this case, yeah just move it to imports/plugins/custom and start editing things in there.
Alexander Bach
@AlexanderBachSchmidt
May 13 11:27
Basically what I need is really close to the standard functionality, but with the option to price it after country and/or region (like North America, Europe, Denmark)
Loan Laux
@loan-laux
May 13 11:29
Then just fork the shipping-rates plugin (moving it to the custom directory) and add your features on top of it.
Alexander Bach
@AlexanderBachSchmidt
May 13 11:37
@loan-laux Sorry for the many questions! See this is in the function: const isOrderShippingRestricted = await isShippingRestricted(context, commonOrder); can I use that to check for the country? I guess I also need to add a field in the UI for allowed countries right?
Nuruddin Badawi
@NuruddinBadawi
May 13 11:59
My custom plugin not load, where is the proplem ?
import Reaction from "/imports/plugins/core/core/server/Reaction";

Reaction.registerPackage({
  label: "Daily Menu",
  name: "dailyMenu",
  icon: "fa fa-bell",
  autoEnable: true,
  registry: [{
    provides: ["dashboard"],
    priority: 0,
    container: "daily-menu",
    icon: "fa fa-menu",
    label: "Daily Menu",
    name: "dailyMenu",
    route: "/dashboard/menu",
    template: "DailyMenuTemplate"
  }]
});
Marcin Brukiewicz
@Ancinek
May 13 19:08
What should I run after cloning reaction-platform and performing the make command?
docker ps is stating that an image called reaction_reaction is running, but I can't access it
Marcin Brukiewicz
@Ancinek
May 13 19:37
My localhost:3000 and localhost:4000 are not accessible
JacobAJohnson
@JacobAJohnson
May 13 21:07
I am working on a reaction commerce application, 1.10.0 is our version (quite a bit behind) and we are looking at updating reaction to a newer version. With that in mind we are curious about if its better to jump to 2.0 or if moving to an earlier version like 1.16.0 would be a better move. Our biggest concerns is in the time it would take to get the application updated and how much of our code base we might have to rewrite.