• Good day all.

    When am trying to show order number on the Learnpress certificate by using the custom short codes, The codes just shows 0000000000 instead of user order number . Here is the codes i paste in the plugin functions.php

    /* EWS Change - Custom Shortcode */
    function lporderid_function() {
    global $wpdb;
    $userid = get_current_user_id();
    $courseid = get_the_ID();

    $sql = "SELECT ref_id FROM wp_learnpress_user_items WHERE user_id = $userid AND item_id = $courseid;";
    $refid = $wpdb->get_var($sql);

    $ordernumber = "14/" . str_pad($refid, 10, '0', STR_PAD_LEFT);

    return $ordernumber;

    }
    add_shortcode('lporderid', 'lporderid_function');

    /* Adds new shortcode option to cert editor */
    add_filter( 'certificates/fields', function($fields) {
    $fields[] = array(
    'name' => 'shortcode',
    'icon' => 'dashicons-smiley',
    'title' => __( 'Shortcode', 'learnpress-certificates' )
    );
    return $fields;
    });

    if (class_exists('LP_Certificate_Layer')) {
    class LP_Certificate_Shortcode_Layer extends LP_Certificate_Layer {
    public function apply( $data ) {
    $this->options['text'] = do_shortcode('[lporderid course_id="' . $data['course_id'] . ']');
    }
    }
    }

    This is the codes i use in the plugin funtions.php and attached below is what i get on the certificate instead of the Order number. Any help please

    • This topic was modified 1 month, 1 week ago by xlordh.
Viewing 1 replies (of 1 total)
  • Plugin Support brianvu-tp

    (@briantp)

    Hi xlordh,

    Thank you for reaching out!

    It seems that the issue you’re experiencing is related to the premium Certificates Add-on for LearnPress. As this involves a premium plugin, the problem you’re encountering falls outside the scope of support we provide on this forum.

    For further assistance, please create a ticket on our official support system, and our team will be happy to help you resolve the issue.

    This forum is dedicated to supporting the LearnPress plugin, but not the premium plugins.

    Thank you for your understanding!

    Best regards,
    Brianvu-tp

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.