Okay
  Public Ticket #1351198
edit values in drop down
Closed

Comments

  •  2
    chefcove started the conversation

    hi,

    Currently, in submit recipe -  the selection for prepare time / cook time / serving drop down menu shows selection from 1,2,3,4 ....  X amount. 

    How do i change the respective selections to be eg. 

    Prepare time -> 15 , 30, 45, 60, 90, 120

    Same for cook time. 

    Servings --> 5, 10, 15, 20 etc.

    thanks

  •  788
    Theme replied

    Hi,

    Are you referring to the frontend or the backend?

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Back end, where one is submit a new receipt

    thanks!

  •  788
    Theme replied

    Hi,

    You would have to copy includes/theme_meta_boxes.php to your child theme (same folder structure), edit the file and change the step part (for example for cooking time) from:

    $this->recipe_custom_meta_fields[] = array( // Post ID select box
                    'label'    => __('Cooking time (in minutes)', 'socialchef'), //
                    'desc'    => '', // description
                    'id'    => 'recipe_cooking_time', // field id and name
                    'type'    => 'slider',
                    'min'    => '1',
                    'max'    => '360',
                    'step'    => '1'
                );

    to

    $this->recipe_custom_meta_fields[] = array( // Post ID select box
                    'label'    => __('Cooking time (in minutes)', 'socialchef'), //
                    'desc'    => '', // description
                    'id'    => 'recipe_cooking_time', // field id and name
                    'type'    => 'slider',
                    'min'    => '1',
                    'max'    => '360',
                    'step'    => '15'
                );

    You would do the same for the other fields you want to change.

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi sorry, I copied the code but could not observe the change.

    Could you advice on the frontend as well.

    thanks

  •   chefcove replied privately
  •  788
    Theme replied

    Hi,

    The instructions I gave you are for the backend as that is what you requested.

    For the frontend editor, you would have to copy includes/plugins/frontend-submit/frontend-submit.php (same folder structure), edit the file and change the code on line 1088

    Right now it's 

    $cook_time_str = ":" . __('Select cook time (minutes)', 'socialchef') . "";
                for ($i = 1;$i < 181;$i++) {
                    $cook_time_str .= ",$i:$i";
                }

    It would need to be modified by you to go in increments you desire.

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi,

    Managed to locate the code.

    Could you also give an example of the edited part, like what you did for the backend editor.

    Assuming i requires increments of 15min.

    Eg. "if step=15"

    thanks

  •  2
    chefcove replied

    Hi, thanks. I found my answer. 

    $i++ becomes $i+=15

    For users whom are new to php like me.

  •  788
    Theme replied

    Great to hear, thanks for posting the answer.

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi,

    Could you advice if my folder structure etc is correct? I cant seem to modify the codes ( which I successfully changed last Nov ).

    Its not reflected in my "share recipe" front end plugin.

    thanks

  •  788
    Theme replied

    Hi,

    Please be more specific. What are you trying to modify? And where?

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi, sorry, missed out my attachement.

    Could you advice if my folder structure etc is correct? I cant seem to modify the codes ( which I successfully changed last Nov ).

    Its not reflected in my "share recipe" front end plugin. 

    thanks

    Attached files:  frontendsubmit.jpg

  •  788
    Theme replied

    Hi,

    The file should not be called frontend-submit-copy.php. It should be called frontend-submit.php

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    hi,

    1) Thanks for your advice. Could you kindly vet through the 2 files attached?

    I am getting error on both .php file.

    2) Is it right to leave the frontend-submit.php in childtheme-include-plugin-frontend submit ?  Or should I just leave it at socialchef -child roof directory ?

    thanks

    Attached files:  frontend-submit.php
      frontend-submit-copy.php

  •  788
    Theme replied

    Hi,

    frontend-submit-copy.php will not do anything within our theme. It is not a part of our theme.

    What error are you getting with frontend-submit.php? What changes did you make to it? In which folder did you place the file?

    Thanks,

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi,

    Not sure why, there are a lot of unknown codes appearing at the frontend submission.

    I engage a developer whom is recently very long lead time in responding to repair the errors.

    I wanted to add another option Eg."difficulty2"  as per the attachement.

    Could you help vet through the codes that he did. You can see his coding marked -  " TheemWiz Customization"

    I believe you will be in a much better position and knowledge in advising me too.  ;)

    thanks

    Attached files:  Where to place frontend-submit.php file in child theme.jpg
      MIssing difficulty2 from front end recipe submission.jpg
      Unknown codes appear at frontend submission.jpg

  •  788
    Theme replied

    Hi,

    Unfortunately customizing code is beyond the scope of our support. This is something you have to hire developers to do for you.

    Best regards,

    themeenergy support

  •  2
    chefcove replied

    Hi,

    No, not to customize any code on your side. Just like to seek your advice on if there is the bug on the new codes?

    thanks

  •  788
    Theme replied

    Hi,

    Unfortunately as I indicated, we cannot debug custom code. Please reinstate the original theme code to get rid of the errors you are experiencing.

    Best regards,

    themeenergy support