• Resolved chrisconquerors

    (@chrisconquerors)


    Hello again,

    I am faced with current problem:

    I have created a few custom fields. I deactivated the subject field because you can’t really do anything with it. So I created a new subject field with a dropdown menu in it. Everything works fine except the following:
    The subject is not saved into the database nor is it displaying the subject next to the ticket number is the support_page=open_ticket.

    I have found that if I edit the following code things work:

    Find in create_ticket.php

    $subject          = get_term_by('slug', 'ticket_subject', 'wpsc_ticket_custom_fields' );
    $wpsc_default_sub = get_term_meta( $subject->term_id,'wpsc_tf_default_subject',true);
    $ticket_subject   = isset($args['ticket_subject']) ? sanitize_text_field($args['ticket_subject']) : apply_filters( 'wpsc_default_subject_text', $wpsc_default_sub,$args );

    And replace with the new slug name:

    $subject          = get_term_by('slug', 'onderwerp', 'wpsc_ticket_custom_fields' );
    $wpsc_default_sub = get_term_meta( $subject->term_id,'wpsc_tf_default_subject',true);
    $ticket_subject   = isset($args['onderwerp']) ? sanitize_text_field($args['onderwerp']) : apply_filters( 'wpsc_default_subject_text', $wpsc_default_sub,$args );

    The slug for my subject is ‘onderwerp’ in this case. With this edit everything works, but I think that it would be better if we could manually change the slug name.

    Could this be made possible?

    Also, I have found an issue with conditional fields. Again, on my subject dropdown you can choose out of 9 options. If you choose any of these, a condition field is opened with a subsequent dropdown. But that second dropdown value is nowhere to be found, except under ticket fields.
    It would be really nice if the second value were to be added to the subject.

    Really loving the plugin!

    Regards,
    Chris

Viewing 1 replies (of 1 total)
  • Plugin Contributor Nikhil G

    (@nsgawli)

    Hello @chrisconquerors,

    Do not change code of the plugin else when you update the plugin your custom code will get removed. Instead of changing core code you can use
    apply_filters( ‘wpsc_default_subject_text’, $wpsc_default_sub,$args );
    to apply your changes.

Viewing 1 replies (of 1 total)
  • The topic ‘Problem displaying custom fields’ is closed to new replies.