Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shift private static variables from yaml file to classes #828

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@
Name: silvershop-config
After: framework/routes#coreroutes
---

SilverStripe\Security\Member:
login_joins_cart: true

SilverShop\Extension\ProductImageExtension:
thumbnail_width: 140
thumbnail_height: 100
content_image_width: 200
large_image_width: 600

SilverShop\Checkout\OrderProcessor:
bcc_receipt_to_admin: true

SilverStripe\Admin\LeftAndMain:
extra_requirements_css:
- 'silvershop/core: client/dist/css/shopcms.css'
5 changes: 5 additions & 0 deletions src/Cart/ShoppingCartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class ShoppingCartController extends Controller
{
private static $url_segment = 'shoppingcart';

/**
* @config
*/
private static string $disable_security_token = '';

/**
* Whether or not this controller redirects to the cart-page whenever an item was added
*
Expand Down
5 changes: 5 additions & 0 deletions src/Extension/MemberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
*/
class MemberExtension extends DataExtension
{
/**
* @config
*/
private static bool $login_joins_cart = true;

private static $has_many = [
'AddressBook' => Address::class,
];
Expand Down
30 changes: 30 additions & 0 deletions src/Extension/ProductImageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,36 @@ class ProductImageExtension extends DataExtension
*/
protected $owner;

/**
* @config
*/
private static int $thumbnail_width = 140;

/**
* @config
*/
private static int $thumbnail_height = 100;

/**
* @config
*/
private static int $content_image_width = 200;

/**
* @config
*/
private static int $content_image_height = 0;

/**
* @config
*/
private static int $large_image_width = 600;

/**
* @config
*/
private static int $large_image_height = 0;

/**
* @param bool $upscale [optional]
* @return Image
Expand Down
Loading