PHP code example of dynamic / silverstripe-shopify

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

    

dynamic / silverstripe-shopify example snippets


public function updateCartOptions(&$config)
{
    $config['cart'] = [
        'popup' => 1,
    ];
}

public function updateButtonOptions(&$buttonOptions)
{
    $buttonOptions['product'] = [
        'iframe' => true,
        'contents' => [
            'title' => true,
            'variantTitle' => false,
            'price' => true,
            'description' => true,
            'quantity' => false,
            'img' => true,
        ],
        'width' => '100%',
        'styles' => [
            'button' => [
                'color' => '#ffffff',
                'background-color' => '#279989',
                ':hover' => [
                    'color' => '#ffffff',
                    'background-color' => '#C5E86C',
                ],
            ],
        ]
    ];
}