For the complete documentation index, see llms.txt. This page is also available as Markdown.

Modification and troubleshooting

The Magento 2 module integrates with the default Luma theme. Most projects need customizations.

Changing existing column names

Column names are defined in etc/di.xml. Change the column definition, then replace the standard name in a DataProvider plugin.

<virtualType name="Omikron\Factfinder\Model\Export\CatalogFeed">
    <arguments>
        <argument name="columns" xsi:type="array">
            <item name="Master" xsi:type="string">CUSTOM_NAME</item>
        </argument>
    </arguments>
</virtualType>
<type name="Omikron\Factfinder\Model\Export\Catalog\ProductType\SimpleDataProvider">
    <plugin name="custom-provider" type="YOUR_VENDOR\YOUR_MODULE\Plugin\AfterToArrayPlugin" />
</type>
public function afterToArray($subject, $result)
{
    return ['CUSTOM_NAME' => $result['Master']] + $result;
}

Magento merges DI definitions, so do not copy unrelated entries. Then run:

bin/magento cache:clean config

Adding a new column

FieldProvider defines fields requiring logic beyond retrieving product data:

To export a BrandLogo image URL, add a field definition. Your exporter must implement Omikron\Factfinder\Api\Export\FieldInterface:

Define the column in CatalogFeed:

GenericField usage

For a direct product attribute, use a GenericField virtual type:

Run bin/magento cache:clean config after the change.

Adding a custom product data provider

Map a custom product type to a data provider through Magento DI:

Magento passes $product automatically. Implement getEntities to return the required data.

Exporting fields from variants

By default, the module exports configurable product data. Variants override only selected fields. Review src/Model/Export/Catalog/Entity/ProductVariation.php.

Use variantFields when variants need additional exported fields. This example exports ImageURL from variants:

Troubleshooting

Removing /pub from exported URLs

If the feed exports URLs containing pub/, your document root likely points to /pub. Add this entry to your project's env.php:

Last updated

Was this helpful?