These are chat archives for reactioncommerce/reaction

14th
Dec 2017
00WhengWheng
@00WhengWheng
Dec 14 2017 01:22
If I wanted to go in production, suppose with docker build, I need to set up private/data/Products.json and Tags and no way right?
Brent Hoover
@zenweasel
Dec 14 2017 01:22
Not sure what you mean
00WhengWheng
@00WhengWheng
Dec 14 2017 01:25
When i build with docker, settings like products.json reactionti.json , go away or not?
Brent Hoover
@zenweasel
Dec 14 2017 01:26
Why would that happen if you were building from your local version?
Akarshit Wal
@Akarshit
Dec 14 2017 02:43
To run reaction on iOS simulator do I have to do
meteor add-platform ios
meteor run ios
Akarshit Wal
@Akarshit
Dec 14 2017 02:57
Trying
nurub52
@nurub52
Dec 14 2017 03:50
Docker Custom Image Build is Failing at Meteor Install Step

... Installing Meteor 1.5.2.2

Downloading Meteor distribution
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...
Retrying download in 5 seconds...

If I curl https://install.meteor.com/ I get result bacl
back
Any Ideas why it might be failing?
Brent Hoover
@zenweasel
Dec 14 2017 03:53
what version of RC is that?
nurub52
@nurub52
Dec 14 2017 04:00
1.5.8
Brent Hoover
@zenweasel
Dec 14 2017 04:01
you might to try upgrading to the current version. It’s a newer version of Meteor
nurub52
@nurub52
Dec 14 2017 04:02
Actually I tried newer as well I got same result except saying .. Installing Meteor 1.6.0
Brent Hoover
@zenweasel
Dec 14 2017 04:03
well, if your curl is failing then it might be network problem
oh wait, sorry misunderstood. The curl is working for you
nurub52
@nurub52
Dec 14 2017 04:05
curl is working
when i curl it gives me install script
Brent Hoover
@zenweasel
Dec 14 2017 04:06
Not sure why it would halting there then
nurub52
@nurub52
Dec 14 2017 04:12
is there anything to do with running on Windows
Brent Hoover
@zenweasel
Dec 14 2017 04:13
Can you try a fresh clone and see if you can custom build from there?
Shouldn’t. Your machine is Windows but the container should still be linux
nurub52
@nurub52
Dec 14 2017 04:17
true linux container
hitachi19
@hitachi19
Dec 14 2017 06:58
@prinzdezibel hi, the path(Reaction provides Autovalue helpers in /lib/collections/helpers.js.) seems wrong in docs (https://docs.reactioncommerce.com/reaction-docs/master/simple-schema) ,it should be /lib/collections/shemas/helpers.js .
Michael Jenny
@prinzdezibel
Dec 14 2017 06:59
@hitachi19 thanks! I'm going to take care of it.
hitachi19
@hitachi19
Dec 14 2017 07:00
@prinzdezibel not at all,it's my pleasure
childproof
@childproof
Dec 14 2017 09:13
Ok so I installed a fresh copy of Ubuntu Server 16.04.3. Before I do anything what should I do to set my users permissions correctly for reaction before installing anything?
Brent Hoover
@zenweasel
Dec 14 2017 09:16
well, you don’t need to do anything special for Reaction per se. JUst don’t do anything as root/sudo
If you have to install Node via package manager, follow the instructions for fixing that. https://docs.npmjs.com/getting-started/fixing-npm-permissions
Make sure and read those carefully
childproof
@childproof
Dec 14 2017 09:25
so If I don't do anything as root or sudo I need to grant my main user permissions right, if so how? I am installing node by the terminal. Before I install node do I need to change permissions if I install it by terminal?
Brent Hoover
@zenweasel
Dec 14 2017 09:27
What do you mean when you say “install by terminal”. Are you doing sudo apt-get install?
childproof
@childproof
Dec 14 2017 09:31
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
Brent Hoover
@zenweasel
Dec 14 2017 09:32
Right, that’s istalling via package manager
So you need to follow the instruction on the link I posted above
childproof
@childproof
Dec 14 2017 09:32
ok
Thank you
Brent Hoover
@zenweasel
Dec 14 2017 09:33
No problem. Let me know how it goes.
I’m sitting here making a Windows installation video right now. Linux is next
childproof
@childproof
Dec 14 2017 09:34
Awesome thank you. I am getting a headache trying to figure this out.
Josh Cox
@joshuacox
Dec 14 2017 13:37
@childproof @zenweasel how about this for an install video in linux?
Daniel Honig
@dhonig
Dec 14 2017 14:42
@zenweasel I loved your joke about "We spent it all on Apple laptops"
personally I'm not sure that I will make that purchase again unless I need it for iPhone dev. I love swift but haven't been doing much in iOS as oflate
the razer blades look super nice. I'd be really happy with Manjaro and a blade
( not to be off topic)
Loan Laux
@loanlaux
Dec 14 2017 14:45
@dhonig Apple has forgotten us pro user lately... But I'm excited for the new desktops (iMac Pro and Mac Pro). I love macOS too much to switch to anything else!
Daniel Honig
@dhonig
Dec 14 2017 14:45
Plasma 5 in KDE is really getting close to OSX, not there yet but its really close. Sooner or later Linux is going to take over as the best desktop OS.......maybe not yet
Loan Laux
@loanlaux
Dec 14 2017 14:46
Didn't know about Manjaro — it looks quite good
Daniel Honig
@dhonig
Dec 14 2017 14:47
I've been really happy. I started with raw Arch but that became a part time job over time
Santiago Botta
@sgobotta
Dec 14 2017 14:49
Hello! I've a quick question. What should I implement in a {processor}/refunds/list Meteor method? I got there by submitting a payment to the cart that led the program to an orders/sendNotification Meteor call. I can see it calculates a total amount using the order but I can't imagine what's the specific goal of refund list.
I made a typo, I meant {processor}/refund/list that takes a paymentMethod param and should be implemented in my payment plugin
Santiago Botta
@sgobotta
Dec 14 2017 15:53
Is there a way to remove a core methodhook from a plugin like we can do with Event hooks?
Daniel Honig
@dhonig
Dec 14 2017 15:56
@sgobotta I don't see a remove, like I do in the eventhook api
Its a before and after kind of thing though so in theory you could just override with your own implementation
Santiago Botta
@sgobotta
Dec 14 2017 15:58
Well, I don't think I can stop reaction to trigger their own before after method hooks
from triggering*
Thanks though.
Daniel Honig
@dhonig
Dec 14 2017 16:01
no
but you can redefine them and change what happens within them
Santiago Botta
@sgobotta
Dec 14 2017 16:02
Do you mean I can redefine let's say a MethodHooks.after("cart/submitPayment",...) implementation?
Daniel Honig
@dhonig
Dec 14 2017 16:02
yes it should work
Santiago Botta
@sgobotta
Dec 14 2017 16:03
Just by declaring it with that exact name in my own plugin module?
Daniel Honig
@dhonig
Dec 14 2017 16:03
yes
Santiago Botta
@sgobotta
Dec 14 2017 16:03
Nice, that would do the trick and save me a lot of work
I'll try and let you know how it went
That might be helpful
I don't reccomend it, but if you have no other way, then it might be justified
just it shouldn't be the first thing you reach for
as it gets in the way of upgrades etc
Santiago Botta
@sgobotta
Dec 14 2017 16:04
That's right
What I need is to submit a payment on the cart, but I don't want my current cart deleted. That happens when copyCartToOrder is triggered on the after cart/submitPayment method.
I also need to avoid the pushCartWorkflow call because we added customized steps to the checkout workflow
Daniel Honig
@dhonig
Dec 14 2017 16:10
why do you still want the cart?
since you have the order history in the order collection?
Santiago Botta
@sgobotta
Dec 14 2017 16:22
Because I didnt really finished buying my products
Let's say I only wanted to perform a recharge of credit to some virtual purse, but still I do need to generate an order and notify the user
Daniel Honig
@dhonig
Dec 14 2017 16:23
partial order? Not sure I undertand
Santiago Botta
@sgobotta
Dec 14 2017 16:23
It can be understood as a partial order, yes.
Daniel Honig
@dhonig
Dec 14 2017 16:24
but for that do you want to mix that in with the checkout
or just make it an independent concern
but re-use the payment methods
I think I get what you mean, I'm buying 'tickets, credits, beans' whatever
William Moss
@willmoss1000
Dec 14 2017 16:25
Could anyone help? I'm following the tutorial here https://docs.reactioncommerce.com/reaction-docs/master/extending-product-schema-location-map to add to the schema. I've copied the first two sections into init.js in my plugin and nothing happens. If I add an event hook it runs, but throws an exception that 'Products' isn't recognised
Daniel Honig
@dhonig
Dec 14 2017 16:25
then they get added to my balance and then I can redeem that against an order?
Santiago Botta
@sgobotta
Dec 14 2017 16:25
Yeah
Daniel Honig
@dhonig
Dec 14 2017 16:26
So maybe its easier not to have that in checkout at all
set up a collection to store the users debits or credits
generate the balance with a query
Santiago Botta
@sgobotta
Dec 14 2017 16:26
Its a bit more complicated than that
Daniel Honig
@dhonig
Dec 14 2017 16:27
might be :)
Santiago Botta
@sgobotta
Dec 14 2017 16:29
To be exact. I've a user balance that I handle as a payment method, in the form of virtual dollars using my own collection and methods. Then, in the middle of the checkout (and also the user profile management) the user should be able to reload his/her virtual dollars using a credit card, that's when stripe shows up. But hey, the checkout should finish when I buy the products with my own payment method using this sort of virtual dollars. I need to save an order with stripe just to reload the user virtual balance.
That's pretty much the deal. I could only save the order and notify the user manually in the "reload" section without using cart/submitPayment and finally submit the payment at the end of the checkout
Daniel Honig
@dhonig
Dec 14 2017 16:30
It might be truely worthy of overriding the hooks
Santiago Botta
@sgobotta
Dec 14 2017 16:30
But I can't help trying to reuse existent elements
Daniel Honig
@dhonig
Dec 14 2017 16:30
as your introducing concerns that are very specific to your business
your in the 20% of the 80 twenty rule
I haven't yet seen anyone implement "Store Credit"
Santiago Botta
@sgobotta
Dec 14 2017 16:31
Yeah, I just need to be careful and get them decoupled and clean in case any update comes and I need to change something drastically
Daniel Honig
@dhonig
Dec 14 2017 16:31
but this is pretty common
you could structure your code so all of your core overrides are clear
Santiago Botta
@sgobotta
Dec 14 2017 16:32
Well, me and the team want to get it as generic as possible to hopefully contribute with it when we're done
Daniel Honig
@dhonig
Dec 14 2017 16:32
I wouldn't worry about it
just get it done
Santiago Botta
@sgobotta
Dec 14 2017 16:32
That's why Im tring not to touch any core code
Daniel Honig
@dhonig
Dec 14 2017 16:32
then worry about extracting it
;)
Santiago Botta
@sgobotta
Dec 14 2017 16:32
yupp : )
Daniel Honig
@dhonig
Dec 14 2017 16:33
Cool. Well Im afraid I can't offer much more help. But let me know how it goes
Santiago Botta
@sgobotta
Dec 14 2017 16:33
You helped me today. I'll let you know!
William Moss
@willmoss1000
Dec 14 2017 16:39
getting 'ReferenceError: Products is not defined' when the following is init.js
Santiago Botta
@sgobotta
Dec 14 2017 16:40
because
docs are wrong
William Moss
@willmoss1000
Dec 14 2017 16:40
ah really?
Santiago Botta
@sgobotta
Dec 14 2017 16:40
compare the import { Product } and the one you are calling at the end
yups, some kind of typo i think
William Moss
@willmoss1000
Dec 14 2017 16:40

import { Packages, Shops } from "/lib/collections";
import { Hooks, Reaction, Logger } from "/server/api";
import { check } from "meteor/check";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Product } from "/lib/collections/schemas";
import { registerSchema } from "/imports/plugins/core/collections/lib/registerSchema";

// adding to the schema

function extendProductSchema() {
Logger.info("::: Add location coordinates to simple product schema");
const ExtendedSchema = new SimpleSchema([Product,
{
lat: {
optional: true,
type: Number,
decimal: true
},
lng: {
optional: true,
type: Number,
decimal: true
}
}
]);
Products.attachSchema(ExtendedSchema, { replace: true, selector: { type: "simple" } });
registerSchema("Product", ExtendedSchema);
}

function setProductLocation() {
Logger.info("::: Set location to product 'Basic Reaction product'");
Product.update({ title: "Basic Reaction Product" }, {
$set: {
lat: 34.0059084,
lng: -118.4903684
}
}, {
publish: true,
selector: {
type: "simple"
}
});
}

// Hook to make additional configuration changes
Hooks.Events.add("afterCoreInit", () => {
extendProductSchema();
setProductLocation();

});

sorry, not in markdown!
Santiago Botta
@sgobotta
Dec 14 2017 16:41
import should be Product
and the call Product
William Moss
@willmoss1000
Dec 14 2017 16:41
'''
ah ok
Santiago Botta
@sgobotta
Dec 14 2017 16:43
wait
I can see what's wrong there
.attachSchema is a function that should be used on Collection type objects.
You are only importing a Product object, that is SimpleSchema type

You should get this at the beggining
import { Collections } from "/lib/collections";

and then do:

Collections.Products.attachSchema(....)

Unless Im missing something
William Moss
@willmoss1000
Dec 14 2017 16:45
ok ill give that a run!
William Moss
@willmoss1000
Dec 14 2017 16:51
hmm no 'cannot read property 'Products' of undefined' ... /server/init.js:30:15)

// adding to the schema

function extendProductSchema() {
  Logger.info("::: Add location coordinates to simple product schema");
  const ExtendedSchema = new SimpleSchema([Product,
    {
      lat: {
        optional: true,
        type: Number,
        decimal: true
      },
      lng: {
        optional: true,
        type: Number,
        decimal: true
      }
    }
  ]);
  Collections.Products.attachSchema(ExtendedSchema, { replace: true, selector: { type: "simple" } });
  registerSchema("Product", ExtendedSchema);
}

function setProductLocation() {
  Logger.info("::: Set location to product 'Basic Reaction product'");
  Product.update({ title: "Basic Reaction Product" }, {
    $set: {
      lat: 34.0059084,
      lng: -118.4903684
    }
  }, {
    publish: true,
    selector: {
      type: "simple"
    }
  });
}



//  Hook to make additional configuration changes
Hooks.Events.add("afterCoreInit", () => {
  extendProductSchema();
  setProductLocation();

});
and these imports
import { Packages, Shops } from "/lib/collections";
import { Hooks, Reaction, Logger } from "/server/api";
import { check } from "meteor/check";
import { SimpleSchema } from "meteor/aldeed:simple-schema";
import { Product } from "/lib/collections/schemas";
import { registerSchema } from "/imports/plugins/core/collections/lib/registerSchema";
import { Collections } from "/lib/collections";
Josh Cox
@joshuacox
Dec 14 2017 17:13
@dhonig and @zenweasel ya I just about fell out of my chair laughing about the
"Yep, I heard
but we spent it all on OSX laptops :cry: "
once upon a time I was once an "Apple Certified Portable Technician" and I can tell you some horror stories......
btw my favorite performance laptop is the lenovo 'y' series [which can often be found in the openbox section of bestbuy on the cheap] these things are built sturdy take some abuse and have plenty of beef under the hood, but I'm also a big fan of having a cheap chrome book around with full linux, or at least crouton, on it, so I can throw it in a backpack and go snowboarding for a brisk change in office space, or spill coffee on it and not really get upset. You can even get kvm virtualization running there as well (though beware ARM presents many challenges, go for an x86 for less headaches)
Santiago Botta
@sgobotta
Dec 14 2017 17:35
@willmoss1000 whoops, my bad:
Should be like this:
import * as Collections from "/lib/collections";
Marcelo Rubini
@marcelorubini
Dec 14 2017 19:28
Hey guys! I'm working with the reaction-shippo plugin and found out that only the first product from Cart items is passed to the function that builds the shippoParcel object. There is a reason for that?
REF: imports/plugins/included/shipping-shippo/server/methods/shippo.js LINE: 427:54
Michael Jenny
@prinzdezibel
Dec 14 2017 19:44
@marcelorubini That sounds like a bug. Have had a quick look into it, indeed that looks to me like a WIP. I'm going to file a ticket.
Michael Jenny
@prinzdezibel
Dec 14 2017 20:04
reactioncommerce/reaction#3408
Loz
@lozGemachet_twitter
Dec 14 2017 22:25
Hello all, I just installed my first plugin, the first line in the register.js
import { Reaction } from "/server/api";
(which I copied from the sample-plugin) breaks the full site!
getting error:
Uncaught Error: Cannot find module '../../server/api'
Brent Hoover
@zenweasel
Dec 14 2017 22:30
where do you have the plugin in your project?