Skip to content

Instantly share code, notes, and snippets.


Roman Schmid bummzack

View GitHub Profile
View Dockerfile
FROM brettt89/silverstripe-web:7.4-apache
RUN apt-get update && apt-get install -y \
libzip-dev zip unzip git nano
# Install additional extensions
RUN install-php-extensions imagick xdebug
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
View FluentQueryPlugin.php
namespace MyProject\GraphQL;
use SilverStripe\GraphQL\Schema\Field\ModelQuery;
use SilverStripe\GraphQL\Schema\Interfaces\ModelQueryPlugin;
use SilverStripe\GraphQL\Schema\Interfaces\SchemaUpdater;
use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\GraphQL\Schema\Type\Enum;
bummzack / Shop_Checkout_Config.php
Last active Sep 18, 2019
Stripe Payments with Stripe Checkout (JS) and SilverStripe 4 + SilverShop
View Shop_Checkout_Config.php
namespace Bummzack\Shop\Checkout;
use SilverShop\Checkout\CheckoutComponentConfig;
use SilverShop\Checkout\Component\Notes;
use SilverShop\Checkout\Component\Terms;
use SilverShop\Model\Order;
class Config extends CheckoutComponentConfig
bummzack / Markdown.php
Created Nov 6, 2018
Markdown textfield
View Markdown.php
namespace App\ORM;
use Exception;
use Psr\Container\NotFoundExceptionInterface;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\ORM\FieldType\DBVarchar;
class Markdown extends DBVarchar
bummzack / FluentCascadeDeleteExtension.php
Last active Oct 4, 2018
Properly remove records from localized table once deleted.
View FluentCascadeDeleteExtension.php
namespace Bummzack\Extensions;
use SilverStripe\Core\ClassInfo;
use SilverStripe\ORM\DataExtension;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Queries\SQLDelete;
use SilverStripe\Versioned\Versioned;
bummzack /
Last active Mar 29, 2018
Fix build issues when creating release builds with corber (cordova)

Memory issues

When building a large app, the default memory of the gradle engine is potentially too low (it's at 2GB per default). The memory can be increased via the build-extras.gradle file (also see:

The problem with this approach is, that the build-extras.gradle resides in the platforms/android directory and will be deleted if you choose to remove/reinstall the platform.

To solve that, create a build hook that copies the file from your project root.

bummzack / CheckoutStep_CustomPaymentMethod.php
Last active Mar 27, 2018
Conditional payment method in SilverShop
View CheckoutStep_CustomPaymentMethod.php
use SilverStripe\Omnipay\GatewayInfo;
class CheckoutStep_CustomPaymentMethod extends CheckoutStep_PaymentMethod
public static function get_supported_gateways(Order $order = null)
bummzack / FluentFileFilteredExtension.php
Created Mar 8, 2018
Filtered files in fluent (SS3)
View FluentFileFilteredExtension.php
* Allow filtering files per locale
class FluentFileFilteredExtension extends FluentFilteredExtension
public function canViewInLocale($locale = null)
if ($this->isFolder()) {
bummzack / CustomBillingAddressComponent.php
Created Dec 31, 2017
SilverShop: Optional Billing Address in Single-Page-Checkout
View CustomBillingAddressComponent.php
* Custom billing address component that makes the billing address optional by default.
* When toggling the `SeparateBillingAddress` checkbox, the address becomes mandatory.
class CustomBillingAddressComponent extends BillingAddressCheckoutComponent
* No required fields, since this is optional
bummzack / CheckoutControllerExtension.php
Created Oct 25, 2017
SilverShop checkout address validation
View CheckoutControllerExtension.php
* Apply this extension to the checkout page controller, eg:
* ```
* CheckoutPage_Controller:
* extensions:
* - CheckoutControllerExtension
* ```