Installatie Drupal Commerce 2.x - Casus begin 2017: verschil tussen versies
Regel 171: | Regel 171: | ||
* http://docs.drupalcommerce.org/v2/product/index.html - Products, attributes, purchasable entities | * http://docs.drupalcommerce.org/v2/product/index.html - Products, attributes, purchasable entities | ||
* http://docs.drupalcommerce.org/v2/product/product-attributes.html | * http://docs.drupalcommerce.org/v2/product/product-attributes.html | ||
+ | |||
+ | ''' Plugin not found-error ''' | ||
+ | |||
+ | * https://www.drupal.org/node/2667996 - Plugin does not exist error | ||
+ | * https://www.drupal.org/node/2800343 - The "entity_type:commerce_product_type" plugin does not exist |
Versie van 1 mrt 2017 16:14
Zie ook Composer & Drupal Console.
Er is geen ontkomen aan: Drupal Commerce kun je alleen via Composer installeren [1], [2]. Daarmee wordt het terminal-commando composer bedoeld, niet de Drupal-module. Je kunt Drupal Commerce 2.x dus waarschijnlijk alleen installeren als je terminal-toegang hebt.
Requirements
Zie de casus hieronder voor details. Deze lijst is niet compleet. Ook is er niet aangegeven welke dingen je expliciet zelf moet regelen.
Drupal-modules
- Zie hieronder + [3]
- Zie de casus hieronder voor meer afhankelijkheden.
PHP-libraries - Algemeen
php-bcmath
Deze module heb je al bij de installatie nodig, maar ook later tijdens aanmaak van producten. Deze installatie speelde zich af op een redelijk frisse LAMP-server. Oorspronkelijk probeerde ik php 7.1 te gebruiken, maar toen die moeilijk deed, ben ik overgestapt op php 7.0, althans dat dacht ik;
Oorspronkelijke installatie: sudo apt-get install php-bcmath
. Dat bleek echter de php 7.1-versie te installatie. De php 7.0-versie geïnstalleerd middels sudo apt-get install php7.0-bcmath
PHP-libraries - Specifiek
Drupal Console
Drupal Commerce wordt aangeraden.
Casus - feb. 2017
Installatie Drupal Commerce
- Basissite geïnstalleerd mbv. eigen script
- Composer geïnstalleerd middels
sudo apt-get install composer
- Vanuit de root van die installatie:
composer config repositories.drupal composer https://packages.drupal.org/8
- Geen foutmeldingen composer require "drupal/commerce 2.x-dev"
gaf foutmelding:
Problem 1 - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. - easyrdf/easyrdf 0.9.1 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system. - Installation request for easyrdf/easyrdf == 0.9.1.0 -> satisfiable by easyrdf/easyrdf[0.9.1].
sudo apt-get install php-mbstring
composer require "drupal/commerce 2.x-dev"
. Gelukt zonder foutmelding, met veel outputdrupal module:install commerce_product commerce_checkout commerce_cart commerce_tax
geeft foutmelding: Commando drupal is niet bekend- Drupal Console Geïnstalleerd
drupal module:install commerce_product commerce_checkout commerce_cart commerce_tax
- Opnieuw foutmelding: Je moet Drupal Console ook locaal installeren per instantie:composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
composer update drupal/console --with-dependencies
: Wat onduidelijke waarschuwingen over whitelisting, maar verder okdrupal module:install commerce_product commerce_checkout commerce_cart commerce_tax
- gelukt. Output:
One or more modules "commerce_tax" are not available, running download process to get those modules Getting releases for module "commerce_tax" [ERROR] There aren't any releases for module "commerce_tax" [ERROR] Invalid module name: commerce_tax Installing module(s) "commerce_product, commerce_checkout, commerce_cart, commerce, address, entity, inline_entity_form, commerce_price, commerce_store, commerce_order, entity_reference_revisions, profile, state_machine" [OK] The following module(s) were installed successfully: "commerce_product, commerce_checkout, commerce_cart, commerce, address, entity, inline_entity_form, commerce_price, commerce_store, commerce_order, entity_reference_revisions, profile, state_machine" // cache:rebuild Rebuilding cache(s), wait a moment please. [OK] Done clearing cache(s).
Updaten
Updaten van Drupal Commerce gaat via:
composer update drupal/commerce --with-dependencies
Updaten van de site-als-geheel via Drupal Console (ná updaten Drupal Commerce!):
drupal update:debug drupal update:execute
Installatie additionele modules
Dat gaat op de gebruikelijke manier, lijkt me. Alleen officiele Drupal Commerce modules gaan via Composer. Tot op dit moment nog geen additionele modules geïnstalleerd.
Configuratie
Valuta
- Eerst valuta, dan stores
- Alleen euro
Stores
Je moet eerst een store configureren voordat je met producten aan de slag kunt
Product attributes
Product attributes heeft betrekking op variaties zoals bv. kleur of maat. Dat speelt hier niet.
Product type (L1)
Net als in DC 1.x, heb je onderscheid tussen product types (=L1) en displays (=L2). De standaard L1-klasse is nogal kaal. Extra velden moet je zelf defineren.
Productafbeeldingen
- Naam:
l1_image
- Aantal: Onbeperkt.
Products » Add product
Foutmelding:
RuntimeException: The bcmath extension is required by NumberFormatter. in CommerceGuys\Intl\Formatter\NumberFormatter->__construct() (line 113 of vendor/commerceguys/intl/src/Formatter/NumberFormatter.php).
CKEditor uitzetten
Administration » Configuration » Content authoring » Text format & Editors
Gelukkig: Er worden nu ook geen HTML-tags meer ongevraagd toegevoegd!
Full HTML als standaard instellen (voor admin)
Zelfde link als hierboven: De volgorde aanpassen van de formats.
'Powered by Drupal'-block verwijderen
Gewoon onder Strucure.
Plugin not found-error bij uploaden afbeelding
Foutmelding:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)
Bronnen
- http://docs.drupalcommerce.org/v2/getting-started/install.html » Dit zijn de officiële installatie-instructies
- https://www.drupal.org/node/2351795 - Drupal Commerce 2.x Advanced Installation Instructions
- https://www.drupal.org/node/2405811 - Composer Manager for Drupal 8 » Bijzaak
- https://www.youtube.com/watch?v=XOy0sR9NPxM - Commerce 2.x Download and Install on Drupal 8, Part 1 of 2 (june 2016)
- https://www.youtube.com/watch?v=CrJrjgOuvSk - Commerce 2.x Download and Install on Drupal 8, Part 2 of 2 (june 2016)
- https://pantheon.io/drupal-8/introduction-drush-and-drupal-console
Configuratie
- http://docs.drupalcommerce.org/v2/currency.html
- https://www.drupal.org/node/2816739 - Unable to create New products, (Unexpected Error)
- http://ckeditor.com/slides/ckeditor-in-drupal-8
- http://docs.drupalcommerce.org/v2/product/index.html - Products, attributes, purchasable entities
- http://docs.drupalcommerce.org/v2/product/product-attributes.html
Plugin not found-error
- https://www.drupal.org/node/2667996 - Plugin does not exist error
- https://www.drupal.org/node/2800343 - The "entity_type:commerce_product_type" plugin does not exist