fmdd/dialann-website

This package is abandoned and no longer maintained. No replacement package was suggested.

Dialann bundle for website e-commerce.

Installs: 838

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Language:HTML

Type:sylius-plugin

This package has no released version yet, and little information is available.


README

Include lot of commun features needed for Sylius projects for the Dialann company.

Installation

$ composer require fmdd/dialann-website

Add plugin dependencies to your config/bundles.php file:

    ...
    FMDD\DialannWebsitePlugin\FMDDDialannWebsitePlugin::class => ['all' => true],
    FMDD\SyliusCartBlamerPlugin\FMDDSyliusCartBlamerPlugin::class => ['all' => true],
    FMDD\SyliusShopServicePlugin\FMDDSyliusShopServicePlugin::class => ['all' => true],
    FMDD\SyliusMarketingPlugin\FMDDSyliusMarketingPlugin::class => ['all' => true],
    FMDD\SyliusEmailOrderAdminPlugin\FMDDSyliusEmailOrderAdminPlugin::class => ['all' => true],
    FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true],
    BitBag\SyliusElasticsearchPlugin\BitBagSyliusElasticsearchPlugin::class => ['all' => true],
    Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true],
    Knp\Bundle\SnappyBundle\KnpSnappyBundle::class => ['all' => true],
    FOS\CKEditorBundle\FOSCKEditorBundle::class => ['all' => true],
    SitemapPlugin\SitemapPlugin::class => ['all' => true],
    BitBag\SyliusCmsPlugin\BitBagSyliusCmsPlugin::class => ['all' => true],
    Sylius\InvoicingPlugin\SyliusInvoicingPlugin::class => ['all' => true],
    Prometee\PayumStripeCheckoutSessionBundle\PrometeePayumStripeCheckoutSessionBundle::class => ['all' => true],
    Prometee\SyliusPayumStripeCheckoutSessionPlugin\PrometeeSyliusPayumStripeCheckoutSessionPlugin::class => ['all' => true]
    ...

Import the plugin ressource into your config file.

#config/packages/_sylius.yaml
imports:
    ...
    - { resource: "@FMDDDialannWebsitePlugin/Resources/config/config.yml"}

Create a file config/fmdd_dialann_website.yaml and write the content below. Don't forget to fill the parameters.

#config/fmdd_dialann_website.yaml
parameters:
    email.admins: ['email.admins@defined.com']
    email.distributor: ['email.admins@defined.com']
    email.exception: ['email.admins@defined.com']
    email.no_reply: 'no-reply@defined.com'
    website.name: "My name website"
    url.facebook: ""
    url.instagram: ""
    url.twitter: ""
    url.youtube: ""
    url.pinterest: ""
    url.linkedin: ""
    url.datatech.catalog: ""
    url.cdn.product.big: "https://cdn.example.com/#brand#/products/big/"
    url.cdn.product.small: "https://cdn.example.com/#brand#/products/small/"
    url.cdn.product.brand: "https://cdn.example.com/image-marque/#brand#.png"
    url.cdn.taxon.image: "https://cdn.example.com/image-taxon/#path#"
    url.cdn.image_loader: ""
    contact.phone: ""
    contact.address.street: ""
    contact.address.locality: ""
    contact.address.state: ""
    contact.address.pc: ""
    google.recaptcha: ""
    contact.email: ""
    contact.opening_time: ""
    partner.enabled: true
    open.shop: true
    user.shop: true
    user.price: true
    other.shop: true
    other.price: true
    price.ht: true
    price.tva: true
    technical.sheet.url: "https://print_technical/"
    color.main: "#ffffff"
    email.image.header: "assets/custom/header_email.jpg"
    sync.global.website: ''
    sync.global.main_taxon: ''
    sync.global.channel: ''
    sync.global.from_channel: ''
    sync.erp.name: ''
    sync.erp.url: ''
    sync.erp.username: ''
    sync.erp.password: ''
    sync.erp.key: ''
    sync.erp.secret: ''
    sync.website.name: ''
    sync.website.url: ''
    sync.website.username: ''
    sync.website.password: ''
    sync.website.key: ''
    sync.website.secret: ''
    aws.key: ""
    aws.secret: ""
    aws.region: ""
    debug_mode: false

Import the config route file :

#config/routes/sylius_admin.yaml
fmdd_dialann_website_admin:
    resource: "@FMDDDialannWebsitePlugin/Resources/config/admin_routing.yml"
    prefix: /whateveryouwant
#config/routes/sylius_shop.yaml
fmdd_dialann_website_shop:
    resource: "@FMDDDialannWebsitePlugin/Resources/config/routing.yml"

Add the few event block in the respective file :

  • The github banner on the top right corner :
# @SyliusShop/layout.html.twig
<html>
    ...
    <body>
        {{ sonata_block_render_event('fmdd.event.github.become.distributor') }}
        ...
    </body>
</html>
# Include this : 
<body class="pushable">
{% include "@FMDDDialannWebsitePlugin/Miscellaneous/_sideNav.html.twig" %}
<div id="main" class="wrapper home-7">
...
  • Replace the pay button form in @SyliusShop/Order/show.html.twig by :
{{ sonata_block_render_event('fmdd.event.order.show.submit.btn') }}

In the registration form view, add the TypeCustomer widget :

# @ShopBundle/Register/_form.html.twig
...
<div class="form-fild col-md-6 no-margin">
    <div style="display: -webkit-inline-flex">{{ form_label(form.typeCustomer) }} <span class="red">*</span>
        <span class="red margin-left-15">{{ form_errors(form.typeCustomer) }}</span></div>
    {{ form_widget(form.typeCustomer) }}
</div>
...

Change the import into the Customer entity

# App\Entity\Customer\Customer.php
use Sylius\Component\Core\Model\Customer as BaseCustomer;
# by
use FMDD\DialannWebsitePlugin\Entity\Customer as BaseCustomer;

Add an alias in your services.yml

services:
    ...
    app.form.extension.type.customer_registration: 
        class: FMDD\DialannWebsitePlugin\Form\Extension\CustomerRegistrationTypeExtension

Replace some views from the plugin :

$ cp -r vendor/fmdd/dialann-website/tests/Application/templates/bundles/ ./templates/

Add a cron tab to run the sync every day using the command :

$ php bin/console fmdd:sync:background
  • Example with PlatformSH :
#.platform.yaml
crons:
    synchronization:
        spec: '0 0 * * *'
        cmd: |
            if [ "$PLATFORM_BRANCH" = master ]; then
                php bin/console fmdd:sync:background
            fi

You can also add this cron to check if Elastic Search service is not empty of data

crons:
    check_fos_elastica_populate:
        spec: '55 * * * *'
        cmd: 'php bin/console fmdd:CheckFosElasticPopulate'

Please be sure to use the following JS librairies :

MARKETING BUNDLE CONFIG :

{{ sonata_block_render_event('fmdd.event.marketing.confirm_registration') }}
{{ sonata_block_render_event('fmdd.event.marketing.promotion') }}
{{ sonata_block_render_event('fmdd.event.marketing.search') }}

Test

  • Email Distributor/Contact : php bin/console fmdd:email:distributor test@test.com --env=dev