This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { replaceComponent, getHOCs, composeWithTracker } from "@reactioncommerce/reaction-components"; | |
import ProductsComponent from "../../components/product-variant/products"; | |
/* | |
* Customized version of imports/plugins/included/product-variant/containers/productsContainer.js | |
* It subscribes to featured products only for landing page section "Products we love" | |
*/ | |
function composer(props, onData) { | |
window.prerenderReady = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getSchemas } from "@reactioncommerce/reaction-collections"; | |
// Validate the subscription filter against our extended filter schema. | |
const Schemas = getSchemas(); | |
const filters = Schemas.filters; | |
/* Replace stock publication with our custom publication that knows how to filter | |
* featured products as well. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods.importProductImages = function () { | |
Logger.info("Started loading product images"); | |
if (!checkForMedia()) { | |
const products = Products.find({ type: "simple" }).fetch(); | |
for (const product of products) { | |
const productId = product._id; | |
if (!Media.findOne({ "metadata.productId": productId })) { | |
const shopId = product.shopId; | |
const filepath = `plugins/reaction-swag-shop/images/${productId}.jpg`; | |
const binary = Assets.getBinary(filepath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hooks.Events.add("beforeCoreInit", () => { | |
methods.loadShops(); | |
Logger.info("Finished loading Shop data"); | |
}); | |
Hooks.Events.add("afterCoreInit", () => { | |
methods.initLayout(); | |
methods.loadProducts(); | |
methods.loadTags(); | |
methods.loadShipping(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
methods.loadShops = function () { | |
Logger.info("Starting load Shops"); | |
if (!checkForShops()) { | |
const shops = require("../private/data/Shops.json"); | |
shops.forEach((shop) => { | |
Shops.insert(shop); | |
Logger.info(`Inserted shop: ${shop.name}`); | |
}); | |
Logger.info("Shops loaded"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { replaceComponent } from "@reactioncommerce/reaction-components"; | |
import ProductGridItemsCore from "/imports/plugins/included/product-variant/components/productGridItems"; | |
class ProductGridItems extends ProductGridItemsCore { | |
static labelColorPalette = [ | |
"#2899D3", // blue | |
"#40e0d0", // turquoise | |
"#F2542F" // orange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Components } from "@reactioncommerce/reaction-components"; | |
import { default as CoreProductAdmin } from "/imports/plugins/included/product-admin/client/components/productAdmin"; | |
import { replaceComponent } from "@reactioncommerce/reaction-components"; | |
class ProductAdmin extends CoreProductAdmin { | |
render() { | |
return ( | |
// -------------- %< -------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SimpleSchema } from "meteor/aldeed:simple-schema"; | |
import { Product } from "/lib/collections/schemas/index"; | |
import { Products } from "/lib/collections/index"; | |
import { getSchemas, registerSchema } from "@reactioncommerce/reaction-collections"; | |
const ExtendedSchema = new SimpleSchema([ | |
Product, | |
{ | |
featuredProductLabel: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const oauth = Npm.require('oauth'); | |
const Agenda = Npm.require('agenda'); | |
Meteor.startup(function(){ | |
const mongoURL = process.env.MONGO_URL; | |
var agenda = new Agenda({db: {address: mongoURL}}); | |
agenda.define('sync_inventory', Meteor.bindEnvironment(function(job, done) { | |
try { | |
syncInventory(); |