• Hi!

    Is there a way to add an extra input/data to the hours ?

    Actually, you can add a start and end hours for the day. But I would like to add an extra information.

    For example, I have a store that would be opened between 14:00 and 16:00 only for children and opened between 16:30 to 20:00 for adults.

    Is there a way to modify a template to add this feature ?

    Thanks for your help ??
    Basil

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    Where do you like to show them?

    You can add custom data, but it does require you to be comfortable with code.

    There’s no way to add a new field to hours field itself, but you can create a new custom meta field, and display that below the normally used hours.

    You would include the hours in the search results template by including this code in this section.

    
    $listing_template .= "\t\t\t" . '<% if ( hours ) { %>' . "\r\n";
    $listing_template .= "\t\t\t" . '<p><%= hours %></p>' . "\r\n";
    $listing_template .= "\t\t\t" . '<% } %>' . "\r\n";
    
    $listing_template .= "\t\t\t" . '<% if ( custom_hours ) { %>' . "\r\n";
    $listing_template .= "\t\t\t" . '<p><%= custom_hours %></p>' . "\r\n";
    $listing_template .= "\t\t\t" . '<% } %>' . "\r\n";
    
    Thread Starter basilgass

    (@basilgass)

    Thanks for the reply. It’s ok to add the custom meta field… But my problem is that each hours created should have it’s own new extra field.

    As there isn’t a defined number of hours, I can’t create the necessary meta field… or is there a way to add a field when the user create a new ‘hours’ ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add extra input to hours’ is closed to new replies.