From 9a0c7bf1a0d2d5fa411d67ca38aa29f53dbdd90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B0=D0=B2=D0=B5=D0=BB?= Date: Mon, 20 Jul 2020 12:31:58 +0300 Subject: [PATCH] fix for checkCustomFile --- src/retailcrm.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/retailcrm.php b/src/retailcrm.php index 05e3d79..2dd55e0 100644 --- a/src/retailcrm.php +++ b/src/retailcrm.php @@ -134,13 +134,18 @@ if (!class_exists( 'WC_Integration_Retailcrm')) : */ public static function checkCustomFile($file) { + $wooPath = WP_PLUGIN_DIR . '/woo-retailcrm/' . $file; $withoutInclude = WP_CONTENT_DIR . '/retailcrm-custom/' . str_replace('include/', '', $file); if (file_exists($withoutInclude)) { return $withoutInclude; } - return WP_PLUGIN_DIR . '/woo-retailcrm/' . $file; + if (file_exists($wooPath)) { + return $wooPath; + } + + return dirname(__FILE__) . '/' . $file; } /**