Warning: You are browsing the documentation for PrestaShop 1.7, which is outdated.

You might want to read an updated version of this page for the current version, PrestaShop 8. Read the updated version of this page

Learn how to upgrade to the latest version.

ShopChoiceTreeType

The ShopChoiceTreeType is subtype of MaterialChoiceTreeType which is configured to be used for shop association input.

Type options

Option Type Default Description
multiple bool true Whether multiple shops can be selected or not.

Required Javascript components

Component Description
admin-dev/themes/new-theme/js/components/form/choice-tree.js Manages interaction of choice tree

Code example

Add ShopChoiceTreeType to your form.

<?php

use Symfony\Component\Form\AbstractType;
use PrestaShopBundle\Form\Admin\Type\ShopChoiceTreeType;

class SomeType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('shop_association', ShopChoiceTreeType::class);
    }
}

Preview example

ShopChoiceTreeType rendered in form