Viewing 9 replies - 1 through 9 (of 9 total)
  • Had the same problem.

    Problem in short: It’s because Woocommerce got loaded before WooCommerce POS.

    Woocommerce POS is initiated through the woocommerce_loaded hook. Woocommerce is initiated on runtime. So when Woocommerce is loaded first, it fires the woocommerce_loaded hook and then loads the Woocommerce POS scripts. So WooCommerce POS is never initiated.

    As workarround you can change the following lines in woocommerce-pos.php:

    add_action( 'woocommerce_loaded', 'run_woocommerce_pos' );
    function run_woocommerce_pos() {
      new WC_POS();
    }

    to

    add_action( 'plugins_loaded', 'run_woocommerce_pos' );
    function run_woocommerce_pos() {
    	if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
    		new WC_POS();
    	}
    }
    Plugin Author kilbot

    (@kilbot)

    Thanks Chris, that is the correct cause of the issue.

    Active plugins are sorted alphabetically in the database so in a standard set up woocommerce will be sorted after WooCommerce POS, ie:

    woocommerce-pos/woocommerce-pos.php
    woocommerce/woocommerce.php

    The problem occurs when woocommerce is in a non standard directory for some reason, eg:

    woocommerce-2.2.6/woocommerce.php
    woocommerce-pos/woocommerce-pos.php

    In these cases you can rename the folder to woocommerce-v2.2.6 which will then be sorted alphabetically again.

    The folders on my WP environment have the default names (woocommerce + woocommerce-pos).

    Some details:
    Ubuntu 14.04
    Nginx
    PHP-FPM 5.5.9

    What did you think of my solution? Personally I do not like it when a plugin works only on certain configurations.

    Plugin Author kilbot

    (@kilbot)

    I’m not adverse to applying a fix if it is a wide spread problem.

    Your solution is fine, but it still requires a certain configuration, ie: it checks for ‘woocommerce/woocommerce.php’.

    It’s possible that some other plugin you have installed is rearranging the active plugins array. If it’s not too much trouble it would be great of you could go to your mysql db and get the active_plugins field from the options table. That will contain a serialized array of the plugins.

    In the meantime, I do some tests on a different approach.

    Plugin Author kilbot

    (@kilbot)

    Actually, I just saw the end of that line of code, ie: the active_plugins filter. It’s likely that another plugin is filtering the database array to sort the loading order .. probably for a similar reason – they want their plugin to load first.

    I’ll do some tests and apply a patch for the 0.4.1.

    Thanks! Still interested in the list of active plugins?

    Plugin Author kilbot

    (@kilbot)

    I am! .. if it’s not to long I could do a quick search and see if there is another plugin playing with the order.

    Here the content of the active_plugins option:

    a:23:{i:0;s:29:"gravityforms/gravityforms.php";i:1;s:33:"woocommerce-nl/woocommerce-nl.php";i:2;s:45:"advanced-menu-widget/advanced-menu-widget.php";i:3;s:55:"advanced-post-types-order/advanced-post-types-order.php";i:4;s:53:"codestyling-localization/codestyling-localization.php";i:5;s:45:"enhanced-text-widget/enhanced-text-widget.php";i:6;s:19:"iwp-client/init.php";i:7;s:25:"option-tree/ot-loader.php";i:8;s:30:"redirect-list/redirectlist.php";i:9;s:47:"regenerate-thumbnails/regenerate-thumbnails.php";i:10;s:36:"sisow-for-woocommerce/sisowideal.php";i:11;s:33:"ssh-sftp-updater-support/sftp.php";i:12;s:33:"w3-total-cache/w3-total-cache.php";i:13;s:39:"wc-cash-on-pickup/wc-cash-on-pickup.php";i:14;s:75:"weight-based-shipping-for-woocommerce/woocommerce-weight-based-shipping.php";i:15;s:73:"woocommerce-distance-rate-shipping/woocommerce-distance-rate-shipping.php";i:16;s:85:"woocommerce-google-analytics-integration/woocommerce-google-analytics-integration.php";i:17;s:45:"woocommerce-myparcel/woocommerce-myparcel.php";i:18;s:80:"woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php";i:19;s:35:"woocommerce-pos/woocommerce-pos.php";i:20;s:27:"woocommerce/woocommerce.php";i:21;s:24:"wordpress-seo/wp-seo.php";i:22;s:35:"wp-mail-options/wp-mail-options.php";}

    Plugin Author kilbot

    (@kilbot)

    This has been fixed in version 0.4.1.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘POS not showing in admin’ is closed to new replies.