PHP code example of themicly / shopcrafty

1. Go to this page and download the library: Download themicly/shopcrafty 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/ */

    

themicly / shopcrafty example snippets


app(\Themicly\Shopcrafty\Core\Navigation\NavigationRegistry::class)
    ->register('main', [
        'label' => 'Reviews',
        'icon' => 'sparkles',
        'route' => 'admin.reviews.index',
        'gate' => 'manage-content',
    ], group: 'Commerce');

app(\Themicly\Shopcrafty\Core\Navigation\NavigationRegistry::class)
    ->register('index:products', [
        'label' => 'Import reviews',
        'route' => 'admin.reviews.import',
    ]);

$addons = app(\Themicly\Shopcrafty\Core\Module\AddonRegistry::class);
$addons->register('reviews', ['name' => 'Reviews']);
$addons->registerSettingsSchema('reviews', [
    'label' => 'Reviews settings',
    'fields' => ['catalog.reviews_enabled'],
]);
$addons->registerStorefrontFeature('product', 'reviews', [
    'label' => 'Reviews',
    'route' => 'storefront.product',
]);
bash
php artisan shopcrafty:demo --list
php artisan shopcrafty:demo default