PHPackages                             thelia/attribute-type-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thelia/attribute-type-module

ActiveThelia-module

thelia/attribute-type-module
============================

2.0.2(1y ago)01.3k6[1 PRs](https://github.com/thelia-modules/AttributeType/pulls)1LGPL-3.0+PHP

Since May 3Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/thelia-modules/AttributeType)[ Packagist](https://packagist.org/packages/thelia/attribute-type-module)[ RSS](/packages/thelia-attribute-type-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (18)Used By (1)

Attribute Type
==============

[](#attribute-type)

Authors: Thelia , Gilles Bourgeat

- This module allows you to add to your attributes the attributes types.
- Example : Color, Image link to the textures ...
- An attribute can have several types.
- An attribute type can have values or not.
- Values can be unique by language.

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/75715af0d5e9b7a38ff27e4e68674e65518d569363bd4292875f461b7cab6272/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7468656c69612d6d6f64756c65732f417474726962757465547970652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/thelia-modules/AttributeType/?branch=master)[![License](https://camo.githubusercontent.com/be82fb3f41e91b456c1d310a65803d180eaef78b3139db904ececdcbeb242c38/68747470733a2f2f706f7365722e707567782e6f72672f7468656c69612f6174747269627574652d747970652d6d6f64756c652f6c6963656e7365)](https://packagist.org/packages/thelia/attribute-type-module)[![Latest Stable Version](https://camo.githubusercontent.com/f7a8d98f809f97bf85045dd6f3ac16259a0cefc0087cd47a4dc8069340bc0540/68747470733a2f2f706f7365722e707567782e6f72672f7468656c69612f6174747269627574652d747970652d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/thelia/attribute-type-module)

Compatibility
-------------

[](#compatibility)

Thelia &gt;= 2.1

Installation
------------

[](#installation)

### Manually

[](#manually)

- Copy the module into `/local/modules/` directory and be sure that the name of the module is `AttributeType`.
- Activate it in your thelia administration panel

### Composer

[](#composer)

Add it in your main thelia composer.json file

```
composer require thelia/attribute-type-module:~1.3.0

```

Usage
-----

[](#usage)

- Once activated, click on the configure button for add or edit the attributes types.
- For associate an attribute to an attribute type, edit an attribute.

Hooks
-----

[](#hooks)

### backoffice :

[](#backoffice-)

- attribute-type.form-top (in form : create, update, attribute type) (params : attribute\_type\_id)
- attribute-type.form-bottom (in form : create, update, attribute type) (params : attribute\_type\_id)
- attribute-type.configuration-top
- attribute-type.configuration-bottom
- attribute-type.configuration-action (by attribute type) (params : attribute\_type\_id)
- attribute-type.configuration-js

Loop
----

[](#loop)

### attribute\_type

[](#attribute_type)

#### Input arguments

[](#input-arguments)

ArgumentDescription**id**A single or a list of ids.**exclude\_id**A single or a list of ids.**slug**String**attribute\_id**A single or a list of attributes ids.#### Output arguments

[](#output-arguments)

VariableDescriptionIDThe attribute type idSLUGThe attribute type slugTITLEThe attribute type titleDESCRIPTIONThe attribute type descriptionCSS\_CLASSThe attribute type css classPATTERNThe attribute type patternINPUT\_TYPEThe attribute type input typeMINThe attribute type minimum valueMAXThe attribute type maximum valueSTEPThe attribute type step valueIMAGE\_MAX\_WIDTHThe max width for image (in px)IMAGE\_MAX\_HEIGHTThe max height for image (in px)IMAGE\_RATIOThe image ratio requiredIS\_MULTILINGUAL\_ATTRIBUTE\_AV\_VALUEIndicates whether the values are unique for each languageHAS\_ATTRIBUTE\_AV\_VALUEIndicates whether the type attribute has values for each attribute av### attribute\_extend\_attribute\_type

[](#attribute_extend_attribute_type)

Extends the Thelia loop : [Attribute](http://doc.thelia.net/en/documentation/loop/attribute.html)

#### Other input arguments

[](#other-input-arguments)

ArgumentDescription**attribute\_type\_id**A single or a list of attributes type ids.**attribute\_type\_slug**A single or a list of attributes type slugs.#### Other output arguments

[](#other-output-arguments)

- The attributes types associated.
- The variable name is equal to the name of the slug,
- The value is boolean, true for associated, false for unassociated.

#### Example

[](#example)

```
    {loop name="attribute_extend_attribute_type" type="attribute_extend_attribute_type" attribute_type_id="1,2,3"}
        {$TITLE}

        {if $COLOR}
            The attribute has type color
        {/if}

        {if $MY_ATTRIBUTE_TYPE}
            The attribute has type "My attribute type"
        {/if}
    {/loop}
```

### attribute\_availability\_extend\_attribute\_type

[](#attribute_availability_extend_attribute_type)

Extends the Thelia loop : [Attribute availability](http://doc.thelia.net/en/documentation/loop/attribute_availability.html)

ArgumentDescription**attribute\_type\_id**A single or a list of attributes type ids.**attribute\_type\_slug**A single or a list of attributes type slugs.#### Other output arguments

[](#other-output-arguments-1)

- The attributes types associated.
- The variable name is equal to the name of the slug,
- The variable contains the value.

#### Example

[](#example-1)

```
    title : color : my attribute type
    {loop name="attribute_availability_extend_attribute_type" type="attribute_availability_extend_attribute_type" attribute="1"}
        {$TITLE} : {$COLOR} : {$MY_ATTRIBUTE_TYPE}
    {/loop}

    title : color : my attribute type
    {loop name="attribute_availability_extend_attribute_type" type="attribute_availability_extend_attribute_type" attribute_type_slug="color"}
        {$TITLE} : {$COLOR} : {$MY_ATTRIBUTE_TYPE}
    {/loop}
```

Model
-----

[](#model)

### AttributeType::getValue

[](#attributetypegetvalue)

```
    /**
     * Returns a value based on the slug, attribute_av_id and locale
     *
     *
     * $value  = AttributeType::getValue('color', 2);
     *
     *
     * @param string $slug
     * @param int $attributeAvId
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValue($slug, $attributeAvId, $locale = 'en_US')
```

### AttributeType::getValues

[](#attributetypegetvalues)

```
    /**
     * Returns a set of values
     * If the value does not exist, it is replaced by null
     *
     *
     * $values = AttributeType::getValue(['color','texture'], [4,7]);
     *
     *
     *
     *  array(
     *  'color' => [4 => '#00000', 7 => '#FFF000'],
     *  'texture' => [4 => null, 7 => 'lines.jpg']
     * )
     *
     *
     * @param string[] $slugs
     * @param int[] $attributeAvIds
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValues(array $slugs, array $attributeAvIds, $locale = 'en_US')
```

### AttributeType::getFirstValues

[](#attributetypegetfirstvalues)

```
    /**
     * Returns a set of first values
     * If the value does not exist, it is replaced by null
     *
     *
     * $values = AttributeType::getFirstValues(['color','texture', 'other'], [4,7]);
     *
     *
     *
     *  array(
     *  'color' => '#00000',
     *  'texture' => 'lines.jpg',
     *  'other' => null
     * )
     *
     *
     * @param string[] $slugs
     * @param int[] $attributeAvIds
     * @param string $locale
     * @return array
     */
    public static function getFirstValues(array $slugs, array $attributeAvIds, $locale = 'en_US')
```

### AttributeType::getAttributeAv

[](#attributetypegetattributeav)

```
    /**
     * Find AttributeAv by slugs, attributeIds, values, locales
     *
     *
     * $attributeAv = AttributeType::getAttributeAv('color', '1', '#00000');
     *
     *
     * @param null|string|array $slugs
     * @param null|string|array $attributeIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\AttributeAv
     */
    public static function getAttributeAv($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US')
```

### AttributeType::getAttributeAvs

[](#attributetypegetattributeavs)

```
    /**
     * Find AttributeAvs by slug, attributeId, value, locale
     *
     *
     * $attributeAvs = AttributeType::getAttributeAvs('color', '1', '#00000');
     *
     *
     * @param null|string|array $slugs
     * @param null|string|array $attributeIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\AttributeAv
     */
    public static function getAttributeAvs($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US')
```

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance71

Regular maintenance activity

Popularity19

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 86% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~260 days

Recently: every ~560 days

Total

15

Last Release

381d ago

Major Versions

1.3.4 → 2.0.12023-04-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2196919?v=4)[thelia](/maintainers/thelia)[@thelia](https://github.com/thelia)

---

Top Contributors

[![gillesbourgeat](https://avatars.githubusercontent.com/u/7335734?v=4)](https://github.com/gillesbourgeat "gillesbourgeat (43 commits)")[![lopes-vincent](https://avatars.githubusercontent.com/u/6057206?v=4)](https://github.com/lopes-vincent "lopes-vincent (7 commits)")

---

Tags

e-commercemodulephpthelia

### Embed Badge

![Health badge](/badges/thelia-attribute-type-module/health.svg)

```
[![Health](https://phpackages.com/badges/thelia-attribute-type-module/health.svg)](https://phpackages.com/packages/thelia-attribute-type-module)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
