PHPackages                             madcoders/setono-sylius-terms-plugin - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. madcoders/setono-sylius-terms-plugin

ActiveSylius-plugin[Utility &amp; Helpers](/categories/utility)

madcoders/setono-sylius-terms-plugin
====================================

Sylius terms and conditions plugin

1.1.0(4y ago)02.6kMITPHPPHP ^7.4 || ^8.0

Since Feb 15Pushed 4y agoCompare

[ Source](https://github.com/mad-coders/SyliusTermsPlugin)[ Packagist](https://packagist.org/packages/madcoders/setono-sylius-terms-plugin)[ RSS](/packages/madcoders-setono-sylius-terms-plugin/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (35)Versions (19)Used By (0)

Fork of Setono/SyliusTermsPlugin
================================

[](#fork-of-setonosyliustermsplugin)

This is fork of [Setono/SyliusTermsPlugin](https://github.com/Setono/SyliusTermsPlugin)

Extended functionality

- you can enable/disable each entry
- you can decide where Terms are displayed: checkout, customer registration form, footer (as link)
- position field to sort terms (if more than one used in the same area)
- upgraded development env to Sylius 1.10

There are 2 additional installation steps (comparing to original README):

### Step 7: Override customer registration form

[](#step-7-override-customer-registration-form)

Override the [Sylius Form](https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/ShopBundle/Resources/views/Register/_form.html.twig):

- If you haven't your own `templates/bundles/SyliusShopBundle/Register/_form.html.twig` yet:

    ```
    $ cp vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Register/_form.html.twig \
    templates/bundles/SyliusShopBundle/Register/_form.html.twig
    ```
- If you already have it:

    Add terms field (exactly this conditional way):

    ```
    {# templates/bundles/SyliusShopBundle/Register/_form.html.twig#}
    {% if form.terms is defined %}
        {% form_theme form.terms '@SetonoSyliusTermsPlugin/Shop/Form/termsTheme.html.twig' %}
        {{ form_row(form.terms) }}
    {% endif %}
    ```

    So the final template will look like this:

    ```
    {# templates/bundles/SyliusShopBundle/Register/_form.html.twig#}
    {{ 'sylius.ui.personal_information'|trans }}

        {{ form_row(form.firstName, sylius_test_form_attribute('first-name')) }}
        {{ form_row(form.lastName, sylius_test_form_attribute('last-name')) }}

    {{ form_row(form.email, sylius_test_form_attribute('email')) }}
    {{ form_row(form.phoneNumber, sylius_test_form_attribute('phone-number')) }}
    {{ form_row(form.subscribedToNewsletter, sylius_test_form_attribute('subscribed-to-newsletter')) }}
    {{ 'sylius.ui.account_credentials'|trans }}
    {{ form_row(form.user.plainPassword.first, sylius_test_form_attribute('password-first')) }}
    {{ form_row(form.user.plainPassword.second, sylius_test_form_attribute('password-second')) }}
    {% if form.terms is defined %}
        {% form_theme form.terms '@SetonoSyliusTermsPlugin/Shop/Form/termsTheme.html.twig' %}
        {{ form_row(form.terms) }}
    {% endif %}
    ```

### Step 8: Override footer block

[](#step-8-override-footer-block)

Override the [Sylius Template Block](https://github.com/Sylius/Sylius/blob/master/src/Sylius/Bundle/ShopBundle/Resources/views/Layout/Footer/Grid/_your_store.html.twig):

- If you haven't your own `templates/bundles/SyliusShopBundle/Layout/Footer/Grid/_your_store.html.twig` yet:

    ```
    $ cp vendor/sylius/sylius/src/Sylius/Bundle/ShopBundle/Resources/views/Layout/Footer/Grid/_your_store.html.twig \
    templates/bundles/SyliusShopBundle/Layout/Footer/Grid/_your_store.html.twig
    ```
- If you already have it:

    Add terms field (exactly this conditional way):

    ```
    {# templates/bundles/SyliusShopBundle/Layout/Footer/Grid/_your_store.html.twig #}
    {% set terms = footer_terms_view() %}
    {% if terms is defined and terms is not null %}
        {% for term in terms %}
            {{ footer_term_link(term, sylius.localeCode) }}
        {% endfor %}
    {% endif %}
    ```

    So the final template will look like this:

    ```
    {# templates/bundles/SyliusShopBundle/Layout/Footer/Grid/_your_store.html.twig #}

        {{ 'sylius.ui.your_store'|trans }}

            {{ 'sylius.ui.about'|trans }}
            {% set terms = footer_terms_view() %}
            {% if terms is defined and terms is not null %}
                {% for term in terms %}
                    {{ footer_term_link(term, sylius.localeCode) }}
                {% endfor %}
            {% endif %}
            {{ 'sylius.ui.contact_us'|trans }}

    ```

There's pull request open which greatly summarizes changes: [Setono#48](https://github.com/Setono/SyliusTermsPlugin/pull/48)

\------- ORIGINAL PLUGIN'S README starts here --------

Will add the requirement to check off terms and conditions when the customer checks out

- [Screenshots](#screenshots)
- [Installation](#installation)

Screenshots
-----------

[](#screenshots)

### Shop

[](#shop)

Before the customer can place order, he/she has to check the required terms

[![Screenshot showing shop checkout complete page](docs/images/shop-checkout-complete.png)](docs/images/shop-checkout-complete.png)

### Admin

[](#admin)

Here is a list of terms. Notice the `terms_and_conditions` which is associated with multiple channels.

[![Screenshot showing admin terms index page](docs/images/admin-terms-index.png)](docs/images/admin-terms-index.png)

[![Screenshot showing admin terms update page](docs/images/admin-terms-update.png)](docs/images/admin-terms-update.png)

The `Explanation` field is the text shown on the complete order page. Notice you can use a placeholder (`[link:Link text]`) to tell where the link should be.

[![Screenshot showing admin terms translation update page](docs/images/admin-terms-update-translation.png)](docs/images/admin-terms-update-translation.png)

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

[](#installation)

### Step 1: Download the plugin

[](#step-1-download-the-plugin)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:

```
$ composer require setono/sylius-terms-plugin
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md) of the Composer documentation.

### Step 2: Enable the plugin

[](#step-2-enable-the-plugin)

Then, enable the plugin by adding it to the list of registered plugins/bundles in the `config/bundles.php` file of your project:

```
