'simple', 'display_product_description' => 0, ]; } /** * List of keys of the default fields we want to display on the builder. * * @since 2.0.0 * @return array */ public function default_fields() { return [ // 'id', 'name', ]; } /** * If you want to force a particular attribute to a value, declare it here. * * @since 2.0.0 * @return array */ public function force_attributes() { return [ 'order_bump_template' => 'simple', ]; } /** * Returns the list of available pricing table templates. * * @since 2.0.0 * @return array */ public function get_templates() { $available_templates = Field_Templates_Manager::get_instance()->get_templates_as_options('order_bump'); return $available_templates; } /** * Returns the list of additional fields specific to this type. * * @since 2.0.0 * @return array */ public function get_fields() { $editor_fields = [ 'product' => [ 'type' => 'model', 'title' => __('Product', 'wp-ultimo'), 'placeholder' => __('e.g. Premium', 'wp-ultimo'), 'desc' => __('Select the product that will be presented to the customer as an add-on option.', 'wp-ultimo'), 'tooltip' => '', 'order' => 12, 'html_attr' => [ 'data-model' => 'product', 'data-value-field' => 'id', 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-max-items' => 1, ], ], 'display_product_description' => [ 'order' => 13, 'type' => 'toggle', 'title' => __('Display Product Description', 'wp-ultimo'), 'desc' => __('Toggle to display the product description as well, if one is available.', 'wp-ultimo'), 'value' => 0, ], 'display_product_image' => [ 'order' => 14, 'type' => 'toggle', 'title' => __('Display Product Image', 'wp-ultimo'), 'desc' => __('Toggle to display the product image as well, if one is available.', 'wp-ultimo'), 'value' => 1, ], ]; // $editor_fields['order_bump_template'] = array( // 'type' => 'group', // 'desc' => Field_Templates_Manager::get_instance()->render_preview_block('order_bump'), // 'order' => 98, // 'fields' => array( // 'order_bump_template' => array( // 'type' => 'select', // 'title' => __('Layout', 'wp-ultimo'), // 'placeholder' => __('Select your Layout', 'wp-ultimo'), // 'options' => array($this, 'get_templates'), // 'wrapper_classes' => 'wu-flex-grow', // 'html_attr' => array( // 'v-model' => 'order_bump_template', // ), // ), // ), // ); // @todo: re-add developer notes. // $editor_fields['_dev_note_develop_your_own_template_order_bump'] = array( // 'type' => 'note', // 'order' => 99, // 'wrapper_classes' => 'sm:wu-p-0 sm:wu-block', // 'classes' => '', // 'desc' => sprintf('