Version Description
Download this release
Release Info
Developer | SkyVerge |
Plugin | Facebook for WooCommerce |
Version | 2.1.3 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.1.3
- changelog.txt +3 -0
- class-wc-facebookcommerce.php +1 -1
- facebook-for-woocommerce.php +1 -1
- i18n/languages/facebook-for-woocommerce.pot +42 -127
- includes/Admin.php +0 -19
- includes/Admin/Orders.php +0 -637
- readme.txt +4 -1
changelog.txt
CHANGED
@@ -1,5 +1,8 @@
|
|
1 |
*** Facebook for WooCommerce Changelog ***
|
2 |
|
|
|
|
|
|
|
3 |
2020.10.28 - version 2.1.2
|
4 |
* Tweak - Default variation selection will be synced to Facebook if the default product variation is already synced
|
5 |
* Fix - Trigger a pixel Search event for product search requests with a single result (works for logged in users or visitors with an active WooCommerce session)
|
1 |
*** Facebook for WooCommerce Changelog ***
|
2 |
|
3 |
+
2020.10.29 - version 2.1.3
|
4 |
+
* Fix - Prevent error triggered while trying to refund orders
|
5 |
+
|
6 |
2020.10.28 - version 2.1.2
|
7 |
* Tweak - Default variation selection will be synced to Facebook if the default product variation is already synced
|
8 |
* Fix - Trigger a pixel Search event for product search requests with a single result (works for logged in users or visitors with an active WooCommerce session)
|
class-wc-facebookcommerce.php
CHANGED
@@ -22,7 +22,7 @@ if ( ! class_exists( 'WC_Facebookcommerce' ) ) :
|
|
22 |
|
23 |
|
24 |
/** @var string the plugin version */
|
25 |
-
const VERSION = '2.1.
|
26 |
|
27 |
/** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
|
28 |
const PLUGIN_VERSION = self::VERSION;
|
22 |
|
23 |
|
24 |
/** @var string the plugin version */
|
25 |
+
const VERSION = '2.1.3';
|
26 |
|
27 |
/** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
|
28 |
const PLUGIN_VERSION = self::VERSION;
|
facebook-for-woocommerce.php
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
* Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
|
11 |
* Author: Facebook
|
12 |
* Author URI: https://www.facebook.com/
|
13 |
-
* Version: 2.1.
|
14 |
* Text Domain: facebook-for-woocommerce
|
15 |
* WC requires at least: 3.5.0
|
16 |
* WC tested up to: 4.6.1
|
10 |
* Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
|
11 |
* Author: Facebook
|
12 |
* Author URI: https://www.facebook.com/
|
13 |
+
* Version: 2.1.3
|
14 |
* Text Domain: facebook-for-woocommerce
|
15 |
* WC requires at least: 3.5.0
|
16 |
* WC tested up to: 4.6.1
|
i18n/languages/facebook-for-woocommerce.pot
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
# This file is distributed under the same license as the Facebook for WooCommerce package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Facebook for WooCommerce 2.1.
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://woocommerce.com/my-account/marketplace-ticket-form/\n"
|
8 |
-
"POT-Creation-Date: 2020-10-
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -201,7 +201,7 @@ msgid "Go to Settings"
|
|
201 |
msgstr ""
|
202 |
|
203 |
#: includes/AJAX.php:337 includes/AJAX.php:406 includes/AJAX.php:470
|
204 |
-
#: includes/Admin/
|
205 |
#: includes/Admin/Settings_Screens/Product_Sync.php:144
|
206 |
msgid "Cancel"
|
207 |
msgstr ""
|
@@ -244,95 +244,6 @@ msgstr ""
|
|
244 |
msgid "Show advanced options"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: includes/Admin/Orders.php:150
|
248 |
-
msgid "An unknown error occurred."
|
249 |
-
msgstr ""
|
250 |
-
|
251 |
-
#: includes/Admin/Orders.php:151
|
252 |
-
msgid "Tracking Number is missing."
|
253 |
-
msgstr ""
|
254 |
-
|
255 |
-
#: includes/Admin/Orders.php:152
|
256 |
-
msgid "Refund reason:"
|
257 |
-
msgstr ""
|
258 |
-
|
259 |
-
#: includes/Admin/Orders.php:153
|
260 |
-
msgid "Choose the reason for refunding this order."
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: includes/Admin/Orders.php:154
|
264 |
-
msgid "Refund description (optional):"
|
265 |
-
msgstr ""
|
266 |
-
|
267 |
-
#: includes/Admin/Orders.php:155
|
268 |
-
msgid "Note: the refund description will be visible by the customer."
|
269 |
-
msgstr ""
|
270 |
-
|
271 |
-
#: includes/Admin/Orders.php:182
|
272 |
-
#. translators: Placeholders: %1$s - HTML <strong> tag, %2$s - HTML </strong>
|
273 |
-
#. tag
|
274 |
-
msgid ""
|
275 |
-
"This order is currently being held by Instagram and cannot be edited. Once "
|
276 |
-
"released by Instagram, it will move to %1$sProcessing%2$s or "
|
277 |
-
"%1$sCancelled%2$s status."
|
278 |
-
msgstr ""
|
279 |
-
|
280 |
-
#: includes/Admin/Orders.php:281
|
281 |
-
msgid "Select the carrier and tracking number for this order:"
|
282 |
-
msgstr ""
|
283 |
-
|
284 |
-
#: includes/Admin/Orders.php:285
|
285 |
-
msgid "Carrier"
|
286 |
-
msgstr ""
|
287 |
-
|
288 |
-
#: includes/Admin/Orders.php:291
|
289 |
-
msgid "Tracking number"
|
290 |
-
msgstr ""
|
291 |
-
|
292 |
-
#: includes/Admin/Orders.php:309
|
293 |
-
msgid "Submit order"
|
294 |
-
msgstr ""
|
295 |
-
|
296 |
-
#: includes/Admin/Orders.php:325
|
297 |
-
msgid "Select a reason for refunding this order:"
|
298 |
-
msgstr ""
|
299 |
-
|
300 |
-
#: includes/Admin/Orders.php:343
|
301 |
-
msgid "Submit refund"
|
302 |
-
msgstr ""
|
303 |
-
|
304 |
-
#: includes/Admin/Orders.php:359
|
305 |
-
msgid "Select a reason for cancelling this order:"
|
306 |
-
msgstr ""
|
307 |
-
|
308 |
-
#: includes/Admin/Orders.php:381
|
309 |
-
msgid "Submit cancellation"
|
310 |
-
msgstr ""
|
311 |
-
|
312 |
-
#: includes/Admin/Orders.php:400
|
313 |
-
msgid "Customer request"
|
314 |
-
msgstr ""
|
315 |
-
|
316 |
-
#: includes/Admin/Orders.php:401
|
317 |
-
msgid "Damaged product"
|
318 |
-
msgstr ""
|
319 |
-
|
320 |
-
#: includes/Admin/Orders.php:402
|
321 |
-
msgid "Product not as described"
|
322 |
-
msgstr ""
|
323 |
-
|
324 |
-
#: includes/Admin/Orders.php:403
|
325 |
-
msgid "Quality issue"
|
326 |
-
msgstr ""
|
327 |
-
|
328 |
-
#: includes/Admin/Orders.php:404
|
329 |
-
msgid "Wrong item"
|
330 |
-
msgstr ""
|
331 |
-
|
332 |
-
#: includes/Admin/Orders.php:405 includes/Commerce/Orders.php:843
|
333 |
-
msgid "Other"
|
334 |
-
msgstr ""
|
335 |
-
|
336 |
#: includes/Admin/Product_Categories.php:99
|
337 |
#: includes/Admin/Settings_Screens/Product_Sync.php:108
|
338 |
msgid ""
|
@@ -677,41 +588,41 @@ msgstr ""
|
|
677 |
msgid "Please %1$sconnect to Facebook%2$s to enable and manage product sync."
|
678 |
msgstr ""
|
679 |
|
680 |
-
#: includes/Admin.php:
|
681 |
msgid ""
|
682 |
"Please enter a Google product category and at least one sub-category to "
|
683 |
"sell this product on Instagram."
|
684 |
msgstr ""
|
685 |
|
686 |
-
#: includes/Admin.php:
|
687 |
msgid "Search main categories..."
|
688 |
msgstr ""
|
689 |
|
690 |
-
#: includes/Admin.php:
|
691 |
msgid "Choose a main category"
|
692 |
msgstr ""
|
693 |
|
694 |
-
#: includes/Admin.php:
|
695 |
msgid "Choose a category"
|
696 |
msgstr ""
|
697 |
|
698 |
-
#: includes/Admin.php:
|
699 |
msgid ""
|
700 |
"To sell this product on Instagram, please ensure it meets the following "
|
701 |
"requirements:"
|
702 |
msgstr ""
|
703 |
|
704 |
-
#: includes/Admin.php:
|
705 |
msgid "Has a price defined"
|
706 |
msgstr ""
|
707 |
|
708 |
-
#: includes/Admin.php:
|
709 |
#. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s -
|
710 |
#. </strong> closing HTML tag
|
711 |
msgid "Has %1$sManage Stock%2$s enabled on the %1$sInventory%2$s tab"
|
712 |
msgstr ""
|
713 |
|
714 |
-
#: includes/Admin.php:
|
715 |
#. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s -
|
716 |
#. </strong> closing HTML tag
|
717 |
msgid ""
|
@@ -719,40 +630,40 @@ msgid ""
|
|
719 |
"and hide\""
|
720 |
msgstr ""
|
721 |
|
722 |
-
#: includes/Admin.php:
|
723 |
msgid "Close"
|
724 |
msgstr ""
|
725 |
|
726 |
-
#: includes/Admin.php:
|
727 |
msgid "Facebook sync"
|
728 |
msgstr ""
|
729 |
|
730 |
-
#: includes/Admin.php:
|
731 |
msgid "Sync and show"
|
732 |
msgstr ""
|
733 |
|
734 |
-
#: includes/Admin.php:
|
735 |
msgid "Sync and hide"
|
736 |
msgstr ""
|
737 |
|
738 |
-
#: includes/Admin.php:
|
739 |
-
#: includes/Admin.php:
|
740 |
msgid "Do not sync"
|
741 |
msgstr ""
|
742 |
|
743 |
-
#: includes/Admin.php:
|
744 |
msgid "Filter by Facebook sync setting"
|
745 |
msgstr ""
|
746 |
|
747 |
-
#: includes/Admin.php:
|
748 |
msgid "Include in Facebook sync"
|
749 |
msgstr ""
|
750 |
|
751 |
-
#: includes/Admin.php:
|
752 |
msgid "Exclude from Facebook sync"
|
753 |
msgstr ""
|
754 |
|
755 |
-
#: includes/Admin.php:
|
756 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
|
757 |
#. <a> tag, %4$s - <a> tag
|
758 |
msgid ""
|
@@ -766,11 +677,11 @@ msgid_plural ""
|
|
766 |
msgstr[0] ""
|
767 |
msgstr[1] ""
|
768 |
|
769 |
-
#: includes/Admin.php:
|
770 |
msgid "Don't show this notice again"
|
771 |
msgstr ""
|
772 |
|
773 |
-
#: includes/Admin.php:
|
774 |
#. translators: Placeholders: %1$s - number of affected products, %2$s opening
|
775 |
#. HTML <a> tag, %3$s - closing HTML </a> tag, %4$s - opening HTML <a> tag,
|
776 |
#. %5$s - closing HTML </a> tag
|
@@ -787,7 +698,7 @@ msgid_plural ""
|
|
787 |
msgstr[0] ""
|
788 |
msgstr[1] ""
|
789 |
|
790 |
-
#: includes/Admin.php:
|
791 |
#. translators: Placeholders: %1$s - opening HTML <strong> tag, %2$s - closing
|
792 |
#. HTML </strong> tag, %3$s - opening HTML <a> tag, %4$s - closing HTML </a>
|
793 |
#. tag
|
@@ -797,69 +708,69 @@ msgid ""
|
|
797 |
"your Facebook catalog. You may still advertise Virtual products on Facebook."
|
798 |
msgstr ""
|
799 |
|
800 |
-
#: includes/Admin.php:
|
801 |
msgid "Sync and show in catalog"
|
802 |
msgstr ""
|
803 |
|
804 |
-
#: includes/Admin.php:
|
805 |
msgid "Sync and hide in catalog"
|
806 |
msgstr ""
|
807 |
|
808 |
-
#: includes/Admin.php:
|
809 |
msgid "Facebook Description"
|
810 |
msgstr ""
|
811 |
|
812 |
-
#: includes/Admin.php:
|
813 |
msgid ""
|
814 |
"Custom (plain-text only) description for product on Facebook. If blank, "
|
815 |
"product description will be used. If product description is blank, "
|
816 |
"shortname will be used."
|
817 |
msgstr ""
|
818 |
|
819 |
-
#: includes/Admin.php:
|
820 |
msgid "Facebook Product Image"
|
821 |
msgstr ""
|
822 |
|
823 |
-
#: includes/Admin.php:
|
824 |
msgid ""
|
825 |
"Choose the product image that should be synced to the Facebook catalog for "
|
826 |
"this product. If using a custom image, please enter an absolute URL (e.g. "
|
827 |
"https://domain.com/image.jpg)."
|
828 |
msgstr ""
|
829 |
|
830 |
-
#: includes/Admin.php:
|
831 |
msgid "Use WooCommerce image"
|
832 |
msgstr ""
|
833 |
|
834 |
-
#: includes/Admin.php:
|
835 |
msgid "Use custom image"
|
836 |
msgstr ""
|
837 |
|
838 |
-
#: includes/Admin.php:
|
839 |
msgid "Custom Image URL"
|
840 |
msgstr ""
|
841 |
|
842 |
-
#: includes/Admin.php:
|
843 |
#. translators: Placeholders %1$s - WC currency symbol
|
844 |
msgid "Facebook Price (%1$s)"
|
845 |
msgstr ""
|
846 |
|
847 |
-
#: includes/Admin.php:
|
848 |
msgid ""
|
849 |
"Custom price for product on Facebook. Please enter in monetary decimal (.) "
|
850 |
"format without thousand separators and currency symbols. If blank, product "
|
851 |
"price will be used."
|
852 |
msgstr ""
|
853 |
|
854 |
-
#: includes/Admin.php:
|
855 |
msgid "Use variation image"
|
856 |
msgstr ""
|
857 |
|
858 |
-
#: includes/Admin.php:
|
859 |
msgid "Use parent image"
|
860 |
msgstr ""
|
861 |
|
862 |
-
#: includes/Admin.php:
|
863 |
msgid "Close modal panel"
|
864 |
msgstr ""
|
865 |
|
@@ -940,6 +851,10 @@ msgstr ""
|
|
940 |
msgid "Suspicious order"
|
941 |
msgstr ""
|
942 |
|
|
|
|
|
|
|
|
|
943 |
#: includes/Handlers/Connection.php:275
|
944 |
msgid "Connection complete! Thanks for using Facebook for WooCommerce."
|
945 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Facebook for WooCommerce package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Facebook for WooCommerce 2.1.3\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://woocommerce.com/my-account/marketplace-ticket-form/\n"
|
8 |
+
"POT-Creation-Date: 2020-10-29 16:47:00+00:00\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=utf-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
201 |
msgstr ""
|
202 |
|
203 |
#: includes/AJAX.php:337 includes/AJAX.php:406 includes/AJAX.php:470
|
204 |
+
#: includes/Admin/Product_Categories.php:118
|
205 |
#: includes/Admin/Settings_Screens/Product_Sync.php:144
|
206 |
msgid "Cancel"
|
207 |
msgstr ""
|
244 |
msgid "Show advanced options"
|
245 |
msgstr ""
|
246 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
#: includes/Admin/Product_Categories.php:99
|
248 |
#: includes/Admin/Settings_Screens/Product_Sync.php:108
|
249 |
msgid ""
|
588 |
msgid "Please %1$sconnect to Facebook%2$s to enable and manage product sync."
|
589 |
msgstr ""
|
590 |
|
591 |
+
#: includes/Admin.php:144
|
592 |
msgid ""
|
593 |
"Please enter a Google product category and at least one sub-category to "
|
594 |
"sell this product on Instagram."
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: includes/Admin.php:166
|
598 |
msgid "Search main categories..."
|
599 |
msgstr ""
|
600 |
|
601 |
+
#: includes/Admin.php:167
|
602 |
msgid "Choose a main category"
|
603 |
msgstr ""
|
604 |
|
605 |
+
#: includes/Admin.php:168
|
606 |
msgid "Choose a category"
|
607 |
msgstr ""
|
608 |
|
609 |
+
#: includes/Admin.php:207
|
610 |
msgid ""
|
611 |
"To sell this product on Instagram, please ensure it meets the following "
|
612 |
"requirements:"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: includes/Admin.php:210
|
616 |
msgid "Has a price defined"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: includes/Admin.php:213
|
620 |
#. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s -
|
621 |
#. </strong> closing HTML tag
|
622 |
msgid "Has %1$sManage Stock%2$s enabled on the %1$sInventory%2$s tab"
|
623 |
msgstr ""
|
624 |
|
625 |
+
#: includes/Admin.php:219
|
626 |
#. translators: Placeholders: %1$s - <strong> opening HTML tag, %2$s -
|
627 |
#. </strong> closing HTML tag
|
628 |
msgid ""
|
630 |
"and hide\""
|
631 |
msgstr ""
|
632 |
|
633 |
+
#: includes/Admin.php:245
|
634 |
msgid "Close"
|
635 |
msgstr ""
|
636 |
|
637 |
+
#: includes/Admin.php:277 includes/Admin.php:1121 includes/Admin.php:1256
|
638 |
msgid "Facebook sync"
|
639 |
msgstr ""
|
640 |
|
641 |
+
#: includes/Admin.php:304 includes/Admin.php:336
|
642 |
msgid "Sync and show"
|
643 |
msgstr ""
|
644 |
|
645 |
+
#: includes/Admin.php:306 includes/Admin.php:337
|
646 |
msgid "Sync and hide"
|
647 |
msgstr ""
|
648 |
|
649 |
+
#: includes/Admin.php:311 includes/Admin.php:338 includes/Admin.php:1125
|
650 |
+
#: includes/Admin.php:1260
|
651 |
msgid "Do not sync"
|
652 |
msgstr ""
|
653 |
|
654 |
+
#: includes/Admin.php:335
|
655 |
msgid "Filter by Facebook sync setting"
|
656 |
msgstr ""
|
657 |
|
658 |
+
#: includes/Admin.php:748
|
659 |
msgid "Include in Facebook sync"
|
660 |
msgstr ""
|
661 |
|
662 |
+
#: includes/Admin.php:749
|
663 |
msgid "Exclude from Facebook sync"
|
664 |
msgstr ""
|
665 |
|
666 |
+
#: includes/Admin.php:942
|
667 |
#. translators: Placeholders: %1$s - <strong> tag, %2$s - </strong> tag, %3$s -
|
668 |
#. <a> tag, %4$s - <a> tag
|
669 |
msgid ""
|
677 |
msgstr[0] ""
|
678 |
msgstr[1] ""
|
679 |
|
680 |
+
#: includes/Admin.php:949
|
681 |
msgid "Don't show this notice again"
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: includes/Admin.php:983
|
685 |
#. translators: Placeholders: %1$s - number of affected products, %2$s opening
|
686 |
#. HTML <a> tag, %3$s - closing HTML </a> tag, %4$s - opening HTML <a> tag,
|
687 |
#. %5$s - closing HTML </a> tag
|
698 |
msgstr[0] ""
|
699 |
msgstr[1] ""
|
700 |
|
701 |
+
#: includes/Admin.php:1049
|
702 |
#. translators: Placeholders: %1$s - opening HTML <strong> tag, %2$s - closing
|
703 |
#. HTML </strong> tag, %3$s - opening HTML <a> tag, %4$s - closing HTML </a>
|
704 |
#. tag
|
708 |
"your Facebook catalog. You may still advertise Virtual products on Facebook."
|
709 |
msgstr ""
|
710 |
|
711 |
+
#: includes/Admin.php:1123 includes/Admin.php:1258
|
712 |
msgid "Sync and show in catalog"
|
713 |
msgstr ""
|
714 |
|
715 |
+
#: includes/Admin.php:1124 includes/Admin.php:1259
|
716 |
msgid "Sync and hide in catalog"
|
717 |
msgstr ""
|
718 |
|
719 |
+
#: includes/Admin.php:1134 includes/Admin.php:1272
|
720 |
msgid "Facebook Description"
|
721 |
msgstr ""
|
722 |
|
723 |
+
#: includes/Admin.php:1136 includes/Admin.php:1274
|
724 |
msgid ""
|
725 |
"Custom (plain-text only) description for product on Facebook. If blank, "
|
726 |
"product description will be used. If product description is blank, "
|
727 |
"shortname will be used."
|
728 |
msgstr ""
|
729 |
|
730 |
+
#: includes/Admin.php:1147 includes/Admin.php:1287
|
731 |
msgid "Facebook Product Image"
|
732 |
msgstr ""
|
733 |
|
734 |
+
#: includes/Admin.php:1149 includes/Admin.php:1289
|
735 |
msgid ""
|
736 |
"Choose the product image that should be synced to the Facebook catalog for "
|
737 |
"this product. If using a custom image, please enter an absolute URL (e.g. "
|
738 |
"https://domain.com/image.jpg)."
|
739 |
msgstr ""
|
740 |
|
741 |
+
#: includes/Admin.php:1151
|
742 |
msgid "Use WooCommerce image"
|
743 |
msgstr ""
|
744 |
|
745 |
+
#: includes/Admin.php:1152 includes/Admin.php:1293
|
746 |
msgid "Use custom image"
|
747 |
msgstr ""
|
748 |
|
749 |
+
#: includes/Admin.php:1163 includes/Admin.php:1305
|
750 |
msgid "Custom Image URL"
|
751 |
msgstr ""
|
752 |
|
753 |
+
#: includes/Admin.php:1174 includes/Admin.php:1318
|
754 |
#. translators: Placeholders %1$s - WC currency symbol
|
755 |
msgid "Facebook Price (%1$s)"
|
756 |
msgstr ""
|
757 |
|
758 |
+
#: includes/Admin.php:1178 includes/Admin.php:1322
|
759 |
msgid ""
|
760 |
"Custom price for product on Facebook. Please enter in monetary decimal (.) "
|
761 |
"format without thousand separators and currency symbols. If blank, product "
|
762 |
"price will be used."
|
763 |
msgstr ""
|
764 |
|
765 |
+
#: includes/Admin.php:1291
|
766 |
msgid "Use variation image"
|
767 |
msgstr ""
|
768 |
|
769 |
+
#: includes/Admin.php:1292
|
770 |
msgid "Use parent image"
|
771 |
msgstr ""
|
772 |
|
773 |
+
#: includes/Admin.php:1445
|
774 |
msgid "Close modal panel"
|
775 |
msgstr ""
|
776 |
|
851 |
msgid "Suspicious order"
|
852 |
msgstr ""
|
853 |
|
854 |
+
#: includes/Commerce/Orders.php:843
|
855 |
+
msgid "Other"
|
856 |
+
msgstr ""
|
857 |
+
|
858 |
#: includes/Handlers/Connection.php:275
|
859 |
msgid "Connection complete! Thanks for using Facebook for WooCommerce."
|
860 |
msgstr ""
|
includes/Admin.php
CHANGED
@@ -31,10 +31,6 @@ class Admin {
|
|
31 |
/** @var string the "sync disabled" sync mode slug */
|
32 |
const SYNC_MODE_SYNC_DISABLED = 'sync_disabled';
|
33 |
|
34 |
-
|
35 |
-
/** @var \Admin\Orders the orders admin handler */
|
36 |
-
protected $orders;
|
37 |
-
|
38 |
/** @var \Admin\Product_Categories the product category admin handler */
|
39 |
protected $product_categories;
|
40 |
|
@@ -56,11 +52,9 @@ class Admin {
|
|
56 |
return;
|
57 |
}
|
58 |
|
59 |
-
require_once __DIR__ . '/Admin/Orders.php';
|
60 |
require_once __DIR__ . '/Admin/Products.php';
|
61 |
require_once __DIR__ . '/Admin/Product_Categories.php';
|
62 |
|
63 |
-
$this->orders = new Admin\Orders();
|
64 |
$this->product_categories = new Admin\Product_Categories();
|
65 |
|
66 |
// add a modal in admin product pages
|
@@ -255,19 +249,6 @@ class Admin {
|
|
255 |
}
|
256 |
|
257 |
|
258 |
-
/**
|
259 |
-
* Gets the orders admin handler instance.
|
260 |
-
*
|
261 |
-
* @since 2.1.0
|
262 |
-
*
|
263 |
-
* @return \SkyVerge\WooCommerce\Facebook\Admin\Orders
|
264 |
-
*/
|
265 |
-
public function get_orders_handler() {
|
266 |
-
|
267 |
-
return $this->orders;
|
268 |
-
}
|
269 |
-
|
270 |
-
|
271 |
/**
|
272 |
* Gets the product category admin handler instance.
|
273 |
*
|
31 |
/** @var string the "sync disabled" sync mode slug */
|
32 |
const SYNC_MODE_SYNC_DISABLED = 'sync_disabled';
|
33 |
|
|
|
|
|
|
|
|
|
34 |
/** @var \Admin\Product_Categories the product category admin handler */
|
35 |
protected $product_categories;
|
36 |
|
52 |
return;
|
53 |
}
|
54 |
|
|
|
55 |
require_once __DIR__ . '/Admin/Products.php';
|
56 |
require_once __DIR__ . '/Admin/Product_Categories.php';
|
57 |
|
|
|
58 |
$this->product_categories = new Admin\Product_Categories();
|
59 |
|
60 |
// add a modal in admin product pages
|
249 |
}
|
250 |
|
251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
/**
|
253 |
* Gets the product category admin handler instance.
|
254 |
*
|
includes/Admin/Orders.php
DELETED
@@ -1,637 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
4 |
-
*
|
5 |
-
* This source code is licensed under the license found in the
|
6 |
-
* LICENSE file in the root directory of this source tree.
|
7 |
-
*
|
8 |
-
* @package FacebookCommerce
|
9 |
-
*/
|
10 |
-
|
11 |
-
namespace SkyVerge\WooCommerce\Facebook\Admin;
|
12 |
-
|
13 |
-
defined( 'ABSPATH' ) or exit;
|
14 |
-
|
15 |
-
use SkyVerge\WooCommerce\Facebook\AJAX;
|
16 |
-
use SkyVerge\WooCommerce\Facebook\Commerce;
|
17 |
-
use SkyVerge\WooCommerce\Facebook\Utilities\Shipment;
|
18 |
-
use SkyVerge\WooCommerce\PluginFramework\v5_5_4 as Framework;
|
19 |
-
|
20 |
-
/**
|
21 |
-
* General handler for order admin functionality.
|
22 |
-
*
|
23 |
-
* @since 2.1.0
|
24 |
-
*/
|
25 |
-
class Orders {
|
26 |
-
|
27 |
-
|
28 |
-
/** @var string key used for setting a transient in the event of bulk actions fired on Commerce orders */
|
29 |
-
private $bulk_order_update_transient = 'wc_facebook_bulk_order_update';
|
30 |
-
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Handler constructor.
|
34 |
-
*
|
35 |
-
* @since 2.1.0
|
36 |
-
*/
|
37 |
-
public function __construct() {
|
38 |
-
|
39 |
-
$this->add_hooks();
|
40 |
-
}
|
41 |
-
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Adds the necessary action & filter hooks.
|
45 |
-
*
|
46 |
-
* @since 2.1.0
|
47 |
-
*/
|
48 |
-
public function add_hooks() {
|
49 |
-
|
50 |
-
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_assets' ] );
|
51 |
-
|
52 |
-
add_action( 'admin_notices', [ $this, 'add_notices' ] );
|
53 |
-
|
54 |
-
add_filter( 'handle_bulk_actions-edit-shop_order', [ $this, 'handle_bulk_update' ], -1, 3 );
|
55 |
-
|
56 |
-
add_filter( 'woocommerce_admin_order_actions', [ $this, 'remove_list_table_actions' ], 10, 2 );
|
57 |
-
add_filter( 'woocommerce_admin_order_preview_actions', [ $this, 'remove_order_preview_actions' ], 10, 2 );
|
58 |
-
|
59 |
-
add_filter( 'wc_order_is_editable', [ $this, 'is_order_editable' ], 10, 2 );
|
60 |
-
|
61 |
-
add_action( 'admin_footer', [ $this, 'render_refund_reason_field' ] );
|
62 |
-
|
63 |
-
add_action( 'woocommerce_refund_created', [ $this, 'handle_refund' ] );
|
64 |
-
|
65 |
-
add_action( 'add_meta_boxes', [ $this, 'maybe_remove_order_metaboxes' ], 999 );
|
66 |
-
}
|
67 |
-
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Enqueue the assets.
|
71 |
-
*
|
72 |
-
* @internal
|
73 |
-
*
|
74 |
-
* @since 2.1.0
|
75 |
-
*/
|
76 |
-
public function enqueue_assets() {
|
77 |
-
global $post;
|
78 |
-
|
79 |
-
if ( ! $this->is_edit_order_screen() ) {
|
80 |
-
return;
|
81 |
-
}
|
82 |
-
|
83 |
-
$order = wc_get_order( $post );
|
84 |
-
|
85 |
-
if ( ! $order instanceof \WC_Order ) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
-
|
89 |
-
wp_enqueue_script( 'wc-facebook-commerce-orders', facebook_for_woocommerce()->get_plugin_url() . '/assets/js/admin/orders.min.js', [
|
90 |
-
'jquery',
|
91 |
-
'wc-backbone-modal',
|
92 |
-
'facebook-for-woocommerce-modal',
|
93 |
-
], \WC_Facebookcommerce::VERSION );
|
94 |
-
|
95 |
-
$shipment_utilities = new Shipment();
|
96 |
-
$shipment_tracking = array_filter( (array) $order->get_meta( '_wc_shipment_tracking_items', true ) );
|
97 |
-
|
98 |
-
if ( ! empty( $shipment_tracking ) ) {
|
99 |
-
|
100 |
-
$shipment_tracking = array_map( function ( $shipment ) use ( $shipment_utilities ) {
|
101 |
-
|
102 |
-
$shipment['carrier_code'] = $shipment_utilities->convert_shipment_tracking_carrier_code( $shipment['tracking_provider'] );
|
103 |
-
|
104 |
-
return $shipment;
|
105 |
-
|
106 |
-
}, $shipment_tracking );
|
107 |
-
}
|
108 |
-
|
109 |
-
// limit the order status field to statuses that can be handled by Facebook
|
110 |
-
switch ( $order->get_status() ) {
|
111 |
-
|
112 |
-
case 'processing':
|
113 |
-
$allowed_statuses = [ 'wc-processing', 'wc-completed', 'wc-cancelled' ];
|
114 |
-
break;
|
115 |
-
|
116 |
-
case 'completed':
|
117 |
-
$allowed_statuses = [ 'wc-completed', 'wc-refunded' ];
|
118 |
-
break;
|
119 |
-
|
120 |
-
case 'refunded':
|
121 |
-
$allowed_statuses = [ 'wc-refunded' ];
|
122 |
-
break;
|
123 |
-
|
124 |
-
case 'cancelled':
|
125 |
-
$allowed_statuses = [ 'wc-cancelled' ];
|
126 |
-
break;
|
127 |
-
|
128 |
-
default:
|
129 |
-
$allowed_statuses = [ 'wc-pending' ];
|
130 |
-
break;
|
131 |
-
}
|
132 |
-
|
133 |
-
wp_localize_script( 'wc-facebook-commerce-orders', 'wc_facebook_commerce_orders', [
|
134 |
-
'order_id' => $order->get_id(),
|
135 |
-
'order_status' => $order->get_status(),
|
136 |
-
'is_commerce_order' => Commerce\Orders::is_commerce_order( $order ),
|
137 |
-
'shipment_tracking' => $shipment_tracking,
|
138 |
-
'allowed_commerce_statuses' => $allowed_statuses,
|
139 |
-
'complete_order_action' => AJAX::ACTION_COMPLETE_ORDER,
|
140 |
-
'complete_order_nonce' => wp_create_nonce( AJAX::ACTION_COMPLETE_ORDER ),
|
141 |
-
'cancel_order_action' => AJAX::ACTION_CANCEL_ORDER,
|
142 |
-
'cancel_order_nonce' => wp_create_nonce( AJAX::ACTION_CANCEL_ORDER ),
|
143 |
-
'complete_modal_message' => $this->get_complete_modal_message(),
|
144 |
-
'complete_modal_buttons' => $this->get_complete_modal_buttons(),
|
145 |
-
'refund_modal_message' => $this->get_refund_modal_message(),
|
146 |
-
'refund_modal_buttons' => $this->get_refund_modal_buttons(),
|
147 |
-
'cancel_modal_message' => $this->get_cancel_modal_message(),
|
148 |
-
'cancel_modal_buttons' => $this->get_cancel_modal_buttons(),
|
149 |
-
'i18n' => [
|
150 |
-
'unknown_error' => __( 'An unknown error occurred.', 'facebook-for-woocommerce' ),
|
151 |
-
'missing_tracking_number_error' => __( 'Tracking Number is missing.', 'facebook-for-woocommerce' ),
|
152 |
-
'refund_reason_label' => __( 'Refund reason:', 'facebook-for-woocommerce' ),
|
153 |
-
'refund_reason_tooltip' => __( 'Choose the reason for refunding this order.', 'facebook-for-woocommerce' ),
|
154 |
-
'refund_description_label' => __( 'Refund description (optional):', 'facebook-for-woocommerce' ),
|
155 |
-
'refund_description_tooltip' => __( 'Note: the refund description will be visible by the customer.', 'facebook-for-woocommerce' ),
|
156 |
-
],
|
157 |
-
] );
|
158 |
-
}
|
159 |
-
|
160 |
-
|
161 |
-
/**
|
162 |
-
* Adds admin notices.
|
163 |
-
*
|
164 |
-
* @internal
|
165 |
-
*
|
166 |
-
* @since 2.1.0
|
167 |
-
*/
|
168 |
-
public function add_notices() {
|
169 |
-
global $post;
|
170 |
-
|
171 |
-
if ( ! $this->is_edit_order_screen() ) {
|
172 |
-
return;
|
173 |
-
}
|
174 |
-
|
175 |
-
$order = wc_get_order( $post );
|
176 |
-
$plugin = facebook_for_woocommerce();
|
177 |
-
|
178 |
-
if ( Commerce\Orders::is_order_pending( $order ) ) {
|
179 |
-
|
180 |
-
$message = sprintf(
|
181 |
-
/* translators: Placeholders: %1$s - HTML <strong> tag, %2$s - HTML </strong> tag */
|
182 |
-
__( 'This order is currently being held by Instagram and cannot be edited. Once released by Instagram, it will move to %1$sProcessing%2$s or %1$sCancelled%2$s status.', 'facebook-for-woocommerce' ),
|
183 |
-
'<strong>', '</strong>'
|
184 |
-
);
|
185 |
-
|
186 |
-
$plugin->get_admin_notice_handler()->add_admin_notice( $message, $plugin::PLUGIN_ID . '_commerce_order_pending_' . $order->get_id(), [
|
187 |
-
'dismissible' => true,
|
188 |
-
'notice_class' => 'notice-info',
|
189 |
-
] );
|
190 |
-
}
|
191 |
-
|
192 |
-
$commerce_orders = get_transient( $this->bulk_order_update_transient );
|
193 |
-
|
194 |
-
if ( ! empty( $commerce_orders ) ) {
|
195 |
-
|
196 |
-
// if there were orders managed by Instagram updated in bulk, we need to warn the merchant that it wasn't updated
|
197 |
-
facebook_for_woocommerce()->get_message_handler()->add_error( sprintf(
|
198 |
-
_n(
|
199 |
-
/* translators: Placeholder: %s - order ID */
|
200 |
-
'Heads up! Instagram order statuses can’t be updated in bulk. Please update Instagram order %s so you can provide order details required by Instagram.',
|
201 |
-
/* translators: Placeholder: %s - order IDs list */
|
202 |
-
'Heads up! Instagram order statuses can’t be updated in bulk. Please update Instagram orders %s individually so you can provide order details required by Instagram.',
|
203 |
-
count( $commerce_orders ),
|
204 |
-
'facebook-for-woocommerce'
|
205 |
-
),
|
206 |
-
implode( ', ', $commerce_orders )
|
207 |
-
) );
|
208 |
-
|
209 |
-
delete_transient( $this->bulk_order_update_transient );
|
210 |
-
|
211 |
-
facebook_for_woocommerce()->get_message_handler()->show_messages();
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
|
216 |
-
/**
|
217 |
-
* Removes order metaboxes if the order is a Commerce pending order.
|
218 |
-
*
|
219 |
-
* @internal
|
220 |
-
*
|
221 |
-
* @since 2.1.0
|
222 |
-
*/
|
223 |
-
public function maybe_remove_order_metaboxes() {
|
224 |
-
global $post;
|
225 |
-
|
226 |
-
if ( ! $post instanceof \WP_Post || ! $this->is_edit_order_screen() ) {
|
227 |
-
return;
|
228 |
-
}
|
229 |
-
|
230 |
-
$order = wc_get_order( $post );
|
231 |
-
|
232 |
-
if ( ! $order || ! $order->has_status( 'pending' ) || ! Commerce\Orders::is_commerce_order( $order ) ) {
|
233 |
-
return;
|
234 |
-
}
|
235 |
-
|
236 |
-
remove_meta_box( 'woocommerce-order-actions', get_current_screen(), 'side' );
|
237 |
-
}
|
238 |
-
|
239 |
-
|
240 |
-
/**
|
241 |
-
* Gets the markup for the buttons used in a modal.
|
242 |
-
*
|
243 |
-
* @since 2.1.0
|
244 |
-
*
|
245 |
-
* @param string $submit_label label for the submit button
|
246 |
-
* @return string
|
247 |
-
*/
|
248 |
-
private function get_modal_buttons( $submit_label ) {
|
249 |
-
|
250 |
-
ob_start();
|
251 |
-
|
252 |
-
?>
|
253 |
-
<button
|
254 |
-
id="btn-ok"
|
255 |
-
class="button button-large button-primary"
|
256 |
-
><?php esc_html_e( $submit_label ); ?></button>
|
257 |
-
<button
|
258 |
-
class="wc-facebook-modal-cancel-button button button-large"
|
259 |
-
onclick="jQuery( '.modal-close' ).trigger( 'click' )"
|
260 |
-
><?php esc_html_e( 'Cancel', 'facebook-for-woocommerce' ); ?></button>
|
261 |
-
<?php
|
262 |
-
|
263 |
-
return ob_get_clean();
|
264 |
-
}
|
265 |
-
|
266 |
-
|
267 |
-
/**
|
268 |
-
* Gets the markup for the message used in the Complete modal.
|
269 |
-
*
|
270 |
-
* @since 2.1.0
|
271 |
-
*
|
272 |
-
* @return string
|
273 |
-
*/
|
274 |
-
private function get_complete_modal_message() {
|
275 |
-
|
276 |
-
ob_start();
|
277 |
-
|
278 |
-
$shipment_utilities = new Shipment();
|
279 |
-
|
280 |
-
echo '<div class="woocommerce_options_panel">',
|
281 |
-
'<p>', esc_html__( 'Select the carrier and tracking number for this order:', 'facebook-for-woocommerce' ), '</p>';
|
282 |
-
|
283 |
-
woocommerce_wp_select( [
|
284 |
-
'id' => 'wc_facebook_carrier',
|
285 |
-
'label' => __( 'Carrier', 'facebook-for-woocommerce' ),
|
286 |
-
'options' => $shipment_utilities->get_carrier_options(),
|
287 |
-
] );
|
288 |
-
|
289 |
-
woocommerce_wp_text_input( [
|
290 |
-
'id' => 'wc_facebook_tracking_number',
|
291 |
-
'label' => __( 'Tracking number', 'facebook-for-woocommerce' ),
|
292 |
-
] );
|
293 |
-
|
294 |
-
echo '</div>';
|
295 |
-
|
296 |
-
return ob_get_clean();
|
297 |
-
}
|
298 |
-
|
299 |
-
|
300 |
-
/**
|
301 |
-
* Gets the markup for the buttons used in the Complete modal.
|
302 |
-
*
|
303 |
-
* @since 2.1.0
|
304 |
-
*
|
305 |
-
* @return string
|
306 |
-
*/
|
307 |
-
private function get_complete_modal_buttons() {
|
308 |
-
|
309 |
-
return $this->get_modal_buttons( __( 'Submit order', 'facebook-for-woocommerce' ) );
|
310 |
-
}
|
311 |
-
|
312 |
-
|
313 |
-
/**
|
314 |
-
* Gets the markup for the message used in the Refund modal.
|
315 |
-
*
|
316 |
-
* @since 2.1.0
|
317 |
-
*
|
318 |
-
* @return string
|
319 |
-
*/
|
320 |
-
private function get_refund_modal_message() {
|
321 |
-
|
322 |
-
ob_start();
|
323 |
-
|
324 |
-
?>
|
325 |
-
<p><?php esc_html_e( 'Select a reason for refunding this order:', 'facebook-for-woocommerce' ); ?></p>
|
326 |
-
<?php
|
327 |
-
|
328 |
-
$this->render_refund_reason_field( 'wc_facebook_refund_reason_modal', false );
|
329 |
-
|
330 |
-
return ob_get_clean();
|
331 |
-
}
|
332 |
-
|
333 |
-
|
334 |
-
/**
|
335 |
-
* Gets the markup for the buttons used in the Refund modal.
|
336 |
-
*
|
337 |
-
* @since 2.1.0
|
338 |
-
*
|
339 |
-
* @return string
|
340 |
-
*/
|
341 |
-
private function get_refund_modal_buttons() {
|
342 |
-
|
343 |
-
return $this->get_modal_buttons( __( 'Submit refund', 'facebook-for-woocommerce' ) );
|
344 |
-
}
|
345 |
-
|
346 |
-
|
347 |
-
/**
|
348 |
-
* Gets the markup for the message used in the Cancel modal.
|
349 |
-
*
|
350 |
-
* @since 2.1.0
|
351 |
-
*
|
352 |
-
* @return string
|
353 |
-
*/
|
354 |
-
private function get_cancel_modal_message() {
|
355 |
-
|
356 |
-
ob_start();
|
357 |
-
|
358 |
-
?>
|
359 |
-
<p><?php esc_html_e( 'Select a reason for cancelling this order:', 'facebook-for-woocommerce' ); ?></p>
|
360 |
-
<?php
|
361 |
-
|
362 |
-
woocommerce_wp_select( [
|
363 |
-
'id' => 'wc_facebook_cancel_reason',
|
364 |
-
'label' => '',
|
365 |
-
'options' => facebook_for_woocommerce()->get_commerce_handler()->get_orders_handler()->get_cancellation_reasons(),
|
366 |
-
] );
|
367 |
-
|
368 |
-
return ob_get_clean();
|
369 |
-
}
|
370 |
-
|
371 |
-
|
372 |
-
/**
|
373 |
-
* Gets the markup for the buttons used in the Cancel modal.
|
374 |
-
*
|
375 |
-
* @since 2.1.0
|
376 |
-
*
|
377 |
-
* @return string
|
378 |
-
*/
|
379 |
-
private function get_cancel_modal_buttons() {
|
380 |
-
|
381 |
-
return $this->get_modal_buttons( __( 'Submit cancellation', 'facebook-for-woocommerce' ) );
|
382 |
-
}
|
383 |
-
|
384 |
-
|
385 |
-
/**
|
386 |
-
* Renders the refund reason field.
|
387 |
-
*
|
388 |
-
* @internal
|
389 |
-
*
|
390 |
-
* @since 2.1.0
|
391 |
-
*/
|
392 |
-
public function render_refund_reason_field( $select_id = '', $hidden = true ) {
|
393 |
-
|
394 |
-
if ( ! $this->is_edit_order_screen() ) {
|
395 |
-
return;
|
396 |
-
}
|
397 |
-
|
398 |
-
?>
|
399 |
-
<select id="<?php echo esc_attr( $select_id ?: 'wc_facebook_refund_reason' ); ?>" <?php echo $hidden ? 'style="display: none;"' : ''; ?>>
|
400 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_BUYERS_REMORSE ); ?>"><?php esc_html_e( 'Customer request', 'facebook-for-woocommerce' ); ?></option>
|
401 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_DAMAGED_GOODS ); ?>"><?php esc_html_e( 'Damaged product', 'facebook-for-woocommerce' ); ?></option>
|
402 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_NOT_AS_DESCRIBED ); ?>"><?php esc_html_e( 'Product not as described', 'facebook-for-woocommerce' ); ?></option>
|
403 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_QUALITY_ISSUE ); ?>"><?php esc_html_e( 'Quality issue', 'facebook-for-woocommerce' ); ?></option>
|
404 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_WRONG_ITEM ); ?>"><?php esc_html_e( 'Wrong item', 'facebook-for-woocommerce' ); ?></option>
|
405 |
-
<option value="<?php echo esc_attr( Commerce\Orders::REFUND_REASON_OTHER ); ?>"><?php esc_html_e( 'Other', 'facebook-for-woocommerce' ); ?></option>
|
406 |
-
</select>
|
407 |
-
<?php
|
408 |
-
}
|
409 |
-
|
410 |
-
|
411 |
-
/**
|
412 |
-
* Sends a refund request to the Commerce API when a WC refund is created.
|
413 |
-
*
|
414 |
-
* @internal
|
415 |
-
*
|
416 |
-
* @since 2.1.0
|
417 |
-
*
|
418 |
-
* @param int $refund_id refund ID
|
419 |
-
* @throws Framework\SV_WC_Plugin_Exception
|
420 |
-
*/
|
421 |
-
public function handle_refund( $refund_id ) {
|
422 |
-
|
423 |
-
$order_refund = wc_get_order( $refund_id );
|
424 |
-
|
425 |
-
if ( $order_refund instanceof \WC_Order_Refund ) {
|
426 |
-
|
427 |
-
$reason_code = isset( $_POST['wc_facebook_refund_reason'] ) ? $_POST['wc_facebook_refund_reason'] : null;
|
428 |
-
|
429 |
-
facebook_for_woocommerce()->get_commerce_handler()->get_orders_handler()->add_order_refund( $order_refund, $reason_code );
|
430 |
-
}
|
431 |
-
}
|
432 |
-
|
433 |
-
|
434 |
-
/**
|
435 |
-
* Sets a transient to display a notice regarding bulk updates for Commerce orders' statuses.
|
436 |
-
*
|
437 |
-
* @internal
|
438 |
-
*
|
439 |
-
* @since 2.1.0
|
440 |
-
*
|
441 |
-
* @param string $redirect_url redirect URL carrying results
|
442 |
-
* @param string $action bulk action
|
443 |
-
* @param int[] $order_ids IDs of orders affected by the bulk action
|
444 |
-
* @return string
|
445 |
-
*/
|
446 |
-
public function handle_bulk_update( $redirect_url, $action, $order_ids ) {
|
447 |
-
|
448 |
-
// listen for order status change actions
|
449 |
-
if ( empty( $action ) || empty( $order_ids ) || ! Framework\SV_WC_Helper::str_starts_with( $action, 'mark_' ) ) {
|
450 |
-
return $redirect_url;
|
451 |
-
}
|
452 |
-
|
453 |
-
$commerce_orders = [];
|
454 |
-
|
455 |
-
foreach ( $order_ids as $index => $order_id ) {
|
456 |
-
|
457 |
-
$order = wc_get_order( $order_id );
|
458 |
-
|
459 |
-
if ( ! $order ) {
|
460 |
-
continue;
|
461 |
-
}
|
462 |
-
|
463 |
-
if ( Commerce\Orders::is_commerce_order( $order ) ) {
|
464 |
-
|
465 |
-
unset( $order_ids[ $index ] );
|
466 |
-
|
467 |
-
$commerce_orders[] = $order->get_order_number();
|
468 |
-
}
|
469 |
-
}
|
470 |
-
|
471 |
-
if ( ! empty( $commerce_orders ) ) {
|
472 |
-
|
473 |
-
// set the orders that are not going to be updated in the transient for reference
|
474 |
-
set_transient( $this->bulk_order_update_transient, $commerce_orders, MINUTE_IN_SECONDS );
|
475 |
-
|
476 |
-
// this will prevent WooCommerce to keep processing the orders we don't want to be changed in bulk
|
477 |
-
add_filter( 'woocommerce_bulk_action_ids', static function( $ids ) use ( $order_ids ) {
|
478 |
-
return $order_ids;
|
479 |
-
} );
|
480 |
-
|
481 |
-
// finally, parse the URL (main filter callback param)
|
482 |
-
if ( empty( $order_ids ) ) {
|
483 |
-
|
484 |
-
$redirect_url = admin_url( 'edit.php?post_type=shop_order' );
|
485 |
-
|
486 |
-
} else {
|
487 |
-
|
488 |
-
$redirect_url = add_query_arg(
|
489 |
-
[
|
490 |
-
'post_type' => 'shop_order',
|
491 |
-
'bulk_action' => $action,
|
492 |
-
'changed' => count( $order_ids ),
|
493 |
-
'ids' => implode( ',', $order_ids ),
|
494 |
-
],
|
495 |
-
$redirect_url
|
496 |
-
);
|
497 |
-
}
|
498 |
-
}
|
499 |
-
|
500 |
-
return $redirect_url;
|
501 |
-
}
|
502 |
-
|
503 |
-
|
504 |
-
/**
|
505 |
-
* Removes the status actions from the order list table rows.
|
506 |
-
*
|
507 |
-
* @internal
|
508 |
-
*
|
509 |
-
* @since 2.1.0
|
510 |
-
*
|
511 |
-
* @param array $actions existing actions
|
512 |
-
* @param \WC_Order $order order object
|
513 |
-
* @return array
|
514 |
-
*/
|
515 |
-
public function remove_list_table_actions( $actions, $order ) {
|
516 |
-
|
517 |
-
if ( $order instanceof \WC_Order && Commerce\Orders::is_commerce_order( $order ) ) {
|
518 |
-
unset( $actions['processing'], $actions['complete'] );
|
519 |
-
}
|
520 |
-
|
521 |
-
return $actions;
|
522 |
-
}
|
523 |
-
|
524 |
-
|
525 |
-
/**
|
526 |
-
* Removes the status actions from the list table order preview modal.
|
527 |
-
*
|
528 |
-
* @internal
|
529 |
-
*
|
530 |
-
* @since 2.1.0
|
531 |
-
*
|
532 |
-
* @param array $actions existing actions
|
533 |
-
* @param \WC_Order $order order object
|
534 |
-
* @return array
|
535 |
-
*/
|
536 |
-
public function remove_order_preview_actions( $actions, $order ) {
|
537 |
-
|
538 |
-
if ( $order instanceof \WC_Order && Commerce\Orders::is_commerce_order( $order ) ) {
|
539 |
-
unset( $actions['status'] );
|
540 |
-
}
|
541 |
-
|
542 |
-
return $actions;
|
543 |
-
}
|
544 |
-
|
545 |
-
|
546 |
-
/**
|
547 |
-
* Prevents sending emails for Commerce orders.
|
548 |
-
*
|
549 |
-
* @internal
|
550 |
-
*
|
551 |
-
* @since 2.1.0
|
552 |
-
*
|
553 |
-
* @param bool $is_enabled whether the email is enabled in the first place
|
554 |
-
* @param \WC_Order $order order object
|
555 |
-
* @return bool
|
556 |
-
*/
|
557 |
-
public function maybe_stop_order_email( $is_enabled, $order ) {
|
558 |
-
|
559 |
-
// will decide whether to allow $is_enabled to be filtered
|
560 |
-
$is_previously_enabled = $is_enabled;
|
561 |
-
|
562 |
-
// checks whether or not the order is a Commerce order
|
563 |
-
$is_commerce_order = $order instanceof \WC_Order && \SkyVerge\WooCommerce\Facebook\Commerce\Orders::is_commerce_order( $order );
|
564 |
-
|
565 |
-
// decides whether to disable or to keep emails enabled
|
566 |
-
$is_enabled = $is_enabled && ! $is_commerce_order;
|
567 |
-
|
568 |
-
if ( $is_previously_enabled && $is_commerce_order ) {
|
569 |
-
|
570 |
-
/**
|
571 |
-
* Filters the flag used to determine whether the email is enabled.
|
572 |
-
*
|
573 |
-
* @param bool $is_enabled whether the email is enabled
|
574 |
-
* @param \WC_Order $order order object
|
575 |
-
* @param Orders $this admin orders instance
|
576 |
-
* @since 2.1.0
|
577 |
-
*
|
578 |
-
*/
|
579 |
-
$is_enabled = (bool) apply_filters( 'wc_facebook_commerce_send_woocommerce_emails', $is_enabled, $order, $this );
|
580 |
-
}
|
581 |
-
|
582 |
-
return $is_enabled;
|
583 |
-
}
|
584 |
-
|
585 |
-
|
586 |
-
/**
|
587 |
-
* Determines whether or not the order is editable.
|
588 |
-
*
|
589 |
-
* @internal
|
590 |
-
*
|
591 |
-
* @since 2.1.0
|
592 |
-
*
|
593 |
-
* @param bool $maybe_editable whether the order is editable in the first place
|
594 |
-
* @param \WC_Order $order order object
|
595 |
-
* @return bool
|
596 |
-
*/
|
597 |
-
public function is_order_editable( $maybe_editable, $order ) {
|
598 |
-
|
599 |
-
// if the order is a WC_Order, determines whether it is pending or not
|
600 |
-
$is_order_pending = $order instanceof \WC_Order && Commerce\Orders::is_order_pending( $order );
|
601 |
-
|
602 |
-
return $maybe_editable && ! $is_order_pending;
|
603 |
-
}
|
604 |
-
|
605 |
-
|
606 |
-
/**
|
607 |
-
* Determines whether or not the current screen is an orders screen.
|
608 |
-
*
|
609 |
-
* @internal
|
610 |
-
*
|
611 |
-
* @since 2.1.0
|
612 |
-
*
|
613 |
-
* @return bool
|
614 |
-
*/
|
615 |
-
public function is_orders_screen() {
|
616 |
-
|
617 |
-
return Framework\SV_WC_Helper::is_current_screen( 'edit-shop_order' ) ||
|
618 |
-
Framework\SV_WC_Helper::is_current_screen( 'shop_order' );
|
619 |
-
}
|
620 |
-
|
621 |
-
|
622 |
-
/**
|
623 |
-
* Determines whether or not the current screen is an order edit screen.
|
624 |
-
*
|
625 |
-
* @internal
|
626 |
-
*
|
627 |
-
* @since 2.1.0
|
628 |
-
*
|
629 |
-
* @return bool
|
630 |
-
*/
|
631 |
-
public function is_edit_order_screen() {
|
632 |
-
|
633 |
-
return Framework\SV_WC_Helper::is_current_screen( 'shop_order' );
|
634 |
-
}
|
635 |
-
|
636 |
-
|
637 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: facebook, automattic, woothemes
|
|
3 |
Tags: facebook, shop, catalog, advertise, pixel, product
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.5.1
|
6 |
-
Stable tag: 2.1.
|
7 |
Requires PHP: 5.6 or greater
|
8 |
MySQL: 5.6 or greater
|
9 |
License: GPLv2 or later
|
@@ -39,6 +39,9 @@ When opening a bug on GitHub, please give us as many details as possible.
|
|
39 |
|
40 |
== Changelog ==
|
41 |
|
|
|
|
|
|
|
42 |
= 2020.10.28 - version 2.1.2 =
|
43 |
* Tweak - Default variation selection will be synced to Facebook if the default product variation is already synced
|
44 |
* Fix - Trigger a pixel Search event for product search requests with a single result (works for logged in users or visitors with an active WooCommerce session)
|
3 |
Tags: facebook, shop, catalog, advertise, pixel, product
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 5.5.1
|
6 |
+
Stable tag: 2.1.3
|
7 |
Requires PHP: 5.6 or greater
|
8 |
MySQL: 5.6 or greater
|
9 |
License: GPLv2 or later
|
39 |
|
40 |
== Changelog ==
|
41 |
|
42 |
+
= 2020.10.29 - version 2.1.3 =
|
43 |
+
* Fix - Prevent error triggered while trying to refund orders
|
44 |
+
|
45 |
= 2020.10.28 - version 2.1.2 =
|
46 |
* Tweak - Default variation selection will be synced to Facebook if the default product variation is already synced
|
47 |
* Fix - Trigger a pixel Search event for product search requests with a single result (works for logged in users or visitors with an active WooCommerce session)
|