LearnPress not enqueue assets [closed]

Question

I am developing a plugin for learnpress based on the Stripe LearnPress plugin. I am using the Eduma theme that I have been using for 1 year, until this need to create a new plugin

However I got to a point where loading assets on the checkout page doesn’t work for me.

/**
     * Enqueue assets.
     *
     * @since 3.0.0
     */
    protected function _enqueue_assets() {
        if ( learn_press_is_checkout() && LP()->settings->get( $this->id . '.enable' ) ) {
            $user = learn_press_get_current_user();

            learn_press_assets()->enqueue_script( 'learn-press-payment', $this->get_plugin_url( 'assets/js/payment.js' ), array() );
            learn_press_assets()->enqueue_script( 'learn-press-stripe', $this->get_plugin_url( 'assets/js/stripe.js' ), array() );
            learn_press_assets()->enqueue_style( 'learn-press-stripe', $this->get_plugin_url( 'assets/css/style.css' ), array() );

            $data = array(
                'publish_key' => $this->settings['publish_key'],
                'plugin_url'  => plugins_url( '', LP_ADDON_STRIPE_PAYMENT_FILE ),
                'test_mode'   => $this->settings['test_mode'],
                'card_name'   => $user->user->data->display_name
            );
            wp_localize_script( 'learn-press-stripe', 'learn_press_stripe_info', $data );
0
Derzz ale 3 years 2020-04-07T20:50:52-05:00 0 Answers 87 views 0

Leave an answer

Browse
Browse