implode(',', array_keys(wu_get_plans_as_options())), 'pricing_table_template' => 'list', 'force_different_durations' => false, 'hide_pricing_table_when_pre_selected' => false, ); } /** * 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 array( // '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 array( 'id' => 'pricing_table', 'name' => __('Plan Selection', 'wp-ultimo'), 'required' => true, ); } /** * Returns the list of available pricing table templates. * * @since 2.0.0 * @return array */ public function get_pricing_table_templates() { $available_templates = Field_Templates_Manager::get_instance()->get_templates_as_options('pricing_table'); 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 = array(); $editor_fields['pricing_table_products'] = array( 'type' => 'model', 'title' => __('Products', 'wp-ultimo'), 'placeholder' => __('e.g. Premium', 'wp-ultimo'), 'desc' => __('Be sure to add the products in the order you want them to show up.', 'wp-ultimo'), 'tooltip' => '', 'order' => 20, 'html_attr' => array( 'data-model' => 'product', 'data-value-field' => 'id', 'data-label-field' => 'name', 'data-search-field' => 'name', 'data-include' => implode(',', array_keys(wu_get_plans_as_options())), 'data-max-items' => 999, ), ); $editor_fields['force_different_durations'] = array( 'type' => 'toggle', 'title' => __('Force Different Durations', 'wp-ultimo'), 'desc' => __('Check this option to force the display of plans with different recurring durations.', 'wp-ultimo'), 'tooltip' => '', 'value' => 0, 'order' => 22, 'html_attr' => array( 'v-model' => 'force_different_durations', ), ); $editor_fields['hide_pricing_table_when_pre_selected'] = array( 'type' => 'toggle', 'title' => __('Hide when Pre-Selected', 'wp-ultimo'), 'desc' => __('Prevent customers from seeing this field when a plan was already selected via the URL.', 'wp-ultimo'), 'tooltip' => __('If the pricing table field is the only field in the current step, the step will be skipped.', 'wp-ultimo'), 'value' => 0, 'order' => 24, 'html_attr' => array( 'v-model' => 'hide_pricing_table_when_pre_selected', ), ); $editor_fields['pricing_table_template'] = array( 'type' => 'group', 'desc' => Field_Templates_Manager::get_instance()->render_preview_block('pricing_table'), 'order' => 26, 'fields' => array( 'pricing_table_template' => array( 'type' => 'select', 'title' => __('Pricing Table Template', 'wp-ultimo'), 'placeholder' => __('Select your Template', 'wp-ultimo'), 'options' => array($this, 'get_pricing_table_templates'), 'wrapper_classes' => 'wu-flex-grow', 'html_attr' => array( 'v-model' => 'pricing_table_template', ), ), ), ); // @todo: re-add developer notes. // $editor_fields['_dev_note_develop_your_own_template_2'] = array( // 'type' => 'note', // 'order' => 99, // 'wrapper_classes' => 'sm:wu-p-0 sm:wu-block', // 'classes' => '', // 'desc' => sprintf('