These are chat archives for reactioncommerce/reaction

26th
Apr 2017
Loan Laux
@loanlaux
Apr 26 2017 13:59
Hi guys!
Have any one of you successfully overrode Reaction's product detail components? Would like to make a few tweaks without editing the original files, if that's possible
Janus Reith
@janus-reith
Apr 26 2017 14:03
@loanlaux yes, if I understand you correctly.
I made a copy of product-detail-simple
Loan Laux
@loanlaux
Apr 26 2017 14:03
Hi @janus-reith, thanks for answering :)
Janus Reith
@janus-reith
Apr 26 2017 14:03
And took out the one part in register.js, so it just registers one template
Which can then be selected in the product settings on the right
The Main layout is in [plugindir]/lib/simple.js
(Or twocolumn.js if you take the other template as a base)
Then you have to edit the Imports in the client/index.js to point to the components of the included Plugin.
Or, if you want to keep a customizable copy of all components in your Plugin dir
Rename them instead
Janus Reith
@janus-reith
Apr 26 2017 14:09
To avoid that they overwrite the other components, even if you selected one of the other template
Hope you can follow
Loan Laux
@loanlaux
Apr 26 2017 14:09
Screen Shot 2017-04-26 at 16.08.54.png
I actually made a copy of product-detail-simple as well, and it works perfectly so that's not an issue.
What I'm trying to do at the moment is to make a copy of the ProductMetadata React component with the <h3> removed, and then reference it inside my [plugindir]/lib/simple.js instead of the original ProductMetadata. I made a copy of productMetadata.js, made my tweaks, registered the component using Reaction's registerComponent(), and now I'm getting this error
Janus Reith
@janus-reith
Apr 26 2017 14:12
why not just remove it from /lib/layout/whateverlayout.js ?
ah sorry,
i get it now
Loan Laux
@loanlaux
Apr 26 2017 14:14
Haha, no problem
Have you ever tried to do that?
Janus Reith
@janus-reith
Apr 26 2017 14:15
well I did something similar
with the MediaGallery Container
that worked
lets do this step by step
Loan Laux
@loanlaux
Apr 26 2017 14:16
Perfect, I appreciate your patience
Janus Reith
@janus-reith
Apr 26 2017 14:16
the class is defined in /client/component/metadata.js
*s
it is then exported in /client/components/index.js
And imported from /client/components in /client/index.js
where it is registered as Component with the same name
so it cann be used in the /lib/layout/whatever.js layout
Loan Laux
@loanlaux
Apr 26 2017 14:19
Okay, let me check that everything is okay on this side
Janus Reith
@janus-reith
Apr 26 2017 14:19
did you take all of these steps into acount?
Loan Laux
@loanlaux
Apr 26 2017 14:30
Ughhh

Didn't noticed I wrote this:

registerComponent({ name: "MyCustomComponent", component: "MyCustomComponent"

instead of

registerComponent({ name: "MyCustomComponent", component: MyCustomComponent

Also, I had missed a step in this whole import/export process
Stupid mistakes... But I'm glad it's solved. Thank you very much, @janus-reith! 🍻
Janus Reith
@janus-reith
Apr 26 2017 14:39
great to hear!
septk
@septk
Apr 26 2017 19:51
hi! when i setup reaction on digitalocean + mongolab, reaction cant load predetermined Flat rates (is empty), and when I'm trying to create one new, I have this error notification "Flat rate update failed. Error: No Provider ID provided when adding methods [bad-provider-id]" How can I resolve this?
Captura-de-pantalla-2017-04-25-a-las-15.55.04.png
Captura-de-pantalla-2017-04-25-a-las-15.55.04.png
Brent Hoover
@zenweasel
Apr 26 2017 21:25
@septk I’ve been trying to track that issue down because I can’t replicate it locally. Can you tell me what’s in the Shipping collection?
terrelltechsup
@terrelltechsup
Apr 26 2017 21:30
I have the same issue as septk on Heroku and mongolab
Alexander Ditzend
@aditzend
Apr 26 2017 21:41
Hi @terrelltechsup @septk @zenweasel I have had the same issue for a couple of days and I solved it. I don't know if this solution is going to work for you, but I realized I was making a very stupid mistake when setting up the db. All collections were running inside the admin database which is used mainly for authentication purposes. That was causing _id mismatches with the shipping collection (its an assumption). The solution was making the correction in the MONGO_URL and replacing "admin" with "reactioncommerce" like this : WRONG > "MONGO_URL": "mongodb://<<user>>:<<pass>>@cluster0-shard-00-00-xxxx.mongodb.net:27017,cluster0-shard-00-01-xxxx.mongodb.net:27017,cluster0-shard-00-02-xxxx.mongodb.net:27017/admin?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin",
WORKING > "MONGO_URL": "mongodb://<<user>>:<<pass>>@cluster0-shard-00-00-xxxx.mongodb.net:27017,cluster0-shard-00-01-xxxx.mongodb.net:27017,cluster0-shard-00-02-xxxx.mongodb.net:27017/reactioncommerce?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin",
hope that helps
Brent Hoover
@zenweasel
Apr 26 2017 22:22
@aditzend Thanks for the feedback. That may very well be the issue since it’s not happening except in deployments. Though weird that it would only be the Shipping collection that would be affected
Alexander Ditzend
@aditzend
Apr 26 2017 22:24
@zenweasel that's what I thought. Why the heck was everything else working fine? I really hope this solves the other guys issues.