小编wis*_*tal的帖子

Magento - 按类别获取可过滤属性

我专门为网站创建了一个自定义导航模块,但我真的希望能够按特定类别列出可过滤属性.所以我的主要导航是:

  • 第1类
  • 第2类
  • 第3类等

然后,当用户将鼠标悬停在一个类别上时,他们会看到一个带有一些可过滤选项的扩展菜单,例如:


第1类

按制造商查看:

  • 制造商1
  • 制造商2
  • 制造商3等

我能够获得商店的所有可过滤属性,但我希望此列表仅提供每个类别的可过滤属性,例如类别1可能有不同的制造商到类别2.然后我需要缓存这些结果,因为这将不经常改变.

attributes filter magento categories

12
推荐指数
1
解决办法
2万
查看次数

ReactJS将道具转移到动态组件

目前我已经构建了一个非常简单的工厂,它查看JSON配置并使用它来为该组件动态生成组件和适当的道具:

let exampleJSON = {
  "components": [
    {
      "type":"ComponentA",
      "params": { myProp: "hey there"  }
    },
    {
      "type":"ComponentB",
      "params": { myOtherProp: "Yo"  }
    }
  ]
}

const ComponentA = (props) => {
  let { myProp } = props;
  return  (
    <div>{ myProp }</div>
  )
}

const ComponentB = (props) => {
  let { myOtherProp } = props;
  return  (
    <div>{ myOtherProp }</div>
  )
}

const ComponentFactory = (props) => {
  const { content } = props;
  return (
    <div>
      { …
Run Code Online (Sandbox Code Playgroud)

reactjs react-jsx

3
推荐指数
1
解决办法
2656
查看次数

标签 统计

attributes ×1

categories ×1

filter ×1

magento ×1

react-jsx ×1

reactjs ×1