'; } public static function tag() { return 'div'; } public static function tagOptions() { return []; } public static function tagControlPath() { return false; } public static function name() { return 'Product Card'; } public static function className() { return 'fcbd-product-card-element'; } public static function category() { return 'fluentcart'; } public static function badge() { return ['label' => 'FC', 'backgroundColor' => '#3157d5', 'textColor' => '#fff']; } public static function slug() { return __CLASS__; } public static function template() { return file_get_contents(__DIR__ . '/html.twig'); } public static function defaultCss() { return file_get_contents(__DIR__ . '/default.css'); } public static function cssTemplate() { return file_get_contents(__DIR__ . '/css.twig'); } public static function defaultChildren() { return false; } public static function dependencies() { return \FluentCartBreakdance\Compatibility\AssetManager::singleProductAtomDependencies(); } public static function settingsControls() { return []; } public static function settings() { return ['proOnly' => false]; } public static function availableIn() { return ['oxygen', 'breakdance']; } public static function propertyPathsToSsrElementWhenValueChanges() { return ['content.product', 'content.card']; } public static function defaultProperties() { return ['content' => [ 'product' => ['source' => 'current', 'product_id' => ''], 'card' => ['price_format' => 'starts_from', 'card_width' => 320, 'render_as_anchor' => false], ]]; } public static function contentControls() { return [ c('product', __('Product', 'sparkcore-commerce'), [ c('source', __('Source', 'sparkcore-commerce'), [], ['type' => 'dropdown', 'layout' => 'inline', 'items' => [ ['value' => 'current', 'text' => __('Current product', 'sparkcore-commerce')], ['value' => 'manual', 'text' => __('Manual product', 'sparkcore-commerce')], ]], false, false, []), c('product_id', __('Product', 'sparkcore-commerce'), [], [ 'type' => 'post_chooser', 'layout' => 'vertical', 'postChooserOptions' => ['multiple' => false, 'showThumbnails' => true, 'postType' => 'fluent-products'], 'condition' => [[[ 'path' => 'content.product.source', 'operand' => 'equals', 'value' => 'manual', ]]], ], false, false, []), ], ['type' => 'section', 'layout' => 'vertical'], false, false, []), c('card', __('Card', 'sparkcore-commerce'), [ c('price_format', __('Price format', 'sparkcore-commerce'), [], ['type' => 'dropdown', 'layout' => 'inline', 'items' => [ ['value' => 'starts_from', 'text' => __('Starts from', 'sparkcore-commerce')], ['value' => 'range', 'text' => __('Price range', 'sparkcore-commerce')], ]], false, false, []), c('card_width', __('Native card width', 'sparkcore-commerce'), [], ['type' => 'number', 'layout' => 'inline'], false, false, []), c('render_as_anchor', __('Whole card is linked', 'sparkcore-commerce'), [], ['type' => 'toggle', 'layout' => 'inline'], false, false, []), ], ['type' => 'section', 'layout' => 'vertical'], false, false, []), ]; } public static function designControls() { return [controlSection('card', __('Card frame', 'sparkcore-commerce'), [ control('max_width', __('Maximum width', 'sparkcore-commerce'), ['type' => 'unit', 'layout' => 'inline'], true), control('background', __('Background', 'sparkcore-commerce'), ['type' => 'color', 'layout' => 'inline']), control('radius', __('Radius', 'sparkcore-commerce'), ['type' => 'unit', 'layout' => 'inline']), control('shadow', __('Shadow', 'sparkcore-commerce'), ['type' => 'shadow', 'layout' => 'vertical']), ])]; } }