PHP code example of totalwebcreations / craft-b2b-commerce
1. Go to this page and download the library: Download totalwebcreations/craft-b2b-commerce library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
totalwebcreations / craft-b2b-commerce example snippets
use yii\base\Event;
use totalwebcreations\b2bcommerce\events\RegisterEvent;
use totalwebcreations\b2bcommerce\modules\companies\services\Registration;
Event::on(
Registration::class,
Registration::EVENT_BEFORE_REGISTER,
function (RegisterEvent $event) {
if (str_ends_with($event->email, '@blocked.example')) {
$event->isValid = false;
}
}
);