These are chat archives for reactioncommerce/reaction

2nd
May 2017
Loan Laux
@loanlaux
May 02 2017 10:49
Hi guys! Did any one of you succeed in adding a field to Product Variants?
I'd like Variants to have their own separate description (which should be displayed on the product detail page and should be editable in admin mode as well). What's the best way to achieve that?
Loan Laux
@loanlaux
May 02 2017 10:57
(actually I'd like to add many more fields but I'll start with a description)
I read the docs about schemas and followed to instructions about adding fields to an existing one https://docs.reactioncommerce.com/reaction-docs/master/plugin-schemas-8
However, I can't see anything new when exploring the db's content (after a reaction reset and adding my new field to product fixtures)
Maybe I'm missing something?
Brent Hoover
@zenweasel
May 02 2017 11:00
Yeah, that should work. I don’t even think the fixtures are run against the schema
Loan Laux
@loanlaux
May 02 2017 11:01
Next step would be to customize the Variant React component but first I'd like to have my new field successfully saved into MongoDB
Thanks for replying @zenweasel :)
So you think I don't even need to add a field to the schema?
Brent Hoover
@zenweasel
May 02 2017 11:02
You will want to, but for the import on first load, that data is not validated against the schema. And even if it was, it wouldn’t just drop the data, it would throw an error
Loan Laux
@loanlaux
May 02 2017 11:02
Okay I see
So it's not normal that my field isn't even imported on first load?
Brent Hoover
@zenweasel
May 02 2017 11:02
yeah, that should work afaik
let me try it here real quick
Loan Laux
@loanlaux
May 02 2017 11:04
Oh wow sorry for the trouble, it does work actually
Brent Hoover
@zenweasel
May 02 2017 11:04
:+1:
Loan Laux
@loanlaux
May 02 2017 11:04
Just tried a new reaction reset as we were speaking and now it's okay
Don't know why it didn't work on the first try
Anyway
Brent Hoover
@zenweasel
May 02 2017 11:05
sometimes it’s easy to forget to refresh robomongo
Loan Laux
@loanlaux
May 02 2017 11:05
I think that's what I was missing
So what would be the next steps in order to make this in the cleanest way possible?
Brent Hoover
@zenweasel
May 02 2017 11:06
well, I think you are on the right path. You would want to create a custom version of the PDP that has your extra fields
and you would want to extend the schema, and import your extended schema
Loan Laux
@loanlaux
May 02 2017 11:06
Cool
Brent Hoover
@zenweasel
May 02 2017 11:06
you may run into some issues because some of the methods may not use your schema
Loan Laux
@loanlaux
May 02 2017 11:07
So how do I check that the final schema does contain my imported field?
Brent Hoover
@zenweasel
May 02 2017 11:07
not sure what you mean
Loan Laux
@loanlaux
May 02 2017 11:09
Well I'm not sure I'm clear enough, sorry about that. On startup, Reaction builds a Products schema with the ProductVariant schema attached
Did I get this right?
Brent Hoover
@zenweasel
May 02 2017 11:09
Yes
Loan Laux
@loanlaux
May 02 2017 11:10
And I'll wanna add my fields to the ProductVariant schema that has been attached to the Products schema. Also right?
Brent Hoover
@zenweasel
May 02 2017 11:10
Yes
Loan Laux
@loanlaux
May 02 2017 11:11
So how do I check that my field has been successfully added on startup and that it's ready to be used everywhere?
Brent Hoover
@zenweasel
May 02 2017 11:12
so one thing to be clear about is that overriding the schema does not replace the schema everywhere
it allows you to use your new extended schema in your new code
Loan Laux
@loanlaux
May 02 2017 11:12
Hmm okay
So if I were to make a mistake in the code that adds my fields to the schema, it would throw an error on startup?
Brent Hoover
@zenweasel
May 02 2017 11:13
well, as I mentioned I don’t think the import validated against the schema
Loan Laux
@loanlaux
May 02 2017 11:13
Yup
Brent Hoover
@zenweasel
May 02 2017 11:13
but if you wrote code that used that field and tried to modify a product with that data, then it would throw an error
if there is some sort of syntax error, then it would get thrown when it gets imported
Loan Laux
@loanlaux
May 02 2017 11:14
That's if I tried to do it without properly adding the field to the schema, right?
Brent Hoover
@zenweasel
May 02 2017 11:14
which depending on where your code is, would be pretty close to startup
that’s correct, once you use your extended schema, then you're all set
Loan Laux
@loanlaux
May 02 2017 11:15
Perfect. Thank you very much, Brent!
Brent Hoover
@zenweasel
May 02 2017 11:15
so it would be pretty clear right away if your extended schema is in place or not
:+1:
Janus Reith
@janus-reith
May 02 2017 14:13
hi, what would i need to change in order to have a specific product as the landing page?
I know how to switch out the products template with a custum page, but how to directly show a product?
My shop will only offer one, configurable product
Loan Laux
@loanlaux
May 02 2017 14:56
Great question, would love to know as well
Daniel Honig
@dhonig
May 02 2017 15:19
@janus-reith good question!
It shouldn't be that hard, I wouild start by looking through the <template
definitions for the one used as a product detail
JonasKopka
@JonasKopka
May 02 2017 15:21
Hi, I cant get the example Theme to work. Can someone Help?
JonasKopka
@JonasKopka
May 02 2017 15:37
NVM
I put the example theme straight up into the custom folder not knowing, it needs to be in a separate folder.
Janus Reith
@janus-reith
May 02 2017 18:15
@dhonig Yeah, I also tried to follow how which template leads to which, but sometimes i gut stuck on seemingly easy things, while there where way bigger things what were easy to solve in ende
Ivanthadev
@ivanthemeh
May 02 2017 18:19
any recommendations on adding sms blast to my app?
Thanks for the shirt BTW, Love it!
Ivanthadev
@ivanthemeh
May 02 2017 18:20
have you used this before @jshimko ?
Jeremy Shimko
@jshimko
May 02 2017 18:21
No, but they’re easily the biggest name in the business
and they’re way easier to use than something like AWS
http://docs.aws.amazon.com/sns/latest/dg/SMSMessages.html
terrelltechsup
@terrelltechsup
May 02 2017 18:22
twilio all day over aws
there are a lot of ways to skin that cat but there is already a twilio or nexmo plugin, otherwise you would probably have to code up something new
Jeremy Shimko
@jshimko
May 02 2017 18:26
Yep, Twilio isn’t the cheapest but it’ll save you a lot of time and it’s very well-documented.
terrelltechsup
@terrelltechsup
May 02 2017 18:28
zapier has sms too so maybe an automated action based on an event hook
you could even setup an email on zapier and trigger sms messages via twilio or using their inhouse sms
by sending an email
Daniel Honig
@dhonig
May 02 2017 18:31
@janus-reith I know what you mean. The hardest things often have the simplest solutions
Daniel Honig
@dhonig
May 02 2017 19:33
I don't know how I feel about using Zapier for customer facing workflows
that are mission critical
to me, I want access to all of that code and its operation
when it comes to internal workflows, thats a different story
I can always write my own jobs to correct that if I have to
terrelltechsup
@terrelltechsup
May 02 2017 22:04
i know where you are coming from, but sometimes the budget doesn't allow for the dev time to create all of those interfaces unless you just so happen to already have those widgets laying around.