Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Changed project namespace, bumped up version number/tag to 0.2, updat…
Browse files Browse the repository at this point in the history
…ed documentation
  • Loading branch information
dakzilla committed Jun 24, 2017
1 parent 570428e commit 6b6d9b1
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 32 deletions.
2 changes: 1 addition & 1 deletion App/Config/Cronjob.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DannyNimmo\VisualMerchandiserRebuild\App\Config;
namespace Dakzilla\VisualMerchandiserRebuild\App\Config;

use Magento\Framework\Exception\LocalizedException;

Expand Down
7 changes: 4 additions & 3 deletions Console/Command/RebuildCommand.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?php
/**
* @author Danny Nimmo <d@nny.nz>
* @category DannyNimmo\VisualMerchandiserRebuild
* @author Simon Dakin <hello@simondakin.com>
* @category Dakzilla\VisualMerchandiserRebuild
* @copyright Copyright © 2017 Danny Nimmo
*/

namespace DannyNimmo\VisualMerchandiserRebuild\Console\Command;
namespace Dakzilla\VisualMerchandiserRebuild\Console\Command;


use DannyNimmo\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Dakzilla\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Magento\Framework\App\Area;
use Magento\Framework\App\State;
use Magento\Framework\Exception\LocalizedException;
Expand Down
9 changes: 2 additions & 7 deletions Console/Command/ShowCommand.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<?php
/**
* @author Danny Nimmo <d@nny.nz>
* @category DannyNimmo\VisualMerchandiserRebuild
* @copyright Copyright © 2017 Danny Nimmo
*/

namespace DannyNimmo\VisualMerchandiserRebuild\Console\Command;
namespace Dakzilla\VisualMerchandiserRebuild\Console\Command;

use DannyNimmo\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Dakzilla\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Magento\Catalog\Model\Category;
use Magento\Catalog\Model\CategoryRepository;
use Magento\Framework\App\Area;
Expand Down
4 changes: 2 additions & 2 deletions Cron/Rebuild.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace DannyNimmo\VisualMerchandiserRebuild\Cron;
namespace Dakzilla\VisualMerchandiserRebuild\Cron;

use DannyNimmo\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Dakzilla\VisualMerchandiserRebuild\Helper\Categories as CategoryHelper;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Psr\Log\LoggerInterface;

Expand Down
4 changes: 2 additions & 2 deletions Helper/Categories.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace DannyNimmo\VisualMerchandiserRebuild\Helper;
namespace Dakzilla\VisualMerchandiserRebuild\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
Expand All @@ -15,7 +15,7 @@

/**
* Class Categories
* @package DannyNimmo\VisualMerchandiserRebuild\Helper
* @package Dakzilla\VisualMerchandiserRebuild\Helper
*/
class Categories extends AbstractHelper
{
Expand Down
43 changes: 39 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,58 @@
# Rebuild Visual Merchandiser Categories for Magento 2

Rebuild Magento 2 Visual Merchandiser categories using the CLI tool.
Rebuild Magento 2 Visual Merchandiser categories using the CLI tool or a scheduled task.

> :warning: **NOTE:** This module is not fully tested, please make sure to test this on a non-production system first, and use at your own risk!
## Installation
## Installation via .zip

```bash
composer require dannynimmo/magento2-visual-merchandiser-rebuild
1. Download the zip file for the master branch on Github
2. Extract the Dakzilla directory in the `app/code` directory of your Magento 2 EE project
3. Run the `php bin/magento setup:upgrade` command to enable the module

## Installation via Composer

```
composer require dakzilla/magento2-visual-merchandiser-rebuild
php bin/magento setup:upgrade
```

## Usage

### Rebuild all smart categories from the command line

```bash
bin/magento catalog:visual-merchandiser:rebuild
```

### Show information about smart categories

```
bin/magento catalog:visual-merchandiser:show
```

The above command should display a nifty table like this one

![Information table](http://i.imgur.com/5yNW9Y8.png)

### Enable and set cron job in admin

In Magento Admin, in the Visual Merchandiser options, you can set a cron expression to be used to rebuild the smart categories on schedule. The example below will execute the job every day at 1:45 AM. If you're not sure, use [Crontab Generator](https://crontab-generator.org/) to create a valid cron expression.
![Admin cron options](http://i.imgur.com/qjcJX01.png)

## Compatibility

This module was tested on Magento 2 Enterprise Edition versions 2.1.5 to 2.1.7. Compatibility with older versions is not guaranteed, but should not be an issue anyhow.

## Changelog

### [0.2](https://github.com/dakzilla/magento2-visual-merchandiser-rebuild/releases/tag/0.2) - 2017-06-24
* Fixed an app state bug with the latest version of Magento 2
* Internal refactor
* Added the `catalog:visual-merchandiser:show` command to display a useful information table about your smart categories
* Added a configurable cron job in admin. From the Visual Merchandiser options, you can now set a cron job to rebuild smart categories automatically. Make sure your Magento cron in configured correctly!

### [0.1.1](https://github.com/dannynimmo/magento2-visual-merchandiser-rebuild/releases/tag/0.1.1) — 2017-03-17
* Fixed major issue where URL keys were missing from collection

Expand Down
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
{
"name": "dannynimmo/magento2-visual-merchandiser-rebuild",
"name": "dakzilla/magento2-visual-merchandiser-rebuild",
"description": "Rebuild Magento 2 Visual Merchandiser categories using the CLI tool",
"version": "0.1.1",
"version": "0.2",
"type": "magento2-module",
"license": "MIT",
"keywords": [
"magento",
"magento2",
"visual merchandiser"
],
"homepage": "https://github.com/dannynimmo/magento2-visual-merchandiser-rebuild",
"homepage": "https://github.com/dakzilla/magento2-visual-merchandiser-rebuild",
"authors": [
{
"name": "Danny Nimmo",
"email": "d@nny.nz",
"homepage": "https://danny.nz/"
},
{
"name": "Simon Dakin",
"email": "hello@simondakin.com"
}
],
"require": {
Expand All @@ -27,7 +31,7 @@
"registration.php"
],
"psr-4": {
"DannyNimmo\\VisualMerchandiserRebuild\\": ""
"Dakzilla\\VisualMerchandiserRebuild\\": ""
}
}
}
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</field>
<field id="cronjob_expression" translate="label comment" type="text" sortOrder="2" showInDefault="1" showInWebsite="0" showInStore="0">
<label>Cron job expression</label>
<backend_model>DannyNimmo\VisualMerchandiserRebuild\App\Config\Cronjob</backend_model>
<backend_model>Dakzilla\VisualMerchandiserRebuild\App\Config\Cronjob</backend_model>
<comment>Enter a valid cron expression to setup up automatic regeneration of Visual Merchandiser categories (Ex: 0 1 * * *)</comment>
<depends>
<field id="cronjob_enabled">1</field>
Expand Down
2 changes: 1 addition & 1 deletion etc/crontab.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
<job name="dannynimmo_vmrebuild_cron" instance="DannyNimmo\VisualMerchandiserRebuild\Cron\Rebuild"
<job name="dannynimmo_vmrebuild_cron" instance="Dakzilla\VisualMerchandiserRebuild\Cron\Rebuild"
method="execute">
<config_path>visualmerchandiser/options/cronjob_expression</config_path>
</job>
Expand Down
7 changes: 4 additions & 3 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
<!--
/**
* @author Danny Nimmo <d@nny.nz>
* @category DannyNimmo\VisualMerchandiserRebuild
* @author Simon Dakin <hello@simondakin.com>
* @category Dakzilla\VisualMerchandiserRebuild
* @copyright Copyright © 2017 Danny Nimmo
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Framework\Console\CommandListInterface">
<arguments>
<argument name="commands" xsi:type="array">
<item name="dannynimmo_vmrebuild_rebuild" xsi:type="object">DannyNimmo\VisualMerchandiserRebuild\Console\Command\RebuildCommand</item>
<item name="dannynimmo_vmrebuild_show" xsi:type="object">DannyNimmo\VisualMerchandiserRebuild\Console\Command\ShowCommand</item>
<item name="dannynimmo_vmrebuild_rebuild" xsi:type="object">Dakzilla\VisualMerchandiserRebuild\Console\Command\RebuildCommand</item>
<item name="dannynimmo_vmrebuild_show" xsi:type="object">Dakzilla\VisualMerchandiserRebuild\Console\Command\ShowCommand</item>
</argument>
</arguments>
</type>
Expand Down
5 changes: 3 additions & 2 deletions etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
<!--
/**
* @author Danny Nimmo <d@nny.nz>
* @category DannyNimmo\VisualMerchandiserRebuild
* @author Simon Dakin <hello@simondakin.com>
* @category Dakzilla\VisualMerchandiserRebuild
* @copyright Copyright © 2017 Danny Nimmo
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="DannyNimmo_VisualMerchandiserRebuild" setup_version="0.1.1">
<module name="Dakzilla_VisualMerchandiserRebuild" setup_version="0.2">
<sequence>
<module name="Magento_VisualMerchandiser"/>
</sequence>
Expand Down
4 changes: 2 additions & 2 deletions registration.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
/**
* @author Danny Nimmo <d@nny.nz>
* @category DannyNimmo\VisualMerchandiserRebuild
* @category Dakzilla\VisualMerchandiserRebuild
* @copyright Copyright © 2017 Danny Nimmo
*/

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'DannyNimmo_VisualMerchandiserRebuild',
'Dakzilla_VisualMerchandiserRebuild',
__DIR__
);

0 comments on commit 6b6d9b1

Please sign in to comment.