Parent- and Subarticles

Inhaltsverzeichnis

Introduction

If you offer products in your shop that are available in multiple variants – for example, different colours, sizes or features – we recommend using parent and sub-articles. This means you don’t have to create a separate main article in the shop for each individual variant, which can quickly become confusing if you have a large number of variants.

The use of parent/sub-articles is much more flexible than the standard variant function in PepperShop. Each sub-article variant has its own stock level, can be assigned its own image and supports multilingual content such as names and descriptions.

The connection between sub-articles and the corresponding parent article is made via the article number, which is particularly advantageous when external systems such as an ERP are connected – these can transfer the variants directly to the shop.

Video

Requirements

The following conditions must be met in order to work correctly with parent/sub-articles in PepperShop:

  • Article display: The two-level article display must be enabled in the shop administration under “Design” → “Settings” → “Design detail adjustments” → “Articles” (this is the default configuration).
  • In the menu “Settings” → “General” → “Edit article”, the setting “Main and sub-articles” must be enabled and saved.
  • The sub-articles must be in one (or more) invisible category(ies) so that they are not offered for sale individually. This is always done automatically by the system when working with the shop administration.
  • All items used must have their own item number (both parent and sub-items).

Start

Once you have adjusted or verified the shop configuration as described in chapter 2, you can open the item editing screen in the shop administration: “Assortment” → “Items” → “New”. The main item is also the parent item. In the “General” tab, you define the item number, the (base) name and the description. Enter “-1” for the price and “0” for the weight. The “Variants” tab now displays an overview in which you can enter the different variants.

Item properties

Differences between parent and sub-items:

Parent item Sub-item
Usage Example Usage Example
Item no. yes pepper yes pepper_prof
Name yes PepperShop yes PepperShop Professional
Description yes Version 2.6 offers… no -
Use Example / Default value Usage Example
Short description yes The new PepperShop… no -
Price no -1 (important, must be = -1!) yes 449.00
Weight no 0 (important, must be = 0!) yes 2
Image yes pepper_gr.jpg no -
Stock no - yes 3
Parent No. no - yes pepper12
grouping_parent no - yes Standard software

Composition of parent and sub-articles

The connection (belonging) is controlled by an article no. The parent article initiates the article group. Its article no. must be linked to each sub-article as the parent no. This happens automatically when you create the sub-articles directly in the Variants tab in the article editing mask. Otherwise, you can link the sub-articles via “Assortment” → “Mass mutations” → “Article mass mutations - Name and article no.".

Alternatively, the parent/sub-item links can also be defined via the Caller Navigator (“Import/Export” → “Caller Navigator”). To do this, export the existing item data.

If the Caller Navigator is not listed in your shop administration, you can use the Import/Export tool (“Import/Export” → “Import/Export tool”). Click on “Export article master” and select the Parent no. and Parent group in addition to the exportable mandatory fields (article name, article no., category ID).

Example import file (without parent group, we will come to this later):

Item no. Name Price Parent no.
shoe_001 Stella sports shoe -1
shoe_001-1 Stella sports shoe size 37 45 shoe_001
shoe_001-2 Stella sports shoe size 38 45 shoe_001
shoe_001-3 Stella sports shoe size 39 45 shoe_001
shoe_001-4 Stella sports shoe size 40 47 shoe_001

The name of a sub-item can be limited to the feature that distinguishes it from the parent item – for example, only the size specification. However, it is recommended that you include the base name of the parent item in the name of each sub-item by default. This ensures greater clarity, especially when exporting or connecting interfaces.

Note: The display of the article name can be further customised in the configuration editor. To do this, go to the shop administration: “Settings” → “System configuration” → “Configuration” → “View and edit control constants for this system” There, you can fine-tune the display behaviour of the article names using the corresponding control constants.

Customer view

In the two-level article display in the shop, the customer first sees an overview of all articles within a category. For each parent article, the cheapest price of the associated sub-articles is automatically determined and displayed with the note “From” (e.g. From €19.90).

In the detail view of an article, the variants can be displayed in two different ways:

  • As a list: All sub-articles are displayed one below the other with their details such as stock level (if activated), price and description.
  • As a drop-down menu: The customer selects the desired variant from a selection field. After selection, all relevant information (e.g. price, image, stock status) is automatically adjusted accordingly.

Grouping sub-items

The sub-items can either be presented one below the other (e.g. red, green, blue, yellow, etc.) or they can be displayed in groups. To do this, you must define the name of each sub-item’s group, e.g. (red + 50g, red + 100g, green + 50g, green + 100g, blue + 50g, blue + 100g, yellow + 50g, yellow + 100g). A grouping field is used for this purpose. In the article editing mask, this is called “Sub-article group”. This field appears in the “Variants” tab when you click on the pencil icon next to the grey field for the corresponding item. In the “Import/Export Tool”, the field is called “Parent Group”.

For sub-item selection via drop-down menus, we recommend the setting “Drop-down grouped”. The display settings can be found under “Settings” → “General” → “Edit item” → “Main and sub-items” → “Display type”.

Parent/sub-articles with option articles (options for variants)

This section describes how a complex article is structured that includes several variants (e.g. “colour”, “size”) and also allows the selection of “optional additional articles” when adding to the shopping cart.

Such a composite article consists of several components, which are defined as follows:

Component overview:

  • Parent article: Serves as the parent article. It contains general information such as “Name”, “Description” and “Product images”. The parent item cannot be purchased directly, has no price and no weight. It is only used to group the variants.
  • Sub-items (1 to n): These are the purchasable variants of the item – “e.g. different colours or sizes”. Each sub-item has its own “item number”, a “variant name suffix” (e.g. size 38 or “green”), a “price”, “stock level” and an “individual weight”.
  • Options (grouped): These are linked additional items that can be added to the main item as options – for example, accessories or complementary products. These options appear as selectable additional components during the “Add to basket” process.

Administration

Create new items

New items should be created using “Duplicate”. This copies an existing parent/sub-item and creates it as a new item, which is usually much faster than re-entering all (similar) variants:

  1. Open the shop administration.
  2. Navigate to “Assortment” → “Items”.
  3. Click on the grey “Duplicate” icon to the right of the item.
  4. Assign a new:
  • Parent item no. and sub-item no.
  • Name (of parent and sub-items)
  • Description and short description
  1. When you are finished, you can assign the item to a new category.
  2. Upload new item images if necessary.
  3. Click on “Save as new”.

If necessary: 8. Adjust linked option items 9. Enter new option items (if necessary) 10. Update the assignments via “Assortment” → “-Bulk mutations” → “Option items”.

Adjust existing items

Existing items can also be adjusted using the item editing mask. To do this, open “Assortment” → “Items” and click on the item you want to edit.

Editing optional items

Optional items are essentially linked standard items. The link is based on an assignment per item. The grouping, on the other hand, is stored in the linked item itself, which means that an item can only be in one optional item group. A pistol is always a pistol..

Shop configuration

The basis for the display format described here is the corresponding configuration of the shop, as defined in the following settings: “Shop administration” → “Settings” → “General"→ “Edit items”.

Design control

The display settings for items and sub-items can be found in the shop administration under: “Shop administration” → “Settings” → “General” → “Edit items” There you can adjust various configurations such as “Display type” and “Position of variant display”.

If you want to customise the display of sub-items, you can do this using the corresponding HTML templates:

  • subartikel.tpl.html – This file controls the display of sub-items and is divided into different sections:
  • List view: All sub-items are displayed in a table with their details.
  • Drop-down selection: Variants are displayed in a selection field. After selection, the relevant data is automatically updated.
  • Grouped drop-down (matrix display): Several features (e.g. colour and size) can be selected simultaneously.

Note: In older versions of PepperShop, this file had a different name.

  • artikeldarstellung.tpl.html and artikel.tpl.html – These templates control the general display of the parent article.

In the list view, customers benefit from a compact overview: All sub-articles of a product are displayed simultaneously with their respective details such as price, availability and description.

In the drop-down display, the variants are displayed in a selection field. As soon as a variant is selected, the image, price, stock level and other data are updated automatically. The names of the drop-down fields can be customised in the file localetext.inc.php.

When a sub-item is added to the shopping cart, it appears with the selected properties *(e.g. colour, size) and the correct price in the shopping cart overview.

Administration

Linking items in the shop administration

Items can be combined and managed directly in the item editing mask as parent and sub-items. To do this, go to the shop administration: “Shop administration” → “Assortment” → “Items” → “New”.

In this screen, first enter the parent item with the general information (e.g. name, description, image). After saving, you can add sub-items in the “Variants” tab to define variants such as “Colour”, “Size” or other “Features”. Both the parent and sub-articles can be edited or expanded at any time using the same screen.

Example with two groups

In many cases, there is not just one but two groups of variants for an article – for example, “colour” and “size”. To display these two types of characteristics clearly, the variant with fewer characteristics is defined as a “sub-item group” and the other as a “sub-item”.

A typical example in PepperShop is an item such as “PepperShop Software”, which is offered in different versions:

  • Standard software
  • Basic
  • Professional
  • Custom software
  • Connect

The “Dropdown grouped” display option controls the display in the shop so that two selection fields appear – one for the sub-item group and one for the sub-item. These are logically separated from each other so that the customer first selects a group and then a detail. Only when both fields are selected is a specific sub-item referenced.

Additional functionality can be integrated via optional modules such as “E-Content”. In sub-item management, for example, such content can be assigned.

Article mass mutations

Article mass mutations can be accessed via the main menu “Articles” → “Article mass mutations”. Once parent and sub-articles have been activated in the shop, the standard editing menu for article mass mutations is adjusted accordingly.

When you click on the “Name / Parent / …” button and select a category, you will now find the option to link the parent article number for each sub-article. This can be done quickly for multiple articles using copy+paste or conveniently via the user interface.

Importing parent/sub-articles via the import tool

A major advantage of parent and sub-articles in PepperShop is that this structure can be easily set up via import. The information required for import can be easily mapped in a spreadsheet. Fields such as item number, parent number, price and stock level are filled in accordingly to correctly establish the relationship between parent and sub-items.

A sample table in Excel format is available for preparation and can be downloaded. It serves as a template for preparing your own article data in the correct structure and with the necessary information for import:

Excel (xls): http://www.peppershop.com/peppershop_files/beispielimport_parent_sub.xls

Libre-Office[^1] Calc (ods): http://www.peppershop.com/peppershop_files/beispielimport_parent_sub.ods

CSV document (csv): http://www.peppershop.com/peppershop_files/beispielimport_parent_sub.csv

This import file is saved as a CSV file and imported in the shop administration under Article import/export.

Importing parent/sub-articles via Business Connector/Caller

In the PepperShop shop administration, the “Import/Export” menu contains the “Caller Navigator” item. Here, you use the “set_artikel” import.

Just as described in the previous chapter, you provide a CSV file here (e.g. via OpenOffice Calc or Excel) in which specific columns control the grouping and presentation of parent and sub-articles. Details can be found here

Information on controlling the parent/sub-article system

The parent/sub-article system of the shop is controlled via several control constants and settings fields in the shop database. The following chapters provide more details.

Control constants in the PepperShop configuration file

The configuration file can be found in the configuration editor (“Settings” → “Shop configuration” → “Configuration” → “View and edit control constants for this system” → “Configuration editor”). The following control constants affect the parent/sub-item links in PepperShop:

PARENT_ANSTATT_SUB_IN_SPECIAL_KATEGORIEN (default = true): If, for example, a sub-item is running as a promotion, not only the sub-item but also the parent item should be displayed in the promotions category. This setting affects the function get_all_special_artikel(), which also reads the promotional items, for example.

AUTO_SUB_ARTIKEL_KAT (default = true): If this function is enabled, sub-articles are automatically assigned to the (invisible) category defined under SUB_ARTIKEL_KAT_NAME when imported via the Business Connector (Caller Navigator).

SUB_ARTIKEL_KAT_NAME (default = Subartikel): Name of the category containing the sub-articles. This category is automatically created during category import via the Business Connector (Caller Navigator) if the parent-sub functionality is enabled.

CUT_PARENT_NAME (default = true): If set to true, the article name of the parent article is cut from the article name of the sub-article when the sub-articles are displayed in a list. For example, if the parent article is called “Trousers” and the sub-article is called “Blue trousers”, the sub-article is displayed as “Blue” in the sub-article list (not in the shopping basket!).

SUBARTIKEL_TEXTEINGABEFELDER_VON_PARENT (default = true): If this control constant is set to false, the “Display type” “List” for sub-articles cannot be used and text input fields are no longer set across the parent article but directly for the corresponding sub-article. If this setting is changed back from false to true, the parent articles must be saved once in the shop administration so that the setting is applied.

Control settings in the shop database

In the shop DB table shop_settings_new, there are two relevant settings for parent/sub:

parent_sub_artikel (default = N): This setting is controlled via the web interface: “Shop administration” → “General"→ “Parent and sub-articles”. The values Y and N are available, where Y stands for yes.

show_subartikel_infos_auf_1_stufe (default = Y): If = Y, information about sub-articles of a parent article is already displayed on the first article level when two-level article display is activated. The information includes the sub-article stock level (total of all sub-article stock levels) as well as the minimum article price (lowest price of the sub-article), minimum promotion price / promotion flag and promo flag → ATTENTION: This has a negative impact on the performance of the article list display! The query values can be controlled in the file shop/USER_SQL_COMMANDS.php with the variable $sql_getMultiArtikellight_1_1_1.

Example application of grouped parent/sub-articles for textiles

When selling textiles, there are usually several variants per item, for example different “colours” and “sizes”. These variants are closely linked, as the customer makes a selection in the shop one after the other – for example, first the size and then the colour, or vice versa. The shop must ensure that only combinations that are actually available can be selected.

In PepperShop, this behaviour can be implemented by adjusting the display settings accordingly. Under “Settings” → “General” → “Edit article”, the option “Dropdown grouped + display position within” can be activated. This ensures that the selection fields are displayed separately and that the customer can only select valid variant combinations.

After saving this setting (applies globally), you must specify the translation texts for the titles of the sub-item selection drop-down menus. The file exists for each language: {shop_directory}/shop/language/en/localetext.inc.php. You would need to adjust it as follows, for example:

<?php
$locale_strings['subartikel_gruppe_titel_global'] = 'Grösse';
$locale_strings['subartikel_name_titel_global'] ='Farbe';

When entering sub-articles, certain information must be entered to ensure correct display and function in the shop. This includes a unique “item name”, an “item number”, the “price”, a “stock level” and the “assignment to parent item” via the corresponding field.

We strongly recommend assigning a separate “product image” to each sub-item, especially for variants such as colours. This allows the customer to see the selected colour directly on the image. The shop automatically updates the image displayed as soon as a different colour variant is selected.

When “importing” the sub-item data, please note the following:

  • The “colour” is specified as the “item name”.
  • The “Size” is entered in the “Grouping Parent” field.

The customer is then presented with a structured selection where they can choose the colour and size one after the other – with the selected variant displayed correctly each time.

Further help

Do you have questions or need assistance? Do you have special requirements or desire a custom solution for your system? Our support team is happy to help. Support services are charged based on time and material at CHF 195.- / hour. Here is how to reach us:

Further useful pages

Was this page helpful?

🌶️
🔥
🌶️