Created
July 13, 2023 02:19
-
-
Save msulaimanmisri/658846447c51c72d9b51c40fd75d1b72 to your computer and use it in GitHub Desktop.
This will enable HPOS at BillPlz WooCommerce Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Use this code only at Development @ Local Environment. DO NOT USE AT PRODUCTION SITE | |
* First, go to BillPlz for WooCommerce WordPress Plugin and then open file named `billPlzWoo.php` | |
*Then, copy and please this code. Only put the code line 19 and method named `enableHposForBillPlz` | |
*/ | |
protected function __construct() | |
{ | |
$this->define_constants(); | |
add_filter('option_woocommerce_billplz_settings', array(&$this, 'patch_keys_constant'), 10, 2); | |
add_filter('before_woocommerce_init', [__CLASS__, 'enableHposForBillPlz']); // Add this line | |
} | |
public static function enableHposForBillPlz() | |
{ | |
if (!class_exists(\Automattic\WooCommerce\Utilities\FeaturesUtil::class)) { | |
FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, false); | |
} | |
FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment