Samples > Data load utility samples


Sample: Loading sales catalogs

This sample demonstrates how to load a sales catalog and sales categories using the data load utility.


About this sample

This sample loads a sales catalog called "Spring Fashions". The sample also creates the following sales categories:


Procedure

Before running this sample, ensure that you have updated the /bin/samples/DataLoad/Catalog/SalesCatalogAndGroups/wc-dataload-env-sales-catalog.xml configuration file with the correct environment and store settings.

<_config:BusinessContext storeIdentifier="MadisonsESite" catalogIdentifier="Spring Fashions"
languageId="-1" currency="USD">
<_config:ContextData name="fulfillmentCenterName">Madisons Home</_config:ContextData>
</_config:BusinessContext>

The storeIdentifier is the identifier of the store which to create the sales catalog. The catalogIdentifier is the identifier of the sales catalog that you just created "Spring Fashions".

  1. Open the command-line interface, and navigate to the appropriate directory:

  2. Enter the following command:

    • ./dataload.sh ../samples/DataLoad/Catalog/SalesCatalogAndGroups/wc-dataload.xml .

    • dataload ..\samples\DataLoad\Catalog\SalesCatalogAndGroups\wc-dataload.xml

  3. Run the following SQL command to verify that a sales catalog has been created with the code 'Spring Fashions':

    select * from catalog where identifier in ('Spring Fashions')
    

    This SQL command returns the sales catalog 'Spring Fashions'.


Procedure for loading new sales categories

  1. Open the command-line interface and navigate to the appropriate directory:

  2. Enter the following command:

    • ./dataload.sh ../samples/DataLoad/Catalog/SalesCatalogAndGroups/wc-dataload-sales-catalog-groups.xml

    • dataload ..\samples\DataLoad\Catalog\SalesCatalogAndGroups\wc-dataload-sales-catalog-groups.xml


Verify results

To verify that the sales catalog has been loaded correctly, run the following SQL command:

select * from catgroup where catgroup_id in (select catgroup_id from cattogrp where catalog_id in (select catalog_id from catalog where identifier in ('Spring Fashions'))) or catgroup_id in (select catgroup_id_child from catgrprel where catalog_id in (select catalog_id from catalog where identifier in ('Spring Fashions')))

This SQL command returns the categories loaded in the sales catalog 'Spring Fashions'.

You can also verify the results by viewing the sales catalog in the Management Center Catalogs tool or in the storefront. To view the sales catalog in the storefront, update the URL with the catalog ID of the sales catalog. For example, if the store ID is 12345 and the catalog ID of the sales catalog is 100000001234, enter the following URL:

http://your_host_name.com/webapp/wcs/stores/servlet/TopCategoriesDisplay?langId=-1&storeId=12345&catalogId=100000001234

Where your_host_name.com is the host name of the server.


Clean up the data

To use another sample, it is recommended that you first remove the data loaded in this sample.

To remove the data loaded in this sample, run the CleanUp.sql file located in the /bin/samples/DataLoad/Catalog/SalesCatalogAndGroups directory.


Previous topic: Sample: Adding image attachments to categories and catalog entries


Next topic: Sample: Loading data to an extended sites store and catalog asset store

Related reference

Data load utility samples


+

Search Tips   |   Advanced Search