Need to add a custom tab in Settings > Store
-
Hi,
Before I explain the issue and the kludge I made, please allow me to mention that I have encountered this issue in previous versions of WP e-Commerce. Now that I upgraded to v1.5.5 I still find this issue, so i decided to post the kludge I’m doing, hoping that this can help others and hoping that the plugin devs will take a look on this issue. Most importantly I want to thank the devs for making this plugin. Thanks guys.Store URL: https://www.theosmusic.com.au
WordPress version: 3.9.2
WP eCommerce version: 3.8.14.3
Gold Cart version: n/a
Theme: custom themeI did this:
I followed the instructions in this link https://docs.getshopped.org/documentation/settings-page-api/, to add a custom tab in Dashboard > Settings > Store.I expected WPeCommerce to do this:
As per the instructions in the link, I’m expecting to have a the custom tab appear in Dashboard > Settings > Store.Instead it did this:
The custom tab appears, but everytime I try to click it. Nothing happens. All that appear is a loading gif beside the “Store Settings” header.Here’s what I found and what I did to:
instead of putting a hook for “wpsc_load_settings_tab_class”, I added the following in my themes functions.php:function my_wpsc_settings_tabs($settings_page) { $settings_page->register_tab('my_import','My Import'); } add_action( 'wpsc_register_settings_tabs', 'my_wpsc_settings_tabs', 10, 1);
I also change the load_default_tab_class function in wp-e-commerce/wpsc-admin/settings-page.php to:
public static function load_default_tab_class( $page_instance ) { $current_tab_id = $page_instance->get_current_tab_id(); if ( array_key_exists( $current_tab_id, $page_instance->tabs ) ) { require_once( 'includes/settings-tabs/' . $current_tab_id . '.php' ); } }
I’m not sure if this is the best solution, kindly let me know if I’m missing something and please let me know so I will be not doing this hack everytime I update this plugin. Thanks.
- The topic ‘Need to add a custom tab in Settings > Store’ is closed to new replies.