Ghostpengy
Forum Replies Created
-
Sure, see code below. It all seems to work till filter hook “woocommerce_email_classes”, which fires when disable Admin is unchecked, but not when enabled.
/** * Class Custom_WC_Email */ class Custom_WC_Email { /** * Custom_WC_Email constructor. */ public function __construct() { // Filtering the emails and adding our own email. add_filter( 'woocommerce_email_classes', array( $this, 'register_email' ), 90, 1 ); // Absolute path to the plugin folder. //define( 'CUSTOM_WC_EMAIL_PATH', plugin_dir_path( __FILE__ ) ); } /** * @param array $emails * * @return array */ public function register_email( $emails ) { require_once 'emails/class-wc-customer-shipping-email.php'; require_once 'emails/class-wc-customer-missing-payment-email.php'; require_once 'emails/class-wc-customer-payment-received-email.php'; require_once 'emails/class-wc-customer-cancelled-email.php'; $emails['wc_customer_shipping_email'] = new WC_Customer_Shipping_Email(); $emails['wc_customer_missing_payment_email'] = new WC_Customer_Missing_Payment_Email(); $emails['wc_customer_payment_received_email'] = new WC_Customer_Payment_Received_Email(); $emails['wc_customer_cancelled_email'] = new WC_Customer_Cancelled_Email(); return $emails; } }
Ok, I was able to resolve it. The plugin itself was loaded from the WordPress directory, not from git. However, I did clone WPML REST API in a different plugin, where autoload.php was throwing the error. Renaming the autoload seems to have resolved the issue.
Forum: Plugins
In reply to: [WP Gallery Metabox] Error in admin codeThis should fix the issue, worked for me.
add_options_page('My Options', 'WP gallery metabox', 'manage_options', 'gallery_metabox', array($this, 'gallery_metabox'), 8);
Worked like a charm, could be added to installation instructions on the plugin page.
Forum: Plugins
In reply to: [WooCommerce] Wrong theme template for product categories in custom themeI resolved the issue. All you need to do is add theme support for woocommerce to start using dedicated templates.
//Adding theme support function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
After adding the code, the used templated went from “page.php” to “taxonomy-product_cat.php”
Forum: Plugins
In reply to: [WooCommerce] Product custom taxomonies pageI resolved the issue. After adding theme support, the custom taxonomies are using woocommerce files correctly! In future, if anyone needs this just add following code:
//Adding theme support function mytheme_add_woocommerce_support() { add_theme_support( 'woocommerce' ); } add_action( 'after_setup_theme', 'mytheme_add_woocommerce_support' );
Forum: Plugins
In reply to: [WooCommerce] Wrong theme template for product categories in custom themeI have been going crazy over this too. Could not find any good solution too. Have the latest update and shop category pages just ignore everything. WordPress returns the the post type just a “page”. That is not a page.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce variations not showing when adding product on adminbump
Forum: Fixing WordPress
In reply to: Changing Themehttps://www.ads-software.com/plugins/jonradio-multiple-themes/
This might be a solution. However, it is STRONGLY discouraged to do any development this way. If you mess something up, you can bring down the entire site until it is resolved. The best solution would be to get in contact with your hosting provider and clone existing website and then change anything you would like.
Forum: Fixing WordPress
In reply to: WooCommerce deactivation removes my pages1. Try disabling all plugins and see if this resolves the issue.
2. Check error log. There might be something still tied in from WooCommerce with some scripts. This can call for error and make everything not to be displayed.
3. If you don’t have access to the error log. You can try viewing widgets, menus, and pages themselves if there are remnants from plugin left there. But you cannot see if this issue is embedded in PHP code itself.
4. Reinstall and reimport content could be the fastest solution if the site is not too big.Forum: Fixing WordPress
In reply to: WordPress editor is brokenForum: Fixing WordPress
In reply to: theme customization not workingload-scripts seems to be outputting buggy code. Best bet would not use customize if you can or just pick another theme altogether.
Forum: Developing with WordPress
In reply to: I know how to link a custom url to an image, BUT how do IIf each button was manually placed in for say Pages section. Then best bet would be to get an editor who has replace function. You can select the image tag and then replace it with a link around it.
If it is done by WordPress. There is a most likely easy way with editing plugin/theme templates.
Forum: Fixing WordPress
In reply to: Redirect a WordPress page to completely another Website that I ownAs far as I understand you just want to place link somewhere “demo-page” and it to go to a different page. That would be then:
<a href="https://www.yoururl.com" target="_blank">Demo Page</a>
If you want just to redirect anyone who goes to “subdomain.mysite.com/demo-page”. That can be done with JavaScript redirect:
<script>window.location = "https://www.yoururl.com";</script>
Forum: Plugins
In reply to: [WooCommerce] Add to cart without variation idbump