'; }
public static function tag() { return 'div'; }
public static function tagOptions() { return []; }
public static function tagControlPath() { return false; }
public static function name() { return 'Product Part'; }
public static function className() { return 'fcbd-product-part-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.part'];
}
public static function defaultProperties()
{
return ['content' => [
'product' => ['source' => 'current', 'product_id' => ''],
'part' => ['part' => 'price', 'show_label' => true],
]];
}
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('part', __('Product part', 'sparkcore-commerce'), [
c('part', __('Part', 'sparkcore-commerce'), [], ['type' => 'dropdown', 'layout' => 'inline', 'items' => [
['value' => 'title', 'text' => __('Title', 'sparkcore-commerce')],
['value' => 'price', 'text' => __('Price range / summary', 'sparkcore-commerce')],
['value' => 'selected_price', 'text' => __('Selected variation price', 'sparkcore-commerce')],
['value' => 'stock', 'text' => __('Stock availability', 'sparkcore-commerce')],
['value' => 'sku', 'text' => __('SKU', 'sparkcore-commerce')],
['value' => 'excerpt', 'text' => __('Excerpt', 'sparkcore-commerce')],
['value' => 'gallery', 'text' => __('Gallery', 'sparkcore-commerce')],
['value' => 'buy_section', 'text' => __('Variations and buy section', 'sparkcore-commerce')],
]], false, false, []),
c('show_label', __('Show SKU label', 'sparkcore-commerce'), [], ['type' => 'toggle', 'layout' => 'inline', 'condition' => [[[
'path' => 'content.part.part', 'operand' => 'equals', 'value' => 'sku',
]]]], false, false, []),
], ['type' => 'section', 'layout' => 'vertical'], false, false, []),
];
}
public static function designControls()
{
return [controlSection('part', __('Part', 'sparkcore-commerce'), [
getPresetSection('EssentialElements\\typography', __('Typography', 'sparkcore-commerce'), 'typography', ['type' => 'popout']),
control('color', __('Text color', 'sparkcore-commerce'), ['type' => 'color', 'layout' => 'inline']),
control('max_width', __('Maximum width', 'sparkcore-commerce'), ['type' => 'unit', 'layout' => 'inline'], true),
])];
}
}