Open sridhargoshika opened 3 years ago
@sridhargoshika your code works for me. Do you see any errors when you add it to your functions.php file? Most importantly, does the dashboard widget appear?
@sridhargoshika your code works for me. Do you see any errors when you add it to your functions.php file? Most importantly, does the dashboard widget appear?
Here is my output, Card details windows is also disappeared and PayNow not working.
Yeah, I see. Our payment scripts are set to only load on the frontend. Try the following code instead (which forces our scripts to load on the backend too).
add_action('wp_dashboard_setup', 'my_dashboard_widgets');
function my_dashboard_widgets() {
wp_add_dashboard_widget('custom_help_widget', 'Product Request', 'my_product_request_dashboard_widget');
}
function my_product_request_dashboard_widget() {
echo do_shortcode('[getpaid form=83]') ;
}
function my_invoice_dashboard_widget() {
echo do_shortcode('[wpinv_history]');
}
add_action( 'admin_enqueue_scripts', 'my_admin_load_scripts' );
function my_admin_load_scripts() {
$screen = get_current_screen();
if ( ! empty( $screen->id ) && 'dashboard' == $screen->id ) {
getpaid()->enqueue_scripts();
}
}
add_filter( 'aui_screen_ids','my_admin_add_aui_screens' );
function my_admin_add_aui_screens( $screens ) {
$screens[] = 'dashboard';
return $screens;
}
I tried your code. It seems PayNow button working correctly. But invoicing-Pagination not working. It showing first page when I click on 2 page.
Any update on this issue
Payment forms shortcode or [wpinv-history] are not working in admin/main dashboard page.
Here is the code in functions.php: `add_action('wp_dashboard_setup', 'my_dashboard_widgets');
function my_dashboard_widgets() { global $wp_meta_boxes; wp_add_dashboard_widget('custom_help_widget', 'Product Request', 'my_product_request_dashboard_widget'); }
function my_product_request_dashboard_widget() {
echo do_shortcode('[getpaid form=83]') ; }
function my_invoice_dashboard_widget() { echo do_shortcode('[wpinv_history]'); }`