Skip to content
  1. Extras
  2. idimage
  3. Quick start

Quick start

After installing the component, a new menu item appears in the Manager: Packages → ID image.

1. Getting the token

  1. Go to the ID Image account.
  2. Copy the token shown in your account.

Getting the token in ID Image account

2. Entering the token in settings

  1. Open the component page in the Manager.
  2. Go to the Settings tab.
  3. Paste the token you copied into the field.
  4. Save.

Settings

3. Balance check

  1. In System information ensure all checks passed.
  2. Request the current request balance to verify the token is set correctly.

Balance check

Important

Your request balance at idimage.ru must be positive.

4 Product indexing

Follow the instructions for product indexing.

5 Placing the snippet

Place the snippet in the product card template or anywhere else:

modx
[[!idImageSimilar]]
[[!msProducts?
    &resources=`[[+idimage.ids]]`
    &sortby=`FIELD(msProduct.id, [[+idimage.ids]])`
    &tpl=`@FILE chunks/catalog/product.row.tpl`
    &parents=`0`
]]
fenom
{$modx->runSnippet('idImageSimilar', [
    'min_scope' => 65
])}

{var $ids = $modx->getPlaceholder('idimage.ids')}
{if  $ids}
  {$modx->runSnippet('msProducts', [
      'tpl' => '@FILE chunks/catalog/product.row.tpl',
      'resources' => $ids,
      'sortby' => "FIELD(msProduct.id, {$ids})",
      'parents' => 0,
  ])}
{/if}

The page will show products ordered by similarity.

Example similar products block

Important

The idImageSimilar snippet only returns product IDs; it does not control how products are displayed.

Example product display on the site

This is just one possible result:

similar products example