Plentymarkets interface documentation

Category

Contracts

CategoryBranchMarketplaceRepositoryContract

Repository for CategoryBranchMarketplace

Namespace

Plenty\Modules\Category\Contracts

Methods
public findCategoryBranchMarketplace($branchId, $webstoreId, $marketplaceId, $marketplaceSubId = 0.0):Plenty\Modules\Category\Models\CategoryBranchMarketplace
Return type: CategoryBranchMarketplace
Parameters

Name

Type

Description

$branchId

int

$webstoreId

int

$marketplaceId

int

$marketplaceSubId

float

CategoryBranchRepositoryContract

Repository Contract for CategoryBranch

Namespace

Plenty\Modules\Category\Contracts

Methods
public find($id):Plenty\Modules\Category\Models\CategoryBranch
Return type: CategoryBranch
Parameters

Name

Type

Description

$id

int

public get($page = 1, $itemsPerPage = 50, $filters = []):Plenty\Repositories\Contracts\PaginationResponseContract
Return type: PaginationResponseContract

Get category trees

Parameters

Name

Type

Description

$page

int

$itemsPerPage

int

$filters

array

Filters restrict the list of results. Results can be filtered by the following parameters: 'type' - the category type. Available values: item, container, content, blog

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

CategoryPropertyRepositoryContract

Repository Contract for CategoryProperty

Namespace

Plenty\Modules\Category\Contracts

Methods
public create($data):Plenty\Modules\Category\Models\CategoryProperty
Return type: CategoryProperty

Link a category to an Elmar category

Parameters

Name

Type

Description

$data

array

public update($categoryId, $marketId, $plentyId, $data):Plenty\Modules\Category\Models\CategoryProperty
Return type: CategoryProperty

Update a link between a category and an Elmar category

Parameters

Name

Type

Description

$categoryId

int

$marketId

float

$plentyId

int

$data

array

public delete($categoryId, $marketId, $plentyId):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Delete the link between a category and an Elmar category

Parameters

Name

Type

Description

$categoryId

int

$marketId

float

$plentyId

int

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

CategoryRepositoryContract

Repository for categories

Namespace

Plenty\Modules\Category\Contracts

Methods
public get($categoryId, $lang = "de", $webstoreId = null):Plenty\Modules\Category\Models\Category
Return type: Category

Returns one category by id.

Parameters

Name

Type

Description

$categoryId

int

The id of the category.

$lang

string

Optional language of details.

$webstoreId

int

Optional webstore id of details.

public getLinklistTree($type = "all", $lang = "de", $clientId = null, $maxLevel = 6, $customerClassId):array

Returns all linklist categories as tree.

Parameters

Name

Type

Description

$type

string

'all','item','container','content' or 'blog'

$lang

string

Optional language of details.

$clientId

int

The unique ID of the client (store)

$maxLevel

int

The deepest category level to load

$customerClassId

int

The customer class id

public getArrayTree($type = "all", $lang = "de", $clientId = null, $maxLevel = 6, $customerClassId, $filter = null):array
Parameters

Name

Type

Description

$type

string

'all','item','container','content' or 'blog'

$lang

string

Optional language of details.

$clientId

int

The unique ID of the client (store)

$maxLevel

int

The deepest category level to load

$customerClassId

int

The customer class id

$filter

callable

public findCategoryByUrl($level1, $level2 = null, $level3 = null, $level4 = null, $level5 = null, $level6 = null, $webstoreId = null, $lang = null):Plenty\Modules\Category\Models\Category
Return type: Category

Get the category by url.

Parameters

Name

Type

Description

$level1

string

First level of the url.

$level2

string

Second level of the url.

$level3

string

Third level of the url.

$level4

string

Fourth level of the url.

$level5

string

Fifth level of the url.

$level6

string

Sixth level of the url.

$webstoreId

int

Id of current webstore.

$lang

string

Language

public buildCache($type = "all", $lang = "de", $clientId, $customerClassId):void

Rebuild the category tree cache

Parameters

Name

Type

Description

$type

string

'all','item','container','content' or 'blog'

$lang

string

Optional language of details.

$clientId

int

The unique ID of the client (store)

$customerClassId

int

The customer class id

public getLinklistList($type = "all", $lang = "de", $clientId = null, $maxLevel = 6):array

Returns all linklist categories as list.

Parameters

Name

Type

Description

$type

string

'all','item','container','content' or 'blog'

$lang

string

Optional language of details.

$clientId

int

The unique ID of the client (store)

$maxLevel

int

The deepest category level to load

public hasChildren($categoryId, $onlySiteMapped = false, $onlyLinkListed = false):bool

Returns true if category has children.

Parameters

Name

Type

Description

$categoryId

int

The id of the category.

$onlySiteMapped

bool

Determines if the result has only sitemaps or all visible categories.

$onlyLinkListed

bool

Determines if the result has only linklists or all visible categories.

public getChildren($categoryId, $lang = "de"):array

Returns children of the category.

Parameters

Name

Type

Description

$categoryId

int

The id of the category.

$lang

string

Optional language of details.

public getUrl($categoryId, $lang = "de", $onlySitemaps = false, $webstoreId = null):string

Retrieves the url for a category.

Parameters

Name

Type

Description

$categoryId

int

The id of the category.

$lang

string

Optional language of details.

$onlySitemaps

bool

Whether or not to only include categories with 'sitemaps' = 'Y'. Default false.

$webstoreId

bool

webstoreId of details

Return type: PaginatedResult

Search for categories

Parameters

Name

Type

Description

$categoryId

int

The id of the category.

$page

int

The requested page.

$itemsPerPage

int

Number of items per page.

$with

array

The relations to be loaded.

$filters

array

Filters restrict the list of results. Results can be filtered by the following parameters: 'type','lang','parentId', 'plentyId', 'linklist'

public createCategories($data):array

Creates new categories, including CategoryDetails. At least one CategoryDetails object for the default language is required. The data fields 'plentyId','lang' and 'name' are required. Client objects can also be specified to activate visibility for a client.

Parameters

Name

Type

Description

$data

array

The data fields for the new Categories, including the details data fields

public updateCategories($data):array

Update categories, including optional CategoryDetails. The data fields 'plentyId','lang' are required for the CategoryDetails object. Client objects can also be specified to change visibility for a client.

Parameters

Name

Type

Description

$data

array

The data fields for the Categories, including the details and client data fields

public createCategory($data):Plenty\Modules\Category\Models\Category
Return type: Category

Creates a new category

Parameters

Name

Type

Description

$data

array

public delete($categoryId):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Deletes a category. The ID of the category must be specified.

Parameters

Name

Type

Description

$categoryId

int

public deleteCategoryDetails($categoryId, $data):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Delete the category details for the languages specified.

Parameters

Name

Type

Description

$categoryId

int

$data

array

public deleteCategoryClients($categoryId, $data):Plenty\Repositories\Models\DeleteResponse
Return type: DeleteResponse

Deactivate availability for clients

Parameters

Name

Type

Description

$categoryId

int

$data

array

public clearCriteria():void

Resets all Criteria filters by creating a new instance of the builder object.

public applyCriteriaFromFilters():void

Applies criteria classes to the current repository.

public setFilters($filters = []):void

Sets the filter array.

Parameters

Name

Type

Description

$filters

array

public getFilters():void

Returns the filter array.

public getConditions():void

Returns a collection of parsed filters as Condition object

public clearFilters():void

Clears the filter array.

CategoryTemplateRepositoryContract

Repository for category templates

Namespace

Plenty\Modules\Category\Contracts

Methods
public find($params):Plenty\Modules\Category\Models\CategoryTemplate
Return type: CategoryTemplate
Parameters

Name

Type

Description

$params

array

public put($data):Plenty\Modules\Category\Models\CategoryTemplate
Return type: CategoryTemplate
Parameters

Name

Type

Description

$data

array

public delete($data):Plenty\Modules\Category\Models\CategoryTemplate
Return type: CategoryTemplate
Parameters

Name

Type

Description

$data

array

Models

Category

Category

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

id

int

The unique ID of the category

parentCategoryId

int

The ID of the category’s parent category. Value is <strong>null</strong> if category level is 1.

level

int

The category level of this category. This information is used for the sitemap.

type

string

The category type of the category

linklist

string

Flag that indicates if the category will be displayed in the online store’s navigation.

right

string

Flag that indicates who can see this category. <ul><li>all = Category is visible to all visitors of the online store.</li><li>customer = Category and all of its subcategories are visible to visitors of the online store that have logged in only. Visitors that are not logged in are redirected to the login page.</li></ul>

sitemap

string

Flag that indicates if the category will be included in the sitemap.

updatedAt

string

The updated at timestamp of the category.

clients

array

Collection of the clients (stores) that belong to this category

details

array

Collection of the category details that belong to this category

elmarCategories

array

The linked elmar

Methods
public toArray()

Returns this model as an array.

CategoryBranch

Category Branch

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

categoryId

int

The ID of the category

category1Id

int

The ID of the category tree’s 1st level. If 1st value is identical to category ID, category is of this level.

category2Id

int

The ID of the category tree’s 2nd level. If 2nd level value is identical to category ID, category is of this level. If 2nd level value is <strong>null</strong>, category is of a higher level.

category3Id

int

The ID of the category tree’s 3rd level. If 3rd level value is identical to category ID, category is of this level. If 2nd level value is <strong>null</strong>, category is of a higher level.

category4Id

int

The ID of the category tree’s 4th level. If 4th level value is identical to category ID, category is of this level. If 2nd level value is <strong>null</strong>, category is of a higher level.

category5Id

int

The ID of the category tree’s 5th level. If 5th level value is identical to category ID, category is of this level. If 2nd level value is <strong>null</strong>, category is of a higher level.

category6Id

int

The ID of the category tree’s 6th level. If 6th level value is identical to category ID, category is of this level. If 2nd level value is <strong>null</strong>, category is of a higher level.

Methods
public toArray()

Returns this model as an array.

CategoryBranchMarketplace

The CategoryBranchMarketplace model

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

plenty_category_branch_marketplace_branch_id

int

plenty_category_branch_marketplace_webstore_id

int

plenty_category_branch_marketplace_marketplace_id

float

plenty_category_branch_marketplace_marketplace_sub_id

float

plenty_category_branch_marketplace_delimiter

string

plenty_category_branch_marketplace_value1

string

plenty_category_branch_marketplace_value2

string

plenty_category_branch_marketplace_last_update

string

branch

CategoryBranch

Methods
public toArray()

Returns this model as an array.

CategoryClient

The Category Client

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

plentyId

int

The unique plenty ID of the client (store) in which the category is visible. Several IDs can be separated by commas. If a subcategory is linked to a client, its parent categories will be linked to this client as well.

Methods
public toArray()

Returns this model as an array.

CategoryDetails

CategoryDetails

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

categoryId

int

The unique ID of the category these category details belong to

plentyId

int

The unique plenty ID of the client (store) in which the category is visible. If a subcategory is linked to a client, its parent categories will be linked to this client as well.

lang

string

The <a href="https://developers.plentymarkets.com/rest-doc/introduction#languages" target="_blank">language</a> of the category

name

string

The name of the category. The same category name can be used more than once in different categories or on different category levels. However, category names must be unique within the same category or level.

description

string

The category text. The description is inserted into the online store using template variables.

description2

string

The category text 2. The description 2 is inserted into the online store using template variables.

shortDescription

string

The short description of the category. The short description can be inserted into the store’s design using template variables.

metaKeywords

string

HTML meta keywords to tag the category for search engines. More than one keyword can be separated by commas.

metaDescription

string

The meta description of the category. This description is analysed by search engines and displayed in search results. This text should be treated as an advertising text to maximise click-through from search engine result pages. Current recommended limit is 156 characters.

nameUrl

string

The category name to be used for the category’s URL. The same URL name can be used more than once in different categories or on different category levels. However, URL names must be unique within the same category or level. The URL name should not be changed once the category is indexed by search engines. If no URL name is specified, the name will automatically be used as the URL name when the category is created.<br />Important: Name should contain ASCII code only and no special characters. The following character strings may not be used as prefixes to URL names: a-, b-, c-, f-, fa-, p-, t-. These prefixes will be removed automatically. For instance, a-class will be changed to class automatically. However, the URL name aclass can be used for a category named A-class.

metaTitle

string

This will be displayed as the title of a tab in the web browser and as a search result in search engines. If this is left blank, the category name will be used as the title. Current recommended limit is 50 characters. Longer titles will be cut off.

image

string

The ID to the image1 of the category.

image2

string

The ID to the image2 of the category.

imagePath

string

The path to the image1 of the category.

image2Path

string

The path to the image2 of the category.

previewUrl

string

The category’s URL.

position

int

The position of the category within a category level.

itemListView

string

The template the category is linked to for the category overview. The template determines what the category overview will look like for this category. This option is available for categories of the type <strong>Item</strong> only. Possible values: ItemViewCategoriesList, ItemViewCategoriesList2 to ItemViewCategoriesList10.

singleItemView

string

The template the category is linked to for the single item view. The template determines the appearance of the single item design for this category. This option is available for categories of the type <strong>Item</strong> only. Possible values: ItemViewSingleItem, ItemViewSingleItem2 to ItemViewSingleItem5.

pageView

string

fulltext

bool

Flag that indicates if the complete category text, i.e. the complete description, will be searched.<ul><li>Y = Complete text will be searched.</li><li>N = Text will not be searched completely.</li></ul>

metaRobots

string

Values from the meta element Robots are analyzed by Web crawlers. These values tell the crawler what it should do with the page and with the links on the page.<ul><li>all = Include this category in the search engine index and follow the links on the page.</li><li>index = Include in the search engine index.</li><li>nofollow = Do not follow the links on the page.</li><li>noindex = Do not include in the search engine index.</li><li>nofollow, noindex = Do not follow the links and do not include the category in the search engine index.</li></ul>

canonicalLink

string

The URL of any category that contains the same content. This will avoid duplicate content.

updatedAt

string

The time the category details were last updated

updatedBy

string

The user who last updated the category details

category

Category

The category these category details are associated with.

Methods
public toArray()

Returns this model as an array.

CategoryItemCount

CategoryItemCount

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

categoryId

int

The unique ID of the category

webstoreId

int

The ID of the client (store)

count

int

The count of items

createdAt

string

The date that the category item count was created.

updatedAt

string

The date that the category item count was updated last.

variationCount

int

The count of variations

customerClassId

int

The ID of the customer class

Methods
public toArray()

Returns this model as an array.

CategoryProperty

The Category Property

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

categoryId

int

The unique ID of the category

marketId

float

The unique ID of the referrer

plentyId

int

The unique plenty ID of the client (store)

value

string

The category of the referrer

Methods
public toArray()

Returns this model as an array.

CategoryTemplate

Category Template

Namespace

Plenty\Modules\Category\Models

Properties
Name Type Description

categoryId

int

The unique ID of the category

plentyId

int

The unique plenty ID of the client (store)

lang

string

The language of the template

content

string

The content of the template

Methods
public toArray()

Returns this model as an array.