Page 1 of 1

Featured Items in Multiple Stores

Posted: Sun Jun 16, 2019 3:07 am
by John R.
I am new to OpenCart 3.x, and I feel like I might be missing something about the Home Page Featured Module.

I will have multiple stores setup. Some of the stores will have common products. Some of these common products should be featured in one store but not necessarily in the others. I did a backtrace, etc and I wound up looking at the *_module table and the record for 'featured'. It is JSON code:
Original:

Code: Select all

{
  "name": "Home Page",
  "product_name": "",
  "product": [
    "311",
    "675",
    "201",
    "207",
    "200",
    "473"
  ],
  "limit": "16",
  "width": "200",
  "height": "200",
  "status": "1"
}
New:

Code: Select all

{
  "name": "Home Page",
  "product_name": "",
  "status": "1",
  "store": {
    "0": {
      "product": [
        "675",
        "201",
        "207",
        "200",
        "473"
      ],
      "limit": "16",
      "width": "200",
      "height": "200"
    },
    "2": {
      "product": [
        "311"
      ],
      "limit": "16",
      "width": "200",
      "height": "200,
    }
  }
}
Note that there is no store_id data in the original json. I am thinking of changing it to something like the new json above and then fiddling with ...module/featured.php to get it to work. Am I missing a setting somewhere or is this recoding necessary? Note that I assume the 'status' means enabled. Any advice or suggestions appreciated. Again, I feel like I am missing something, but I don't see an option to pick a store for each item in Extensions > Featured

Re: Featured Items in Multiple Stores

Posted: Sun Jun 16, 2019 3:44 am
by John R.
Well, it seems to be working.... No bugs yet. If anyone is interested, this is my altered featured.php file for the above change. And, incidentally, I am now adding my 'featured' items via JSON code through the database. The main change is changing most or all occurrences of:

Code: Select all

 $setting 

to

Code: Select all

$setting['store'][$this->config->get('config_store_id')]