By default opened form field
-
Hi there, Hope you are well. I need help with a section where Sellers can create Pricing Menu by adding categories and items. By default it has a row opened to add an item, Pressing ‘Add Item’ button there will be a new line added for new item. In the current scenario user will fill in item fields and then press “Add Category” to create a Category for items (it is also called a sub menu). Item after the category field will be child of this category. Please visit below links for pictures to understand better.
Current position of section of Section:https://drive.google.com/file/d/1tusN33sxQoFE8Exr7UI4YDaoZOlMqkdl/view?usp=drivesdk
Section should be like this on page load:https://drive.google.com/file/d/1uB6nWC8VHcgHs3a4upimwqLJ41Q4XRV_/view?usp=drivesdk
Code behind this:https://drive.google.com/file/d/1uCh6frfidRDxDOQY_a8hogklz1a7b5uh/view?usp=drivesdk
I want your help with the code to set “Category Title” opened by default on the top of other fields so that user can understand the flow.
-
hello @iconithemes
Thanks for your response on the above. I would like to explain my request again so that you can get it but first i wanna let you know that why I can’t contact Listeo support. Actually I am a freelancer and my client come to me because Listeo support is very expensive and they also don’t reply requests timely.
Now, I want Section should be like this on page load:https://drive.google.com/file/d/1uB6nWC8VHcgHs3a4upimwqLJ41Q4XRV_/view?usp=drivesdk
Because as of now in its default state, user came and started entering to create an item, after he added a category because by default there is no guide on how to proceed and also category is not an open field by default so he added a category after adding the 1st item. then he added items downside as much as he want to add, as you can see in this screenshot
By adding item like that will not count 1st item because it has not any category set. It will start counting from where category is set (It is okay if there is no category set) but in my scenario I need to be a category set for items so I want Category field to be opened by default and should be at top. here is a preview of items added above
Hope, you better understand the issue now and please help me modify/ adjust the code
honestly, I am not much familiar with PHP, would grateful if you provide modified code
problem resolved by adding a table row in pricing.php
added this table row
<tr class="pricing-list-item pricing-submenu" data-number="0">
<td>
<div class="fm-move"><i class="sl sl-icon-cursor-move"></i></div>
<div class="fm-input"><input type="text" name="_menu[0][menu_title]" placeholder="<?php esc_html_e('Box/Goddes braids (Category/ Menu Title)', 'listeo_core'); ?>"></div>
<div class="fm-close"><a class="delete" href="#"><i class="fa fa-remove"></i></a></div>
</td>
</tr>at the position mentioned in this code
<?php else : ?>
<div class="row">
<div class="col-md-12">
<table id="pricing-list-container">
//Added the code given above here
<tr class="pricing-list-item pattern" data-iterator="0">
<td>
<div class="fm-move"><i class="sl sl-icon-cursor-move"></i></div>
<div class="fm-input pricing-cover">
<div class="pricing-cover-wrapper" data-tippy-placement="bottom" title="<?php esc_html('Change Cover', 'listeo_core'); ?>">
<img class="cover-pic" src="<?php echo get_template_directory_uri(); ?>/images/pricing-cover-placeholder.png" alt="" />
<div class="upload-button"></div>
<input class="file-upload" type="file" accept="image/*" name="_menu[0][menu_elements][0][cover]" />
</div>
</div>
<div class="fm-input pricing-name"><input type="text" placeholder="<?php esc_html_e('Small/Medium/Large', 'listeo_core'); ?>" name="_menu[0][menu_elements][0][name]" /></div>
<div class="fm-input pricing-ingredients"><input type="text" placeholder="<?php esc_html_e('Shoulder/Waist Length', 'listeo_core'); ?>" name="_menu[0][menu_elements][0][description]" /></div>
<div class="fm-input pricing-price"><input type="number" step="0.01" name="_menu[0][menu_elements][0][price]" placeholder="<?php esc_html_e('Price', 'listeo_core'); ?>" data-unit="<?php echo esc_attr($currency) ?>" /></div>
<?php if (!get_option('listeo_bookings_disabled')) { ?>
<div class="fm-input pricing-bookable">
<div class="switcher-tip" data-tip-content="<?php esc_html_e('Click to make this item bookable in booking widget', 'listeo_core'); ?>"><input type="checkbox" value="on" class="input-checkbox switch_1" name="_menu[0][menu_elements][0][bookable]" /></div>
</div>
<?php $extra_service_types = get_option('listeo_extra_services_options_type', array());
if (!$extra_service_types) {
$extra_service_types = array();
}
if (count($extra_service_types) < 4) { ?>
<div class="fm-input pricing-bookable-options">
<select name="<?php echo esc_attr($key); ?>[0][menu_elements][0][bookable_options]" id="">
<?php if (!in_array('onetime', $extra_service_types)) { ?><option value="onetime"><?php esc_html_e('One time fee', 'listeo_core'); ?></option><?php } ?>
<?php if (!in_array('byguest', $extra_service_types)) { ?><option value="byguest"><?php esc_html_e('Multiply by guests', 'listeo_core'); ?></option><?php } ?>
<?php if (!in_array('bydays', $extra_service_types)) { ?><option value="bydays"><?php esc_html_e('Multiply by days', 'listeo_core'); ?></option><?php } ?>
<?php if (!in_array('byguestanddays', $extra_service_types)) { ?><option value="byguestanddays"><?php esc_html_e('Multiply by guests & days ', 'listeo_core'); ?></option><?php } ?>
</select>
<div class="checkboxes in-row pricing-quanity-buttons">
<input type="checkbox" value="on" class="input-checkbox" name="_menu[0][menu_elements][0][bookable_quantity]" id="_menu[0][menu_elements][0][bookable_quantity]" />
<label for="_menu[0][menu_elements][0][bookable_quantity]"><?php esc_html_e('Quantity Buttons', 'listeo_core') ?></label>
<input type="number" class="bookable_quantity_max" step="1" name="_menu[0][menu_elements][0][bookable_quantity_max]" placeholder="<?php esc_html_e('Max quantity', 'listeo_core'); ?>" />
</div>
</div>
<?php } ?>
<?php } ?>
<div class="fm-close"><a class="delete" href="#"><i class="fa fa-remove"></i></a></div>
</td>
</tr>
</table>
<a href="#" class="button add-pricing-list-item"><?php esc_html_e('Add Item', 'listeo_core'); ?></a>
<a href="#" class="button add-pricing-submenu"><?php esc_html_e('Add Category', 'listeo_core'); ?></a>
</div>
</div>
<?php endif;
The topic ‘By default opened form field’ is closed to new replies.