schafferer/shcware-import-bundle

1.1.39 2017-02-07 07:40 UTC

README

This package combines the product import ("pkgTwProductImport") and the wawi-objects ("pkgTwWawi") from originally tischwelt

Database updates

Note to the "updates" folder:

The update-folder contains 3 different types of updates:

  • updates from the formerly "pkgTwProductImport/pkgTwProductImport-updates" - folder are prefixed with "import-update-"
  • updates from the formerly "pkgTwWaWi/pkgTwWaWi-updates" - folder are prefixed with "wawi-update-"

As these two updates and the objects within the packages need some fields which weren't created yet, the corresponding updates from tischwelt "custom-core/updates/common" folder have also been added.

  • updates from the formerly "custom-core/updates/common" - folder are prefixed with "custom-core-"

As some updates had an identical buildnumber within their filenames, they have been renamed in ascending order, to include an unique buildnumber.

In case you need to find the corresponding update within the tischwelt project, search for an call of "::AllowTransaction" e.g. "TCMSLogChange::AllowTransaction(3, 'dbversion-CustomCoreTW')".

The updates within this package should not be executed another time, when installed in tischwelt project, as the ::AllowTransaction method should return false and the update manager will mark the update as "skipped".

Import-Service

The import is divided into task-groups containing tasks. Task-groups and tasks each have an order in which they're executed. Both are registered via service-tags.

Tasks prefixed with "TW" are only relevant for tischwelt, tasks prefixed with "SGD" are only relevant for schafferer-gastro-discount. Prefixed Tasks are not registered within this package and must be registered at client-side.

Currently there are the following task-groups and tasks, which will be executed in the listed order:

  • group: prepare

    • CacheDisableTask
    • ImportQueueOnFilledSkipTaskGroup (skips the rest of the tasks if there are items in the queue)
    • ImportCSVsTask
    • ShopCategoryEnNameFieldTask
    • ProduktArtTask
    • AttributesTask
    • AttributeValuesTask
    • CleanupBestandTask
    • ImportQueueCreateEmptyTask
    • ImportQueueFillTask
    • ImportQueueOnEmptyAbort
    • MarkProductsWithToProcessFlagTask
  • group: run

    • ImportQueueProcessItemsTask
      • uses the following ProcessorTasks to process one import-queue-item:
      • ArticleBaseDataProviderTask
      • ArticlePriceDataProviderTask (SGD and TW have their own one)
      • ManufacturerAndSeriesDataProviderTask
      • StockMessageDataProviderTask
      • IsNewArticleDataProviderTask
      • ArticleIsHiddenDataProviderTask
      • ArticleAlternativeNameDataProviderTask
      • UpdateOrCreateShopArticleTask
      • UpdateArticleStatsTask
      • UpdateArticleStockTask
      • UpdateArticleCategoriesTask
      • UpdateArticleAttributesTask
      • UpdateArticleProduktArtTask
      • UpdateArticleTypeTask
      • UpdateArticleImagesAndPdfsTask
      • UpdateArticleAttributesVirtualArticlesTask

An Important note about ImportQueueProcessItemsTask

All subtasks have access to a data collector that can be used to transfer data from one task to any later task. This is used to collect all data in an array required to create/update the base article in UpdateOrCreateShopArticleTask. The task will then make the resulting article available in the collector via the key 'item'. If no matching item is found for the article, then item will be set to null.

YOU SHOULD have any task that needs to access the item implement PostProcessItemTaskInterface and come AFTER UpdateOrCreateShopArticleTask.

  • group: cleanup
    • ImportQueueOnFilledSkipTaskGroup (skips the rest of the tasks if there are items in the queue)
    • DisableProductsNotInCSVImportTask
    • UpdateProductBlacklistingTask (TW only; SGD uses country based black-listing)
    • AccessoriesTask
    • ShopArticleSetTask (Siehe #12078 - this is a type of variant handling. Alternative to TwProductImportHelper_Variant)
    • UpdateTwShopArticleSerieTask
    • ShopArticleSeriesEnableNotificationServiceTask (TW ONLY)
    • UpdateProductCountCategoryTreeTask
    • EnableCategoriesWithProductsTask
    • DisableEmptyCategoriesTask
    • DeactivateEmptyManufacturerTask
    • ChangeCategoryTemplateForAllManufacturersWithSeriesTask
    • RemoveInactiveProductsFromWishlistsTask
    • RemoveInactiveProductsFromNoticelistsTask
    • ProductHasImagesTask
    • SeriesGroupTask
    • RefreshProductCategoryNestedSetTask
    • CacheEnableTask
    • CacheClearTask
    • SendImportReportTask

Set Service Product Type to Products (#28708)

We connect products to product type based on the ARTFA field in article.csv. Current possible service product types are

V - Verbrauchsartikel O - Ausstattungs-Option D - Dienstleistungsartikel

The import can mark products with one or more specified product types as not searchable (they will not show in the product category list or the search results). Use the parameter schafferer_shcware_import for this.

Example:

schafferer_shcware_import:

product_type_ident_list_products_show_not_in_lists: ["O","D"]

Product Categories Using Nested Set (#29857)

This bundle extends the product category table editor. But we need nested set categories for other bundles which extends the table editor also. So we require the nested set for product categories bundle here that other bundles can use ist.

Variant Import

different products may require different variant sets. This can be solved by tagging a service implementing ImportVariantSetIdProviderInterface. The service list is checked sequentially. If any of the registered services returns a none null answer, then that id is used. otherwise the default is used.

You can define the default to use using the parameter:

parameters:
    schafferer_shcware_import.default_variant_set_id: "xxx"

Use the following Tag to define a variant set provider

    <tag name="schafferer_shcware_import.variant_set_provider" />

Next to the default variant set id provider, there is one that can assign a variant set based on the products article type (ProductTypeVariantSetIdProvider) You can configure it using schafferer_shcware_import.product_type_variant_set

product-type-system-name: variant-set-id

Testing / Debugging

You can use the cms simulation 'Run single Import-Task' to run individual tasks