These are chat archives for reactioncommerce/reaction

25th
Feb 2016
Aaron Judd
@aaronjudd
Feb 25 2016 00:39
and also add that layout definition to Shops.layouts
Aaron Judd
@aaronjudd
Feb 25 2016 00:45
you should be able to define your own checkout path with a template/workflow (see the checkout register) that should allow you to have an a completely custom checkout.
also, another approach you might want to consider… you could just clone the checkout package now, and just customize it...
Aaron Judd
@aaronjudd
Feb 25 2016 00:51
we’ve been moving packages up into the .meteor/packages and trying to remove dependencies / make them independent specifically to make this easier, rather than Template.replace / extends, which is ok for small mods, but is pretty tough to use for any significant changes.. so now, you’d just copy a package, remove the reaction-checkout, and use your own from there.
or some mix of both packages..
@elkridgelodge @spencern @meladawy - yes, aware that’s not the optimal experience and should get around to optimizing that to reload soon. The less painful technique right now is to open meteor mongo in another shell, and then db.Packages.remove({}); right before you save your registry changes ;-)
Aaron Judd
@aaronjudd
Feb 25 2016 01:02
@spencern I though layout was being passed in the option, but could you try adding “layout” here https://github.com/reactioncommerce/reaction/blob/development/packages/reaction-router/common/init.js#L80 and inserting after line 93 as well
Maged Eladawy
@meladawy
Feb 25 2016 08:34
@aaronjudd :+1:
Maged Eladawy
@meladawy
Feb 25 2016 09:13
Hey All, i want to alter the home page template
i know that its rendering "productGrid" template
and in init.js file the home page route has defined as the following
'''
//
// index / home route
//
shop.route("/", {
name: "index",
action: function () {
renderLayout();
}
});
'''
  //
  // index / home route
  //
  shop.route("/", {
    name: "index",
    action: function () {
      renderLayout();
    }
  });
but productGrid template has not been defined in route "/"
how reaction recognised that productGrid template is associated to "/" route ?
hrath2015
@hrath2015
Feb 25 2016 09:20
I guess you have to change it in register.js in reaction core.
"layout: [{
layout: "coreLayout",
workflow: "coreWorkflow",
theme: "default",
enabled: true,
structure: {
template: "products",
layoutHeader: "layoutHeader",
layoutFooter: "layoutFooter",
notFound: "productNotFound",
dashboardControls: "dashboardControls",
adminControlsFooter: "adminControlsFooter"
}"
replace template "products" with your template.
Maged Eladawy
@meladawy
Feb 25 2016 09:23
Ahaa...so inside init.js we only defined the route "/" and template has been assigned through reaction-core/server/register.js file
hrath2015
@hrath2015
Feb 25 2016 09:23
Yes that is only the route.
Maged Eladawy
@meladawy
Feb 25 2016 09:23
great but i don't think that changing the core package is a good behaviour
hrath2015
@hrath2015
Feb 25 2016 09:24
Which is default and render corelayout and coreworkflow
Maged Eladawy
@meladawy
Feb 25 2016 09:24
can i alter this through another custom package
anyway thank you @hrath2015 :)
hrath2015
@hrath2015
Feb 25 2016 09:28
I guess u can. you have define layout and workflow combination in package and same need to update in shops as well.
Maged Eladawy
@meladawy
Feb 25 2016 09:40
Yea i'll try this now
Maged Eladawy
@meladawy
Feb 25 2016 10:29
I tried this to override the home page packages template but it doesn't work
ReactionCore.registerPackage({
    label: "Homepage",
    name: "homepage",
    icon: "fa fa-home",
    autoEnable: true,
    settings: {
    },
    layout: [{
      layout: "coreLayout",
      workflow: "coreWorkflow",    
      template: "homepage",
      theme: "default",
      enabled: true,
      structure: {
        template: "homepage",
        layoutHeader: "layoutHeader",
        layoutFooter: "layoutFooter",
        notFound: "notFound",
        dashboardControls: "dashboardControls",
        adminControlsFooter: "adminControlsFooter"
      }
    }]
  });
i tried this from another custom package
hrath2015
@hrath2015
Feb 25 2016 10:37
Have u updated shops.json as well
what error u getting?
Maged Eladawy
@meladawy
Feb 25 2016 10:42
No i didn't but why i need to update shops.json
the page was not find
home page is now not found
although i'm sure i have defined the template "homapege"
hrath2015
@hrath2015
Feb 25 2016 10:43
Layout should be specific to Shop (in case multi shop scenario)
blob
please update it there. Mongo DB should show homepage in shops collection
after change do meteor reset and start u should be good
Maged Eladawy
@meladawy
Feb 25 2016 10:47
I'll try this, but if i changes products to homepage in shops.json
Does it mean that i define the shop layout to be homepage ?
actually homepage template shouldn't be for shops or something it will just display the list of available shops
so i just wander why i have to change the layout template of each shop to homepage
hrath2015
@hrath2015
Feb 25 2016 10:52
earlier message from @aaronjudd "@aaronjudd
@elkridgelodge if you expand this section: https://github.com/elkridgelodge/sip-workflow/blob/master/server/register.js#L6
to be reflect the expanded layout definition like: https://github.com/reactioncommerce/reaction/blob/development/packages/reaction-checkout/server/register.js#L21
and also add that layout definition to Shops.layouts"
As of now layout definition should be there in shops.layouts also.
Maged Eladawy
@meladawy
Feb 25 2016 10:54
Yea i updated this and its now displaying the homepage template
hrath2015
@hrath2015
Feb 25 2016 10:54
If u want to use other template (homepage) instead of products, I guess change will be needed in both register and shops.
Maged Eladawy
@meladawy
Feb 25 2016 10:57
Yea so the idea is the each store has its own layout structure thats why you are storing the layout structure inside shop document ?
hrath2015
@hrath2015
Feb 25 2016 10:58
that is my understanding.
Maged Eladawy
@meladawy
Feb 25 2016 11:01
Mmmmm its clear nw
thank u friend !
hrath2015
@hrath2015
Feb 25 2016 11:15
@meladawy u r welcome. Glad could help.