Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jose

    (@giuse)

    Hi @hawaii2

    Officially until now, this plugin supports only standard posts and pages.

    However, if you need it only on a few products you can do this:

    Update the plugin to version 1.0.6

    Open your wp-config.php and add this code before the comment /* That’s all, stop editing! Happy publishing. */

    define( 'EOS_SW_CUSTOM_URLS',array(
    	'product/product-sample/' => 'twentytwenty'
    ) );

    replace “product/product-sample/” with what you need and twentytwenty with the theme you want to load.

    This method is feasible for a few products, but if you need it for all products and you have many of them, unfortunately, you have no easy solutions.

    If you have more products, you need something that looks like:

    define( 'EOS_SW_CUSTOM_URLS',array(
    	'product/product-sample/' => 'twentytwenty',
            'product/product-sample-2/' => 'twentytwenty'
    ) );

    The method described above will work for whatever post type if you need it.

    I hope it helps.

    Thread Starter hawaii2

    (@hawaii2)

    Hi Jose,
    Thanks for your quick reply. But after I update the plugin to version 1.0.6, I’m receiving the following error when I try to edit the product.

    Fatal error: Uncaught Error: Call to undefined function eos_sw_get_post_types() in /website/wp-content/plugins/freesoul-switch-theme/inc/eos-sw-metaboxes.php:8 Stack trace: #0 /website/wp-includes/class-wp-hook.php(294): eos_sw_add_meta_box('product') #1 /website/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #2 /website/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #3 /website/wp-admin/includes/meta-boxes.php(1578): do_action('add_meta_boxes', 'product', Object(WP_Post)) #4 /website/wp-admin/edit-form-advanced.php(271): register_and_do_post_meta_boxes(Object(WP_Post)) #5 /website/wp-admin/post.php(206): require('...') #6 {main} thrown in /website/wp-content/plugins/freesoul-switch-theme/inc/eos-sw-metaboxes.php on line 8

    Plugin Author Jose

    (@giuse)

    Hi @hawaii2

    you are welcome! Have you updated the plugin via FTP?

    Copy the file wp-content/plugins/freesoul-switch-theme/mu-plugins/eos-switch-theme.php to wp-content/mu-plugins/eos-switch-theme.php.

    The function eos_sw_get_post_types is defined in that file, and the error is saying that the function doesn’t exist. This means that the mu-plugin was not updated.
    When you update the plugin on the plugins page, that file should be automatically updated, but it looks this didn’t happen.

    Let me know it works after manually copying the file.

    Thread Starter hawaii2

    (@hawaii2)

    Thanks! The error was gone after copy the file. But the product is still on the default theme.

    Added code in wp-config.php:
    define( ‘EOS_SW_CUSTOM_URLS’,array(
    ‘product/bike/’ => ‘storefront’
    ) );

    The product page URL:
    https://loclhost/product/bike/

    Plugin Author Jose

    (@giuse)

    You are welcome @hawaii2

    Are you sure the code in wp-config.php is before the comment /* That’s all, stop editing! Happy publishing. */ ?

    Thread Starter hawaii2

    (@hawaii2)

    Yes. I added the code just below the “define(‘FS_METHOD’,’direct’);”. The part is not commented out.

    Plugin Author Jose

    (@giuse)

    Hi @hawaii2

    Strange it doesn’t work. Do you have any strange permalink settings?
    It’s important the code is before define(‘ABSPATH’, dirname(__FILE__) . ‘/’); and before require_once(ABSPATH . ‘wp-settings.php’);

    In any case, do you need a different theme in a permanent way or just for debugging?
    If it’s only for debugging you can use Freesouul Deactivate Plugins to check the preview of the products with a different theme.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Different theme for the product page of WooCommerce’ is closed to new replies.