EmicoEcommerce / Magento2TweakwiseExport-archived

Magento 2 module for Tweakwise export
Other
6 stars 16 forks source link
magento tweakwise

This package is abandoned and no longer maintained. For the replacement package see tweakwise/magento2-tweakwise-export package instead.


Build Status Code Climate Codacy Badge

Installation

Install package using composer

composer config minimum-stability dev
composer require emico/tweakwise-export

Install package using zip file

Extract tweakwise-export.zip src folder to app/code/Emico/TweakwiseExport/

If 'Store Level Export' enabled single store feed can be generated using the command line.

php bin/magento tweakwise:export --store '<storecode>'

Run installers

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy

Usage

All export settings can be found under Stores -> Configuration -> Catalog -> Tweakwise -> Export.

Generating feeds can be done using the command line.

php bin/magento tweakwise:export

Debugging

Debugging is done using the default debugging functionality of Magento / PHP. You can enable indentation of the feed by setting deploy mode to developer.

php bin/magento deploy:mode:set developer

Usage:
 tweakwise:export [-c|--validate] [file]

Arguments:
 file                  Export to specific file (default: "var/feeds/tweakwise.xml")

Options:
 --validate (-c)       Validate feed and rollback if fails.
 --help (-h)           Display this help message
 --quiet (-q)          Do not output any message
 --verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
 --version (-V)        Display this application version
 --ansi                Force ANSI output
 --no-ansi             Disable ANSI output
 --no-interaction (-n) Do not ask any interactive question

Feed structure

The feed contains some header information followed by categories and then products. Tweakwise does not natively support multiple stores, in order to circumvent this all categories and products are prefixed with 1000{store_id}. If a product (with id 1178) is active and visible in multiple stores (say 1, 5 and 8) then it will appear three times in the feed with ids: 100011178, 100051178 and 100081178. The data on that product depends on the attribute values of the specific store. In short an entity is available in the feed as 1000{store_id}{entity_id}

The feed only contains products that are visible under your catalog configuration. If a product has children (say it is configurable) then the feed will also contain all the data from those children. Child data is aggregated onto the "parent" product. The reason for this is that when a user searches for a t-shirt with size M then the configurable must show up in the results, therefor the configurable should be exported with all sizes available among its children.

The feed contains only attributes which have bearing on search or navigation, check src/Model/ProductAttributes.php:45 to see the criteria an attribute must meet in order to be exported.

A note on the feed implementation

Magento's native interfaces and handlers for data retrieval were deemed to slow for a large catalog. Since performance is essential we decided on our own queries for data retrieval. The consequence is that we need to keep track of the inner workings of magento and are subject to its changes. If you find an issue with data retrieval please create an issue on github.

Export Settings

Visibility settings

Magento has multiple visibility settings, tweakwise only knows visible products meaning that if a product is in the feed then it will be visible while navigating and searching. The magento visibility setting is exported in the feed so you can add a hidden filter to your tweakwise template to artificially use the correct settings. If you do this then exclude the visibility attribute from child products (see "Export Settings").

Events

Currently there are no events documented, this will be done in the coming version(s).

Profiling

For profiling use the standard Magento profiler, more info will be provided in the coming version(s).