These are chat archives for reactioncommerce/reaction

20th
Feb 2018
Brent Hoover
@zenweasel
Feb 20 2018 08:12
@willmoss1000 There are currently no plans to add more shipping plugins. You could however take the current flat-rates plugin, clone-it, and create a plugin that acts the way you like.
I think @prinzdezibel’s suggestion makes a lot of sense and you could just add some test in your FAQ/About saying which countries you ship to. I feel like I created a ticket for allowing this to be configurable from the dashboard at some point but I am not finding it now
@00WhengWheng My suggestion is to create a repo with your exact code that you want to deploy. e.g. a repo not tied to the reaction repo and with your plugins, etc in it. You will also need to remove the custom plugins from the .gitignore.
Loan Laux
@loanlaux
Feb 20 2018 10:15
Hi guys! I'm trying to customize the SearchResults subscription to accommodate searching among custom fields on products. Not sure what the best way to do this would be. Should I first try to include my custom fields into the ProductSearch record? Then, should I completely override the SearchResults subscription to include my custom field as a search criteria? There are a lot of things to consider so I would gladly appreciate your input.
Of course, I'm looking for the most "Reaction-compliant" solution here, and replacing completely the SearchResults subscription doesn't seem like a smart thing to do. So how would you go about doing this?
Brent Hoover
@zenweasel
Feb 20 2018 10:20
When I wrote the backend on the search I tried to make it as much a “pluggable” backend as possible. Meaning that you could drop in your own search backend w/o having to change much on the front-end. And Erik did the same with the frontend
So I would clone search-mongo and create your own version and disable search-mongo
Loan Laux
@loanlaux
Feb 20 2018 10:22
Awesome. Is there a way to programmatically disable a core plugin or is it acceptable to just delete its directory?
Brent Hoover
@zenweasel
Feb 20 2018 10:22
So if you want to just get more results back you can just modify search-mongo
my suggestion is to just rename it with a period at the beginning and Reaction/Meteor will ignore it. That way if you want to merge in updates you can just temporarily rename it back so you don’t need to deal with merge conflicts
Amalan Jenicious
@amalan-shenll
Feb 20 2018 10:25
hi everyone
can i get a good example repo or link for react meteor mongodb client server connection to get mongo collection data
Thank you
Brent Hoover
@zenweasel
Feb 20 2018 10:26
Sorry, I don’t understand that question
Loan Laux
@loanlaux
Feb 20 2018 10:27
Alright, thanks @zenweasel! Is there anything on the roadmap to allow disabling/overriding core plugins from a custom one (i.e. without having to edit their directory's name)? Can I file an issue for such a feature to be integrated?
Brent Hoover
@zenweasel
Feb 20 2018 10:27
There is already an issue for it, I don’t exactly where it is on the roadmap as we work to transition packages/plugins to NPM packages
Loan Laux
@loanlaux
Feb 20 2018 10:28
I'm thinking maybe an overrides property in register.js. For example in this case, overrides: "search-mongo" would disable search-mongo and let my custom plugin do its job
Perfect, I'll look for it then :)
Danny Waite
@danny-waite
Feb 20 2018 11:02

Guys, I posted this over at GitHub, was passed over here: currently building a proof of concept on Reaction, so far so good, enjoying your approach.

I'm trying to restrict the products that display on the home page to products that include the Featured tag, I'm guessing this is a logical way of doing it, seems this would a common requirement however its not immediately apparent how best to do this. I've read Part 2 of "Building a Swag Shop" which covers something similar though I want to avoid modifying the schema if at all possible.

Brent Hoover
@zenweasel
Feb 20 2018 11:03
@prinzdezibel should be able to help you
Danny Waite
@danny-waite
Feb 20 2018 11:04
great :)
Michael Jenny
@prinzdezibel
Feb 20 2018 11:08
@danny-waite Hi Danny, the thing is you probably need to filter out the products you're interested in (the featured products) and display them to the visitor
to have this filter working, I've introduced a new field "featuredProduct" in swag shop that allows me to query only those products
so this would naturally mean you'd have to modify the schema
If you're keen on not doing that , you may try to tag the products you're interested in.
this is an out-of-the-box functionality
you can then filter for these tags
Danny Waite
@danny-waite
Feb 20 2018 11:12
thanks Michael, yeah I think the tag route seems the best for me, the question is where best to implement this? inside productsContainer.js?
William Moss
@willmoss1000
Feb 20 2018 11:12
@prinzdezibel @zenweasel great thanks! Yeh, the additional difficulty is that it's a marketplace and each user needs to be able to set their own rates, by country/group of countries. Ok, thanks for letting me know there's nothing in the pipeline. I'll clone flat-rates and get on with it. Cheers!
Danny Waite
@danny-waite
Feb 20 2018 11:13
@prinzdezibel wasn't obvious when looking at the code where to do this or indeed if I was just modifying the home page
Michael Jenny
@prinzdezibel
Feb 20 2018 11:15
@danny-waite yes, that would be the place where you'd set up the filters you're interested in for the subscription. Perhaps you may want to have a look I've done it for swag shop: https://github.com/reactioncommerce/reaction-swag-shop/blob/b93df34ce9a14ff2c9a4e737a73854f4b65897f7/client/containers/product-variant/productsContainer.js#L144
you somehow need to pass the tags you like to filter for into the subscription.
Danny Waite
@danny-waite
Feb 20 2018 11:20
@prinzdezibel ok great, so I'm thinking that if I pass my featured tag into this structure const queryParams = Object.assign({}, tags, Reaction.Router.current().queryParams, shopIds);we should be good to go?
Michael Jenny
@prinzdezibel
Feb 20 2018 11:23
:crossed_flags:
that would be the idea, yes
Danny Waite
@danny-waite
Feb 20 2018 11:24
got it, great help, much appreciated!
Michael Jenny
@prinzdezibel
Feb 20 2018 11:24
:thumbsup: you're welcome
Vineeth
@Vineeth73009077_twitter
Feb 20 2018 11:58
anyone know how to change ICO file and to have HTTPS to domain url
is there any document for the same
Amalan Jenicious
@amalan-shenll
Feb 20 2018 12:36

@zenweasel
i am creating reaction plugin
i have created custom schema and a react component
i want the react component to display data from schema
i used
export default withTracker(()=>{
return {
foods: Foods.find({}).fetch()
};
})(DisplayFood);

but i am getting empty this.props
i followed this meteor/simple-todos-react@e618d9e

Loan Laux
@loanlaux
Feb 20 2018 13:14
@zenweasel — I followed your advice, renamed the search-mongo directory to .search-mongo and created my own in /imports/plugins/custom (which is a simple duplicate for now). The problem is that search-mongo is imported directly from /imports/plugins/included/search-mongo/ in two /imports/plugins/core/versions/server/migrations/ files. What should I do about this?
Of course, this causes Reaction to hang at startup with Error: Cannot find module '/imports/plugins/included/search-mongo/server/methods/searchcollections'
Loan Laux
@loanlaux
Feb 20 2018 13:21
Should I modify the import statements in those two files to point towards my custom search-mongo? It doesn't seem like a good idea but I'm not sure if there's another solution
Brent Hoover
@zenweasel
Feb 20 2018 13:27
You can just remove those migration files. They probably should have been written smarter to test for the module before importing
Loan Laux
@loanlaux
Feb 20 2018 13:28
Awesome. Should I create an issue for this?
Brent Hoover
@zenweasel
Feb 20 2018 13:29
Sure
Loan Laux
@loanlaux
Feb 20 2018 13:29
Will do :+1:
William Moss
@willmoss1000
Feb 20 2018 13:30
@zenweasel @prinzdezibel what happens currently if the user orders items from multiple shops in a single go? Looks like it will throw a fatal error - is there any issue anywhere / pull request anywhere to add this functionality? I couldn't find any, just a quick check.
Michael Jenny
@prinzdezibel
Feb 20 2018 13:30
That should actually be possible. If not, it could be a bug
Brent Hoover
@zenweasel
Feb 20 2018 13:31
That works fine. I test it all the time
Ok
// TODO this needs to be rewritten to handle getting rates from each shops that's represented on the order
line 78
Brent Hoover
@zenweasel
Feb 20 2018 13:32
Right?
We don't handle separate shipping configuration per shop
William Moss
@willmoss1000
Feb 20 2018 13:33
Ok, so each shop can't have it's own shipping rates currently?
Brent Hoover
@zenweasel
Feb 20 2018 13:33
That's correct
William Moss
@willmoss1000
Feb 20 2018 13:33
aha
Brent Hoover
@zenweasel
Feb 20 2018 13:34
Off to bed y'all. Carry on
William Moss
@willmoss1000
Feb 20 2018 13:34
Thanks for your help
Just quickly, so if I order from two shops. 2 items from one, and 1 from the other. How will my payment for shipping be divided?
Brent Hoover
@zenweasel
Feb 20 2018 13:49
Each will be charged that amount
William Moss
@willmoss1000
Feb 20 2018 14:02
Thanks! @zenweasel I'll need to change that then.
Cheers
William Moss
@willmoss1000
Feb 20 2018 14:20
I think @zenweasel has gone. But @prinzdezibel flat-rate is charged per order. You then charge the shop sellers for shipping? What if they do fulfillment themselves? Should the rate not be doubled as they have ordered from two different stores?
Have I misunderstood? - and are there any docs/anything I can read on how this currently works
Michael Jenny
@prinzdezibel
Feb 20 2018 14:23
From my understanding, yes. Because there're two independent fulfillments for the order. But I'm not sure if that only applies to Shippo or to flat rate as well. Have you seen https://www.youtube.com/watch?v=Y-p7ZrIBZCQ&t=99s? It would be interesting how the shipping is done there.
William Moss
@willmoss1000
Feb 20 2018 14:27
Ok great. Cheers, no I haven't - I'll have a look
William Moss
@willmoss1000
Feb 20 2018 16:19
@prinzdezibel thanks a lot - that's really helpful. One issue trying to set my redirect URI to: localhost:3000/stripe/connect/authorize
without a redirect URI it won't let me setup payment as a new shop owner
and it assumes this is already setup in the video
Caleb B
@zikeji
Feb 20 2018 16:20
I'm trying to add a new script in my plugin I'm writing. What's the best practice for doing so? I basically just need to do a <script> that points to an external resource at the bottom of the HTML
Caleb B
@zikeji
Feb 20 2018 16:37
I got it, just going to replicate the analytics plugin
mavais
@mavais
Feb 20 2018 19:15
@danny-waite @prinzdezibel I have written a custom Home Page template and i am displaying the latest collections and fast selling products there. I have written the template helper where I'm directly fetching the products collection. Should it be a problem? I wish i can use the swag shop but that's still WIP.