Template

Providers

TemplateServiceProvider

Service provider for template plugins

Namespace

Plenty\Modules\Webshop\Template\Providers

Methods

public overrideTemplate(string $original, string $override):void

Override a twig template. The new template will be used when the overridden template is going to be rendered.

Parameters
string $original
string $override
public addTemplateAlias(string $original, string $alias):void

Add an alias for a template. Rendering the template will also check for overrides of the alias template.

Parameters
string $original
string $alias

Consent

Contracts

ConsentRepositoryContract

Repository to register consents and check for users response.

Namespace

Plenty\Modules\Webshop\Consent\Contracts

Methods

public registerConsentGroup(string $key, string $label, array $options = []):void

Register a new group of consents.

Parameters
string $key Unique identifier of the group
string $label Displayed label of the group
array $options Additional options of the group. Available options are: - necessary:boolean True if the group is necessary and could not be declined - description:string Description of the group. - position:number The position of the group
public registerConsent(string $key, string $label, array $options = []):void

Register a new consent.

Parameters
string $key Unique identifier of the consent.
string $label Displayed label of the consent.
array $options Additional options of the consent. Available options are: - necessary:boolean True of the consent is necessary and could not be declined - description:string Description of the consent - provider:string The provider of the cookie - lifespan:string Lifespan of the cookie - policyUrl:string URL to external privacy policy - group:string Identifier of an consent group - position:number The position of the consent in the group - isOptOut:boolean Select the consent by default. The user needs to decline the consent explicitly. - cookieNames:array Names of cookies which will be set. These cookies will not be blocked after the user confirmed the consent.
public getConsentGroups():Collection

Get all consent groups including all consents.

public hasResponse():bool

Check if the user has already responded the consents.

public setResponse(string $key, bool $isConsented = false):void

Set the response for a consent or a group of consents.

Parameters
string $key The key of the consent group and the consent, e.g. "group.consent" Use "*" as consent key to check if all entries of a group has a response, e.g. "group.*"
bool $isConsented True if the user has accepted the consent or the group of consents
public isConsented(string $key):bool

Check if the user has consented.

Parameters
string $key The key of the consent group and the consent, e.g. "group.consent" Use "*" as consent key to check if all entries of a group has a response, e.g. "group.*"

Seo

Contracts

RobotsRepositoryContract

Repository for robots.txt

Namespace

Plenty\Modules\Webshop\Seo\Contracts

Methods

public findByWebstoreId(int $webstoreId):Robots
Parameters
int $webstoreId
public updateByWebstoreId(int $webstoreId, string $data):Robots
Parameters
int $webstoreId
string $data

SitemapConfigurationRepositoryContract

Repository for sitemap configuration

Namespace

Plenty\Modules\Webshop\Seo\Contracts

Methods

public findByWebstoreId(int $webstoreId):SitemapConfiguration
Parameters
int $webstoreId
public updateByWebstoreId(int $webstoreId, array $data = []):SitemapConfiguration
Parameters
int $webstoreId
array $data

Models

Robots

The robots model

Namespace

Plenty\Modules\Webshop\Seo\Models

Properties

Type Name Description
string value

Methods

public toArray()

Returns this model as an array.

SitemapConfiguration

The sitemap configuration model

Namespace

Plenty\Modules\Webshop\Seo\Models

Properties

Type Name Description
int contentCategory
int itemCategory
int item
int blog

Methods

public toArray()

Returns this model as an array.