Product Feed PRO for WooCommerce - Version 4.0.0

Version Description

Fixed another issue with cached prices ending up in product feeds.

Download this release

Release Info

Developer jorisverwater
Plugin Icon 128x128 Product Feed PRO for WooCommerce
Version 4.0.0
Comparing to
See all releases

Code changes from version 3.0.0 to 4.0.0

Files changed (42) hide show
  1. TODO.txt +38 -27
  2. classes/channels/class-facebook_drm.php +6 -1
  3. classes/channels/class-fruugoaus.php +232 -0
  4. classes/channels/class-fruugoes.php +232 -0
  5. classes/channels/class-fruugonl.php +232 -0
  6. classes/channels/class-fruugouk.php +233 -0
  7. classes/channels/class-fruugous.php +232 -0
  8. classes/channels/class-google_dsa.php +30 -0
  9. classes/channels/class-google_local.php +75 -0
  10. classes/channels/class-google_local_products.php +178 -0
  11. classes/channels/class-google_shopping.php +46 -1
  12. classes/channels/class-guenstiger.php +171 -0
  13. classes/channels/class-katoni.php +121 -0
  14. classes/channels/class-manomano.php +1 -1
  15. classes/channels/class-miinto_dk.php +182 -0
  16. classes/channels/class-miinto_nl.php +182 -0
  17. classes/channels/class-miinto_pl.php +182 -0
  18. classes/channels/class-moebel.php +520 -0
  19. classes/class-activate.php +70 -35
  20. classes/class-admin-notifications.php +4 -2
  21. classes/class-attributes.php +55 -13
  22. classes/class-deactivate-cleanup.php +4 -5
  23. classes/class-get-products.php +1006 -391
  24. classes/class-google-remarketing.php +28 -0
  25. classes/class-uninstall-cleanup.php +4 -4
  26. js/woosea_autocomplete.js +24 -28
  27. js/woosea_channel.js +27 -0
  28. js/woosea_field_mapping.js +19 -8
  29. js/woosea_key.js +67 -0
  30. js/woosea_license.js +4 -3
  31. js/woosea_manage.js +194 -32
  32. js/woosea_rules.js +42 -2
  33. js/woosea_validation.js +165 -2
  34. pages/admin/woosea-generate-feed-step-0.php +83 -19
  35. pages/admin/woosea-generate-feed-step-1.php +43 -5
  36. pages/admin/woosea-generate-feed-step-4.php +51 -20
  37. pages/admin/woosea-generate-feed-step-7.php +18 -0
  38. pages/admin/woosea-key.php +141 -0
  39. pages/admin/woosea-manage-feed.php +39 -26
  40. pages/admin/woosea-manage-settings.php +282 -71
  41. readme.txt +726 -13
  42. woocommerce-sea.php +710 -237
TODO.txt CHANGED
@@ -1,32 +1,43 @@
1
- So you found my to-do list for future features in this plugin? Well, hope you enjoy the little sneak preview of what's coming. Missing some features you might like? Drop me a line at support@adtribes.io and we might just add it to the list. Thanks!
 
2
 
3
- ELITE TO DO:
4
- - toevoegen utm parameters aan alle linkjes in de plugin
5
- - notificaties zijn dismisable, maar na een tijdje moeten ze toch weer tonen voor de licentie gebruikers. Hoe gaan we dat doen?
6
 
 
 
 
 
 
7
 
8
- MOST URGENT ISSUES:
9
- 1. Fix step between page 0 en 1 for shops that have a lot of attributes. Why is it running into memory issues? Building of drop-downs full of attributes, can it be done with one call?
10
- 2. Fix status update blinking percentage
11
 
12
- TO-DO:
13
- 4. add WPML support
14
- 5. X en + operators toevoegen aan de rules zodat je prijs x 1.2 kan doen of prijs + 5 euro
15
- 6. do not immediatly start generating the product feed after final step of configuration as it might run into a timeout
16
- 7. attribute mapping werkt niet als er teveel attributen zijn. Pagina sneller maken!
17
- 8. Tracking & conversion
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  - dynamic dropdowns in GA / tracking page for values
19
- 9. Add support for Composite products: https://woocommerce.com/products/composite-products/
20
- 10. Add support for Bundled products: https://woocommerce.com/products/product-bundles/
21
- 11. Add and option to create rules with formula's in them
22
- 12. Add more complex rules based on more than just 1 condition (AND)
23
- 13. Support Amazon templates
24
- 14. Add possibility to copy/clone projects
25
- 15. Add a link to 'visit page' on plugin section page
26
- 17. Regular expression usage in category mapping and feed rules and filter settings
27
- 18. Cron interval configurable for user (exact timing instead of just daily,twicedaily or hourly)
28
- 19. Tabbed configuration of feed
29
- 20. Add localisation (at least for nl_NL and nl_BE / fr_BE) - https://codex.wordpress.org/I18n_for_WordPress_Developers#Translating_Plugins_and_Themes
30
-
31
- DESIGN ISSUES:
32
- 21. new unique grey menu icons for wordpress
1
+ So you found my to-do list for this plugin? Well, hope you enjoy the little sneak preview of what's coming.
2
+ Missing some features you might like? Drop me a line at support@adtribes.io and we might just add it to the list. Thanks!
3
 
4
+ TO DO BEFORE ELITE RELEASE:
 
 
5
 
6
+ Plugin functionalities:
7
+ - Add support for WPML - WooCommerce Multilingual (Multi-currency)
8
+ - Build a better WP Cron check, current one is not good enough
9
+ - Add support for Google Shopping product review feeds - https://developers.google.com/product-review-feeds/
10
+ - Kloppen de dynamic remarketing prijzen? Lijkt erop dat alleen de duurste variation prijs gebruikt wordt? Sowieso complete remarketing hertesten!
11
 
 
 
 
12
 
13
+ Adtribes.io website changes:
14
+ - Confirmation email aanpassen: links naar blogs, FAQ en algemene voorwaarden
15
+ - Search functionaliteit bouwen die zoekt op Blog posts en pages
16
+ - Er zitten maar 3 attributen in de URL waardoor structured data price ook niet klopt: https://adtribes.io/product/create-custom-feed/?attribute_pa_size=small&attribute_pa_color=yellow&attribute_kleurtje=White%2FBlack
17
+ - WP Logo aanpassen, in het midden uitlijnen en AdTribes toevoegen
18
+ - Op de blog en alle andere pagina's buttons / links opnemen naar de WP-download pagina en de Elite pagina
19
+ - Logo plaatsen op website zelf
20
+ - Icon maken voor in WP-admin menu
21
+
22
+
23
+ Write blog articles:
24
+ - handleiding schrijven voor hele Shopping & Facebook proces
25
+ - how to only include products from 1 specific category in your product feed
26
+ - explain the different price attributes of the plugin
27
+ - how to send a debug.log to our support department (debug=true uitleg).
28
+ - how to create a g:product_type mapping (Category path)
29
+
30
+
31
+ OTHER ISSUES:
32
+ - Remarketing and structured data fix, check if prices are correct (VAT issue) - on variation pages it shows prices without VAT in the structured data
33
+ - Remarketing tags not yet on thank-you purchase page
34
+ - Incomplete remarketing tag on cart-page
35
+ - Tracking & conversion
36
  - dynamic dropdowns in GA / tracking page for values
37
+ - Add support for Composite products: https://woocommerce.com/products/composite-products/
38
+ - Add support for Bundled products: https://woocommerce.com/products/product-bundles/
39
+ - Add more complex rules based on more than just 1 condition (AND)
40
+ - Add localisation (at least for nl_NL and nl_BE / fr_BE) - https://codex.wordpress.org/I18n_for_WordPress_Developers#Translating_Plugins_and_Themes
41
+ - AMAZON integration:
42
+ - requires a professional seller account, 39 dollar a month, before being able to create a developer account
43
+ - only than we can use their AWS service needed to connect our plugin
 
 
 
 
 
 
 
classes/channels/class-facebook_drm.php CHANGED
@@ -57,7 +57,7 @@ class WooSEA_facebook_drm {
57
  "name" => "price",
58
  "feed_name" => "g:price",
59
  "format" => "required",
60
- "woo_suggest" => "price",
61
  ),
62
  "gtin" => array(
63
  "name" => "gtin",
@@ -152,6 +152,11 @@ class WooSEA_facebook_drm {
152
  "feed_name" => "g:shipping_weight",
153
  "format" => "optional",
154
  ),
 
 
 
 
 
155
  "shipping_size" => array(
156
  "name" => "shipping_size",
157
  "feed_name" => "g:shipping_size",
57
  "name" => "price",
58
  "feed_name" => "g:price",
59
  "format" => "required",
60
+ "woo_suggest" => "regular_price",
61
  ),
62
  "gtin" => array(
63
  "name" => "gtin",
152
  "feed_name" => "g:shipping_weight",
153
  "format" => "optional",
154
  ),
155
+ "size" => array(
156
+ "name" => "size",
157
+ "feed_name" => "g:size",
158
+ "format" => "optional",
159
+ ),
160
  "shipping_size" => array(
161
  "name" => "shipping_size",
162
  "feed_name" => "g:shipping_size",
classes/channels/class-fruugoaus.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Fruugoaustralia.com feeds
4
+ */
5
+ class WooSEA_fruugoaus {
6
+ public $fruugoaus;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $fruugoaus = array(
13
+ "Feed fields" => array(
14
+ "Product Id" => array(
15
+ "name" => "ProductId",
16
+ "feed_name" => "ProductId",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Sku Id" => array(
21
+ "name" => "SkuId",
22
+ "feed_name" => "SkuId",
23
+ "format" => "required",
24
+ "woo_suggest" => "sku",
25
+ ),
26
+ "GTINs" => array(
27
+ "name" => "EAN",
28
+ "feed_name" => "EAN",
29
+ "format" => "required",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "Brand",
33
+ "feed_name" => "Brand",
34
+ "format" => "required",
35
+ ),
36
+ "Category" => array(
37
+ "name" => "Category",
38
+ "feed_name" => "Category",
39
+ "format" => "required",
40
+ "woo_suggest" => "category",
41
+ ),
42
+ "Image URL 1" => array(
43
+ "name" => "Imageurl1",
44
+ "feed_name" => "Imageurl1",
45
+ "format" => "required",
46
+ "woo_suggest" => "image",
47
+ ),
48
+ "Stock Status" => array(
49
+ "name" => "StockStatus",
50
+ "feed_name" => "StockStatus",
51
+ "format" => "required",
52
+ "woo_suggest" => "availability",
53
+ ),
54
+ "Quantity in Stock" => array(
55
+ "name" => "StockQuantity",
56
+ "feed_name" => "StockQuantity",
57
+ "format" => "required",
58
+ ),
59
+ "Title" => array(
60
+ "name" => "Title",
61
+ "feed_name" => "Title",
62
+ "format" => "required",
63
+ "woo_suggest" => "title",
64
+ ),
65
+ "Description" => array(
66
+ "name" => "Description",
67
+ "feed_name" => "Description",
68
+ "format" => "required",
69
+ "woo_suggest" => "description",
70
+ ),
71
+ "Normal Price With VAT" => array(
72
+ "name" => "NormalPriceWithVat",
73
+ "feed_name" => "NormalPriceWithVat",
74
+ "format" => "required",
75
+ "woo_suggest" => "price",
76
+ ),
77
+ "Normal Price Without VAT" => array(
78
+ "name" => "NormalPriceWithoutVat",
79
+ "feed_name" => "NormalPriceWithoutVat",
80
+ "format" => "optional",
81
+ ),
82
+ "VAT Rate" => array(
83
+ "name" => "VatRate",
84
+ "feed_name" => "VatRate",
85
+ "format" => "required",
86
+ ),
87
+ "Image URL 2" => array(
88
+ "name" => "Imageurl2",
89
+ "feed_name" => "Imageurl2",
90
+ "format" => "optional",
91
+ ),
92
+ "Image URL 3" => array(
93
+ "name" => "Imageurl3",
94
+ "feed_name" => "Imageurl3",
95
+ "format" => "optional",
96
+ ),
97
+ "Image URL 4" => array(
98
+ "name" => "Imageurl4",
99
+ "feed_name" => "Imageurl4",
100
+ "format" => "optional",
101
+ ),
102
+ "Image URL 5" => array(
103
+ "name" => "Imageurl5",
104
+ "feed_name" => "Imageurl5",
105
+ "format" => "optional",
106
+ ),
107
+ "Language" => array(
108
+ "name" => "Language",
109
+ "feed_name" => "Language",
110
+ "format" => "optional",
111
+ ),
112
+ "Attribute Size" => array(
113
+ "name" => "AttributeSize",
114
+ "feed_name" => "AttributeSize",
115
+ "format" => "optional",
116
+ ),
117
+ "Attribute Color" => array(
118
+ "name" => "AttributeColor",
119
+ "feed_name" => "AttributeColor",
120
+ "format" => "optional",
121
+ ),
122
+ "Currency" => array(
123
+ "name" => "Currency",
124
+ "feed_name" => "Currency",
125
+ "format" => "optional",
126
+ ),
127
+ "Discount Price Without VAT" => array(
128
+ "name" => "DiscountPriceWithoutVAT",
129
+ "feed_name" => "DiscountPriceWithoutVAT",
130
+ "format" => "optional",
131
+ ),
132
+ "Discount Price With VAT" => array(
133
+ "name" => "DiscountPriceWithVAT",
134
+ "feed_name" => "DiscountPriceWithVAT",
135
+ "format" => "optional",
136
+ ),
137
+ "ISBN" => array(
138
+ "name" => "ISBN",
139
+ "feed_name" => "ISBN",
140
+ "format" => "optional",
141
+ ),
142
+ "Manufacturer" => array(
143
+ "name" => "Manufacturer",
144
+ "feed_name" => "Manufacturer",
145
+ "format" => "optional",
146
+ ),
147
+ "Restock Date" => array(
148
+ "name" => "RestockDate",
149
+ "feed_name" => "RestockDate",
150
+ "format" => "optional",
151
+ ),
152
+ "Lead Time" => array(
153
+ "name" => "LeadTime",
154
+ "feed_name" => "LeadTime",
155
+ "format" => "optional",
156
+ ),
157
+ "Package Weight" => array(
158
+ "name" => "PackageWeight",
159
+ "feed_name" => "PackageWeight",
160
+ "format" => "optional",
161
+ ),
162
+ "Attribute 1" => array(
163
+ "name" => "Attribute1",
164
+ "feed_name" => "Attribute1",
165
+ "format" => "optional",
166
+ ),
167
+ "Attribute 2" => array(
168
+ "name" => "Attribute2",
169
+ "feed_name" => "Attribute2",
170
+ "format" => "optional",
171
+ ),
172
+ "Attribute 3" => array(
173
+ "name" => "Attribute3",
174
+ "feed_name" => "Attribute3",
175
+ "format" => "optional",
176
+ ),
177
+ "Attribute 4" => array(
178
+ "name" => "Attribute4",
179
+ "feed_name" => "Attribute4",
180
+ "format" => "optional",
181
+ ),
182
+ "Attribute 5" => array(
183
+ "name" => "Attribute5",
184
+ "feed_name" => "Attribute5",
185
+ "format" => "optional",
186
+ ),
187
+ "Attribute 6" => array(
188
+ "name" => "Attribute6",
189
+ "feed_name" => "Attribute6",
190
+ "format" => "optional",
191
+ ),
192
+ "Attribute 7" => array(
193
+ "name" => "Attribute7",
194
+ "feed_name" => "Attribute7",
195
+ "format" => "optional",
196
+ ),
197
+ "Attribute 8" => array(
198
+ "name" => "Attribute8",
199
+ "feed_name" => "Attribute8",
200
+ "format" => "optional",
201
+ ),
202
+ "Attribute 9" => array(
203
+ "name" => "Attribute9",
204
+ "feed_name" => "Attribute9",
205
+ "format" => "optional",
206
+ ),
207
+ "Attribute 10" => array(
208
+ "name" => "Attribute10",
209
+ "feed_name" => "Attribute10",
210
+ "format" => "optional",
211
+ ),
212
+ "Country" => array(
213
+ "name" => "Country",
214
+ "feed_name" => "Country",
215
+ "format" => "optional",
216
+ ),
217
+ "Discount Price Start Date" => array(
218
+ "name" => "DiscountPriceStartDate",
219
+ "feed_name" => "DiscountPriceStartDate",
220
+ "format" => "optional",
221
+ ),
222
+ "Discount Price End Date" => array(
223
+ "name" => "DiscountPriceEndDate",
224
+ "feed_name" => "DiscountPriceEndDate",
225
+ "format" => "optional",
226
+ ),
227
+ ),
228
+ );
229
+ return $fruugoaus;
230
+ }
231
+ }
232
+ ?>
classes/channels/class-fruugoes.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Fruugo.es feeds
4
+ */
5
+ class WooSEA_fruugoes {
6
+ public $fruugoes;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $fruugoes = array(
13
+ "Feed fields" => array(
14
+ "Product Id" => array(
15
+ "name" => "ProductId",
16
+ "feed_name" => "ProductId",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Sku Id" => array(
21
+ "name" => "SkuId",
22
+ "feed_name" => "SkuId",
23
+ "format" => "required",
24
+ "woo_suggest" => "sku",
25
+ ),
26
+ "GTINs" => array(
27
+ "name" => "EAN",
28
+ "feed_name" => "EAN",
29
+ "format" => "required",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "Brand",
33
+ "feed_name" => "Brand",
34
+ "format" => "required",
35
+ ),
36
+ "Category" => array(
37
+ "name" => "Category",
38
+ "feed_name" => "Category",
39
+ "format" => "required",
40
+ "woo_suggest" => "category",
41
+ ),
42
+ "Image URL 1" => array(
43
+ "name" => "Imageurl1",
44
+ "feed_name" => "Imageurl1",
45
+ "format" => "required",
46
+ "woo_suggest" => "image",
47
+ ),
48
+ "Stock Status" => array(
49
+ "name" => "StockStatus",
50
+ "feed_name" => "StockStatus",
51
+ "format" => "required",
52
+ "woo_suggest" => "availability",
53
+ ),
54
+ "Quantity in Stock" => array(
55
+ "name" => "StockQuantity",
56
+ "feed_name" => "StockQuantity",
57
+ "format" => "required",
58
+ ),
59
+ "Title" => array(
60
+ "name" => "Title",
61
+ "feed_name" => "Title",
62
+ "format" => "required",
63
+ "woo_suggest" => "title",
64
+ ),
65
+ "Description" => array(
66
+ "name" => "Description",
67
+ "feed_name" => "Description",
68
+ "format" => "required",
69
+ "woo_suggest" => "description",
70
+ ),
71
+ "Normal Price With VAT" => array(
72
+ "name" => "NormalPriceWithVat",
73
+ "feed_name" => "NormalPriceWithVat",
74
+ "format" => "required",
75
+ "woo_suggest" => "price",
76
+ ),
77
+ "Normal Price Without VAT" => array(
78
+ "name" => "NormalPriceWithoutVat",
79
+ "feed_name" => "NormalPriceWithoutVat",
80
+ "format" => "optional",
81
+ ),
82
+ "VAT Rate" => array(
83
+ "name" => "VatRate",
84
+ "feed_name" => "VatRate",
85
+ "format" => "required",
86
+ ),
87
+ "Image URL 2" => array(
88
+ "name" => "Imageurl2",
89
+ "feed_name" => "Imageurl2",
90
+ "format" => "optional",
91
+ ),
92
+ "Image URL 3" => array(
93
+ "name" => "Imageurl3",
94
+ "feed_name" => "Imageurl3",
95
+ "format" => "optional",
96
+ ),
97
+ "Image URL 4" => array(
98
+ "name" => "Imageurl4",
99
+ "feed_name" => "Imageurl4",
100
+ "format" => "optional",
101
+ ),
102
+ "Image URL 5" => array(
103
+ "name" => "Imageurl5",
104
+ "feed_name" => "Imageurl5",
105
+ "format" => "optional",
106
+ ),
107
+ "Language" => array(
108
+ "name" => "Language",
109
+ "feed_name" => "Language",
110
+ "format" => "optional",
111
+ ),
112
+ "Attribute Size" => array(
113
+ "name" => "AttributeSize",
114
+ "feed_name" => "AttributeSize",
115
+ "format" => "optional",
116
+ ),
117
+ "Attribute Color" => array(
118
+ "name" => "AttributeColor",
119
+ "feed_name" => "AttributeColor",
120
+ "format" => "optional",
121
+ ),
122
+ "Currency" => array(
123
+ "name" => "Currency",
124
+ "feed_name" => "Currency",
125
+ "format" => "optional",
126
+ ),
127
+ "Discount Price Without VAT" => array(
128
+ "name" => "DiscountPriceWithoutVAT",
129
+ "feed_name" => "DiscountPriceWithoutVAT",
130
+ "format" => "optional",
131
+ ),
132
+ "Discount Price With VAT" => array(
133
+ "name" => "DiscountPriceWithVAT",
134
+ "feed_name" => "DiscountPriceWithVAT",
135
+ "format" => "optional",
136
+ ),
137
+ "ISBN" => array(
138
+ "name" => "ISBN",
139
+ "feed_name" => "ISBN",
140
+ "format" => "optional",
141
+ ),
142
+ "Manufacturer" => array(
143
+ "name" => "Manufacturer",
144
+ "feed_name" => "Manufacturer",
145
+ "format" => "optional",
146
+ ),
147
+ "Restock Date" => array(
148
+ "name" => "RestockDate",
149
+ "feed_name" => "RestockDate",
150
+ "format" => "optional",
151
+ ),
152
+ "Lead Time" => array(
153
+ "name" => "LeadTime",
154
+ "feed_name" => "LeadTime",
155
+ "format" => "optional",
156
+ ),
157
+ "Package Weight" => array(
158
+ "name" => "PackageWeight",
159
+ "feed_name" => "PackageWeight",
160
+ "format" => "optional",
161
+ ),
162
+ "Attribute 1" => array(
163
+ "name" => "Attribute1",
164
+ "feed_name" => "Attribute1",
165
+ "format" => "optional",
166
+ ),
167
+ "Attribute 2" => array(
168
+ "name" => "Attribute2",
169
+ "feed_name" => "Attribute2",
170
+ "format" => "optional",
171
+ ),
172
+ "Attribute 3" => array(
173
+ "name" => "Attribute3",
174
+ "feed_name" => "Attribute3",
175
+ "format" => "optional",
176
+ ),
177
+ "Attribute 4" => array(
178
+ "name" => "Attribute4",
179
+ "feed_name" => "Attribute4",
180
+ "format" => "optional",
181
+ ),
182
+ "Attribute 5" => array(
183
+ "name" => "Attribute5",
184
+ "feed_name" => "Attribute5",
185
+ "format" => "optional",
186
+ ),
187
+ "Attribute 6" => array(
188
+ "name" => "Attribute6",
189
+ "feed_name" => "Attribute6",
190
+ "format" => "optional",
191
+ ),
192
+ "Attribute 7" => array(
193
+ "name" => "Attribute7",
194
+ "feed_name" => "Attribute7",
195
+ "format" => "optional",
196
+ ),
197
+ "Attribute 8" => array(
198
+ "name" => "Attribute8",
199
+ "feed_name" => "Attribute8",
200
+ "format" => "optional",
201
+ ),
202
+ "Attribute 9" => array(
203
+ "name" => "Attribute9",
204
+ "feed_name" => "Attribute9",
205
+ "format" => "optional",
206
+ ),
207
+ "Attribute 10" => array(
208
+ "name" => "Attribute10",
209
+ "feed_name" => "Attribute10",
210
+ "format" => "optional",
211
+ ),
212
+ "Country" => array(
213
+ "name" => "Country",
214
+ "feed_name" => "Country",
215
+ "format" => "optional",
216
+ ),
217
+ "Discount Price Start Date" => array(
218
+ "name" => "DiscountPriceStartDate",
219
+ "feed_name" => "DiscountPriceStartDate",
220
+ "format" => "optional",
221
+ ),
222
+ "Discount Price End Date" => array(
223
+ "name" => "DiscountPriceEndDate",
224
+ "feed_name" => "DiscountPriceEndDate",
225
+ "format" => "optional",
226
+ ),
227
+ ),
228
+ );
229
+ return $fruugoes;
230
+ }
231
+ }
232
+ ?>
classes/channels/class-fruugonl.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Fruugo.nl feeds
4
+ */
5
+ class WooSEA_fruugonl {
6
+ public $fruugonl;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $fruugonl = array(
13
+ "Feed fields" => array(
14
+ "Product Id" => array(
15
+ "name" => "ProductId",
16
+ "feed_name" => "ProductId",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Sku Id" => array(
21
+ "name" => "SkuId",
22
+ "feed_name" => "SkuId",
23
+ "format" => "required",
24
+ "woo_suggest" => "sku",
25
+ ),
26
+ "GTINs" => array(
27
+ "name" => "EAN",
28
+ "feed_name" => "EAN",
29
+ "format" => "required",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "Brand",
33
+ "feed_name" => "Brand",
34
+ "format" => "required",
35
+ ),
36
+ "Category" => array(
37
+ "name" => "Category",
38
+ "feed_name" => "Category",
39
+ "format" => "required",
40
+ "woo_suggest" => "category",
41
+ ),
42
+ "Image URL 1" => array(
43
+ "name" => "Imageurl1",
44
+ "feed_name" => "Imageurl1",
45
+ "format" => "required",
46
+ "woo_suggest" => "image",
47
+ ),
48
+ "Stock Status" => array(
49
+ "name" => "StockStatus",
50
+ "feed_name" => "StockStatus",
51
+ "format" => "required",
52
+ "woo_suggest" => "availability",
53
+ ),
54
+ "Quantity in Stock" => array(
55
+ "name" => "StockQuantity",
56
+ "feed_name" => "StockQuantity",
57
+ "format" => "required",
58
+ ),
59
+ "Title" => array(
60
+ "name" => "Title",
61
+ "feed_name" => "Title",
62
+ "format" => "required",
63
+ "woo_suggest" => "title",
64
+ ),
65
+ "Description" => array(
66
+ "name" => "Description",
67
+ "feed_name" => "Description",
68
+ "format" => "required",
69
+ "woo_suggest" => "description",
70
+ ),
71
+ "Normal Price With VAT" => array(
72
+ "name" => "NormalPriceWithVat",
73
+ "feed_name" => "NormalPriceWithVat",
74
+ "format" => "required",
75
+ "woo_suggest" => "price",
76
+ ),
77
+ "Normal Price Without VAT" => array(
78
+ "name" => "NormalPriceWithoutVat",
79
+ "feed_name" => "NormalPriceWithoutVat",
80
+ "format" => "optional",
81
+ ),
82
+ "VAT Rate" => array(
83
+ "name" => "VatRate",
84
+ "feed_name" => "VatRate",
85
+ "format" => "required",
86
+ ),
87
+ "Image URL 2" => array(
88
+ "name" => "Imageurl2",
89
+ "feed_name" => "Imageurl2",
90
+ "format" => "optional",
91
+ ),
92
+ "Image URL 3" => array(
93
+ "name" => "Imageurl3",
94
+ "feed_name" => "Imageurl3",
95
+ "format" => "optional",
96
+ ),
97
+ "Image URL 4" => array(
98
+ "name" => "Imageurl4",
99
+ "feed_name" => "Imageurl4",
100
+ "format" => "optional",
101
+ ),
102
+ "Image URL 5" => array(
103
+ "name" => "Imageurl5",
104
+ "feed_name" => "Imageurl5",
105
+ "format" => "optional",
106
+ ),
107
+ "Language" => array(
108
+ "name" => "Language",
109
+ "feed_name" => "Language",
110
+ "format" => "optional",
111
+ ),
112
+ "Attribute Size" => array(
113
+ "name" => "AttributeSize",
114
+ "feed_name" => "AttributeSize",
115
+ "format" => "optional",
116
+ ),
117
+ "Attribute Color" => array(
118
+ "name" => "AttributeColor",
119
+ "feed_name" => "AttributeColor",
120
+ "format" => "optional",
121
+ ),
122
+ "Currency" => array(
123
+ "name" => "Currency",
124
+ "feed_name" => "Currency",
125
+ "format" => "optional",
126
+ ),
127
+ "Discount Price Without VAT" => array(
128
+ "name" => "DiscountPriceWithoutVAT",
129
+ "feed_name" => "DiscountPriceWithoutVAT",
130
+ "format" => "optional",
131
+ ),
132
+ "Discount Price With VAT" => array(
133
+ "name" => "DiscountPriceWithVAT",
134
+ "feed_name" => "DiscountPriceWithVAT",
135
+ "format" => "optional",
136
+ ),
137
+ "ISBN" => array(
138
+ "name" => "ISBN",
139
+ "feed_name" => "ISBN",
140
+ "format" => "optional",
141
+ ),
142
+ "Manufacturer" => array(
143
+ "name" => "Manufacturer",
144
+ "feed_name" => "Manufacturer",
145
+ "format" => "optional",
146
+ ),
147
+ "Restock Date" => array(
148
+ "name" => "RestockDate",
149
+ "feed_name" => "RestockDate",
150
+ "format" => "optional",
151
+ ),
152
+ "Lead Time" => array(
153
+ "name" => "LeadTime",
154
+ "feed_name" => "LeadTime",
155
+ "format" => "optional",
156
+ ),
157
+ "Package Weight" => array(
158
+ "name" => "PackageWeight",
159
+ "feed_name" => "PackageWeight",
160
+ "format" => "optional",
161
+ ),
162
+ "Attribute 1" => array(
163
+ "name" => "Attribute1",
164
+ "feed_name" => "Attribute1",
165
+ "format" => "optional",
166
+ ),
167
+ "Attribute 2" => array(
168
+ "name" => "Attribute2",
169
+ "feed_name" => "Attribute2",
170
+ "format" => "optional",
171
+ ),
172
+ "Attribute 3" => array(
173
+ "name" => "Attribute3",
174
+ "feed_name" => "Attribute3",
175
+ "format" => "optional",
176
+ ),
177
+ "Attribute 4" => array(
178
+ "name" => "Attribute4",
179
+ "feed_name" => "Attribute4",
180
+ "format" => "optional",
181
+ ),
182
+ "Attribute 5" => array(
183
+ "name" => "Attribute5",
184
+ "feed_name" => "Attribute5",
185
+ "format" => "optional",
186
+ ),
187
+ "Attribute 6" => array(
188
+ "name" => "Attribute6",
189
+ "feed_name" => "Attribute6",
190
+ "format" => "optional",
191
+ ),
192
+ "Attribute 7" => array(
193
+ "name" => "Attribute7",
194
+ "feed_name" => "Attribute7",
195
+ "format" => "optional",
196
+ ),
197
+ "Attribute 8" => array(
198
+ "name" => "Attribute8",
199
+ "feed_name" => "Attribute8",
200
+ "format" => "optional",
201
+ ),
202
+ "Attribute 9" => array(
203
+ "name" => "Attribute9",
204
+ "feed_name" => "Attribute9",
205
+ "format" => "optional",
206
+ ),
207
+ "Attribute 10" => array(
208
+ "name" => "Attribute10",
209
+ "feed_name" => "Attribute10",
210
+ "format" => "optional",
211
+ ),
212
+ "Country" => array(
213
+ "name" => "Country",
214
+ "feed_name" => "Country",
215
+ "format" => "optional",
216
+ ),
217
+ "Discount Price Start Date" => array(
218
+ "name" => "DiscountPriceStartDate",
219
+ "feed_name" => "DiscountPriceStartDate",
220
+ "format" => "optional",
221
+ ),
222
+ "Discount Price End Date" => array(
223
+ "name" => "DiscountPriceEndDate",
224
+ "feed_name" => "DiscountPriceEndDate",
225
+ "format" => "optional",
226
+ ),
227
+ ),
228
+ );
229
+ return $fruugonl;
230
+ }
231
+ }
232
+ ?>
classes/channels/class-fruugouk.php ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Fruugo.co.uk feeds
4
+ */
5
+ class WooSEA_fruugouk {
6
+ public $fruugouk;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $fruugouk = array(
13
+ "Feed fields" => array(
14
+ "Product Id" => array(
15
+ "name" => "ProductId",
16
+ "feed_name" => "ProductId",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Sku Id" => array(
21
+ "name" => "SkuId",
22
+ "feed_name" => "SkuId",
23
+ "format" => "required",
24
+ "woo_suggest" => "sku",
25
+ ),
26
+ "GTINs" => array(
27
+ "name" => "EAN",
28
+ "feed_name" => "EAN",
29
+ "format" => "required",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "Brand",
33
+ "feed_name" => "Brand",
34
+ "format" => "required",
35
+ ),
36
+ "Category" => array(
37
+ "name" => "Category",
38
+ "feed_name" => "Category",
39
+ "format" => "required",
40
+ "woo_suggest" => "category",
41
+ ),
42
+ "Image URL 1" => array(
43
+ "name" => "Imageurl1",
44
+ "feed_name" => "Imageurl1",
45
+ "format" => "required",
46
+ "woo_suggest" => "image",
47
+ ),
48
+ "Stock Status" => array(
49
+ "name" => "StockStatus",
50
+ "feed_name" => "StockStatus",
51
+ "format" => "required",
52
+ "woo_suggest" => "availability",
53
+ ),
54
+ "Quantity in Stock" => array(
55
+ "name" => "StockQuantity",
56
+ "feed_name" => "StockQuantity",
57
+ "format" => "required",
58
+ ),
59
+ "Title" => array(
60
+ "name" => "Title",
61
+ "feed_name" => "Title",
62
+ "format" => "required",
63
+ "woo_suggest" => "title",
64
+ ),
65
+ "Description" => array(
66
+ "name" => "Description",
67
+ "feed_name" => "Description",
68
+ "format" => "required",
69
+ "woo_suggest" => "description",
70
+ ),
71
+ "Normal Price Without VAT" => array(
72
+ "name" => "NormalPriceWithoutVat",
73
+ "feed_name" => "NormalPriceWithoutVat",
74
+ "format" => "optional",
75
+ ),
76
+
77
+ "Normal Price With VAT" => array(
78
+ "name" => "NormalPriceWithVat",
79
+ "feed_name" => "NormalPriceWithVat",
80
+ "format" => "required",
81
+ "woo_suggest" => "price",
82
+ ),
83
+ "VAT Rate" => array(
84
+ "name" => "VatRate",
85
+ "feed_name" => "VatRate",
86
+ "format" => "required",
87
+ ),
88
+ "Image URL 2" => array(
89
+ "name" => "Imageurl2",
90
+ "feed_name" => "Imageurl2",
91
+ "format" => "optional",
92
+ ),
93
+ "Image URL 3" => array(
94
+ "name" => "Imageurl3",
95
+ "feed_name" => "Imageurl3",
96
+ "format" => "optional",
97
+ ),
98
+ "Image URL 4" => array(
99
+ "name" => "Imageurl4",
100
+ "feed_name" => "Imageurl4",
101
+ "format" => "optional",
102
+ ),
103
+ "Image URL 5" => array(
104
+ "name" => "Imageurl5",
105
+ "feed_name" => "Imageurl5",
106
+ "format" => "optional",
107
+ ),
108
+ "Language" => array(
109
+ "name" => "Language",
110
+ "feed_name" => "Language",
111
+ "format" => "optional",
112
+ ),
113
+ "Attribute Size" => array(
114
+ "name" => "AttributeSize",
115
+ "feed_name" => "AttributeSize",
116
+ "format" => "optional",
117
+ ),
118
+ "Attribute Color" => array(
119
+ "name" => "AttributeColor",
120
+ "feed_name" => "AttributeColor",
121
+ "format" => "optional",
122
+ ),
123
+ "Currency" => array(
124
+ "name" => "Currency",
125
+ "feed_name" => "Currency",
126
+ "format" => "optional",
127
+ ),
128
+ "Discount Price Without VAT" => array(
129
+ "name" => "DiscountPriceWithoutVAT",
130
+ "feed_name" => "DiscountPriceWithoutVAT",
131
+ "format" => "optional",
132
+ ),
133
+ "Discount Price With VAT" => array(
134
+ "name" => "DiscountPriceWithVAT",
135
+ "feed_name" => "DiscountPriceWithVAT",
136
+ "format" => "optional",
137
+ ),
138
+ "ISBN" => array(
139
+ "name" => "ISBN",
140
+ "feed_name" => "ISBN",
141
+ "format" => "optional",
142
+ ),
143
+ "Manufacturer" => array(
144
+ "name" => "Manufacturer",
145
+ "feed_name" => "Manufacturer",
146
+ "format" => "optional",
147
+ ),
148
+ "Restock Date" => array(
149
+ "name" => "RestockDate",
150
+ "feed_name" => "RestockDate",
151
+ "format" => "optional",
152
+ ),
153
+ "Lead Time" => array(
154
+ "name" => "LeadTime",
155
+ "feed_name" => "LeadTime",
156
+ "format" => "optional",
157
+ ),
158
+ "Package Weight" => array(
159
+ "name" => "PackageWeight",
160
+ "feed_name" => "PackageWeight",
161
+ "format" => "optional",
162
+ ),
163
+ "Attribute 1" => array(
164
+ "name" => "Attribute1",
165
+ "feed_name" => "Attribute1",
166
+ "format" => "optional",
167
+ ),
168
+ "Attribute 2" => array(
169
+ "name" => "Attribute2",
170
+ "feed_name" => "Attribute2",
171
+ "format" => "optional",
172
+ ),
173
+ "Attribute 3" => array(
174
+ "name" => "Attribute3",
175
+ "feed_name" => "Attribute3",
176
+ "format" => "optional",
177
+ ),
178
+ "Attribute 4" => array(
179
+ "name" => "Attribute4",
180
+ "feed_name" => "Attribute4",
181
+ "format" => "optional",
182
+ ),
183
+ "Attribute 5" => array(
184
+ "name" => "Attribute5",
185
+ "feed_name" => "Attribute5",
186
+ "format" => "optional",
187
+ ),
188
+ "Attribute 6" => array(
189
+ "name" => "Attribute6",
190
+ "feed_name" => "Attribute6",
191
+ "format" => "optional",
192
+ ),
193
+ "Attribute 7" => array(
194
+ "name" => "Attribute7",
195
+ "feed_name" => "Attribute7",
196
+ "format" => "optional",
197
+ ),
198
+ "Attribute 8" => array(
199
+ "name" => "Attribute8",
200
+ "feed_name" => "Attribute8",
201
+ "format" => "optional",
202
+ ),
203
+ "Attribute 9" => array(
204
+ "name" => "Attribute9",
205
+ "feed_name" => "Attribute9",
206
+ "format" => "optional",
207
+ ),
208
+ "Attribute 10" => array(
209
+ "name" => "Attribute10",
210
+ "feed_name" => "Attribute10",
211
+ "format" => "optional",
212
+ ),
213
+ "Country" => array(
214
+ "name" => "Country",
215
+ "feed_name" => "Country",
216
+ "format" => "optional",
217
+ ),
218
+ "Discount Price Start Date" => array(
219
+ "name" => "DiscountPriceStartDate",
220
+ "feed_name" => "DiscountPriceStartDate",
221
+ "format" => "optional",
222
+ ),
223
+ "Discount Price End Date" => array(
224
+ "name" => "DiscountPriceEndDate",
225
+ "feed_name" => "DiscountPriceEndDate",
226
+ "format" => "optional",
227
+ ),
228
+ ),
229
+ );
230
+ return $fruugouk;
231
+ }
232
+ }
233
+ ?>
classes/channels/class-fruugous.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Fruugo.us feeds
4
+ */
5
+ class WooSEA_fruugous {
6
+ public $fruugous;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $fruugous = array(
13
+ "Feed fields" => array(
14
+ "Product Id" => array(
15
+ "name" => "ProductId",
16
+ "feed_name" => "ProductId",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Sku Id" => array(
21
+ "name" => "SkuId",
22
+ "feed_name" => "SkuId",
23
+ "format" => "required",
24
+ "woo_suggest" => "sku",
25
+ ),
26
+ "GTINs" => array(
27
+ "name" => "EAN",
28
+ "feed_name" => "EAN",
29
+ "format" => "required",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "Brand",
33
+ "feed_name" => "Brand",
34
+ "format" => "required",
35
+ ),
36
+ "Category" => array(
37
+ "name" => "Category",
38
+ "feed_name" => "Category",
39
+ "format" => "required",
40
+ "woo_suggest" => "category",
41
+ ),
42
+ "Image URL 1" => array(
43
+ "name" => "Imageurl1",
44
+ "feed_name" => "Imageurl1",
45
+ "format" => "required",
46
+ "woo_suggest" => "image",
47
+ ),
48
+ "Stock Status" => array(
49
+ "name" => "StockStatus",
50
+ "feed_name" => "StockStatus",
51
+ "format" => "required",
52
+ "woo_suggest" => "availability",
53
+ ),
54
+ "Quantity in Stock" => array(
55
+ "name" => "StockQuantity",
56
+ "feed_name" => "StockQuantity",
57
+ "format" => "required",
58
+ ),
59
+ "Title" => array(
60
+ "name" => "Title",
61
+ "feed_name" => "Title",
62
+ "format" => "required",
63
+ "woo_suggest" => "title",
64
+ ),
65
+ "Description" => array(
66
+ "name" => "Description",
67
+ "feed_name" => "Description",
68
+ "format" => "required",
69
+ "woo_suggest" => "description",
70
+ ),
71
+ "Normal Price With VAT" => array(
72
+ "name" => "NormalPriceWithVat",
73
+ "feed_name" => "NormalPriceWithVat",
74
+ "format" => "required",
75
+ "woo_suggest" => "price",
76
+ ),
77
+ "Normal Price Without VAT" => array(
78
+ "name" => "NormalPriceWithoutVat",
79
+ "feed_name" => "NormalPriceWithoutVat",
80
+ "format" => "optional",
81
+ ),
82
+ "VAT Rate" => array(
83
+ "name" => "VatRate",
84
+ "feed_name" => "VatRate",
85
+ "format" => "required",
86
+ ),
87
+ "Image URL 2" => array(
88
+ "name" => "Imageurl2",
89
+ "feed_name" => "Imageurl2",
90
+ "format" => "optional",
91
+ ),
92
+ "Image URL 3" => array(
93
+ "name" => "Imageurl3",
94
+ "feed_name" => "Imageurl3",
95
+ "format" => "optional",
96
+ ),
97
+ "Image URL 4" => array(
98
+ "name" => "Imageurl4",
99
+ "feed_name" => "Imageurl4",
100
+ "format" => "optional",
101
+ ),
102
+ "Image URL 5" => array(
103
+ "name" => "Imageurl5",
104
+ "feed_name" => "Imageurl5",
105
+ "format" => "optional",
106
+ ),
107
+ "Language" => array(
108
+ "name" => "Language",
109
+ "feed_name" => "Language",
110
+ "format" => "optional",
111
+ ),
112
+ "Attribute Size" => array(
113
+ "name" => "AttributeSize",
114
+ "feed_name" => "AttributeSize",
115
+ "format" => "optional",
116
+ ),
117
+ "Attribute Color" => array(
118
+ "name" => "AttributeColor",
119
+ "feed_name" => "AttributeColor",
120
+ "format" => "optional",
121
+ ),
122
+ "Currency" => array(
123
+ "name" => "Currency",
124
+ "feed_name" => "Currency",
125
+ "format" => "optional",
126
+ ),
127
+ "Discount Price Without VAT" => array(
128
+ "name" => "DiscountPriceWithoutVAT",
129
+ "feed_name" => "DiscountPriceWithoutVAT",
130
+ "format" => "optional",
131
+ ),
132
+ "Discount Price With VAT" => array(
133
+ "name" => "DiscountPriceWithVAT",
134
+ "feed_name" => "DiscountPriceWithVAT",
135
+ "format" => "optional",
136
+ ),
137
+ "ISBN" => array(
138
+ "name" => "ISBN",
139
+ "feed_name" => "ISBN",
140
+ "format" => "optional",
141
+ ),
142
+ "Manufacturer" => array(
143
+ "name" => "Manufacturer",
144
+ "feed_name" => "Manufacturer",
145
+ "format" => "optional",
146
+ ),
147
+ "Restock Date" => array(
148
+ "name" => "RestockDate",
149
+ "feed_name" => "RestockDate",
150
+ "format" => "optional",
151
+ ),
152
+ "Lead Time" => array(
153
+ "name" => "LeadTime",
154
+ "feed_name" => "LeadTime",
155
+ "format" => "optional",
156
+ ),
157
+ "Package Weight" => array(
158
+ "name" => "PackageWeight",
159
+ "feed_name" => "PackageWeight",
160
+ "format" => "optional",
161
+ ),
162
+ "Attribute 1" => array(
163
+ "name" => "Attribute1",
164
+ "feed_name" => "Attribute1",
165
+ "format" => "optional",
166
+ ),
167
+ "Attribute 2" => array(
168
+ "name" => "Attribute2",
169
+ "feed_name" => "Attribute2",
170
+ "format" => "optional",
171
+ ),
172
+ "Attribute 3" => array(
173
+ "name" => "Attribute3",
174
+ "feed_name" => "Attribute3",
175
+ "format" => "optional",
176
+ ),
177
+ "Attribute 4" => array(
178
+ "name" => "Attribute4",
179
+ "feed_name" => "Attribute4",
180
+ "format" => "optional",
181
+ ),
182
+ "Attribute 5" => array(
183
+ "name" => "Attribute5",
184
+ "feed_name" => "Attribute5",
185
+ "format" => "optional",
186
+ ),
187
+ "Attribute 6" => array(
188
+ "name" => "Attribute6",
189
+ "feed_name" => "Attribute6",
190
+ "format" => "optional",
191
+ ),
192
+ "Attribute 7" => array(
193
+ "name" => "Attribute7",
194
+ "feed_name" => "Attribute7",
195
+ "format" => "optional",
196
+ ),
197
+ "Attribute 8" => array(
198
+ "name" => "Attribute8",
199
+ "feed_name" => "Attribute8",
200
+ "format" => "optional",
201
+ ),
202
+ "Attribute 9" => array(
203
+ "name" => "Attribute9",
204
+ "feed_name" => "Attribute9",
205
+ "format" => "optional",
206
+ ),
207
+ "Attribute 10" => array(
208
+ "name" => "Attribute10",
209
+ "feed_name" => "Attribute10",
210
+ "format" => "optional",
211
+ ),
212
+ "Country" => array(
213
+ "name" => "Country",
214
+ "feed_name" => "Country",
215
+ "format" => "optional",
216
+ ),
217
+ "Discount Price Start Date" => array(
218
+ "name" => "DiscountPriceStartDate",
219
+ "feed_name" => "DiscountPriceStartDate",
220
+ "format" => "optional",
221
+ ),
222
+ "Discount Price End Date" => array(
223
+ "name" => "DiscountPriceEndDate",
224
+ "feed_name" => "DiscountPriceEndDate",
225
+ "format" => "optional",
226
+ ),
227
+ ),
228
+ );
229
+ return $fruugous;
230
+ }
231
+ }
232
+ ?>
classes/channels/class-google_dsa.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Google DSA product feeds
4
+ */
5
+ class WooSEA_google_dsa {
6
+ public $google_dsa;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $google_dsa = array(
13
+ "DSA fields" => array(
14
+ "Page URL" => array(
15
+ "name" => "Page URL",
16
+ "feed_name" => "Page URL",
17
+ "format" => "required",
18
+ "woo_suggest" => "link",
19
+ ),
20
+ "Custom label" => array(
21
+ "name" => "Custom label",
22
+ "feed_name" => "Custom label",
23
+ "format" => "required",
24
+ ),
25
+ ),
26
+ );
27
+ return $google_dsa;
28
+ }
29
+ }
30
+ ?>
classes/channels/class-google_local.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Google Local Product Inventory feeds
4
+ */
5
+ class WooSEA_google_local {
6
+ public $google_local;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $google_local = array(
13
+ "Local product inventory fields" => array(
14
+ "Store code" => array(
15
+ "name" => "Store code",
16
+ "feed_name" => "store code",
17
+ "format" => "required",
18
+ ),
19
+ "Itemid" => array(
20
+ "name" => "Itemid",
21
+ "feed_name" => "itemid",
22
+ "format" => "required",
23
+ "woo-suggest" => "id",
24
+ ),
25
+ "Quantity" => array(
26
+ "name" => "Quantity",
27
+ "feed_name" => "quantity",
28
+ "format" => "required",
29
+ "woo_suggest" => "quantity",
30
+ ),
31
+ "Price" => array(
32
+ "name" => "Price",
33
+ "feed_name" => "price",
34
+ "format" => "required",
35
+ "woo_suggest" => "price",
36
+ ),
37
+ "Sale price" => array(
38
+ "name" => "Sale price",
39
+ "feed_name" => "Sale price",
40
+ "format" => "optional",
41
+ "woo_suggest" => "sale_price",
42
+ ),
43
+ "Sale price effective date" => array(
44
+ "name" => "Sale price effective date",
45
+ "feed_name" => "sale price effective date",
46
+ "format" => "optional",
47
+ "woo_suggest" => "sale_price_effective_date",
48
+ ),
49
+ "Availability" => array(
50
+ "name" => "Availability",
51
+ "feed_name" => "availability",
52
+ "format" => "optional",
53
+ "woo_suggest" => "availability",
54
+ ),
55
+ "Weeks of supply" => array(
56
+ "name" => "Weeks of supply",
57
+ "feed_name" => "weeks of supply",
58
+ "format" => "optional",
59
+ ),
60
+ "Pickup method" => array(
61
+ "name" => "Pickup method",
62
+ "feed_name" => "pickup method",
63
+ "format" => "optional",
64
+ ),
65
+ "Pickup sla" => array(
66
+ "name" => "Pickup sla",
67
+ "feed_name" => "pickup sla",
68
+ "format" => "optional",
69
+ ),
70
+ ),
71
+ );
72
+ return $google_local;
73
+ }
74
+ }
75
+ ?>
classes/channels/class-google_local_products.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Google Local Products feeds
4
+ */
5
+ class WooSEA_google_local_products {
6
+ public $google_local_products;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $google_local_products = array(
13
+ "Local products fields" => array(
14
+ "Itemid" => array(
15
+ "name" => "Itemid",
16
+ "feed_name" => "g:itemid",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Title" => array(
21
+ "name" => "Title",
22
+ "feed_name" => "g:title",
23
+ "format" => "required",
24
+ "woo_suggest" => "title",
25
+ ),
26
+ "Description" => array(
27
+ "name" => "Description",
28
+ "feed_name" => "g:description",
29
+ "format" => "optional",
30
+ "woo_suggest" => "description",
31
+ ),
32
+ "Image link" => array(
33
+ "name" => "image_link",
34
+ "feed_name" => "g:image_link",
35
+ "format" => "optional",
36
+ "woo_suggest" => "image",
37
+ ),
38
+ "Condition" => array(
39
+ "name" => "condition",
40
+ "feed_name" => "g:condition",
41
+ "format" => "optional",
42
+ "woo_suggest" => "condition",
43
+ ),
44
+ "Gtin" => array(
45
+ "name" => "gtin",
46
+ "feed_name" => "g:gtin",
47
+ "format" => "optional",
48
+ ),
49
+ "MPN" => array(
50
+ "name" => "MPN",
51
+ "feed_name" => "g:mpn",
52
+ "format" => "optional",
53
+ ),
54
+ "Brand" => array(
55
+ "name" => "brand",
56
+ "feed_name" => "g:brand",
57
+ "format" => "optional",
58
+ ),
59
+ "Google product category" => array(
60
+ "name" => "google_product_category",
61
+ "feed_name" => "g:google_product_category",
62
+ "format" => "optional",
63
+ "woo_suggest" => "categories",
64
+ ),
65
+ "Energy efficiency class" => array(
66
+ "name" => "energy_efficiency_class",
67
+ "feed_name" => "g:energy_efficiency_class",
68
+ "format" => "optional",
69
+ ),
70
+ "Energy efficiency class min" => array(
71
+ "name" => "energy_efficiency_class_min",
72
+ "feed_name" => "g:energy_efficiency_class_min",
73
+ "format" => "optional",
74
+ ),
75
+ "Energy efficiency class max" => array(
76
+ "name" => "energy_efficiency_class_max",
77
+ "feed_name" => "g:energy_efficiency_class_max",
78
+ "format" => "optional",
79
+ ),
80
+ "Webitemid" => array(
81
+ "name" => "webitemid",
82
+ "feed_name" => "g:webitemid",
83
+ "format" => "optional",
84
+ ),
85
+ "Price" => array(
86
+ "name" => "Price",
87
+ "feed_name" => "g:price",
88
+ "format" => "optional",
89
+ "woo_suggest" => "price",
90
+ ),
91
+ "Sale price" => array(
92
+ "name" => "Sale price",
93
+ "feed_name" => "g:sale_price",
94
+ "format" => "optional",
95
+ "woo_suggest" => "sale_price",
96
+ ),
97
+ "Sale price effective date" => array(
98
+ "name" => "Sale price effective date",
99
+ "feed_name" => "g:sale_price_effective_date",
100
+ "format" => "optional",
101
+ "woo_suggest" => "sale_price_effective_date",
102
+ ),
103
+ "Unit pricing measure" => array(
104
+ "name" => "unit_pricing_measure",
105
+ "feed_name" => "g:unit_pricing_measure",
106
+ "format" => "optional",
107
+ ),
108
+ "Unit pricing base measure" => array(
109
+ "name" => "unit_pricing_base_measure",
110
+ "feed_name" => "g:unit_pricing_base_measure",
111
+ "format" => "optional",
112
+ ),
113
+ "Pickup method" => array(
114
+ "name" => "Pickup method",
115
+ "feed_name" => "g:pickup_method",
116
+ "format" => "optional",
117
+ ),
118
+ "Pickup SLA" => array(
119
+ "name" => "Pickup SLA",
120
+ "feed_name" => "g:pickup_sla",
121
+ "format" => "optional",
122
+ ),
123
+ "Pickup link template" => array(
124
+ "name" => "Pickup link template",
125
+ "feed_name" => "g:pickup_link_template",
126
+ "format" => "optional",
127
+ ),
128
+ "Mobile pickup link template" => array(
129
+ "name" => "Mobile pickup link template",
130
+ "feed_name" => "g:mobile_pickup_link_template",
131
+ "format" => "optional",
132
+ ),
133
+ "Link template" => array(
134
+ "name" => "Link template",
135
+ "feed_name" => "g:link_template",
136
+ "format" => "optional",
137
+ ),
138
+ "Mobile link template" => array(
139
+ "name" => "Mobile link template",
140
+ "feed_name" => "g:mobile_link_template",
141
+ "format" => "optional",
142
+ ),
143
+ "Ads redirect" => array(
144
+ "name" => "Ads redirect",
145
+ "feed_name" => "g:ads_redirect",
146
+ "format" => "optional",
147
+ ),
148
+ "Age group" => array(
149
+ "name" => "age_group",
150
+ "feed_name" => "g:age_group",
151
+ "format" => "optional",
152
+ ),
153
+ "Color" => array(
154
+ "name" => "color",
155
+ "feed_name" => "g:color",
156
+ "format" => "optional",
157
+ ),
158
+ "Gender" => array(
159
+ "name" => "gender",
160
+ "feed_name" => "g:gender",
161
+ "format" => "optional",
162
+ ),
163
+ "Size" => array(
164
+ "name" => "size",
165
+ "feed_name" => "g:size",
166
+ "format" => "optional",
167
+ ),
168
+ "Item group ID" => array(
169
+ "name" => "item_group_id",
170
+ "feed_name" => "g:item_group_id",
171
+ "format" => "optional",
172
+ ),
173
+ ),
174
+ );
175
+ return $google_local_products;
176
+ }
177
+ }
178
+ ?>
classes/channels/class-google_shopping.php CHANGED
@@ -96,6 +96,11 @@ class WooSEA_google_shopping {
96
  "feed_name" => "g:unit_pricing_base_measure",
97
  "format" => "optional",
98
  ),
 
 
 
 
 
99
  "Installment" => array(
100
  "name" => "installment",
101
  "feed_name" => "g:installment",
@@ -171,6 +176,16 @@ class WooSEA_google_shopping {
171
  "feed_name" => "g:energy_efficiency_class",
172
  "format" => "optional",
173
  ),
 
 
 
 
 
 
 
 
 
 
174
  "Age group" => array(
175
  "name" => "age_group",
176
  "feed_name" => "g:age_group",
@@ -218,11 +233,16 @@ class WooSEA_google_shopping {
218
  ),
219
  ),
220
  "Shopping campaigns" => array(
221
- "Adwords redirect" => array(
222
  "name" => "adwords_redirect",
223
  "feed_name" => "g:adwords_redirect",
224
  "format" => "optional",
225
  ),
 
 
 
 
 
226
  "Excluded destination" => array(
227
  "name" => "excluded_destination",
228
  "feed_name" => "g:excluded_destination",
@@ -258,6 +278,16 @@ class WooSEA_google_shopping {
258
  "feed_name" => "g:promotion_id",
259
  "format" => "optional",
260
  ),
 
 
 
 
 
 
 
 
 
 
261
  ),
262
  "Shipping" => array(
263
  "Shipping" => array(
@@ -290,6 +320,16 @@ class WooSEA_google_shopping {
290
  "feed_name" => "g:shipping_height",
291
  "format" => "optional",
292
  ),
 
 
 
 
 
 
 
 
 
 
293
  ),
294
  "Tax" => array(
295
  "Tax" => array(
@@ -297,6 +337,11 @@ class WooSEA_google_shopping {
297
  "feed_name" => "g:tax",
298
  "format" => "optional",
299
  ),
 
 
 
 
 
300
  ),
301
  );
302
 
96
  "feed_name" => "g:unit_pricing_base_measure",
97
  "format" => "optional",
98
  ),
99
+ "Cost of goods sold" => array(
100
+ "name" => "cost_of_goods_sold",
101
+ "feed_name" => "g:cost_of_goods_sold",
102
+ "format" => "optional",
103
+ ),
104
  "Installment" => array(
105
  "name" => "installment",
106
  "feed_name" => "g:installment",
176
  "feed_name" => "g:energy_efficiency_class",
177
  "format" => "optional",
178
  ),
179
+ "Minimum energy efficiency class" => array(
180
+ "name" => "min_energy_efficiency_class",
181
+ "feed_name" => "g:min_energy_efficiency_class",
182
+ "format" => "optional",
183
+ ),
184
+ "Maximum energy efficiency class" => array(
185
+ "name" => "max_energy_efficiency_class",
186
+ "feed_name" => "g:max_energy_efficiency_class",
187
+ "format" => "optional",
188
+ ),
189
  "Age group" => array(
190
  "name" => "age_group",
191
  "feed_name" => "g:age_group",
233
  ),
234
  ),
235
  "Shopping campaigns" => array(
236
+ "Adwords redirect (old)" => array(
237
  "name" => "adwords_redirect",
238
  "feed_name" => "g:adwords_redirect",
239
  "format" => "optional",
240
  ),
241
+ "Ads redirect (new)" => array(
242
+ "name" => "ads_redirect",
243
+ "feed_name" => "g:ads_redirect",
244
+ "format" => "optional",
245
+ ),
246
  "Excluded destination" => array(
247
  "name" => "excluded_destination",
248
  "feed_name" => "g:excluded_destination",
278
  "feed_name" => "g:promotion_id",
279
  "format" => "optional",
280
  ),
281
+ "Included destination" => array(
282
+ "name" => "included_destination",
283
+ "feed_name" => "included_destination",
284
+ "format" => "optional",
285
+ ),
286
+ "Excluded destination" => array(
287
+ "name" => "excluded_destination",
288
+ "feed_name" => "g:excluded_destination",
289
+ "format" => "optional",
290
+ ),
291
  ),
292
  "Shipping" => array(
293
  "Shipping" => array(
320
  "feed_name" => "g:shipping_height",
321
  "format" => "optional",
322
  ),
323
+ "Minimum handling time" => array(
324
+ "name" => "min_handling_time",
325
+ "feed_name" => "g:min_handling_time",
326
+ "format" => "optional",
327
+ ),
328
+ "Maximum handling time" => array(
329
+ "name" => "max_handling_time",
330
+ "feed_name" => "g:max_handling_time",
331
+ "format" => "optional",
332
+ ),
333
  ),
334
  "Tax" => array(
335
  "Tax" => array(
337
  "feed_name" => "g:tax",
338
  "format" => "optional",
339
  ),
340
+ "Tax category" => array(
341
+ "name" => "tax_category",
342
+ "feed_name" => "g:tax_category",
343
+ "format" => "optional",
344
+ ),
345
  ),
346
  );
347
 
classes/channels/class-guenstiger.php ADDED
@@ -0,0 +1,171 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Guenstiger feeds
4
+ */
5
+ class WooSEA_guenstiger {
6
+ public $guenstiger;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $guenstiger = array(
13
+ "Feed fields" => array(
14
+ "Bestellnummer" => array(
15
+ "name" => "bestellnummer",
16
+ "feed_name" => "bestellnummer",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "HerstellerArtNr" => array(
21
+ "name" => "HerstellerArtNr",
22
+ "feed_name" => "HerstellerArtNr",
23
+ "format" => "required",
24
+ ),
25
+ "Hersteller" => array(
26
+ "name" => "Hersteller",
27
+ "feed_name" => "Hersteller",
28
+ "format" => "required",
29
+ ),
30
+ "ProductLink" => array(
31
+ "name" => "ProductLink",
32
+ "feed_name" => "ProductLink",
33
+ "format" => "required",
34
+ "woo_suggest" => "link",
35
+ ),
36
+ "FotoLink" => array(
37
+ "name" => "FotoLink",
38
+ "feed_name" => "FotoLink",
39
+ "format" => "required",
40
+ "woo_suggest" => "image",
41
+ ),
42
+ "ProducktBeschreibung" => array(
43
+ "name" => "ProduktBeschreibung",
44
+ "feed_name" => "ProduktBeschreibung",
45
+ "format" => "required",
46
+ "woo_suggest" => "description",
47
+ ),
48
+ "ProduktBezeichnung" => array(
49
+ "name" => "ProduktBezeichnung",
50
+ "feed_name" => "ProduktBezeichnung",
51
+ "format" => "required",
52
+ "woo_suggest" => "title",
53
+ ),
54
+ "Preis" => array(
55
+ "name" => "Preis",
56
+ "feed_name" => "Preis",
57
+ "format" => "required",
58
+ "woo_suggest" => "price",
59
+ ),
60
+ "Lieferzeit" => array(
61
+ "name" => "Lieferzeit",
62
+ "feed_name" => "Lieferzeit",
63
+ "format" => "required",
64
+ ),
65
+ "EANCode" => array(
66
+ "name" => "EANCode",
67
+ "feed_name" => "EANCode",
68
+ "format" => "required",
69
+ ),
70
+ "Kategorie" => array(
71
+ "name" => "Kategorie",
72
+ "feed_name" => "Kategorie",
73
+ "format" => "required",
74
+ "woo_suggest" => "category",
75
+ ),
76
+ "VersandVorkasse" => array(
77
+ "name" => "VersandVorkasse",
78
+ "feed_name" => "VersandVorkasse",
79
+ "format" => "required",
80
+ ),
81
+ "VersandPayPal" => array(
82
+ "name" => "VersandPayPal",
83
+ "feed_name" => "VersandPaypal",
84
+ "format" => "required",
85
+ ),
86
+ "VersandKreditkarte" => array(
87
+ "name" => "VersandKreditkarte",
88
+ "feed_name" => "VersandKreditkarte",
89
+ "format" => "required",
90
+ ),
91
+ "VersandLastschrift" => array(
92
+ "name" => "VersandLastschrift",
93
+ "feed_name" => "VersandLandschrift",
94
+ "format" => "required",
95
+ ),
96
+ "VersandRechnung" => array(
97
+ "name" => "VersandRechnung",
98
+ "feed_name" => "VersandRechnung",
99
+ "format" => "required",
100
+ ),
101
+ "VersandNachnahme" => array(
102
+ "name" => "VersandNachnahme",
103
+ "feed_name" => "VersandNachnahme",
104
+ "format" => "required",
105
+ ),
106
+ "Grundpreis komplett" => array(
107
+ "name" => "Grundpreis komplett",
108
+ "feed_name" => "Grundpres komplett",
109
+ "format" => "optional",
110
+ ),
111
+ "Energieeffizienzklasse" => array(
112
+ "name" => "Energieeffizienzklasse",
113
+ "feed_name" => "Energieeffizienzklasse",
114
+ "format" => "optional",
115
+ ),
116
+ "Keyword" => array(
117
+ "name" => "Keyword",
118
+ "feed_name" => "Keyword",
119
+ "format" => "optional",
120
+ ),
121
+ "Gewicht" => array(
122
+ "name" => "Gewicht",
123
+ "feed_name" => "Gewicht",
124
+ "format" => "optional",
125
+ ),
126
+ "Groesse" => array(
127
+ "name" => "Groesse",
128
+ "feed_name" => "Groesse",
129
+ "format" => "optional",
130
+ ),
131
+ "Farbe" => array(
132
+ "name" => "Farbe",
133
+ "feed_name" => "Farbe",
134
+ "format" => "optional",
135
+ ),
136
+ "Geschlecht" => array(
137
+ "name" => "Geschlecht",
138
+ "feed_name" => "Geschlecht",
139
+ "format" => "optional",
140
+ ),
141
+ "Erwachsene / Kind" => array(
142
+ "name" => "Erwachsene / Kind",
143
+ "feed_name" => "Erwachsene / Kind",
144
+ "format" => "optional",
145
+ ),
146
+ "PZN" => array(
147
+ "name" => "PZN",
148
+ "feed_name" => "PZN",
149
+ "format" => "optional",
150
+ ),
151
+ "Reifentyp" => array(
152
+ "name" => "Reifentyp",
153
+ "feed_name" => "Reifentyp",
154
+ "format" => "optional",
155
+ ),
156
+ "Reifensaison" => array(
157
+ "name" => "Reifensaison",
158
+ "feed_name" => "Reifensaison",
159
+ "format" => "optional",
160
+ ),
161
+ "Reifenmass" => array(
162
+ "name" => "Reifenmass",
163
+ "feed_name" => "Reifenmass",
164
+ "format" => "optional",
165
+ ),
166
+ ),
167
+ );
168
+ return $guenstiger;
169
+ }
170
+ }
171
+ ?>
classes/channels/class-katoni.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Katoni feeds
4
+ */
5
+ class WooSEA_katoni {
6
+ public $katoni;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $katoni = array(
13
+ "Feed fields" => array(
14
+ "GTIN" => array(
15
+ "name" => "gtin",
16
+ "feed_name" => "gtin",
17
+ "format" => "required",
18
+ ),
19
+ "Item Group ID" => array(
20
+ "name" => "item_group_id",
21
+ "feed_name" => "item_group_id",
22
+ "format" => "required",
23
+ "woo_suggest" => "item_group_id",
24
+ ),
25
+ "Product ID" => array(
26
+ "name" => "id",
27
+ "feed_name" => "g:id",
28
+ "format" => "required",
29
+ "woo_suggest" => "id",
30
+ ),
31
+ "Brand" => array(
32
+ "name" => "brand",
33
+ "feed_name" => "brand",
34
+ "format" => "required",
35
+ ),
36
+ "Title" => array(
37
+ "name" => "title",
38
+ "feed_name" => "title",
39
+ "format" => "required",
40
+ "woo_suggest" => "title",
41
+ ),
42
+ "Product Type" => array(
43
+ "name" => "product_type",
44
+ "feed_name" => "product_type",
45
+ "format" => "required",
46
+ ),
47
+ "Gender" => array(
48
+ "name" => "gender",
49
+ "feed_name" => "gender",
50
+ "format" => "required",
51
+ ),
52
+ "Size" => array(
53
+ "name" => "size",
54
+ "feed_name" => "size",
55
+ "format" => "required",
56
+ ),
57
+ "Image link" => array(
58
+ "name" => "image_link",
59
+ "feed_name" => "image_link",
60
+ "format" => "required",
61
+ "woo_suggest" => "image",
62
+ ),
63
+ "Additional image link" => array(
64
+ "name" => "additional_image_link",
65
+ "feed_name" => "additional_image_link",
66
+ "format" => "optional",
67
+ ),
68
+ "Availability" => array(
69
+ "name" => "availability",
70
+ "feed_name" => "availability",
71
+ "format" => "optional",
72
+ "woo_suggest" => "availability",
73
+ ),
74
+ "Stock level" => array(
75
+ "name" => "stock_level",
76
+ "feed_name" => "stock_level",
77
+ "format" => "optional",
78
+ ),
79
+ "Season" => array(
80
+ "name" => "season",
81
+ "feed_name" => "season",
82
+ "format" => "optional",
83
+ ),
84
+ "Description" => array(
85
+ "name" => "description",
86
+ "feed_name" => "description",
87
+ "format" => "required",
88
+ "woo_suggest" => "description",
89
+ ),
90
+ "Material" => array(
91
+ "name" => "material",
92
+ "feed_name" => "material",
93
+ "format" => "optional",
94
+ ),
95
+ "Washing" => array(
96
+ "name" => "washing",
97
+ "feed_name" => "washing",
98
+ "format" => "optional",
99
+ ),
100
+ "Discount retail price" => array(
101
+ "name" => "discount_retail_price",
102
+ "feed_name" => "discount_retail_price",
103
+ "format" => "optional",
104
+ ),
105
+ "Retail price" => array(
106
+ "name" => "retail_price",
107
+ "feed_name" => "retail_price",
108
+ "format" => "required",
109
+ "woo_suggest" => "price",
110
+ ),
111
+ "Wholsesale price" => array(
112
+ "name" => "wholesale_price",
113
+ "feed_name" => "wholesale_price",
114
+ "format" => "optional",
115
+ ),
116
+ ),
117
+ );
118
+ return $katoni;
119
+ }
120
+ }
121
+ ?>
classes/channels/class-manomano.php CHANGED
@@ -31,7 +31,7 @@ class WooSEA_manomano {
31
  "name" => "title",
32
  "feed_name" => "title",
33
  "format" => "required",
34
- "woo_suggest" => "title",
35
  ),
36
  "description" => array(
37
  "name" => "description",
31
  "name" => "title",
32
  "feed_name" => "title",
33
  "format" => "required",
34
+ "woo_suggest" => "mother_title",
35
  ),
36
  "description" => array(
37
  "name" => "description",
classes/channels/class-miinto_dk.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Miinto Denmark feeds
4
+ */
5
+ class WooSEA_miinto_dk {
6
+ public $miinto_dk;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $miinto_dk = array(
13
+ "Feed fields" => array(
14
+ "GTIN" => array(
15
+ "name" => "gtin",
16
+ "feed_name" => "gtin",
17
+ "format" => "required",
18
+ ),
19
+ "Item Group ID" => array(
20
+ "name" => "item_group_id",
21
+ "feed_name" => "item_group_id",
22
+ "format" => "required",
23
+ "woo_suggest" => "item_group_id",
24
+ ),
25
+ "C:style_id:string" => array(
26
+ "name" => "c:style_id:string",
27
+ "feed_name" => "c:style_id:string",
28
+ "format" => "required",
29
+ ),
30
+ "Brand" => array(
31
+ "name" => "brand",
32
+ "feed_name" => "brand",
33
+ "format" => "required",
34
+ ),
35
+ "Title" => array(
36
+ "name" => "title",
37
+ "feed_name" => "title",
38
+ "format" => "required",
39
+ "woo_suggest" => "title",
40
+ ),
41
+ "C:title_PL:string" => array(
42
+ "name" => "c:title_PL:string",
43
+ "feed_name" => "c:title_PL:string",
44
+ "format" => "optional",
45
+ ),
46
+ "C:title_DK:string" => array(
47
+ "name" => "c:title_DK:string",
48
+ "feed_name" => "c:title_DK:string",
49
+ "format" => "optional",
50
+ ),
51
+ "C:title_NL:string" => array(
52
+ "name" => "c:title_NL:string",
53
+ "feed_name" => "c:title_NL:string",
54
+ "format" => "optional",
55
+ ),
56
+ "Product Type" => array(
57
+ "name" => "product_type",
58
+ "feed_name" => "product_type",
59
+ "format" => "required",
60
+ ),
61
+ "Gender" => array(
62
+ "name" => "gender",
63
+ "feed_name" => "gender",
64
+ "format" => "required",
65
+ ),
66
+ "Size" => array(
67
+ "name" => "size",
68
+ "feed_name" => "size",
69
+ "format" => "required",
70
+ ),
71
+ "Image link" => array(
72
+ "name" => "image_link",
73
+ "feed_name" => "image_link",
74
+ "format" => "required",
75
+ "woo_suggest" => "image",
76
+ ),
77
+ "Additional image link" => array(
78
+ "name" => "additional_image_link",
79
+ "feed_name" => "additional_image_link",
80
+ "format" => "optional",
81
+ ),
82
+ "Availability" => array(
83
+ "name" => "availability",
84
+ "feed_name" => "availability",
85
+ "format" => "optional",
86
+ "woo_suggest" => "availability",
87
+ ),
88
+ "C:stock_level:integer" => array(
89
+ "name" => "c:stock_level:integer",
90
+ "feed_name" => "c:stock_level:integer",
91
+ "format" => "required",
92
+ ),
93
+ "C:season_tag:string" => array(
94
+ "name" => "c:season_tag:string",
95
+ "feed_name" => "c:season_tag:string",
96
+ "format" => "required",
97
+ ),
98
+ "Description" => array(
99
+ "name" => "description",
100
+ "feed_name" => "description",
101
+ "format" => "required",
102
+ "woo_suggest" => "description",
103
+ ),
104
+ "C:description_PL:string" => array(
105
+ "name" => "c:description_PL:string",
106
+ "feed_name" => "c:description_PL:string",
107
+ "format" => "optional",
108
+ ),
109
+ "C:description_NL:string" => array(
110
+ "name" => "c:description_NL:string",
111
+ "feed_name" => "c:description_NL:string",
112
+ "format" => "optional",
113
+ ),
114
+ "C:description_DK:string" => array(
115
+ "name" => "c:description_DK:string",
116
+ "feed_name" => "c:description_DK:string",
117
+ "format" => "optional",
118
+ ),
119
+ "Material" => array(
120
+ "name" => "material",
121
+ "feed_name" => "material",
122
+ "format" => "optional",
123
+ ),
124
+ "Washing" => array(
125
+ "name" => "washing",
126
+ "feed_name" => "washing",
127
+ "format" => "optional",
128
+ ),
129
+ "C:discount_retail_price_PLN:integer" => array(
130
+ "name" => "c:discount_retail_price_PLN:integer",
131
+ "feed_name" => "c:discount_retail_price_PLN:integer",
132
+ "format" => "optional",
133
+ ),
134
+ "C:discount_retail_price_DKK:integer" => array(
135
+ "name" => "c:discount_retail_price_DKK:integer",
136
+ "feed_name" => "c:discount_retail_price_DKK:integer",
137
+ "format" => "optional",
138
+ ),
139
+ "C:discount_retail_price_EUR:integer" => array(
140
+ "name" => "c:discount_retail_price_EUR:integer",
141
+ "feed_name" => "c:discount_retail_price_EUR:integer",
142
+ "format" => "optional",
143
+ ),
144
+ "C:retail_price_PLN:integer" => array(
145
+ "name" => "c:retail_price_PLN:integer",
146
+ "feed_name" => "c:retail_price_PLN:integer",
147
+ "format" => "required",
148
+ "woo_suggest" => "price",
149
+ ),
150
+ "C:retail_price_DKK:integer" => array(
151
+ "name" => "c:retail_price_DKK:integer",
152
+ "feed_name" => "c:retail_price_DKK:integer",
153
+ "format" => "required",
154
+ "woo_suggest" => "price",
155
+ ),
156
+ "C:retail_price_EUR:integer" => array(
157
+ "name" => "c:retail_price_EUR:integer",
158
+ "feed_name" => "c:retail_price_EUR:integer",
159
+ "format" => "required",
160
+ "woo_suggest" => "price",
161
+ ),
162
+ "C:wholsesale_price_PLN:integer" => array(
163
+ "name" => "c:wholesale_price_PLN:integer",
164
+ "feed_name" => "c:wholesale_price_PLN:integer",
165
+ "format" => "optional",
166
+ ),
167
+ "C:wholsesale_price_DKK:integer" => array(
168
+ "name" => "c:wholesale_price_DKK:integer",
169
+ "feed_name" => "c:wholesale_price_DKK:integer",
170
+ "format" => "optional",
171
+ ),
172
+ "C:wholsesale_price_EUR:integer" => array(
173
+ "name" => "c:wholesale_price_EUR:integer",
174
+ "feed_name" => "c:wholesale_price_EUR:integer",
175
+ "format" => "optional",
176
+ ),
177
+ ),
178
+ );
179
+ return $miinto_dk;
180
+ }
181
+ }
182
+ ?>
classes/channels/class-miinto_nl.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Miinto Netherlands feeds
4
+ */
5
+ class WooSEA_miinto_nl {
6
+ public $miinto_nl;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $miinto_nl = array(
13
+ "Feed fields" => array(
14
+ "GTIN" => array(
15
+ "name" => "gtin",
16
+ "feed_name" => "gtin",
17
+ "format" => "required",
18
+ ),
19
+ "Item Group ID" => array(
20
+ "name" => "item_group_id",
21
+ "feed_name" => "item_group_id",
22
+ "format" => "required",
23
+ "woo_suggest" => "item_group_id",
24
+ ),
25
+ "C:style_id:string" => array(
26
+ "name" => "c:style_id:string",
27
+ "feed_name" => "c:style_id:string",
28
+ "format" => "required",
29
+ ),
30
+ "Brand" => array(
31
+ "name" => "brand",
32
+ "feed_name" => "brand",
33
+ "format" => "required",
34
+ ),
35
+ "Title" => array(
36
+ "name" => "title",
37
+ "feed_name" => "title",
38
+ "format" => "required",
39
+ "woo_suggest" => "title",
40
+ ),
41
+ "C:title_PL:string" => array(
42
+ "name" => "c:title_PL:string",
43
+ "feed_name" => "c:title_PL:string",
44
+ "format" => "optional",
45
+ ),
46
+ "C:title_DK:string" => array(
47
+ "name" => "c:title_DK:string",
48
+ "feed_name" => "c:title_DK:string",
49
+ "format" => "optional",
50
+ ),
51
+ "C:title_NL:string" => array(
52
+ "name" => "c:title_NL:string",
53
+ "feed_name" => "c:title_NL:string",
54
+ "format" => "optional",
55
+ ),
56
+ "Product Type" => array(
57
+ "name" => "product_type",
58
+ "feed_name" => "product_type",
59
+ "format" => "required",
60
+ ),
61
+ "Gender" => array(
62
+ "name" => "gender",
63
+ "feed_name" => "gender",
64
+ "format" => "required",
65
+ ),
66
+ "Size" => array(
67
+ "name" => "size",
68
+ "feed_name" => "size",
69
+ "format" => "required",
70
+ ),
71
+ "Image link" => array(
72
+ "name" => "image_link",
73
+ "feed_name" => "image_link",
74
+ "format" => "required",
75
+ "woo_suggest" => "image",
76
+ ),
77
+ "Additional image link" => array(
78
+ "name" => "additional_image_link",
79
+ "feed_name" => "additional_image_link",
80
+ "format" => "optional",
81
+ ),
82
+ "Availability" => array(
83
+ "name" => "availability",
84
+ "feed_name" => "availability",
85
+ "format" => "optional",
86
+ "woo_suggest" => "availability",
87
+ ),
88
+ "C:stock_level:integer" => array(
89
+ "name" => "c:stock_level:integer",
90
+ "feed_name" => "c:stock_level:integer",
91
+ "format" => "required",
92
+ ),
93
+ "C:season_tag:string" => array(
94
+ "name" => "c:season_tag:string",
95
+ "feed_name" => "c:season_tag:string",
96
+ "format" => "required",
97
+ ),
98
+ "Description" => array(
99
+ "name" => "description",
100
+ "feed_name" => "description",
101
+ "format" => "required",
102
+ "woo_suggest" => "description",
103
+ ),
104
+ "C:description_PL:string" => array(
105
+ "name" => "c:description_PL:string",
106
+ "feed_name" => "c:description_PL:string",
107
+ "format" => "optional",
108
+ ),
109
+ "C:description_NL:string" => array(
110
+ "name" => "c:description_NL:string",
111
+ "feed_name" => "c:description_NL:string",
112
+ "format" => "optional",
113
+ ),
114
+ "C:description_DK:string" => array(
115
+ "name" => "c:description_DK:string",
116
+ "feed_name" => "c:description_DK:string",
117
+ "format" => "optional",
118
+ ),
119
+ "Material" => array(
120
+ "name" => "material",
121
+ "feed_name" => "material",
122
+ "format" => "optional",
123
+ ),
124
+ "Washing" => array(
125
+ "name" => "washing",
126
+ "feed_name" => "washing",
127
+ "format" => "optional",
128
+ ),
129
+ "C:discount_retail_price_PLN:integer" => array(
130
+ "name" => "c:discount_retail_price_PLN:integer",
131
+ "feed_name" => "c:discount_retail_price_PLN:integer",
132
+ "format" => "optional",
133
+ ),
134
+ "C:discount_retail_price_DKK:integer" => array(
135
+ "name" => "c:discount_retail_price_DKK:integer",
136
+ "feed_name" => "c:discount_retail_price_DKK:integer",
137
+ "format" => "optional",
138
+ ),
139
+ "C:discount_retail_price_EUR:integer" => array(
140
+ "name" => "c:discount_retail_price_EUR:integer",
141
+ "feed_name" => "c:discount_retail_price_EUR:integer",
142
+ "format" => "optional",
143
+ ),
144
+ "C:retail_price_PLN:integer" => array(
145
+ "name" => "c:retail_price_PLN:integer",
146
+ "feed_name" => "c:retail_price_PLN:integer",
147
+ "format" => "required",
148
+ "woo_suggest" => "price",
149
+ ),
150
+ "C:retail_price_DKK:integer" => array(
151
+ "name" => "c:retail_price_DKK:integer",
152
+ "feed_name" => "c:retail_price_DKK:integer",
153
+ "format" => "required",
154
+ "woo_suggest" => "price",
155
+ ),
156
+ "C:retail_price_EUR:integer" => array(
157
+ "name" => "c:retail_price_EUR:integer",
158
+ "feed_name" => "c:retail_price_EUR:integer",
159
+ "format" => "required",
160
+ "woo_suggest" => "price",
161
+ ),
162
+ "C:wholsesale_price_PLN:integer" => array(
163
+ "name" => "c:wholesale_price_PLN:integer",
164
+ "feed_name" => "c:wholesale_price_PLN:integer",
165
+ "format" => "optional",
166
+ ),
167
+ "C:wholsesale_price_DKK:integer" => array(
168
+ "name" => "c:wholesale_price_DKK:integer",
169
+ "feed_name" => "c:wholesale_price_DKK:integer",
170
+ "format" => "optional",
171
+ ),
172
+ "C:wholsesale_price_EUR:integer" => array(
173
+ "name" => "c:wholesale_price_EUR:integer",
174
+ "feed_name" => "c:wholesale_price_EUR:integer",
175
+ "format" => "optional",
176
+ ),
177
+ ),
178
+ );
179
+ return $miinto_nl;
180
+ }
181
+ }
182
+ ?>
classes/channels/class-miinto_pl.php ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Miinto Poland feeds
4
+ */
5
+ class WooSEA_miinto_pl {
6
+ public $miinto_pl;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $miinto_pl = array(
13
+ "Feed fields" => array(
14
+ "GTIN" => array(
15
+ "name" => "gtin",
16
+ "feed_name" => "gtin",
17
+ "format" => "required",
18
+ ),
19
+ "Item Group ID" => array(
20
+ "name" => "item_group_id",
21
+ "feed_name" => "item_group_id",
22
+ "format" => "required",
23
+ "woo_suggest" => "item_group_id",
24
+ ),
25
+ "C:style_id:string" => array(
26
+ "name" => "c:style_id:string",
27
+ "feed_name" => "c:style_id:string",
28
+ "format" => "required",
29
+ ),
30
+ "Brand" => array(
31
+ "name" => "brand",
32
+ "feed_name" => "brand",
33
+ "format" => "required",
34
+ ),
35
+ "Title" => array(
36
+ "name" => "title",
37
+ "feed_name" => "title",
38
+ "format" => "required",
39
+ "woo_suggest" => "title",
40
+ ),
41
+ "C:title_PL:string" => array(
42
+ "name" => "c:title_PL:string",
43
+ "feed_name" => "c:title_PL:string",
44
+ "format" => "optional",
45
+ ),
46
+ "C:title_DK:string" => array(
47
+ "name" => "c:title_DK:string",
48
+ "feed_name" => "c:title_DK:string",
49
+ "format" => "optional",
50
+ ),
51
+ "C:title_NL:string" => array(
52
+ "name" => "c:title_NL:string",
53
+ "feed_name" => "c:title_NL:string",
54
+ "format" => "optional",
55
+ ),
56
+ "Product Type" => array(
57
+ "name" => "product_type",
58
+ "feed_name" => "product_type",
59
+ "format" => "required",
60
+ ),
61
+ "Gender" => array(
62
+ "name" => "gender",
63
+ "feed_name" => "gender",
64
+ "format" => "required",
65
+ ),
66
+ "Size" => array(
67
+ "name" => "size",
68
+ "feed_name" => "size",
69
+ "format" => "required",
70
+ ),
71
+ "Image link" => array(
72
+ "name" => "image_link",
73
+ "feed_name" => "image_link",
74
+ "format" => "required",
75
+ "woo_suggest" => "image",
76
+ ),
77
+ "Additional image link" => array(
78
+ "name" => "additional_image_link",
79
+ "feed_name" => "additional_image_link",
80
+ "format" => "optional",
81
+ ),
82
+ "Availability" => array(
83
+ "name" => "availability",
84
+ "feed_name" => "availability",
85
+ "format" => "optional",
86
+ "woo_suggest" => "availability",
87
+ ),
88
+ "C:stock_level:integer" => array(
89
+ "name" => "c:stock_level:integer",
90
+ "feed_name" => "c:stock_level:integer",
91
+ "format" => "required",
92
+ ),
93
+ "C:season_tag:string" => array(
94
+ "name" => "c:season_tag:string",
95
+ "feed_name" => "c:season_tag:string",
96
+ "format" => "required",
97
+ ),
98
+ "Description" => array(
99
+ "name" => "description",
100
+ "feed_name" => "description",
101
+ "format" => "required",
102
+ "woo_suggest" => "description",
103
+ ),
104
+ "C:description_PL:string" => array(
105
+ "name" => "c:description_PL:string",
106
+ "feed_name" => "c:description_PL:string",
107
+ "format" => "optional",
108
+ ),
109
+ "C:description_NL:string" => array(
110
+ "name" => "c:description_NL:string",
111
+ "feed_name" => "c:description_NL:string",
112
+ "format" => "optional",
113
+ ),
114
+ "C:description_DK:string" => array(
115
+ "name" => "c:description_DK:string",
116
+ "feed_name" => "c:description_DK:string",
117
+ "format" => "optional",
118
+ ),
119
+ "Material" => array(
120
+ "name" => "material",
121
+ "feed_name" => "material",
122
+ "format" => "optional",
123
+ ),
124
+ "Washing" => array(
125
+ "name" => "washing",
126
+ "feed_name" => "washing",
127
+ "format" => "optional",
128
+ ),
129
+ "C:discount_retail_price_PLN:integer" => array(
130
+ "name" => "c:discount_retail_price_PLN:integer",
131
+ "feed_name" => "c:discount_retail_price_PLN:integer",
132
+ "format" => "optional",
133
+ ),
134
+ "C:discount_retail_price_DKK:integer" => array(
135
+ "name" => "c:discount_retail_price_DKK:integer",
136
+ "feed_name" => "c:discount_retail_price_DKK:integer",
137
+ "format" => "optional",
138
+ ),
139
+ "C:discount_retail_price_EUR:integer" => array(
140
+ "name" => "c:discount_retail_price_EUR:integer",
141
+ "feed_name" => "c:discount_retail_price_EUR:integer",
142
+ "format" => "optional",
143
+ ),
144
+ "C:retail_price_PLN:integer" => array(
145
+ "name" => "c:retail_price_PLN:integer",
146
+ "feed_name" => "c:retail_price_PLN:integer",
147
+ "format" => "required",
148
+ "woo_suggest" => "price",
149
+ ),
150
+ "C:retail_price_DKK:integer" => array(
151
+ "name" => "c:retail_price_DKK:integer",
152
+ "feed_name" => "c:retail_price_DKK:integer",
153
+ "format" => "required",
154
+ "woo_suggest" => "price",
155
+ ),
156
+ "C:retail_price_EUR:integer" => array(
157
+ "name" => "c:retail_price_EUR:integer",
158
+ "feed_name" => "c:retail_price_EUR:integer",
159
+ "format" => "required",
160
+ "woo_suggest" => "price",
161
+ ),
162
+ "C:wholsesale_price_PLN:integer" => array(
163
+ "name" => "c:wholesale_price_PLN:integer",
164
+ "feed_name" => "c:wholesale_price_PLN:integer",
165
+ "format" => "optional",
166
+ ),
167
+ "C:wholsesale_price_DKK:integer" => array(
168
+ "name" => "c:wholesale_price_DKK:integer",
169
+ "feed_name" => "c:wholesale_price_DKK:integer",
170
+ "format" => "optional",
171
+ ),
172
+ "C:wholsesale_price_EUR:integer" => array(
173
+ "name" => "c:wholesale_price_EUR:integer",
174
+ "feed_name" => "c:wholesale_price_EUR:integer",
175
+ "format" => "optional",
176
+ ),
177
+ ),
178
+ );
179
+ return $miinto_pl;
180
+ }
181
+ }
182
+ ?>
classes/channels/class-moebel.php ADDED
@@ -0,0 +1,520 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Moebel feeds
4
+ */
5
+ class WooSEA_moebel {
6
+ public $moebel;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $moebel = array(
13
+ "Feed fields" => array(
14
+ "Art nr" => array(
15
+ "name" => "art_nr",
16
+ "feed_name" => "art_nr",
17
+ "format" => "required",
18
+ "woo_suggest" => "id",
19
+ ),
20
+ "Art name" => array(
21
+ "name" => "art_name",
22
+ "feed_name" => "art_name",
23
+ "format" => "required",
24
+ "woo_suggest" => "title",
25
+ ),
26
+ "Art beschreibung" => array(
27
+ "name" => "art_beschreibung",
28
+ "feed_name" => "art_beschreibung",
29
+ "format" => "required",
30
+ "woo_suggest" => "description",
31
+ ),
32
+ "Art URL" => array(
33
+ "name" => "art_url",
34
+ "feed_name" => "art_url",
35
+ "format" => "required",
36
+ "woo_suggest" => "link",
37
+ ),
38
+ "Art img URL" => array(
39
+ "name" => "art_img_url",
40
+ "feed_name" => "art_img_url",
41
+ "format" => "required",
42
+ "woo_suggest" => "image",
43
+ ),
44
+ "Art waehrung" => array(
45
+ "name" => "art_waehrung",
46
+ "feed_name" => "art_waehrung",
47
+ "format" => "required",
48
+ ),
49
+ "Art preis" => array(
50
+ "name" => "art_price",
51
+ "feed_name" => "art_price",
52
+ "format" => "required",
53
+ "woo_suggest" => "price",
54
+ ),
55
+ "Art lieferkosten" => array(
56
+ "name" => "art_lieferkosten",
57
+ "feed_name" => "art_lieferkosten",
58
+ "format" => "required",
59
+ ),
60
+ "Art stamm" => array(
61
+ "name" => "art_stamm",
62
+ "feed_name" => "art_stamm",
63
+ "format" => "optional",
64
+ ),
65
+ "Art ean" => array(
66
+ "name" => "art_ean",
67
+ "feed_name" => "art_ean",
68
+ "format" => "optional",
69
+ ),
70
+ "Art streichpreis" => array(
71
+ "name" => "art_streichpreis",
72
+ "feed_name" => "art_streichpreis",
73
+ "format" => "optional",
74
+ ),
75
+ "Art grundpreis" => array(
76
+ "name" => "art_grundpreis",
77
+ "feed_name" => "art_grundpreis",
78
+ "format" => "optional",
79
+ ),
80
+ "Art grundpreis einheit" => array(
81
+ "name" => "art_grundpreis_einheit",
82
+ "feed_name" => "art_grundpreis_einheit",
83
+ "format" => "optional",
84
+ ),
85
+ "Art finanzierung" => array(
86
+ "name" => "art_finanzierung",
87
+ "feed_name" => "art_finanzierung",
88
+ "format" => "optional",
89
+ ),
90
+ "Art lieferzeit" => array(
91
+ "name" => "art_lieferzeit",
92
+ "feed_name" => "art_lieferzeit",
93
+ "format" => "optional",
94
+ ),
95
+ "Art lieferzeit wert" => array(
96
+ "name" => "art_lieferzeit_wert",
97
+ "feed_name" => "art_lieferzeit_wert",
98
+ "format" => "optional",
99
+ ),
100
+ "Art lieferkosten text" => array(
101
+ "name" => "art_lieferkosten_text",
102
+ "feed_name" => "art_lieferkosten_text",
103
+ "format" => "optional",
104
+ ),
105
+ "Art versand at" => array(
106
+ "name" => "art_versand_at",
107
+ "feed_name" => "art_versand_at",
108
+ "format" => "optional",
109
+ ),
110
+ "Art versand at preis" => array(
111
+ "name" => "art_versand_at_preis",
112
+ "feed_name" => "art_versand_at_preis",
113
+ "format" => "optional",
114
+ ),
115
+ "Art versand ch" => array(
116
+ "name" => "art_versand_ch",
117
+ "feed_name" => "art_versand_ch",
118
+ "format" => "optional",
119
+ ),
120
+ "Art versand ch preis" => array(
121
+ "name" => "art_versand_ch_preis",
122
+ "feed_name" => "art_versand_ch_preis",
123
+ "format" => "optional",
124
+ ),
125
+ "Art versand sonstlaender" => array(
126
+ "name" => "art_versand_sonstlaender",
127
+ "feed_name" => "art_versand_sonstlaender",
128
+ "format" => "optional",
129
+ ),
130
+ "Art montage" => array(
131
+ "name" => "art_montage",
132
+ "feed_name" => "art_montage",
133
+ "format" => "optional",
134
+ ),
135
+ "Art montagepreis" => array(
136
+ "name" => "art_montagepreis",
137
+ "feed_name" => "art_montagepreis",
138
+ "format" => "optional",
139
+ ),
140
+ "Art express" => array(
141
+ "name" => "art_express",
142
+ "feed_name" => "art_express",
143
+ "format" => "optional",
144
+ ),
145
+ "Art verfuegbarkeit" => array(
146
+ "name" => "art_verfuegbarkeit",
147
+ "feed_name" => "art_verfuegbarkeit",
148
+ "format" => "optional",
149
+ ),
150
+ "Art verfuegbarkeit" => array(
151
+ "name" => "art_verfuegbarkeit",
152
+ "feed_name" => "art_verfuegbarkeit",
153
+ "format" => "optional",
154
+ ),
155
+ "Art farbe" => array(
156
+ "name" => "art_farbe",
157
+ "feed_name" => "art_farbe",
158
+ "format" => "optional",
159
+ ),
160
+ "Art hauptfarbe" => array(
161
+ "name" => "art_hauptfarbe",
162
+ "feed_name" => "art_hauptfarbe",
163
+ "format" => "optional",
164
+ ),
165
+ "Art material" => array(
166
+ "name" => "art_material",
167
+ "feed_name" => "art_material",
168
+ "format" => "optional",
169
+ ),
170
+ "Art hauptmaterial" => array(
171
+ "name" => "art_hauptmaterial",
172
+ "feed_name" => "art_hauptmaterial",
173
+ "format" => "optional",
174
+ ),
175
+ "Art holzart" => array(
176
+ "name" => "art_holzart",
177
+ "feed_name" => "art_holzart",
178
+ "format" => "optional",
179
+ ),
180
+ "Art stil" => array(
181
+ "name" => "art_stil",
182
+ "feed_name" => "art_stil",
183
+ "format" => "optional",
184
+ ),
185
+ "Art marke" => array(
186
+ "name" => "art_marke",
187
+ "feed_name" => "art_marke",
188
+ "format" => "optional",
189
+ ),
190
+ "Art kategorie" => array(
191
+ "name" => "art_kategorie",
192
+ "feed_name" => "art_kategorie",
193
+ "format" => "optional",
194
+ ),
195
+ "Art bewertung" => array(
196
+ "name" => "art_bewertung",
197
+ "feed_name" => "art_bewertung",
198
+ "format" => "optional",
199
+ ),
200
+ "Art bewertungsanzahl" => array(
201
+ "name" => "art_bewertungsanzahl",
202
+ "feed_name" => "art_bewertungsanzahl",
203
+ "format" => "optional",
204
+ ),
205
+ "Art extras" => array(
206
+ "name" => "art_extras",
207
+ "feed_name" => "art_extras",
208
+ "format" => "optional",
209
+ ),
210
+ "Art geschlecht" => array(
211
+ "name" => "art_geschlecht",
212
+ "feed_name" => "art_geschlecht",
213
+ "format" => "optional",
214
+ ),
215
+ "Art oberflaeche" => array(
216
+ "name" => "art_oberflaeche",
217
+ "feed_name" => "art_oberflaeche",
218
+ "format" => "optional",
219
+ ),
220
+ "Art sets" => array(
221
+ "name" => "art_sets",
222
+ "feed_name" => "art_sets",
223
+ "format" => "optional",
224
+ ),
225
+ "Art ausrichting" => array(
226
+ "name" => "art_ausrichtung",
227
+ "feed_name" => "art_ausrichting",
228
+ "format" => "optional",
229
+ ),
230
+ "Art verwendungsort" => array(
231
+ "name" => "art_verwendungsort",
232
+ "feed_name" => "art_verwendungsort",
233
+ "format" => "optional",
234
+ ),
235
+ "Art sitzplatze" => array(
236
+ "name" => "art_sitzplatze",
237
+ "feed_name" => "art_sitzplatze",
238
+ "format" => "optional",
239
+ ),
240
+ "Art muster" => array(
241
+ "name" => "art_muster",
242
+ "feed_name" => "art_muster",
243
+ "format" => "optional",
244
+ ),
245
+ "Art energiequelle" => array(
246
+ "name" => "art_energiequelle",
247
+ "feed_name" => "art_energiequelle",
248
+ "format" => "optional",
249
+ ),
250
+ "Art siegel" => array(
251
+ "name" => "art_siegel",
252
+ "feed_name" => "art_siegel",
253
+ "format" => "optional",
254
+ ),
255
+ "Art hersteller" => array(
256
+ "name" => "art_hersteller",
257
+ "feed_name" => "art_hersteller",
258
+ "format" => "optional",
259
+ ),
260
+ "Art img url2" => array(
261
+ "name" => "art_img_url2",
262
+ "feed_name" => "art_img_url2",
263
+ "format" => "optional",
264
+ ),
265
+ "Art img url3" => array(
266
+ "name" => "art_img_url3",
267
+ "feed_name" => "art_img_url3",
268
+ "format" => "optional",
269
+ ),
270
+ "Art img url4" => array(
271
+ "name" => "art_img_url4",
272
+ "feed_name" => "art_img_url4",
273
+ "format" => "optional",
274
+ ),
275
+ "Art masse" => array(
276
+ "name" => "art_masse",
277
+ "feed_name" => "art_masse",
278
+ "format" => "optional",
279
+ ),
280
+ "Art breite" => array(
281
+ "name" => "art_breite",
282
+ "feed_name" => "art_breite",
283
+ "format" => "optional",
284
+ ),
285
+ "Art breite einheit" => array(
286
+ "name" => "art_breite_einheit",
287
+ "feed_name" => "art_breite_einheit",
288
+ "format" => "optional",
289
+ ),
290
+ "Art tiefe" => array(
291
+ "name" => "art_tiefe",
292
+ "feed_name" => "art_tiefe",
293
+ "format" => "optional",
294
+ ),
295
+ "Art tiefe einheit" => array(
296
+ "name" => "art_tiefe_einheit",
297
+ "feed_name" => "art_tiefe_einheit",
298
+ "format" => "optional",
299
+ ),
300
+ "Art hoehe" => array(
301
+ "name" => "art_hoehe",
302
+ "feed_name" => "art_hoehe",
303
+ "format" => "optional",
304
+ ),
305
+ "Art hoehe einheit" => array(
306
+ "name" => "art_hoehe_einheit",
307
+ "feed_name" => "art_hoehe_einheit",
308
+ "format" => "optional",
309
+ ),
310
+ "Art sitztiefe" => array(
311
+ "name" => "art_sitztiefe",
312
+ "feed_name" => "art_sitztiefe",
313
+ "format" => "optional",
314
+ ),
315
+ "Art sitzhoehe" => array(
316
+ "name" => "art_sitzhoehe",
317
+ "feed_name" => "art_sitzhoehe",
318
+ "format" => "optional",
319
+ ),
320
+ "Art sitzhoehe einheit" => array(
321
+ "name" => "art_sitzhoehe_einheit",
322
+ "feed_name" => "art_sitzhoehe_einheit",
323
+ "format" => "optional",
324
+ ),
325
+ "Art sitztiefe einheit" => array(
326
+ "name" => "art_sitztiefe_einheit",
327
+ "feed_name" => "art_sitztiefe_einheit",
328
+ "format" => "optional",
329
+ ),
330
+ "Art schenkelmass" => array(
331
+ "name" => "art_schenkelmass",
332
+ "feed_name" => "art_schenkelmass",
333
+ "format" => "optional",
334
+ ),
335
+ "Art schenkelmass einheit" => array(
336
+ "name" => "art_schenkelmass_einheit",
337
+ "feed_name" => "art_schenkelmass_einheit",
338
+ "format" => "optional",
339
+ ),
340
+ "Art durchmesser" => array(
341
+ "name" => "art_durchmesser",
342
+ "feed_name" => "art_durchmesser",
343
+ "format" => "optional",
344
+ ),
345
+ "Art durchmesser einheit" => array(
346
+ "name" => "art_durchmesser_einheit",
347
+ "feed_name" => "art_durchmesser_einheit",
348
+ "format" => "optional",
349
+ ),
350
+ "Art aufhaengung" => array(
351
+ "name" => "art_aufhaengung",
352
+ "feed_name" => "art_aufhaengung",
353
+ "format" => "optional",
354
+ ),
355
+ "Art fuellmaterial" => array(
356
+ "name" => "art_fuellmaterial",
357
+ "feed_name" => "art_fuellmaterial",
358
+ "format" => "optional",
359
+ ),
360
+ "Art funktion heimtex" => array(
361
+ "name" => "art_funktion_heimtext",
362
+ "feed_name" => "art_funtion_heimtext",
363
+ "format" => "optional",
364
+ ),
365
+ "Art effizienzklasse" => array(
366
+ "name" => "art_effizienzklasse",
367
+ "feed_name" => "art_effizienzklasse",
368
+ "format" => "optional",
369
+ ),
370
+ "Art lautstaerke" => array(
371
+ "name" => "art_lautstaerke",
372
+ "feed_name" => "art_lautstaerke",
373
+ "format" => "optional",
374
+ ),
375
+ "Art helligkeit" => array(
376
+ "name" => "art_helligkeit",
377
+ "feed_name" => "art_helligkeit",
378
+ "format" => "optional",
379
+ ),
380
+ "Art lichtfarbe" => array(
381
+ "name" => "art_lichtfarbe",
382
+ "feed_name" => "art_lichtfarbe",
383
+ "format" => "optional",
384
+ ),
385
+ "Art kuechenelektro" => array(
386
+ "name" => "art_kuechenelektro",
387
+ "feed_name" => "art_kuechenelektro",
388
+ "format" => "optional",
389
+ ),
390
+ "Art herdeigenschaften" => array(
391
+ "name" => "art_herdeigenschaften",
392
+ "feed_name" => "art_herdeigenschaften",
393
+ "format" => "optional",
394
+ ),
395
+ "Art kochfeld" => array(
396
+ "name" => "art_kochfeld",
397
+ "feed_name" => "art_kochfeld",
398
+ "format" => "optional",
399
+ ),
400
+ "Art material arbeitsplatte" => array(
401
+ "name" => "art_material_arbeitsplatte",
402
+ "feed_name" => "art_material_arbeitsplatte",
403
+ "format" => "optional",
404
+ ),
405
+ "Art extras sessel" => array(
406
+ "name" => "art_extras_sessel",
407
+ "feed_name" => "art_extras_sessel",
408
+ "format" => "optional",
409
+ ),
410
+ "Art schlaffunktion" => array(
411
+ "name" => "art_schlaffunktion",
412
+ "feed_name" => "art_schlaffunktion",
413
+ "format" => "optional",
414
+ ),
415
+ "Art form sofa" => array(
416
+ "name" => "art_form_sofa",
417
+ "feed_name" => "art_form_sofa",
418
+ "format" => "optional",
419
+ ),
420
+ "Art extras sofa" => array(
421
+ "name" => "art_extras_sofa",
422
+ "feed_name" => "art_extras_sofa",
423
+ "format" => "optional",
424
+ ),
425
+ "Art material fuesse" => array(
426
+ "name" => "art_material_fuesse",
427
+ "feed_name" => "art_material_fuesse",
428
+ "format" => "optional",
429
+ ),
430
+ "Art haertegrad matratze" => array(
431
+ "name" => "art_haertegrad_matratze",
432
+ "feed_name" => "art_haertegrad_matratze",
433
+ "format" => "optional",
434
+ ),
435
+ "Art liegezonen" => array(
436
+ "name" => "art_liegezonen",
437
+ "feed_name" => "art_liegezonen",
438
+ "format" => "optional",
439
+ ),
440
+ "Art allergiker matratze" => array(
441
+ "name" => "art_allergiker_matratze",
442
+ "feed_name" => "art_allergiker_matratze",
443
+ "format" => "optional",
444
+ ),
445
+ "Art stauraum bett" => array(
446
+ "name" => "art_stauraum_bett",
447
+ "feed_name" => "art_stauraum_bett",
448
+ "format" => "optional",
449
+ ),
450
+ "Art beleuchtung bett" => array(
451
+ "name" => "art_beleuchtung_bett",
452
+ "feed_name" => "art_beleuchtung_bett",
453
+ "format" => "optional",
454
+ ),
455
+ "Art matratzenmasse" => array(
456
+ "name" => "art_matratzenmasse",
457
+ "feed_name" => "art_matratzenmasse",
458
+ "format" => "optional",
459
+ ),
460
+ "Art matratzenart" => array(
461
+ "name" => "art_matratzenart",
462
+ "feed_name" => "art_matratzenart",
463
+ "format" => "optional",
464
+ ),
465
+ "Art bezugwaschbar" => array(
466
+ "name" => "art_bezugwaschbar",
467
+ "feed_name" => "art_bezugwaschbar",
468
+ "format" => "optional",
469
+ ),
470
+ "Art vitrine" => array(
471
+ "name" => "art_vitrine",
472
+ "feed_name" => "art_vitrine",
473
+ "format" => "optional",
474
+ ),
475
+ "Art abschliessbar" => array(
476
+ "name" => "art_abschliessbar",
477
+ "feed_name" => "art_abschliessbar",
478
+ "format" => "optional",
479
+ ),
480
+ "Art variable faecher" => array(
481
+ "name" => "art_variable_faecher",
482
+ "feed_name" => "art_variable_faecher",
483
+ "format" => "optional",
484
+ ),
485
+ "Art tuerenzahl" => array(
486
+ "name" => "art_tuerenzahl",
487
+ "feed_name" => "art_tuerenzahl",
488
+ "format" => "optional",
489
+ ),
490
+ "Art schubladenzahl" => array(
491
+ "name" => "art_schubladenzahl",
492
+ "feed_name" => "art_schubladenzahl",
493
+ "format" => "optional",
494
+ ),
495
+ "Art faecherzahl" => array(
496
+ "name" => "art_faecherzahl",
497
+ "feed_name" => "art_faecherzahl",
498
+ "format" => "optional",
499
+ ),
500
+ "Art tischform" => array(
501
+ "name" => "art_tischform",
502
+ "feed_name" => "art_tischform",
503
+ "format" => "optional",
504
+ ),
505
+ "Art tischfunktion" => array(
506
+ "name" => "art_tischfunktion",
507
+ "feed_name" => "art_tischfunktion",
508
+ "format" => "optional",
509
+ ),
510
+ "Art gestell material" => array(
511
+ "name" => "art_gestell_material",
512
+ "feed_name" => "art_gestell_material",
513
+ "format" => "optional",
514
+ ),
515
+ ),
516
+ );
517
+ return $moebel;
518
+ }
519
+ }
520
+ ?>
classes/class-activate.php CHANGED
@@ -30,6 +30,27 @@ class WooSEA_Activation {
30
  "taxonomy" => "none",
31
  "utm_source" => "Google Remarketing",
32
  "type" => "Advertising" ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  "Bing Shopping" => array (
34
  "channel_hash" => md5("Bing Shopping"),
35
  "name" => "Bing Shopping",
@@ -71,6 +92,13 @@ class WooSEA_Activation {
71
  ),
72
  "Armenia" => array (),
73
  "Australia" => array (
 
 
 
 
 
 
 
74
  "Shopping.com" => array (
75
  "channel_hash" => md5("Shopping.com"),
76
  "name" => "Shopping.com",
@@ -306,10 +334,17 @@ class WooSEA_Activation {
306
  "Miinto" => array (
307
  "channel_hash" => md5("Miinto.dk"),
308
  "name" => "Miinto.dk",
309
- "fields" => "customfeed",
310
  "taxonomy" => "none",
311
  "utm_source" => "Miinto.dk",
312
  "type" => "Comparison shopping engine" ),
 
 
 
 
 
 
 
313
  ),
314
  "Djibouti" => array (),
315
  "Dominica" => array (),
@@ -670,7 +705,7 @@ class WooSEA_Activation {
670
  "Guenstiger" => array (
671
  "channel_hash" => md5("Guenstiger.de"),
672
  "name" => "Guenstiger.de",
673
- "fields" => "customfeed",
674
  "taxonomy" => "none",
675
  "utm_source" => "Guenstiger.de",
676
  "type" => "Comparison shopping engine" ),
@@ -719,7 +754,7 @@ class WooSEA_Activation {
719
  "Moebel.de" => array (
720
  "channel_hash" => md5("Moebel.de"),
721
  "name" => "Moebel.de",
722
- "fields" => "customfeed",
723
  "taxonomy" => "none",
724
  "utm_source" => "Moebel.de",
725
  "type" => "Comparison shopping engine" ),
@@ -1056,7 +1091,7 @@ class WooSEA_Activation {
1056
  "Miinto" => array (
1057
  "channel_hash" => md5("Miinto.nl"),
1058
  "name" => "Miinto.nl",
1059
- "fields" => "customfeed",
1060
  "taxonomy" => "none",
1061
  "utm_source" => "Miinto.nl",
1062
  "type" => "Comparison shopping engine" ),
@@ -1077,7 +1112,7 @@ class WooSEA_Activation {
1077
  "Fruugo.nl" => array (
1078
  "channel_hash" => md5("Fruugo.nl"),
1079
  "name" => "Fruugo.nl",
1080
- "fields" => "customfeed",
1081
  "taxonomy" => "none",
1082
  "utm_source" => "Fruugo.nl",
1083
  "type" => "Marketplace" ),
@@ -1153,13 +1188,6 @@ class WooSEA_Activation {
1153
  "taxonomy" => "none",
1154
  "utm_source" => "Adform.pl",
1155
  "type" => "Advertising" ),
1156
- "Ceneo" => array (
1157
- "channel_hash" => md5("Ceneo.pl"),
1158
- "name" => "Ceneo.pl",
1159
- "fields" => "customfeed",
1160
- "taxonomy" => "none",
1161
- "utm_source" => "Ceneo.pl",
1162
- "type" => "Marketplace" ),
1163
  "Cenowarka" => array (
1164
  "channel_hash" => md5("Cenowarka.pl"),
1165
  "name" => "Cenowarka.pl",
@@ -1167,13 +1195,13 @@ class WooSEA_Activation {
1167
  "taxonomy" => "none",
1168
  "utm_source" => "Cenowarka.pl",
1169
  "type" => "Comparison shopping engine" ),
1170
- "Domodi" => array (
1171
- "channel_hash" => md5("Domodi.pl"),
1172
- "name" => "Domodi.pl",
1173
- "fields" => "customfeed",
1174
- "taxonomy" => "none",
1175
- "utm_source" => "Domodi.pl",
1176
- "type" => "Comparison shopping engine" ),
1177
  "ShopAlike" => array (
1178
  "channel_hash" => md5("ShopAlike.pl"),
1179
  "name" => "ShopAlike.pl",
@@ -1295,7 +1323,14 @@ class WooSEA_Activation {
1295
  "taxonomy" => "none",
1296
  "utm_source" => "Adform",
1297
  "type" => "Advertising" ),
1298
- "Spartoo" => array (
 
 
 
 
 
 
 
1299
  "channel_hash" => md5("Spartoo.es"),
1300
  "name" => "Spartoo.es",
1301
  "fields" => "customfeed",
@@ -1447,12 +1482,12 @@ class WooSEA_Activation {
1447
  "taxonomy" => "none",
1448
  "utm_source" => "Spartoo.co.uk",
1449
  "type" => "Marketplace" ),
1450
- "Frugoo" => array (
1451
- "channel_hash" => md5("Frugoo.com"),
1452
- "name" => "Frugoo.com",
1453
- "fields" => "customfeed",
1454
  "taxonomy" => "none",
1455
- "utm_source" => "Frugoo.com",
1456
  "type" => "Marketplace" ),
1457
  "ManoMano" => array (
1458
  "channel_hash" => md5("ManoMano.co.uk"),
@@ -1611,11 +1646,11 @@ class WooSEA_Activation {
1611
  "utm_source" => "TheNextAd",
1612
  "type" => "Advertising" ),
1613
  "Fruugo" => array (
1614
- "channel_hash" => md5("Fruugo"),
1615
- "name" => "Fruugo.com",
1616
- "fields" => "customfeed",
1617
  "taxonomy" => "none",
1618
- "utm_source" => "Fruugo.com",
1619
  "type" => "Marketplace" ),
1620
  "Polyvore" => array (
1621
  "channel_hash" => md5("Polyvore"),
@@ -1697,12 +1732,12 @@ class WooSEA_Activation {
1697
  wp_schedule_event ( time(), 'hourly', 'woosea_cron_hook');
1698
  }
1699
 
1700
- /**
1701
- * Function for checking if license is valid
1702
- */
1703
- if (!wp_next_scheduled( 'woosea_check_license' ) ) {
1704
- wp_schedule_event ( time(), 'twicedaily', 'woosea_check_license');
1705
- }
1706
 
1707
  /**
1708
  * We check only once if this is a paid version of the plugin
30
  "taxonomy" => "none",
31
  "utm_source" => "Google Remarketing",
32
  "type" => "Advertising" ),
33
+ "Google DSA Feed" => array (
34
+ "channel_hash" => md5("Google DSA"),
35
+ "name" => "Google - DSA",
36
+ "fields" => "google_dsa",
37
+ "taxonomy" => "none",
38
+ "utm_source" => "Google DSA",
39
+ "type" => "Advertising" ),
40
+ "Google Local Products Feed" => array (
41
+ "channel_hash" => md5("Google Local Products"),
42
+ "name" => "Google Local Products",
43
+ "fields" => "google_local_products",
44
+ "taxonomy" => "google_shopping",
45
+ "utm_source" => "Google Local Products",
46
+ "type" => "Advertising" ),
47
+ "Google Local Products Inventory Feed" => array (
48
+ "channel_hash" => md5("Google Local Products Inventory"),
49
+ "name" => "Google Local Products Inventory",
50
+ "fields" => "google_local",
51
+ "taxonomy" => "google_shopping",
52
+ "utm_source" => "Google Local Product Inventory",
53
+ "type" => "Advertising" ),
54
  "Bing Shopping" => array (
55
  "channel_hash" => md5("Bing Shopping"),
56
  "name" => "Bing Shopping",
92
  ),
93
  "Armenia" => array (),
94
  "Australia" => array (
95
+ "Fruugoaustralia" => array (
96
+ "channel_hash" => md5("Fruugoaustralia.com"),
97
+ "name" => "Fruugoaustralia.com",
98
+ "fields" => "fruugoaus",
99
+ "taxonomy" => "none",
100
+ "utm_source" => "Fruugoaustralia.com",
101
+ "type" => "Marketplace" ),
102
  "Shopping.com" => array (
103
  "channel_hash" => md5("Shopping.com"),
104
  "name" => "Shopping.com",
334
  "Miinto" => array (
335
  "channel_hash" => md5("Miinto.dk"),
336
  "name" => "Miinto.dk",
337
+ "fields" => "miinto_dk",
338
  "taxonomy" => "none",
339
  "utm_source" => "Miinto.dk",
340
  "type" => "Comparison shopping engine" ),
341
+ "Katoni" => array (
342
+ "channel_hash" => md5("Katoni.dk"),
343
+ "name" => "Katoni.dk",
344
+ "fields" => "katoni",
345
+ "taxonomy" => "none",
346
+ "utm_source" => "Katoni.dk",
347
+ "type" => "Comparison shopping engine" ),
348
  ),
349
  "Djibouti" => array (),
350
  "Dominica" => array (),
705
  "Guenstiger" => array (
706
  "channel_hash" => md5("Guenstiger.de"),
707
  "name" => "Guenstiger.de",
708
+ "fields" => "guenstiger",
709
  "taxonomy" => "none",
710
  "utm_source" => "Guenstiger.de",
711
  "type" => "Comparison shopping engine" ),
754
  "Moebel.de" => array (
755
  "channel_hash" => md5("Moebel.de"),
756
  "name" => "Moebel.de",
757
+ "fields" => "moebel",
758
  "taxonomy" => "none",
759
  "utm_source" => "Moebel.de",
760
  "type" => "Comparison shopping engine" ),
1091
  "Miinto" => array (
1092
  "channel_hash" => md5("Miinto.nl"),
1093
  "name" => "Miinto.nl",
1094
+ "fields" => "miinto_nl",
1095
  "taxonomy" => "none",
1096
  "utm_source" => "Miinto.nl",
1097
  "type" => "Comparison shopping engine" ),
1112
  "Fruugo.nl" => array (
1113
  "channel_hash" => md5("Fruugo.nl"),
1114
  "name" => "Fruugo.nl",
1115
+ "fields" => "fruugonl",
1116
  "taxonomy" => "none",
1117
  "utm_source" => "Fruugo.nl",
1118
  "type" => "Marketplace" ),
1188
  "taxonomy" => "none",
1189
  "utm_source" => "Adform.pl",
1190
  "type" => "Advertising" ),
 
 
 
 
 
 
 
1191
  "Cenowarka" => array (
1192
  "channel_hash" => md5("Cenowarka.pl"),
1193
  "name" => "Cenowarka.pl",
1195
  "taxonomy" => "none",
1196
  "utm_source" => "Cenowarka.pl",
1197
  "type" => "Comparison shopping engine" ),
1198
+ "Miinto" => array (
1199
+ "channel_hash" => md5("Miinto.pl"),
1200
+ "name" => "Miinto.pl",
1201
+ "fields" => "miinto_pl",
1202
+ "taxonomy" => "none",
1203
+ "utm_source" => "Miinto.pl",
1204
+ "type" => "Comparison shopping engine" ),
1205
  "ShopAlike" => array (
1206
  "channel_hash" => md5("ShopAlike.pl"),
1207
  "name" => "ShopAlike.pl",
1323
  "taxonomy" => "none",
1324
  "utm_source" => "Adform",
1325
  "type" => "Advertising" ),
1326
+ "Fruugoes" => array (
1327
+ "channel_hash" => md5("Fruugo.es"),
1328
+ "name" => "Fruugo.es",
1329
+ "fields" => "fruugoes",
1330
+ "taxonomy" => "none",
1331
+ "utm_source" => "Fruugo.es",
1332
+ "type" => "Marketplace" ),
1333
+ "Spartoo" => array (
1334
  "channel_hash" => md5("Spartoo.es"),
1335
  "name" => "Spartoo.es",
1336
  "fields" => "customfeed",
1482
  "taxonomy" => "none",
1483
  "utm_source" => "Spartoo.co.uk",
1484
  "type" => "Marketplace" ),
1485
+ "Fruugouk" => array (
1486
+ "channel_hash" => md5("Fruugo.co.uk"),
1487
+ "name" => "Fruugo.co.uk",
1488
+ "fields" => "fruugouk",
1489
  "taxonomy" => "none",
1490
+ "utm_source" => "Fruugo.co.uk",
1491
  "type" => "Marketplace" ),
1492
  "ManoMano" => array (
1493
  "channel_hash" => md5("ManoMano.co.uk"),
1646
  "utm_source" => "TheNextAd",
1647
  "type" => "Advertising" ),
1648
  "Fruugo" => array (
1649
+ "channel_hash" => md5("Fruugo.us"),
1650
+ "name" => "Fruugo.us",
1651
+ "fields" => "fruugous",
1652
  "taxonomy" => "none",
1653
+ "utm_source" => "Fruugo.us",
1654
  "type" => "Marketplace" ),
1655
  "Polyvore" => array (
1656
  "channel_hash" => md5("Polyvore"),
1732
  wp_schedule_event ( time(), 'hourly', 'woosea_cron_hook');
1733
  }
1734
 
1735
+ /**
1736
+ * Function for checking if license is valid
1737
+ */
1738
+ if (!wp_next_scheduled( 'woosea_check_license' ) ) {
1739
+ wp_schedule_event ( time(), 'daily', 'woosea_check_license');
1740
+ }
1741
 
1742
  /**
1743
  * We check only once if this is a paid version of the plugin
classes/class-admin-notifications.php CHANGED
@@ -18,7 +18,9 @@ class WooSEA_Get_Admin_Notifications {
18
  $file = $path . "/". $filename ."." ."log";
19
 
20
  // Remove the previous file, preventing the file from becoming to big
21
- unlink($file);
 
 
22
 
23
  // External location for downloading the file
24
  $external_base = $upload_dir['baseurl'];
@@ -108,7 +110,7 @@ class WooSEA_Get_Admin_Notifications {
108
  $message_type = "notice notice-error is-dismissible";
109
  break;
110
  case 14:
111
- $message = "Grant access to our customer service to help you with creating product feed configurations. Enabling this option will create a new WordPress user. Credentials will automatically be send to AdTribes.io support team. By disabling this option the Wordpress user will be deleted.<br/><br/><strong>Please note:<br/></strong>The addition of extra attributes to your store and the JSON-LD features are part of our <a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">Elite membership</a>.";
112
  $message_type = "notice notice-info";
113
  break;
114
  }
18
  $file = $path . "/". $filename ."." ."log";
19
 
20
  // Remove the previous file, preventing the file from becoming to big
21
+ if ( file_exists ( $file ) ){
22
+ unlink($file);
23
+ }
24
 
25
  // External location for downloading the file
26
  $external_base = $upload_dir['baseurl'];
110
  $message_type = "notice notice-error is-dismissible";
111
  break;
112
  case 14:
113
+ $message = "Add important attributes, such as Brand, GTIN, condition and many more to create a perfect Google Shopping feed or fix the WooCommerce structured data bug so less products get disapproved in Google's Merchant Center.";
114
  $message_type = "notice notice-info";
115
  break;
116
  }
classes/class-attributes.php CHANGED
@@ -48,9 +48,10 @@ private function get_dynamic_attributes(){
48
  global $wpdb;
49
  $list = array();
50
 
51
- $no_taxonomies = array("element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","yst_prominent_words","category","post_tag","nav_menu","link_category","post_format","product_type","product_visibility","product_cat","product_shipping_class","product_tag");
52
  $taxonomies = get_taxonomies();
53
- $diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
 
54
 
55
  # get custom taxonomy values for a product
56
  foreach($diff_taxonomies as $tax_diff){
@@ -77,17 +78,31 @@ private function get_dynamic_attributes(){
77
  private function get_custom_attributes() {
78
  global $wpdb;
79
  $list = array();
80
-
81
- $sql = "SELECT meta_key as name, meta_value as type FROM " . $wpdb->prefix . "postmeta" . " group by meta_key";
82
- $data = $wpdb->get_results($sql);
83
-
84
 
85
  if (count($data)) {
86
  foreach ($data as $key => $value) {
87
- if (!preg_match("/pyre|sbg|fusion/i",$value->name)){
 
88
  $value_display = str_replace("_", " ",$value->name);
89
  $list["custom_attributes_" . $value->name] = ucfirst($value_display);
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  }
92
  return $list;
93
  }
@@ -171,6 +186,7 @@ public function get_mapping_attributes_dropdown() {
171
  "sku" => "SKU",
172
  "sku_id" => "SKU_ID",
173
  "title" => "Product name",
 
174
  "description" => "Product description",
175
  "short_description" => "Product short description",
176
  "price" => "Price",
@@ -194,13 +210,17 @@ public function get_mapping_attributes_dropdown() {
194
  "availability" => "Availability",
195
  "quantity" => "Quantity [Stock]",
196
  "product_type" => "Product Type",
 
 
 
 
197
  "publication_date" => "Publication date",
198
  "item_group_id" => "Item group ID",
199
  "weight" => "Weight",
200
  "width" => "Width",
201
  "height" => "Height",
202
  "length" => "Length",
203
- "shipping" => "Shipping price",
204
  "visibility" => "Visibility",
205
  "rating_total" => "Total rating",
206
  "rating_average" => "Average rating",
@@ -264,6 +284,7 @@ public function get_mapping_attributes_dropdown() {
264
  $dropdown .= "<option value='google_category'>Google category</option>";
265
  $dropdown .="</optgroup>";
266
 
 
267
  /**
268
  * Create dropdown with custom attributes
269
  */
@@ -282,6 +303,14 @@ public function get_mapping_attributes_dropdown() {
282
 
283
  $dropdown .="</optgroup>";
284
  }
 
 
 
 
 
 
 
 
285
  return $dropdown;
286
  }
287
 
@@ -293,13 +322,18 @@ public function get_mapping_attributes_dropdown() {
293
  "sku" => "SKU",
294
  "sku_id" => "SKU_ID",
295
  "title" => "Product name",
296
- "description" => "Product description",
 
297
  "short_description" => "Product short description",
298
  "link" => "Link",
299
  "image" => "Main image",
300
  "feature_image" => "Feature image",
301
  "product_type" => "Product Type",
302
- "publication_date" => "Publication date",
 
 
 
 
303
  "currency" => "Currency",
304
  "categories" => "Category",
305
  "raw_categories" => "Category (not used for mapping)",
@@ -326,7 +360,7 @@ public function get_mapping_attributes_dropdown() {
326
  "width" => "Width",
327
  "height" => "Height",
328
  "length" => "Length",
329
- "shipping" => "Shipping price",
330
  "visibility" => "Visibility",
331
  "rating_total" => "Total rating",
332
  "rating_average" => "Average rating",
@@ -362,13 +396,21 @@ public function get_mapping_attributes_dropdown() {
362
  $attributes = array_merge($attributes, $custom_attributes);
363
  }
364
 
365
-
366
  $static = array(
 
367
  "static_value" => "Static value",
368
  "calculated" => "Plugin calculation",
 
369
  );
370
 
371
  $attributes = array_merge($attributes, $static);
 
 
 
 
 
 
 
372
  return $attributes;
373
  }
374
 
48
  global $wpdb;
49
  $list = array();
50
 
51
+ $no_taxonomies = array("portfolio_category","portfolio_skills","portfolio_tags","nav_menu","post_format","slide-page","element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","yst_prominent_words","category","post_tag","nav_menu","link_category","post_format","product_type","product_visibility","product_cat","product_shipping_class","product_tag");
52
  $taxonomies = get_taxonomies();
53
+
54
+ $diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
55
 
56
  # get custom taxonomy values for a product
57
  foreach($diff_taxonomies as $tax_diff){
78
  private function get_custom_attributes() {
79
  global $wpdb;
80
  $list = array();
81
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id = posts.id AND posts.post_type LIKE '%product%'
82
+ AND meta.meta_key NOT LIKE 'pyre%' AND meta.meta_key NOT LIKE 'sbg_%' AND meta.meta_key NOT LIKE 'wccaf_%' AND meta.meta_key NOT LIKE 'rp_%' AND (meta.meta_key NOT LIKE '\_%' OR meta.meta_key LIKE '\_woosea%' OR meta.meta_key LIKE '\_yoast%' OR meta.meta_key='_product_attributes') GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
83
+ $data = $wpdb->get_results($sql);
 
84
 
85
  if (count($data)) {
86
  foreach ($data as $key => $value) {
87
+
88
+ if (!preg_match("/_product_attributes/i",$value->name)){
89
  $value_display = str_replace("_", " ",$value->name);
90
  $list["custom_attributes_" . $value->name] = ucfirst($value_display);
91
+ } else {
92
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id = posts.id AND posts.post_type LIKE '%product%' AND meta.meta_key='_product_attributes';";
93
+ $data = $wpdb->get_results($sql);
94
+ if (count($data)) {
95
+ foreach ($data as $key => $value) {
96
+ $product_attr = unserialize($value->type);
97
+ if(!empty($product_attr)){
98
+ foreach ($product_attr as $key => $arr_value) {
99
+ $value_display = str_replace("_", " ",$arr_value['name']);
100
+ $list["custom_attributes_" . $key] = ucfirst($value_display);
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
  }
107
  return $list;
108
  }
186
  "sku" => "SKU",
187
  "sku_id" => "SKU_ID",
188
  "title" => "Product name",
189
+ "mother_title" => "Product name mother product",
190
  "description" => "Product description",
191
  "short_description" => "Product short description",
192
  "price" => "Price",
210
  "availability" => "Availability",
211
  "quantity" => "Quantity [Stock]",
212
  "product_type" => "Product Type",
213
+ "content_type" => "Content Type",
214
+ "exclude_from_catalog" => "Excluded from catalog",
215
+ "exclude_from_search" => "Excluded from search",
216
+ "exclude_from_all" => "Excluded from all (hidden)",
217
  "publication_date" => "Publication date",
218
  "item_group_id" => "Item group ID",
219
  "weight" => "Weight",
220
  "width" => "Width",
221
  "height" => "Height",
222
  "length" => "Length",
223
+ "shipping" => "Shipping",
224
  "visibility" => "Visibility",
225
  "rating_total" => "Total rating",
226
  "rating_average" => "Average rating",
284
  $dropdown .= "<option value='google_category'>Google category</option>";
285
  $dropdown .="</optgroup>";
286
 
287
+
288
  /**
289
  * Create dropdown with custom attributes
290
  */
303
 
304
  $dropdown .="</optgroup>";
305
  }
306
+
307
+ /**
308
+ * Add the product tag field
309
+ */
310
+ $dropdown .= "<optgroup label='Other fields'><strong>Other fields</strong>";
311
+ $dropdown .= "<option value='product_tag'>Product tags</option>";
312
+ $dropdown .= "</optgroup>";
313
+
314
  return $dropdown;
315
  }
316
 
322
  "sku" => "SKU",
323
  "sku_id" => "SKU_ID",
324
  "title" => "Product name",
325
+ "mother_title" => "Product name mother product",
326
+ "description" => "Product description",
327
  "short_description" => "Product short description",
328
  "link" => "Link",
329
  "image" => "Main image",
330
  "feature_image" => "Feature image",
331
  "product_type" => "Product Type",
332
+ "content_type" => "Content Type",
333
+ "exclude_from_catalog" => "Excluded from catalog",
334
+ "exclude_from_search" => "Excluded from search",
335
+ "exclude_from_all" => "Excluded from all (hidden)",
336
+ "publication_date" => "Publication date",
337
  "currency" => "Currency",
338
  "categories" => "Category",
339
  "raw_categories" => "Category (not used for mapping)",
360
  "width" => "Width",
361
  "height" => "Height",
362
  "length" => "Length",
363
+ "shipping" => "Shipping",
364
  "visibility" => "Visibility",
365
  "rating_total" => "Total rating",
366
  "rating_average" => "Average rating",
396
  $attributes = array_merge($attributes, $custom_attributes);
397
  }
398
 
 
399
  $static = array(
400
+ "installment" => "Installment",
401
  "static_value" => "Static value",
402
  "calculated" => "Plugin calculation",
403
+ "product_tag" => "Product tags",
404
  );
405
 
406
  $attributes = array_merge($attributes, $static);
407
+
408
+ // Did the user checked extra attributes
409
+ if(get_option( 'woosea_extra_attributes' )){
410
+ $extra_attributes = get_option( 'woosea_extra_attributes' );
411
+ array_walk($extra_attributes, function(&$value, $key) { $value .= ' (Added Custom attribute)';});
412
+ $attributes = array_merge($attributes, $extra_attributes);
413
+ }
414
  return $attributes;
415
  }
416
 
classes/class-deactivate-cleanup.php CHANGED
@@ -6,10 +6,9 @@
6
  */
7
  class WooSEA_Deactivate_Cleanup {
8
  public static function deactivate_cleanup() {
9
- wp_clear_scheduled_hook('woosea_cron_hook');
10
- wp_clear_scheduled_hook('woosea_check_license');
11
  delete_option( 'channel_statics');
12
- delete_option('license_information');
13
- // delete_option( 'cron_projects' );
14
- }
15
  }
6
  */
7
  class WooSEA_Deactivate_Cleanup {
8
  public static function deactivate_cleanup() {
9
+ wp_clear_scheduled_hook('woosea_cron_hook');
10
+ wp_clear_scheduled_hook('woosea_check_license');
11
  delete_option( 'channel_statics');
12
+ delete_option('license_information');
13
+ }
 
14
  }
classes/class-get-products.php CHANGED
@@ -24,14 +24,17 @@ class WooSEA_Get_Products {
24
  * @param int $product_id
25
  * @return array
26
  */
27
- public function wc_get_product_cat_ids( $product_id ) {
28
- $product_cats = wp_get_post_terms( $product_id, 'product_cat', array( "fields" => "ids" ) );
29
-
30
- foreach ( $product_cats as $product_cat ) {
31
- $product_cats = array_merge( $product_cats, get_ancestors( $product_cat, 'product_cat' ) );
32
- }
33
- return $product_cats;
34
- }
 
 
 
35
 
36
  /**
37
  * Function to add CDATA brackets to title, short_description and description attributes
@@ -41,12 +44,19 @@ class WooSEA_Get_Products {
41
  // return "<![CDATA[ $string ]]>";
42
  }
43
 
 
 
 
 
 
 
 
 
44
  /**
45
  * Function that will create an append with Google Analytics UTM parameters
46
  * Removes UTM paramaters that are left blank
47
  */
48
- public function woosea_append_utm_code ( $feed_config, $productId, $parentId ) {
49
-
50
  // AdTribes conversionId
51
  if(array_key_exists('adtribes_conversion', $feed_config)){
52
  $adtribesConvId = "$feed_config[project_hash]|adtribes|$productId";
@@ -80,11 +90,33 @@ class WooSEA_Get_Products {
80
  $utm_part .= "&$key=$value";
81
  }
82
 
83
- # Strip first & from utm
84
- if($parentId > 0){
85
- $utm_part = "&".ltrim($utm_part, '&');
 
 
 
 
 
 
 
 
 
 
 
 
86
  } else {
87
- $utm_part = "?".ltrim($utm_part, '&');
 
 
 
 
 
 
 
 
 
 
88
  }
89
  return $utm_part;
90
  }
@@ -103,17 +135,24 @@ class WooSEA_Get_Products {
103
  global $wpdb;
104
  $list = array();
105
 
106
- $sql = "SELECT meta_key as name, meta_value as type FROM " . $wpdb->prefix . "postmeta" . " WHERE post_id=".$productId." group by meta_key";
107
- $data = $wpdb->get_results($sql);
108
 
109
  if (count($data)) {
110
  foreach ($data as $key => $value) {
111
  $value_display = str_replace("_", " ",$value->name);
112
- if (!preg_match("/pyre|sbg/i",$value->name)){
113
- $list[$value->name] = ucfirst($value_display);
114
- }
 
 
 
 
 
 
 
115
  }
116
- return $list;
117
  }
118
  return false;
119
  }
@@ -134,12 +173,8 @@ class WooSEA_Get_Products {
134
  $order_data = $order->get_data();
135
  $order_date_created = $order_data['date_created']->date('Y-m-d H:i:s');
136
 
137
- //error_log("ORDER ID:" . $orders->ID);
138
- //error_log("ORDER DATE:" . $order_date_created);
139
-
140
  foreach ($order->get_items() as $item_key => $item_values){
141
  $product_id = $item_values->get_product_id();
142
- //error_log("PRODUCT ID:" . $product_id);
143
  }
144
  }
145
  //return $orders_timeframe;
@@ -165,23 +200,25 @@ class WooSEA_Get_Products {
165
 
166
  if ( is_wp_error( $parent ) )
167
  return $parent;
168
-
169
- if ($nicename){
170
- $name = $parent->slug;
171
- } else {
172
- $name = $parent->name;
173
- }
 
174
 
175
- if ($parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited )){
176
- $visited[] = $parent->parent;
177
- $chain .= $this->woosea_get_term_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
178
- }
179
 
180
- if ($link){
181
- $chain .= $separator.$name;
182
- } else {
183
- $chain .= $separator.$name;
184
- }
 
185
  return $chain;
186
  } // End woo_get_term_parents()
187
 
@@ -196,6 +233,22 @@ class WooSEA_Get_Products {
196
  return false;
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  /**
200
  * Get shipping cost for product
201
  */
@@ -204,73 +257,167 @@ class WooSEA_Get_Products {
204
  $shipping_arr = array();
205
  $zone_count = 0;
206
  $nr_shipping_zones = count($shipping_zones);
207
-
208
  $base_location = wc_get_base_location();
209
  $base_country = $base_location['country'];
210
 
211
- foreach ( $shipping_zones as $zone){
 
 
 
212
 
 
213
  $zone_details = array();
214
- $zone_code = $zone['zone_locations'][0]->code;
215
- $zone_details['country'] = $zone_code;
216
- $zone_details['service'] = "";
217
- $zone_details['region'] = "";
218
- if(isset($zone['zone_locations'][1]->code)){
219
- $zone_region = $zone['zone_locations'][1]->code;
220
- $zn_short = explode (":", $zone_region);
221
-
222
- if(count($zn_short) > 1){
223
- $zone_details['region'] = $zn_short[1];
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  }
225
- }
226
-
227
- // When no shipping zone has been configured in project take the shops country zone id as default
228
- if (!array_key_exists('zone', $project_config) AND ($zone_code == $base_country)){
229
- $project_config['zone'] = $zone['zone_id'];
230
  }
231
 
232
- $shipping_methods = $zone['shipping_methods'];
233
- $arr_shipping_methods = json_decode( json_encode( $shipping_methods ), true );
 
 
 
 
 
 
 
 
 
 
 
 
234
 
235
- foreach ( $arr_shipping_methods as $shipping ) {
 
 
 
 
236
 
237
- // FLAT RATE SHIPPING COSTS
238
- //if($shipping['instance_settings']['title'] == "Flat rate"){
239
- if(isset($shipping['instance_settings']['cost'])){
240
- $zone_details['service'] = $shipping['instance_settings']['title'];
241
- $shipping_cost = $shipping['instance_settings']['cost'];
 
 
 
 
 
242
  }
243
 
244
  // CLASS SHIPPING COSTS
245
- if(isset($shipping['instance_settings'][$class_cost_id])){
246
- $zone_details['service'] = $shipping['instance_settings']['title'];
247
- $shipping_cost = ($shipping['instance_settings'][$class_cost_id]+$shipping_cost);
248
- }
249
- //}
250
-
251
- // FREE SHIPPING COSTS
252
- if($shipping['instance_settings']['title'] == "Free shipping"){
253
- if ($price >= $shipping['instance_settings']['min_amount']){
254
- $zone_details['service'] = $shipping['instance_settings']['title'];
255
- $shipping_cost = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
256
  }
257
- }
258
- }
259
 
260
- foreach ($tax_rates as $k => $v){
261
- if((isset($v['shipping'])) and ($v['shipping'] == "yes")){
262
- $rate = (($v['rate']+100)/100);
263
- $shipping_cost = $shipping_cost*$rate;
264
- $shipping_cost = round($shipping_cost, 2);
265
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  }
267
-
268
- $zone_details['price'] = $shipping_cost;
269
- $shipping_arr[$zone_count] = $zone_details;
270
- $zone_count++;
271
  }
 
272
  return $shipping_arr;
273
- //return $shipping_cost;
274
  }
275
 
276
  /**
@@ -313,7 +460,7 @@ class WooSEA_Get_Products {
313
 
314
  $base = $upload_dir['basedir'];
315
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
316
- $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "." . $feed_config['fileformat'];
317
 
318
  // External location for downloading the file
319
  $external_base = $upload_dir['baseurl'];
@@ -349,7 +496,7 @@ class WooSEA_Get_Products {
349
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><rss xmlns:g="http://base.google.com/ns/1.0"></rss>');
350
  $xml->addAttribute('version', '2.0');
351
  $xml->addChild('channel');
352
- $xml->channel->addChild('title', $feed_config['projectname'] );
353
  $xml->channel->addChild('link', site_url());
354
  $xml->channel->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced WooCommerce Product Feed PRO plugin from AdTribes.io. For all your support questions check out our FAQ on https://www.adtribes.io or e-mail to: support@adtribes.io ');
355
  $xml->asXML($file);
@@ -364,25 +511,57 @@ class WooSEA_Get_Products {
364
  foreach ($products as $key => $value){
365
 
366
  if (is_array ( $value ) ) {
367
-
368
  if(!empty( $value )){
369
  $product = $xml->channel->addChild('item');
370
  foreach ($value as $k => $v){
371
  if ($k == "g:shipping"){
372
  $ship = explode("||", $v);
373
  foreach ($ship as $kk => $vv){
374
- $country_ship = explode(":", $vv);
375
-
376
- $shipping = $product->addChild($k, '', $namespace['g']);
377
- $shipping_country = $shipping->addChild('g:country', $country_ship[0], $namespace['g']);
378
- $shipping_region = $shipping->addChild('g:region', $country_ship[2], $namespace['g']);
379
- $shipping_service = $shipping->addChild('g:service', $country_ship[1], $namespace['g']);
380
- $shipping_price = $shipping->addChild('g:price', $country_ship[3], $namespace['g']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  }
382
  // Fix issue with additional images for Google Shopping
383
  } elseif (preg_match("/g:additional_image_link/i",$k)){
384
  $link = $product->addChild('g:additional_image_link', $v, $namespace['g']);
385
  //$product->$k = $v;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  } else {
387
  $product->$k = $v;
388
  }
@@ -404,7 +583,7 @@ class WooSEA_Get_Products {
404
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><yml_catalog></yml_catalog>');
405
  $xml->addAttribute('date', date('Y-m-d H:i'));
406
  $shop = $xml->addChild('shop');
407
- $shop->addChild('name', $feed_config['projectname']);
408
  $shop->addChild('company', get_bloginfo());
409
  $shop->addChild('url', site_url());
410
  $shop->addChild('platform', 'WooCommerce');
@@ -422,7 +601,7 @@ class WooSEA_Get_Products {
422
  $categories = $shop->addChild('categories');
423
 
424
  foreach ($product_categories as $product_category){
425
- $category = $categories->addChild('category', $product_category->name);
426
  $category->addAttribute('id', $product_category->term_id);
427
  if ($product_category->parent > 0){
428
  $category->addAttribute('parentId', $product_category->parent);
@@ -441,8 +620,9 @@ class WooSEA_Get_Products {
441
  } else {
442
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
443
  $xml->addAttribute('version', '1.0');
 
444
  $xml->addChild('datetime', date('Y-m-d H:i:s'));
445
- $xml->addChild('title', $feed_config['projectname']);
446
  $xml->addChild('link', site_url());
447
  $xml->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced WooCommerce Product Feed PRO plugin from AdTribes.io. For all your support questions check out our FAQ on https://www.adtribes.io or e-mail to: support@adtribes.io ');
448
  $xml->asXML($file);
@@ -493,21 +673,32 @@ class WooSEA_Get_Products {
493
  if (is_array ( $cat ) ) {
494
  foreach ($cat as $kk => $vv){
495
  $child = "category";
496
- $category->addChild("$child", "$vv");
497
  }
498
  }
499
  } elseif ($k == "shipping"){
500
- $ships = explode("||",$v);
501
- if (is_array ( $ships ) ) {
502
- foreach ($ships as $kk => $vv){
503
- $ship_zone = $product->addChild('shipping');
504
- $country_ship = explode(":", $vv);
505
-
506
- $shipping_country = $ship_zone->addChild('country', $country_ship[0]);
507
- $shipping_region = $ship_zone->addChild('region', $country_ship[2]);
508
- $shipping_service = $ship_zone->addChild('service', $country_ship[1]);
509
- $shipping_price = $ship_zone->addChild('price', $country_ship[3]);
510
- }
 
 
 
 
 
 
 
 
 
 
 
511
  }
512
  } elseif ($k == "category_link"){
513
  $category = $product->addChild('category_links');
@@ -515,7 +706,7 @@ class WooSEA_Get_Products {
515
  if (is_array ( $cat_links ) ) {
516
  foreach ($cat_links as $kk => $vv){
517
  $child = "category_link";
518
- $category->addChild("$child", "$vv");
519
  }
520
  }
521
  } elseif ($k == "categoryId"){
@@ -535,7 +726,7 @@ class WooSEA_Get_Products {
535
  if ($count > 0){
536
  foreach ($product_categories as $product_category){
537
  if($vv == $product_category->name){
538
- $product->addChild("$k", "$product_category->term_id");
539
  }
540
  }
541
  }
@@ -571,11 +762,10 @@ class WooSEA_Get_Products {
571
  * Returns relative and absolute file path
572
  */
573
  public function woosea_create_csvtxt_feed ( $products, $feed_config, $header ) {
574
-
575
  $upload_dir = wp_upload_dir();
576
  $base = $upload_dir['basedir'];
577
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
578
- $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "." . $feed_config['fileformat'];
579
 
580
  // External location for downloading the file
581
  $external_base = $upload_dir['baseurl'];
@@ -633,7 +823,22 @@ class WooSEA_Get_Products {
633
  } else {
634
  $csv_delimiter = $feed_config['delimiter'];
635
  }
636
- $blaat = fputcsv($fp, $pieces, $csv_delimiter, '"');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
637
  }
638
  }
639
  // Close the file
@@ -668,14 +873,6 @@ class WooSEA_Get_Products {
668
  "Plugin" => WOOCOMMERCESEA_PLUGIN_VERSION
669
  );
670
 
671
- /**
672
- * Function for checking if license is valid
673
- */
674
- if (!wp_next_scheduled( 'woosea_check_license' ) ) {
675
- wp_schedule_event ( time(), 'twicedaily', 'woosea_check_license');
676
- }
677
-
678
-
679
  /**
680
  * Do not change these settings, they are here to prevent running into memory issues
681
  */
@@ -695,6 +892,10 @@ class WooSEA_Get_Products {
695
  $nr_batches = ceil($published_products/750);
696
  }
697
  }
 
 
 
 
698
  $offset_step_size = ceil($published_products/$nr_batches);
699
 
700
  /**
@@ -750,6 +951,15 @@ class WooSEA_Get_Products {
750
  // Get Orders
751
  // $order_timeframe = WooSEA_Get_Products::woosea_get_orders ( $project_config );
752
 
 
 
 
 
 
 
 
 
 
753
  // Construct WP query
754
  $wp_query = array(
755
  'posts_per_page' => $offset_step_size,
@@ -757,7 +967,7 @@ class WooSEA_Get_Products {
757
  'post_type' => $post_type,
758
  'post_status' => 'publish',
759
  'fields' => 'ids',
760
- 'no_found_rows' => true,
761
  );
762
  $prods = new WP_Query($wp_query);
763
 
@@ -789,10 +999,33 @@ class WooSEA_Get_Products {
789
 
790
  $product_data['id'] = get_the_ID();
791
  $product_data['title'] = $product->get_title();
 
 
 
792
  $product_data['sku'] = $product->get_sku();
793
  $product_data['sku_id'] = $product_data['id'];
794
  $product_data['publication_date'] = get_the_date('d-m-y G:i:s');
795
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
796
  if (!empty($product_data['sku'])){
797
  $product_data['sku_id'] = $product_data['sku']."_".$product_data['id'];
798
  }
@@ -813,10 +1046,29 @@ class WooSEA_Get_Products {
813
 
814
  if(($primary_cat_id) AND ($primary_cat_id > 0)){
815
  $product_cat = get_term($primary_cat_id, 'product_cat');
816
-
817
  if(isset($product_cat->name)) {
818
  $catname = $product_cat->name;
819
  $catlink = get_category_link($product_cat->term_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
  }
821
  } else {
822
  foreach ($categories as $key => $value){
@@ -894,28 +1146,35 @@ class WooSEA_Get_Products {
894
  $product_data['short_description'] = html_entity_decode((str_replace("\r", "", $post->post_excerpt)), ENT_QUOTES | ENT_XML1, 'UTF-8');
895
 
896
  // Strip HTML from (short) description
897
- $product_data['description'] = strip_shortcodes(strip_tags($product_data['description']));
898
- $product_data['short_description'] = strip_shortcodes(strip_tags($product_data['short_description']));
 
 
 
 
899
 
900
  // Strip out the non-line-brake character
901
  $product_data['description'] = str_replace("&#xa0;", "", $product_data['description']);
902
  $product_data['short_description'] = str_replace("&#xa0;", "", $product_data['short_description']);
903
 
 
 
 
 
904
  /**
905
  * Check of we need to add Google Analytics UTM parameters
906
  */
907
  if(isset($project_config['utm_on'])){
908
- $utm_part = $this->woosea_append_utm_code ( $project_config, get_the_ID(), $this->parentID);
909
  } else {
910
  $utm_part = "";
911
  }
912
 
913
  $product_data['link'] = get_permalink()."$utm_part";
914
  $product_data['condition'] = ucfirst( get_post_meta( $product_data['id'], '_woosea_condition', true ) );
915
- if(empty($product_data['condition'])){
916
  $product_data['condition'] = "New";
917
  }
918
-
919
  $product_data['availability'] = $this->get_stock( $this->childID );
920
 
921
  /**
@@ -936,56 +1195,84 @@ class WooSEA_Get_Products {
936
  $product_data['sale_price_start_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_from");
937
  $product_data['sale_price_end_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_to");
938
  $product_data['sale_price_effective_date'] = $product_data['sale_price_start_date'] ."/".$product_data['sale_price_end_date'];
 
 
 
 
 
939
  $product_data['image'] = wp_get_attachment_url($product->get_image_id());
940
- $gallery_ids = $product->get_gallery_image_ids();
941
- foreach ($gallery_ids as $gallery_key => $gallery_value){
942
- $gal_id = $gallery_key+1;
943
- $product_data["image_" . $gal_id] = wp_get_attachment_url($gallery_value);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944
  }
945
  $product_data['product_type'] = $product->get_type();
 
 
 
 
946
  $product_data['rating_total'] = $product->get_rating_count();
947
  $product_data['rating_average'] = $product->get_average_rating();
948
  $product_data['shipping'] = 0;
949
- $tax_rates = WC_Tax::get_rates( $product->get_tax_class() );
 
950
  $shipping_class_id = $product->get_shipping_class_id();
951
  $shipping_class= $product->get_shipping_class();
952
  $class_cost_id = "class_cost_".$shipping_class_id;
953
-
954
  // Get prices including taxes
955
- $product_data['price'] = wc_format_localized_price(wc_get_price_including_tax($product,array('price'=> $product->get_price())));
956
- $product_data['regular_price'] = wc_format_localized_price(wc_get_price_including_tax($product, array('price'=> $product->get_regular_price())));
957
  $product_data['sale_price'] = wc_format_localized_price(wc_get_price_including_tax($product, array('price'=> $product->get_sale_price())));
 
 
 
 
 
958
 
959
  // Workaround for price caching issues
960
- if(!isset($tax_rates[1]['rate'])){
 
 
 
 
 
 
 
 
961
  $tax_rates[1]['rate'] = 0;
962
  }
 
 
963
 
964
- $product_data['price_forced'] = round(wc_format_localized_price( wc_get_price_excluding_tax($product,array('price'=> $product->get_price())) * (100+$tax_rates[1]['rate'])/100 ), 2);
965
- $product_data['regular_price_forced'] = round(wc_format_localized_price(wc_get_price_excluding_tax($product, array('price'=> $product->get_regular_price())) + (100+$tax_rates[1]['rate'])/100 ), 2);
966
- $product_data['sale_price_forced'] = round(wc_format_localized_price(wc_get_price_excluding_tax($product, array('price'=> $product->get_sale_price())) + (100+$tax_rates[1]['rate'])/100 ), 2);
967
-
968
- // Get net prices
969
  $product_data['net_price'] = wc_format_localized_price($product->get_price());
970
  $product_data['net_regular_price'] = wc_format_localized_price($product->get_regular_price());
971
  $product_data['net_sale_price'] = wc_format_localized_price($product->get_sale_price());
972
-
973
  $price = wc_format_localized_price(wc_get_price_including_tax($product,array('price'=> $product->get_price())));
974
  if($product_data['sale_price'] > 0){
975
  $price = $product_data['sale_price'];
976
  }
977
 
978
  $product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $price, $tax_rates, $shipping_zones);
979
-
980
- $shipping_str = "";
981
- foreach ($product_data['shipping'] as $key => $value){
982
- $shipping_str .= "||";
983
- foreach($value as $k => $v){
984
- $shipping_str .= "$v>";
985
- }
986
- }
987
- ltrim($shipping_str, "||");
988
-
989
  $product_data['weight'] = ($product->get_weight()) ? $product->get_weight() : false;
990
  $product_data['height'] = ($product->get_height()) ? $product->get_height() : false;
991
  $product_data['length'] = ($product->get_length()) ? $product->get_length() : false;
@@ -1020,7 +1307,7 @@ class WooSEA_Get_Products {
1020
 
1021
  foreach($diff_taxonomies as $taxo){
1022
  $term_value = get_the_terms($product_data['id'], $taxo);
1023
-
1024
  if(is_array($term_value)){
1025
  foreach($term_value as $term){
1026
  $product_data[$taxo] = $term->name;
@@ -1028,6 +1315,22 @@ class WooSEA_Get_Products {
1028
  }
1029
  }
1030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  /**
1032
  * Get Custom Attributes for Single products
1033
  */
@@ -1048,22 +1351,27 @@ class WooSEA_Get_Products {
1048
  if(($custom_kk == "_woosea_condition") && ($custom_value == "")){
1049
  $custom_value = $product_data['condition'];
1050
  }
1051
-
1052
-
1053
- if(!empty( $custom_value )){
1054
-
1055
- // Need to clean up the strange price rightpress is returning
1056
- if($custom_kk == "rp_wcdpd_price_cache"){
1057
-
1058
- $product_data['price'] = $custom_value['price']['p'];
1059
- $product_data['sale_price'] = $custom_value['sale_price']['p'];
 
 
 
 
 
 
 
 
1060
  }
1061
-
1062
- $product_data[$new_key] = $custom_value;
1063
  }
1064
- }
1065
- }
1066
-
1067
  /**
1068
  * Get Product Attributes for Single products
1069
  */
@@ -1076,7 +1384,14 @@ class WooSEA_Get_Products {
1076
  $product_data[$attr_name] = $attr_value;
1077
  }
1078
  }
1079
-
 
 
 
 
 
 
 
1080
  /**
1081
  * Versioned products need a seperate approach
1082
  * Get data for these products based on the mother products item group id
@@ -1086,11 +1401,58 @@ class WooSEA_Get_Products {
1086
  $product_variations = new WC_Product_Variation( $product_data['id'] );
1087
  $variations = $product_variations->get_variation_attributes();
1088
  $append = "";
1089
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1090
  /**
1091
  * Although this is a product variation we also need to grap the Product attributes belonging to the simple mother product
1092
  */
1093
  $mother_attributes = get_post_meta($product_data['item_group_id'], '_product_attributes');
 
1094
  foreach ($mother_attributes as $attribute){
1095
  foreach($attribute as $attr){
1096
 
@@ -1116,27 +1478,48 @@ class WooSEA_Get_Products {
1116
 
1117
  if(is_array($term_value)){
1118
  foreach($term_value as $term){
1119
- $product_data[$taxo] = $term->name;
1120
  }
1121
  }
1122
  }
1123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1124
  // User does need to also add the attributes to the feed otherwise they cannot be appended to the productname
1125
  foreach($variations as $kk => $vv){
1126
  $custom_key = $kk;
1127
 
1128
  if (isset($project_config['product_variations']) AND ($project_config['product_variations'] == "on")){
 
1129
  $taxonomy = str_replace("attribute_","",$kk);
1130
  $term = get_term_by('slug', $vv, $taxonomy);
1131
-
1132
  if($term){
1133
  $append = ucfirst($term->name);
 
 
 
 
 
 
 
 
1134
  }
1135
-
1136
- // Prevent duplicate attribute values from being added to the product name
1137
- //if(!preg_match('/'.$product_data['title'].'/', $append)){
1138
- // $product_data['title'] = $product_data['title']." ".$append;
1139
- //}
1140
  }
1141
 
1142
  $custom_key = str_replace("attribute_","",$custom_key);
@@ -1149,29 +1532,50 @@ class WooSEA_Get_Products {
1149
  */
1150
  $custom_attributes = $this->get_custom_attributes( $product_data['id'] );
1151
 
1152
- foreach($custom_attributes as $custom_kk => $custom_vv){
1153
- $custom_value = get_post_meta( $product_data['id'], $custom_kk, true );
 
1154
 
1155
- // Product variant brand is empty, grap that of the mother product
1156
- if(($custom_kk == "_woosea_brand") && ($custom_value == "")){
1157
- $custom_value = get_post_meta( $product_data['item_group_id'], $custom_kk, true );
1158
- }
1159
 
1160
- // Product variant optimized title is empty, grap the mother product title
1161
- if(($custom_kk == "_woosea_optimized_title") && ($custom_value == "")){
1162
- $custom_value = $product_data['title'];
1163
- }
1164
-
1165
- if(!is_array($custom_value)){
1166
 
1167
- $new_key ="custom_attributes_" . $custom_kk;
1168
- // In order to make the mapping work again, replace var by product
1169
- $new_key = str_replace("var","product",$new_key);
1170
- if(!empty( $custom_value )){
1171
- $product_data[$new_key] = $custom_value;
1172
- }
 
 
 
1173
  }
1174
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1175
 
1176
  /**
1177
  * We also need to make sure that we get the custom attributes belonging to the simple mother product
@@ -1179,14 +1583,15 @@ class WooSEA_Get_Products {
1179
  $custom_attributes_mother = $this->get_custom_attributes( $product_data['item_group_id'] );
1180
 
1181
  foreach($custom_attributes_mother as $custom_kk_m => $custom_value_m){
 
1182
  if(!array_key_exists($custom_kk_m, $product_data)){
1183
  $custom_value_m = get_post_meta( $product_data['item_group_id'], $custom_kk_m, true );
1184
- $new_key_m ="custom_attributes_" . $custom_kk_m;
1185
  // In order to make the mapping work again, replace var by product
1186
  $new_key_m = str_replace("var","product",$new_key_m);
1187
 
1188
  if(!key_exists($new_key_m, $product_data) AND (!empty($custom_value_m))){
1189
- if(!is_array($custom_value_m)){
1190
  // determine what to do with this later
1191
  } else {
1192
  $product_data[$new_key_m] = $custom_value_m;
@@ -1195,24 +1600,58 @@ class WooSEA_Get_Products {
1195
  }
1196
  }
1197
 
1198
- // Get versioned product categories
1199
  $categories = wc_get_product_cat_ids( $product_data['item_group_id'] );
1200
-
1201
  // Check if the Yoast plugin is installed and active
1202
  if ( class_exists('WPSEO_Primary_Term') ){
1203
  $product_id = $product_data['item_group_id'];
1204
-
1205
  $primary_cat_id=get_post_meta($product_id ,'_yoast_wpseo_primary_product_cat',true);
 
1206
  if($primary_cat_id){
1207
  $product_cat = get_term($primary_cat_id, 'product_cat');
1208
- $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1209
- if(!is_object($category_path)){
1210
- $product_data['category_path'] = $category_path;
1211
- }
 
 
 
 
 
 
 
 
1212
 
1213
- if(isset($product_cat->name)) {
1214
- $catname = $product_cat->name;
1215
- $catlink = get_category_link($product_cat->term_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1216
  }
1217
  } else {
1218
  foreach ($categories as $key => $value){
@@ -1244,45 +1683,47 @@ class WooSEA_Get_Products {
1244
  }
1245
  }
1246
  }
 
1247
  } else {
1248
  foreach ($categories as $key => $value){
1249
  if (!$catname){
1250
  $product_cat = get_term($value, 'product_cat');
1251
- $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1252
- if(!is_object($category_path)){
1253
- $product_data['category_path'] = $category_path;
1254
- }
1255
- if(isset($product_cat->name)) {
1256
- $catname = $product_cat->name;
1257
- $catlink = get_term_link($value,'product_cat');
1258
- }
1259
- } else {
1260
- $product_cat = get_term($value, 'product_cat');
1261
- $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1262
- if(!is_object($category_path)){
1263
- $product_data['category_path'] = $category_path;
1264
  }
1265
- if(isset($product_cat->name)) {
1266
- $catname_concat = $product_cat->name;
1267
- $catlink_concat = get_term_link($value,'product_cat');
1268
- }
1269
- $catname .= "||".$catname_concat;
1270
- $catlink .= "||".$catlink_concat;
1271
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1272
  }
1273
  }
 
1274
  $product_data['category_link'] = $catlink;
1275
  $product_data['categories'] = $catname;
1276
  }
1277
-
1278
- /**
1279
- * Check if we need to add category taxonomy mappings (Google Shopping)
1280
- */
1281
- if ((array_key_exists('mappings', $project_config)) AND ($project_config['taxonomy'] == 'google_shopping')){
1282
- $product_data = $this->woocommerce_sea_mappings( $project_config['mappings'], $product_data );
1283
- }
1284
-
1285
-
1286
  /**
1287
  * In order to prevent XML formatting errors in Google's Merchant center
1288
  * we will add CDATA brackets to the title and description attributes
@@ -1291,26 +1732,37 @@ class WooSEA_Get_Products {
1291
  $product_data['description'] = $this->woosea_append_cdata ( $product_data['description'] );
1292
  $product_data['short_description'] = $this->woosea_append_cdata ( $product_data['short_description'] );
1293
 
1294
-
1295
  /**
1296
  * Check if individual products need to be excluded
1297
  */
1298
  $product_data = $this->woosea_exclude_individual( $product_data );
1299
 
 
 
 
 
 
 
 
1300
  /**
1301
  * Filter execution
1302
  */
1303
  if (array_key_exists('rules', $project_config)){
1304
- $product_data = $this->woocommerce_sea_rules( $project_config['rules'], $product_data );
1305
  }
1306
 
1307
  /**
1308
- * Rules execution
1309
  */
1310
- if (array_key_exists('rules2', $project_config)){
1311
- $product_data = $this->woocommerce_sea_rules2( $project_config['rules2'], $product_data );
 
 
 
 
 
 
1312
  }
1313
-
1314
  /**
1315
  * When a product is a variable product we need to delete the original product from the feed, only the originals are allowed
1316
  */
@@ -1368,26 +1820,47 @@ class WooSEA_Get_Products {
1368
  }
1369
 
1370
  if (array_key_exists($attr_value['mapfrom'], $product_data)){
 
1371
  if(is_array($product_data[$attr_value['mapfrom']])){
1372
- $shipping_str = "";
1373
- foreach ($product_data[$attr_value['mapfrom']] as $key => $value){
1374
- $shipping_str .= "||";
1375
- foreach($value as $k => $v){
1376
- if(preg_match('/[0-9]/', $v)){
1377
- $shipping_str .= ":$attr_value[prefix] $v $attr_value[suffix]";
1378
- } else {
1379
- $shipping_str .= ":$v";
1380
- }
1381
- }
1382
- }
1383
- $shipping_str = ltrim($shipping_str, "||");
1384
- $shipping_str = rtrim($shipping_str, ":");
1385
- $shipping_str = ltrim($shipping_str, ":");
1386
- $shipping_str = str_replace("||:", "||", $shipping_str);
1387
-
1388
- $attr_line .= ",'".$shipping_str."'";
1389
- } else {
1390
- $attr_line .= ",'".$attr_value['prefix']. "".$product_data[$attr_value['mapfrom']]."" .$attr_value['suffix']."'";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1391
  }
1392
  } else {
1393
  $attr_line .= ",''";
@@ -1427,7 +1900,7 @@ class WooSEA_Get_Products {
1427
  } else {
1428
  $attr_line .= ",'".$product_data[$attribute_key]."'";
1429
  }
1430
- }
1431
  }
1432
  $attr_line = trim($attr_line, "'");
1433
  $products[] = array ( $attr_line );
@@ -1461,6 +1934,7 @@ class WooSEA_Get_Products {
1461
  $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $attr_value['mapfrom'] ." $attr_value[suffix]";
1462
  }
1463
  } elseif ($attr_value['mapfrom'] == $attribute_key){
 
1464
  if(!isset($xml_product)){
1465
  $xml_product = array (
1466
  $attr_value['attribute'] => "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]"
@@ -1468,15 +1942,37 @@ class WooSEA_Get_Products {
1468
  } else {
1469
  if(key_exists($attr_value['mapfrom'],$product_data)){
1470
  if(is_array($product_data[$attr_value['mapfrom']])){
1471
- $shipping_str = "";
1472
- foreach ($product_data[$attr_value['mapfrom']] as $key => $value){
1473
- $shipping_str .= "||";
1474
- foreach($value as $k => $v){
1475
- if(preg_match('/[0-9]/', $v)){
1476
- $shipping_str .= ":$attr_value[prefix] $v $attr_value[suffix]";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1477
  } else {
1478
- $shipping_str .= ":$v";
1479
- }
1480
  }
1481
  }
1482
  $shipping_str = ltrim($shipping_str, "||");
@@ -1484,13 +1980,16 @@ class WooSEA_Get_Products {
1484
  $shipping_str = ltrim($shipping_str, ":");
1485
  $shipping_str = str_replace("||:", "||", $shipping_str);
1486
 
1487
- $xml_product[$attr_value['attribute']] = "$shipping_str";
 
1488
  } else {
1489
  if(array_key_exists($attr_value['attribute'], $xml_product)){
1490
- $ca++;
1491
- $xml_product[$attr_value['attribute']."_$ca"] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
1492
  } else {
1493
- $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
 
 
1494
  }
1495
  }
1496
  }
@@ -1522,6 +2021,8 @@ class WooSEA_Get_Products {
1522
  array_push ($xml_piece, $xml_product);
1523
  unset($xml_product);
1524
  }
 
 
1525
  unset($product_data);
1526
  }
1527
  endwhile;
@@ -1530,7 +2031,7 @@ class WooSEA_Get_Products {
1530
  /**
1531
  * Update processing status of project
1532
  */
1533
- $project_updated = $this->woosea_project_update($project_config['project_hash'], $offset_step_size, $xml_piece);
1534
 
1535
  /**
1536
  * Write row to CSV/TXT or XML file
@@ -1546,6 +2047,11 @@ class WooSEA_Get_Products {
1546
  unset($products);
1547
  }
1548
 
 
 
 
 
 
1549
  /**
1550
  * Ready creating file, clean up our feed configuration mess now
1551
  */
@@ -1556,7 +2062,7 @@ class WooSEA_Get_Products {
1556
  /**
1557
  * Update processing statistics of batched projects
1558
  */
1559
- public function woosea_project_update($project_hash, $offset_step_size, $xml_piece){
1560
  $feed_config = get_option( 'cron_projects' );
1561
  $nr_projects = count ($feed_config);
1562
 
@@ -1608,16 +2114,27 @@ class WooSEA_Get_Products {
1608
  $nrpr = $feed_config[$key]['nr_products_processed'];
1609
  $nr_prods_processed = $nrpr+$offset_step_size;
1610
 
1611
- if(is_array($xml_piece)){
1612
  // End of processing batched feed
1613
  if($nrpr >= $feed_config[$key]['nr_products']){
 
1614
  // Set counters back to 0
1615
  $feed_config[$key]['nr_products_processed'] = 0;
1616
 
1617
  // Set processing status on ready
1618
  $feed_config[$key]['running'] = "ready";
1619
  $project_data['last_updated'] = date("d M Y H:i");
1620
-
 
 
 
 
 
 
 
 
 
 
1621
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
1622
  delete_option( $batch_project );
1623
 
@@ -1626,7 +2143,7 @@ class WooSEA_Get_Products {
1626
  } else {
1627
  $feed_config[$key]['nr_products_processed'] = $nr_prods_processed;
1628
  $feed_config[$key]['running'] = "processing";
1629
-
1630
  // Set new scheduled event for next batch in 3 seconds
1631
  if($offset_step_size < $published_products){
1632
  if (! wp_next_scheduled ( 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) ) ) {
@@ -1636,10 +2153,20 @@ class WooSEA_Get_Products {
1636
  }
1637
  } else {
1638
  // No batch is needed, already done processing all products
1639
-
1640
  // Set counters back to 0
1641
  $feed_config[$key]['nr_products_processed'] = 0;
1642
-
 
 
 
 
 
 
 
 
 
 
1643
  // Set processing status on ready
1644
  $feed_config[$key]['running'] = "ready";
1645
  $project_data['last_updated'] = date("d M Y H:i");
@@ -1651,18 +2178,6 @@ class WooSEA_Get_Products {
1651
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
1652
  }
1653
  }
1654
- } else {
1655
- // Fall-back: no more products in xml_piece, stop batching process
1656
- // Set counters back to 0
1657
- $feed_config[$key]['nr_products_processed'] = 0;
1658
-
1659
- // Set processing status on ready
1660
- $feed_config[$key]['running'] = "ready";
1661
- $project_data['last_updated'] = date("d M Y H:i");
1662
-
1663
- $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
1664
- delete_option( $batch_project );
1665
- }
1666
  }
1667
  }
1668
  $nr_projects_cron = count ( get_option ( 'cron_projects' ) );
@@ -1797,6 +2312,7 @@ class WooSEA_Get_Products {
1797
  $term = get_term_by('slug', $meta, $taxonomy);
1798
  return $term->name;
1799
  } else {
 
1800
  return get_post_meta($id, $name, true);
1801
  }
1802
  }
@@ -1807,48 +2323,31 @@ class WooSEA_Get_Products {
1807
  $original_cat = $product_data['categories'];
1808
  $original_cat = preg_replace('/&amp;/','&',$original_cat);
1809
 
1810
- // When a product sits in multiple categories we use the last category to map on
1811
- if (strpos($original_cat, '||') !== false) {
1812
- $original_cat_pieces = explode("||", $original_cat);
1813
- $nr_pieces = count($original_cat_pieces);
1814
- $original_cat = $original_cat_pieces[$nr_pieces-1];
1815
- }
1816
-
1817
  $tmp_cat = "";
1818
  $match = "false";
1819
 
1820
  foreach ($project_mappings as $pm_key => $pm_array){
1821
-
1822
  // Strip slashes
1823
  $pm_array['criteria'] = str_replace("\\","",$pm_array['criteria']);
 
 
 
1824
 
1825
  // First check if there is a category mapping for this specific product
1826
- if(($pm_array['criteria'] == $original_cat) AND (!empty($pm_array['map_to_category']))){
1827
- $cat_pieces = explode ("||",$original_cat);
1828
-
1829
- if (count($cat_pieces) > 1){
1830
- foreach ($cat_pieces as $k_piece => $v_piece){
1831
- if($v_piece == $pm_array['criteria']){
1832
- $category_pieces = explode("-", $pm_array['map_to_category']);
1833
- $tmp_cat = $category_pieces[0];
1834
- $match = "true";
1835
- } else {
1836
- $product_data['categories'] = "";
1837
- }
1838
- }
1839
- } else {
1840
- if($original_cat == $pm_array['criteria']){
1841
- $category_pieces = explode("-", $pm_array['map_to_category']);
1842
- $tmp_cat = $category_pieces[0];
1843
- $match = "true";
1844
- }
1845
- }
1846
  }
1847
  }
1848
 
1849
  if($match == "true"){
1850
- $product_data['categories'] = $tmp_cat;
 
 
1851
  } else {
 
1852
  $product_data['categories'] = "";
1853
  }
1854
 
@@ -1858,17 +2357,22 @@ class WooSEA_Get_Products {
1858
  /**
1859
  * Execute project rules
1860
  */
1861
- private function woocommerce_sea_rules2( $project_rules2, $product_data ){
1862
-
1863
  $aantal_prods = count($product_data);
1864
  if($aantal_prods > 0){
1865
 
1866
  foreach ($project_rules2 as $pr_key => $pr_array){
 
1867
  foreach ($product_data as $pd_key => $pd_value){
1868
 
1869
  // Check is there is a rule on specific attributes
1870
  if($pd_key == $pr_array['attribute']){
1871
 
 
 
 
 
 
1872
  // Check if a rule has been set for Google categories
1873
  if ($product_data[$pr_array['than_attribute']] == "google_category"){
1874
  $pr_array['than_attribute'] = "categories";
@@ -1876,8 +2380,15 @@ class WooSEA_Get_Products {
1876
  $pr_array['newvalue'] = $category_id[0];
1877
  }
1878
 
1879
- if ((is_numeric($pd_value)) AND ($pr_array['than_attribute'] != "shipping")){
1880
- // Rules for numeric values
 
 
 
 
 
 
 
1881
  switch ($pr_array['condition']) {
1882
  case($pr_array['condition'] = "contains"):
1883
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
@@ -1924,10 +2435,31 @@ class WooSEA_Get_Products {
1924
  $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
1925
  }
1926
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1927
  default:
1928
  break;
1929
  }
1930
  } elseif (is_array($pd_value)) {
 
1931
  // For now only shipping details are in an array
1932
  foreach ($pd_value as $k => $v){
1933
  foreach ($v as $kk => $vv){
@@ -1999,7 +2531,8 @@ class WooSEA_Get_Products {
1999
  if (!array_key_exists('cs', $pr_array)){
2000
  $pd_value = strtolower($pd_value);
2001
  $pr_array['criteria'] = strtolower($pr_array['criteria']);
2002
- }
 
2003
  switch ($pr_array['condition']) {
2004
  case($pr_array['condition'] = "contains"):
2005
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
@@ -2112,12 +2645,24 @@ class WooSEA_Get_Products {
2112
  break;
2113
 
2114
  case($pr_array['condition'] = "empty"):
2115
- $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
 
 
 
 
 
2116
  break;
 
2117
  default:
2118
  break;
2119
  }
2120
  }
 
 
 
 
 
 
2121
  }
2122
  }
2123
  }
@@ -2149,7 +2694,7 @@ class WooSEA_Get_Products {
2149
  /**
2150
  * Execute project filters (include / exclude)
2151
  */
2152
- private function woocommerce_sea_rules( $project_rules, $product_data ){
2153
  $allowed = 1;
2154
 
2155
  // Check if product was already excluded from the feed
@@ -2239,67 +2784,121 @@ class WooSEA_Get_Products {
2239
  break;
2240
  }
2241
  } elseif (is_array($pd_value)){
2242
-
2243
- // For now only shipping details are in an array
2244
- foreach ($pd_value as $k => $v){
2245
- foreach ($v as $kk => $vv){
2246
- // Only shipping detail rule can be on price for now
2247
- if($kk == "price"){
2248
- switch ($pr_array['condition']) {
2249
- case($pr_array['condition'] = "contains"):
2250
- if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
2251
- $allowed = 0;
2252
- }
2253
- break;
2254
- case($pr_array['condition'] = "containsnot"):
2255
- if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
2256
- $allowed = 0;
2257
- }
2258
- break;
2259
- case($pr_array['condition'] = "="):
2260
- if (($vv == $pr_array['criteria'])){
2261
- $allowed = 0;
2262
- }
2263
- break;
2264
- case($pr_array['condition'] = "!="):
2265
- if (($vv != $pr_array['criteria'])){
2266
- $allowed = 0;
2267
- }
2268
- break;
2269
- case($pr_array['condition'] = ">"):
2270
- if (($vv > $pr_array['criteria'])){
2271
- $allowed = 0;
2272
- }
2273
- break;
2274
- case($pr_array['condition'] = ">="):
2275
- if (($vv >= $pr_array['criteria'])){
2276
- $allowed = 0;
2277
- }
2278
- break;
2279
- case($pr_array['condition'] = "<"):
2280
- if (($vv < $pr_array['criteria'])){
2281
- $allowed = 0;
2282
- }
2283
- break;
2284
- case($pr_array['condition'] = "=<"):
2285
- if (($vv <= $pr_array['criteria'])){
2286
- $allowed = 0;
2287
- }
2288
- break;
2289
- case($pr_array['condition'] = "empty"):
2290
- if (strlen($vv) < 1){
2291
- $allowed = 0;
2292
- }
2293
- break;
2294
- default:
2295
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2296
  }
2297
  }
2298
  }
2299
  }
2300
  } else {
2301
- // Rules for string values
2302
-
2303
  // If case-sensitve is off than lowercase both the criteria and attribute value
2304
  if (array_key_exists('cs', $pr_array)){
2305
  if ($pr_array['cs'] != "on"){
@@ -2374,6 +2973,7 @@ class WooSEA_Get_Products {
2374
  }
2375
  break;
2376
  case($pr_array['condition'] = "empty"):
 
2377
  if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
2378
  $allowed = 0;
2379
  } elseif ((strlen($pd_value > 0)) && ($pr_array['than'] == "include_only")){
@@ -2390,6 +2990,21 @@ class WooSEA_Get_Products {
2390
  // A empty rule has been set on an attribute that is not in a product anyhow. Still, remove this product from the feed
2391
  if($pr_array['condition'] == "empty"){
2392
  $allowed = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2393
  }
2394
  }
2395
  }
24
  * @param int $product_id
25
  * @return array
26
  */
27
+ // public function wc_get_product_cat_ids( $product_id ) {
28
+ //
29
+ // $product_cats = wp_get_post_terms( $product_id, 'product_cat', array( "fields" => "ids" ) );
30
+ //
31
+ // error_log(print_r($product_cats, TRUE));
32
+ //
33
+ // foreach ( $product_cats as $product_cat ) {
34
+ // $product_cats = array_merge( $product_cats, get_ancestors( $product_cat, 'product_cat' ) );
35
+ // }
36
+ // return $product_cats;
37
+ // }
38
 
39
  /**
40
  * Function to add CDATA brackets to title, short_description and description attributes
44
  // return "<![CDATA[ $string ]]>";
45
  }
46
 
47
+ /**
48
+ * Strip unwanted UTF chars from string
49
+ */
50
+ public function woosea_utf8_for_xml( $string ){
51
+ $string = html_entity_decode($string);
52
+ return preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $string);
53
+ }
54
+
55
  /**
56
  * Function that will create an append with Google Analytics UTM parameters
57
  * Removes UTM paramaters that are left blank
58
  */
59
+ public function woosea_append_utm_code ( $feed_config, $productId, $parentId, $link ) {
 
60
  // AdTribes conversionId
61
  if(array_key_exists('adtribes_conversion', $feed_config)){
62
  $adtribesConvId = "$feed_config[project_hash]|adtribes|$productId";
90
  $utm_part .= "&$key=$value";
91
  }
92
 
93
+ /**
94
+ * Get the default WPML language
95
+ * As that does not have ?lang= behind the links
96
+ */
97
+ if(isset($feed_config['WPML'])){
98
+ if ( function_exists('icl_object_id') ) {
99
+ global $sitepress;
100
+ $default_lang = $sitepress->get_default_language();
101
+
102
+ if (preg_match("/\?/i", $link)){
103
+ $utm_part = "&".ltrim($utm_part, '&');
104
+ } else {
105
+ $utm_part = "?".ltrim($utm_part, '&');
106
+ }
107
+ }
108
  } else {
109
+ # Strip first & from utm
110
+ if($parentId > 0){
111
+ # Even though variation products always have parameters in the URL we still need to check and make sure they are there
112
+ if(strpos($link, '?') !== false){
113
+ $utm_part = "&".ltrim($utm_part, '&');
114
+ } else {
115
+ $utm_part = "?".ltrim($utm_part, '&');
116
+ }
117
+ } else {
118
+ $utm_part = "?".ltrim($utm_part, '&');
119
+ }
120
  }
121
  return $utm_part;
122
  }
135
  global $wpdb;
136
  $list = array();
137
 
138
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id=".$productId." AND meta.post_id = posts.id GROUP BY meta.meta_key ORDER BY meta.meta_key ASC";
139
+ $data = $wpdb->get_results($sql);
140
 
141
  if (count($data)) {
142
  foreach ($data as $key => $value) {
143
  $value_display = str_replace("_", " ",$value->name);
144
+ if (!preg_match("/_product_attributes/i",$value->name)){
145
+ $list[$value->name] = ucfirst($value_display);
146
+ } else {
147
+ $product_attr = unserialize($value->type);
148
+
149
+ foreach ($product_attr as $key => $arr_value) {
150
+ $value_display = str_replace("_", " ",$arr_value['name']);
151
+ $list[$key] = ucfirst($value_display);
152
+ }
153
+ }
154
  }
155
+ return $list;
156
  }
157
  return false;
158
  }
173
  $order_data = $order->get_data();
174
  $order_date_created = $order_data['date_created']->date('Y-m-d H:i:s');
175
 
 
 
 
176
  foreach ($order->get_items() as $item_key => $item_values){
177
  $product_id = $item_values->get_product_id();
 
178
  }
179
  }
180
  //return $orders_timeframe;
200
 
201
  if ( is_wp_error( $parent ) )
202
  return $parent;
203
+
204
+ if($parent){
205
+ if ($nicename){
206
+ $name = $parent->slug;
207
+ } else {
208
+ $name = $parent->name;
209
+ }
210
 
211
+ if ($parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited )){
212
+ $visited[] = $parent->parent;
213
+ $chain .= $this->woosea_get_term_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
214
+ }
215
 
216
+ if ($link){
217
+ $chain .= $separator.$name;
218
+ } else {
219
+ $chain .= $separator.$name;
220
+ }
221
+ }
222
  return $chain;
223
  } // End woo_get_term_parents()
224
 
233
  return false;
234
  }
235
 
236
+ /**
237
+ * Get installment for product
238
+ */
239
+ public function woosea_get_installment ($project_config, $productId){
240
+ $installment = "";
241
+ $currency = get_woocommerce_currency();
242
+
243
+ $installment_months = get_post_meta($productId, '_woosea_installment_months', true);
244
+ $installment_amount = get_post_meta($productId, '_woosea_installment_amount', true);
245
+
246
+ if(!empty($installment_amount)){
247
+ $installment = $installment_months.":".$installment_amount." ".$currency;
248
+ }
249
+ return $installment;
250
+ }
251
+
252
  /**
253
  * Get shipping cost for product
254
  */
257
  $shipping_arr = array();
258
  $zone_count = 0;
259
  $nr_shipping_zones = count($shipping_zones);
260
+ $zone_details = array();
261
  $base_location = wc_get_base_location();
262
  $base_country = $base_location['country'];
263
 
264
+ // Normal shipping set-up
265
+ $zone_count = count($shipping_arr)+1;
266
+
267
+ foreach ( $shipping_zones as $zone){
268
 
269
+ // Start with a clean shipping zone
270
  $zone_details = array();
271
+ $zone_details['country'] = "";
272
+
273
+ // Start with a clean postal code
274
+ $postal_code = array();
275
+
276
+ foreach ( $zone['zone_locations'] as $zone_type ) {
277
+
278
+ if ($zone_type->type == "country"){
279
+ // This is a country shipping zone
280
+ $zone_details['country'] = $zone_type->code;
281
+ } elseif ($zone_type->type == "state"){
282
+ // This is a state shipping zone, split of country
283
+ $zone_expl = explode(":", $zone_type->code);
284
+ $zone_details['country'] = $zone_expl[0];
285
+ $zone_details['region'] = $zone_expl[1];
286
+ } elseif ($zone_type->type == "postcode"){
287
+ // Create an array of postal codes so we can loop over it later
288
+ if ($project_config['taxonomy'] == 'google_shopping'){
289
+ $zone_type->code = str_replace("...", "-", $zone_type->code);
290
+ }
291
+ array_push($postal_code, $zone_type->code);
292
+ } else {
293
+ // Unknown shipping zone type
294
  }
 
 
 
 
 
295
  }
296
 
297
+ // Get the g:services and g:prices, because there could be multiple services the $shipping_arr could multiply again
298
+ // g:service = "Method title - Shipping class costs"
299
+ // for example, g:service = "Estimated Shipping - Heavy shipping". g:price would be 180
300
+ $shipping_methods = $zone['shipping_methods'];
301
+
302
+ foreach ($shipping_methods as $k => $v){
303
+
304
+ if($v->enabled == "yes"){
305
+ if(empty($zone_details['country'])){
306
+ $zone_details['service'] = $zone['zone_name'] ." ". $v->title;
307
+ } else {
308
+ $zone_details['service'] = $zone['zone_name'] ." ". $v->title ." ".$zone_details['country'];
309
+ }
310
+ $taxable = $v->tax_status;
311
 
312
+ if(isset($v->instance_settings['cost'])){
313
+ $shipping_cost = $v->instance_settings['cost'];
314
+ if(!$shipping_cost){
315
+ $shipping_cost = 0;
316
+ }
317
 
318
+ if($taxable == "taxable"){
319
+ foreach ($tax_rates as $k => $w){
320
+ if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
321
+ $rate = (($w['rate']+100)/100);
322
+ $shipping_cost = str_replace(",", ".", $shipping_cost);
323
+ $shipping_cost = $shipping_cost*$rate;
324
+ $shipping_cost = round($shipping_cost, 2);
325
+ }
326
+ }
327
+ }
328
  }
329
 
330
  // CLASS SHIPPING COSTS
331
+ if(isset($v->instance_settings[$class_cost_id])){
332
+ if (is_numeric($v->instance_settings[$class_cost_id])){
333
+ //$shipping_cost = ($v->instance_settings[$class_cost_id]+$shipping_cost);
334
+ $shipping_cost = $v->instance_settings[$class_cost_id];
335
+
336
+ if($taxable == "taxable"){
337
+ foreach ($tax_rates as $k => $w){
338
+
339
+ if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
340
+ $rate = (($w['rate']+100)/100);
341
+ $shipping_cost = $shipping_cost*$rate;
342
+ $shipping_cost = round($shipping_cost, 2);
343
+ }
344
+ }
345
+ }
346
+ } else {
347
+ $shipping_cost = $v->instance_settings[$class_cost_id];
348
+ $shipping_cost = str_replace("[qty]", "1", $shipping_cost);
349
+ $mathString = trim($shipping_cost); // trim white spaces
350
+ if (preg_match("/fee percent/", $mathString)){
351
+ $shipcost_piece = explode("+", $mathString);
352
+ $mathString = trim($shipcost_piece[0]);
353
+ }
354
+
355
+ $mathString = str_replace ('..', '.', $mathString); // remove input mistakes from users using shipping formula's
356
+ $mathString = preg_replace ('[^0-9\+-\*\/\(\)]', '', $mathString); // remove any non-numbers chars; exception for math operators
357
+ $mathString = str_replace(array('\'', '"', ','), '', $mathString);
358
+
359
+ if(!empty($mathString)){
360
+ eval("\$mathString = $mathString;");
361
+ $shipping_cost = $mathString;
362
+
363
+ if($taxable == "taxable"){
364
+ foreach ($tax_rates as $k => $w){
365
+
366
+ if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
367
+ $rate = (($w['rate']+100)/100);
368
+ if(is_numeric($shipping_cost)){
369
+ $shipping_cost = $shipping_cost*$rate;
370
+ $shipping_cost = round($shipping_cost, 2);
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ }
378
+
379
+ // FREE SHIPPING COSTS IF MINIMUM FEE REACHED
380
+ if($v->id == "free_shipping"){
381
+ $minimum_fee = $v->min_amount;
382
+ if ($price >= $minimum_fee){
383
+ //unset($shipping_arr);
384
+ //$shipping_arr = array();
385
+ $currency = get_woocommerce_currency();
386
+ $shipping_cost = 0;
387
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
388
+ } else {
389
+ // No need to add the free shipping zone as it is not eligable
390
+ break;
391
+ }
392
  }
 
 
393
 
394
+ if($shipping_cost >= 0){
395
+ $currency = get_woocommerce_currency();
396
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
397
+ }
398
+
399
+ // This shipping zone has postal codes so multiply the zone details
400
+ $nr_postals = count($postal_code);
401
+ if ($nr_postals > 0){
402
+ if(!empty($shipping_cost)){
403
+ for ($x = 0; $x <= count($postal_code); ) {
404
+ $zone_count++;
405
+ if(!empty($postal_code[$x])){
406
+ $zone_details['postal_code'] = $postal_code[$x];
407
+ $shipping_arr[$zone_count] = $zone_details;
408
+ }
409
+ $x++;
410
+ }
411
+ }
412
+ } else {
413
+ $zone_count++;
414
+ $shipping_arr[$zone_count] = $zone_details;
415
+ }
416
+ }
417
  }
 
 
 
 
418
  }
419
+ //error_log(print_r($shipping_arr, TRUE));
420
  return $shipping_arr;
 
421
  }
422
 
423
  /**
460
 
461
  $base = $upload_dir['basedir'];
462
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
463
+ $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "_tmp." . $feed_config['fileformat'];
464
 
465
  // External location for downloading the file
466
  $external_base = $upload_dir['baseurl'];
496
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><rss xmlns:g="http://base.google.com/ns/1.0"></rss>');
497
  $xml->addAttribute('version', '2.0');
498
  $xml->addChild('channel');
499
+ $xml->channel->addChild('title', htmlspecialchars($feed_config['projectname']));
500
  $xml->channel->addChild('link', site_url());
501
  $xml->channel->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced WooCommerce Product Feed PRO plugin from AdTribes.io. For all your support questions check out our FAQ on https://www.adtribes.io or e-mail to: support@adtribes.io ');
502
  $xml->asXML($file);
511
  foreach ($products as $key => $value){
512
 
513
  if (is_array ( $value ) ) {
 
514
  if(!empty( $value )){
515
  $product = $xml->channel->addChild('item');
516
  foreach ($value as $k => $v){
517
  if ($k == "g:shipping"){
518
  $ship = explode("||", $v);
519
  foreach ($ship as $kk => $vv){
520
+ $sub_count = substr_count($vv, '##');
521
+ $shipping = $product->addChild($k, '',htmlspecialchars($namespace['g']));
522
+ $ship_split = explode(":", $vv);
523
+
524
+ foreach($ship_split as $ship_piece){
525
+
526
+ $piece_value = explode("##", $ship_piece);
527
+ if (preg_match("/WOOSEA_COUNTRY/", $ship_piece)){
528
+ $shipping_country = $shipping->addChild('g:country', $piece_value[1], $namespace['g']);
529
+ } elseif (preg_match("/WOOSEA_REGION/", $ship_piece)){
530
+ $shipping_region = $shipping->addChild('g:region', $piece_value[1], $namespace['g']);
531
+ } elseif (preg_match("/WOOSEA_POSTAL_CODE/", $ship_piece)){
532
+ $shipping_price = $shipping->addChild('g:postal_code', $piece_value[1], $namespace['g']);
533
+ } elseif (preg_match("/WOOSEA_SERVICE/", $ship_piece)){
534
+ $shipping_service = $shipping->addChild('g:service', $piece_value[1], $namespace['g']);
535
+ } elseif (preg_match("/WOOSEA_PRICE/", $ship_piece)){
536
+ $shipping_price = $shipping->addChild('g:price',trim($piece_value[1]),$namespace['g']);
537
+ } else {
538
+ // DO NOT ADD ANYTHING
539
+ }
540
+ }
541
  }
542
  // Fix issue with additional images for Google Shopping
543
  } elseif (preg_match("/g:additional_image_link/i",$k)){
544
  $link = $product->addChild('g:additional_image_link', $v, $namespace['g']);
545
  //$product->$k = $v;
546
+ } elseif ($k == "g:installment"){
547
+ if(!empty($v)){
548
+ $installment_split = explode(":", $v);
549
+ $installment = $product->addChild($k, '', $namespace['g']);
550
+ $installment_months = $installment->addChild('g:months', $installment_split[0], $namespace['g']);
551
+ $installment_amount = $installment->addChild('g:amount', $installment_split[1], $namespace['g']);
552
+ }
553
+ } elseif ($k == "g:color" || $k == "g:size" || $k == "g:material"){
554
+ if(!empty($v)){
555
+ $attr_split = explode(",", $v);
556
+ $nr_attr = count($attr_split)-1;
557
+ $attr_value = "";
558
+
559
+ for ($x = 0; $x <= $nr_attr; $x++){
560
+ $attr_value .= trim($attr_split[$x])."/";
561
+ }
562
+ $attr_value = rtrim($attr_value,"/");
563
+ $product->$k = $attr_value;
564
+ }
565
  } else {
566
  $product->$k = $v;
567
  }
583
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><yml_catalog></yml_catalog>');
584
  $xml->addAttribute('date', date('Y-m-d H:i'));
585
  $shop = $xml->addChild('shop');
586
+ $shop->addChild('name', htmlspecialchars($feed_config['projectname']));
587
  $shop->addChild('company', get_bloginfo());
588
  $shop->addChild('url', site_url());
589
  $shop->addChild('platform', 'WooCommerce');
601
  $categories = $shop->addChild('categories');
602
 
603
  foreach ($product_categories as $product_category){
604
+ $category = $categories->addChild('category', htmlspecialchars($product_category->name));
605
  $category->addAttribute('id', $product_category->term_id);
606
  if ($product_category->parent > 0){
607
  $category->addAttribute('parentId', $product_category->parent);
620
  } else {
621
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
622
  $xml->addAttribute('version', '1.0');
623
+ $xml->addAttribute('standalone', 'yes');
624
  $xml->addChild('datetime', date('Y-m-d H:i:s'));
625
+ $xml->addChild('title', htmlspecialchars($feed_config['projectname']));
626
  $xml->addChild('link', site_url());
627
  $xml->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced WooCommerce Product Feed PRO plugin from AdTribes.io. For all your support questions check out our FAQ on https://www.adtribes.io or e-mail to: support@adtribes.io ');
628
  $xml->asXML($file);
673
  if (is_array ( $cat ) ) {
674
  foreach ($cat as $kk => $vv){
675
  $child = "category";
676
+ $category->addChild("$child", htmlspecialchars($vv));
677
  }
678
  }
679
  } elseif ($k == "shipping"){
680
+
681
+ $ship = explode("||", $v);
682
+ foreach ($ship as $kk => $vv){
683
+ $ship_zone = $product->addChild('shipping');
684
+ $ship_split = explode(":", $vv);
685
+
686
+ foreach($ship_split as $ship_piece){
687
+ $piece_value = explode("##", $ship_piece);
688
+ if (preg_match("/WOOSEA_COUNTRY/", $ship_piece)){
689
+ $shipping_country = $ship_zone->addChild('country', htmlspecialchars($piece_value[1]));
690
+ } elseif (preg_match("/WOOSEA_REGION/", $ship_piece)){
691
+ $shipping_region = $ship_zone->addChild('region', htmlspecialchars($piece_value[1]));
692
+ } elseif (preg_match("/WOOSEA_POSTAL_CODE/", $ship_piece)){
693
+ $postal_code = $ship_zone->addChild('postal_code', htmlspecialchars($piece_value[1]));
694
+ } elseif (preg_match("/WOOSEA_SERVICE/", $ship_piece)){
695
+ $shipping_service = $ship_zone->addChild('service', htmlspecialchars($piece_value[1]));
696
+ } elseif (preg_match("/WOOSEA_PRICE/", $ship_piece)){
697
+ $shipping_price = $ship_zone->addChild('price', htmlspecialchars($piece_value[1]));
698
+ } else {
699
+ // DO NOT ADD ANYTHING
700
+ }
701
+ }
702
  }
703
  } elseif ($k == "category_link"){
704
  $category = $product->addChild('category_links');
706
  if (is_array ( $cat_links ) ) {
707
  foreach ($cat_links as $kk => $vv){
708
  $child = "category_link";
709
+ $category->addChild("$child", htmlspecialchars($vv));
710
  }
711
  }
712
  } elseif ($k == "categoryId"){
726
  if ($count > 0){
727
  foreach ($product_categories as $product_category){
728
  if($vv == $product_category->name){
729
+ $product->addChild("$k", htmlspecialchars($product_category->term_id));
730
  }
731
  }
732
  }
762
  * Returns relative and absolute file path
763
  */
764
  public function woosea_create_csvtxt_feed ( $products, $feed_config, $header ) {
 
765
  $upload_dir = wp_upload_dir();
766
  $base = $upload_dir['basedir'];
767
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
768
+ $file = $path . "/" . sanitize_file_name($feed_config['filename']) . "_tmp." . $feed_config['fileformat'];
769
 
770
  // External location for downloading the file
771
  $external_base = $upload_dir['baseurl'];
823
  } else {
824
  $csv_delimiter = $feed_config['delimiter'];
825
  }
826
+
827
+ if ($feed_config['fields'] == "google_local"){
828
+ $tab_line = "";
829
+
830
+ foreach ($pieces as $t_key => $t_value){
831
+ $tab_line .= $t_value . "$csv_delimiter";
832
+ }
833
+ $tab_line = rtrim($tab_line, $csv_delimiter);
834
+ $tab_line .= PHP_EOL;
835
+ fwrite($fp, $tab_line);
836
+ } else {
837
+ fputs( $fp, $bom = chr(0xEF) . chr(0xBB) . chr(0xBF) );
838
+ //$pieces = array_map("utf8_decode", $pieces);
839
+ $tofile = fputcsv($fp, $pieces, $csv_delimiter, '"');
840
+ }
841
+
842
  }
843
  }
844
  // Close the file
873
  "Plugin" => WOOCOMMERCESEA_PLUGIN_VERSION
874
  );
875
 
 
 
 
 
 
 
 
 
876
  /**
877
  * Do not change these settings, they are here to prevent running into memory issues
878
  */
892
  $nr_batches = ceil($published_products/750);
893
  }
894
  }
895
+
896
+ // TEST BATCHES
897
+ // $nr_batches = 5;
898
+
899
  $offset_step_size = ceil($published_products/$nr_batches);
900
 
901
  /**
951
  // Get Orders
952
  // $order_timeframe = WooSEA_Get_Products::woosea_get_orders ( $project_config );
953
 
954
+ // Switch to configured WPML lamguage
955
+ if(isset($project_config['WPML'])){
956
+ if ( function_exists('icl_object_id') ) {
957
+ global $sitepress;
958
+ $lang = $project_config['WPML'];
959
+ $sitepress->switch_lang($lang);
960
+ }
961
+ }
962
+
963
  // Construct WP query
964
  $wp_query = array(
965
  'posts_per_page' => $offset_step_size,
967
  'post_type' => $post_type,
968
  'post_status' => 'publish',
969
  'fields' => 'ids',
970
+ 'no_found_rows' => true
971
  );
972
  $prods = new WP_Query($wp_query);
973
 
999
 
1000
  $product_data['id'] = get_the_ID();
1001
  $product_data['title'] = $product->get_title();
1002
+ $product_data['title'] = $this->woosea_utf8_for_xml( $product_data['title'] );
1003
+ $product_data['mother_title'] = $product->get_title();
1004
+ $product_data['mother_title'] = $this->woosea_utf8_for_xml( $product_data['mother_title'] );
1005
  $product_data['sku'] = $product->get_sku();
1006
  $product_data['sku_id'] = $product_data['id'];
1007
  $product_data['publication_date'] = get_the_date('d-m-y G:i:s');
1008
 
1009
+ // Start product visibility logic
1010
+ $product_data['exclude_from_catalog'] = "no";
1011
+ $product_data['exclude_from_search'] = "no";
1012
+ $product_data['exclude_from_all'] = "no";
1013
+
1014
+ $visibility_list = wp_get_post_terms(get_the_ID(), 'product_visibility', array("fields" => "all"));
1015
+ foreach($visibility_list as $visibility_single){
1016
+ if($visibility_single->slug == "exclude-from-catalog"){
1017
+ $product_data['exclude_from_catalog'] = "yes";
1018
+ }
1019
+ if($visibility_single->slug == "exclude-from-search"){
1020
+ $product_data['exclude_from_search'] = "yes";
1021
+ }
1022
+ }
1023
+
1024
+ if(($product_data['exclude_from_search'] == "yes") AND ($product_data['exclude_from_catalog'] == "yes")){
1025
+ $product_data['exclude_from_all'] = "yes";
1026
+ }
1027
+ // End product visibility logic
1028
+
1029
  if (!empty($product_data['sku'])){
1030
  $product_data['sku_id'] = $product_data['sku']."_".$product_data['id'];
1031
  }
1046
 
1047
  if(($primary_cat_id) AND ($primary_cat_id > 0)){
1048
  $product_cat = get_term($primary_cat_id, 'product_cat');
1049
+
1050
  if(isset($product_cat->name)) {
1051
  $catname = $product_cat->name;
1052
  $catlink = get_category_link($product_cat->term_id);
1053
+ } else {
1054
+ foreach ($categories as $key => $value){
1055
+ if (!$catname){
1056
+ $product_cat = get_term($value, 'product_cat');
1057
+
1058
+ if(isset($product_cat->name)) {
1059
+ $catname = $product_cat->name;
1060
+ $catlink = get_term_link($value,'product_cat');
1061
+ }
1062
+ } else {
1063
+ $product_cat = get_term($value, 'product_cat');
1064
+ if(isset($product_cat->name)) {
1065
+ $catname_concat = $product_cat->name;
1066
+ $catlink_concat = get_term_link($value,'product_cat');
1067
+ }
1068
+ $catname .= "||".$catname_concat;
1069
+ $catlink .= "||".$catlink_concat;
1070
+ }
1071
+ }
1072
  }
1073
  } else {
1074
  foreach ($categories as $key => $value){
1146
  $product_data['short_description'] = html_entity_decode((str_replace("\r", "", $post->post_excerpt)), ENT_QUOTES | ENT_XML1, 'UTF-8');
1147
 
1148
  // Strip HTML from (short) description
1149
+ $product_data['description'] = strip_tags($product_data['description']);
1150
+ $product_data['short_description'] = strip_tags($product_data['short_description']);
1151
+
1152
+ // Strip out Visual Composer short codes
1153
+ $product_data['description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['description'] );
1154
+ $product_data['short_description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['short_description'] );
1155
 
1156
  // Strip out the non-line-brake character
1157
  $product_data['description'] = str_replace("&#xa0;", "", $product_data['description']);
1158
  $product_data['short_description'] = str_replace("&#xa0;", "", $product_data['short_description']);
1159
 
1160
+ // Strip strange UTF chars
1161
+ $product_data['description'] = $this->woosea_utf8_for_xml( $product_data['description'] );
1162
+ $product_data['short_description'] = $this->woosea_utf8_for_xml( $product_data['short_description'] );
1163
+
1164
  /**
1165
  * Check of we need to add Google Analytics UTM parameters
1166
  */
1167
  if(isset($project_config['utm_on'])){
1168
+ $utm_part = $this->woosea_append_utm_code ( $project_config, get_the_ID(), $this->parentID, get_permalink());
1169
  } else {
1170
  $utm_part = "";
1171
  }
1172
 
1173
  $product_data['link'] = get_permalink()."$utm_part";
1174
  $product_data['condition'] = ucfirst( get_post_meta( $product_data['id'], '_woosea_condition', true ) );
1175
+ if(empty($product_data['condition']) || $product_data['condition'] == "Array"){
1176
  $product_data['condition'] = "New";
1177
  }
 
1178
  $product_data['availability'] = $this->get_stock( $this->childID );
1179
 
1180
  /**
1195
  $product_data['sale_price_start_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_from");
1196
  $product_data['sale_price_end_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_to");
1197
  $product_data['sale_price_effective_date'] = $product_data['sale_price_start_date'] ."/".$product_data['sale_price_end_date'];
1198
+ if($product_data['sale_price_effective_date'] == "/"){
1199
+ $product_data['sale_price_effective_date'] = "";
1200
+ }
1201
+
1202
+
1203
  $product_data['image'] = wp_get_attachment_url($product->get_image_id());
1204
+
1205
+ // For variable products I need to get the product gallery images of the simple mother product
1206
+ if($product_data['item_group_id'] > 0){
1207
+ $parent_product = wc_get_product( $product_data['item_group_id'] );
1208
+ if(is_object($parent_product)){
1209
+ $gallery_ids = $parent_product->get_gallery_image_ids();
1210
+ $gal_id=1;
1211
+ foreach ($gallery_ids as $gallery_key => $gallery_value){
1212
+ $product_data["image_" . $gal_id] = wp_get_attachment_url($gallery_value);
1213
+ $gal_id++;
1214
+ }
1215
+ }
1216
+ } else {
1217
+ $gallery_ids = $product->get_gallery_image_ids();
1218
+ $gal_id=1;
1219
+ foreach ($gallery_ids as $gallery_key => $gallery_value){
1220
+ $product_data["image_" . $gal_id] = wp_get_attachment_url($gallery_value);
1221
+ $gal_id++;
1222
+ }
1223
  }
1224
  $product_data['product_type'] = $product->get_type();
1225
+ $product_data['content_type'] = "product";
1226
+ if($product_data['product_type'] == "variation"){
1227
+ $product_data['content_type'] = "product_group";
1228
+ }
1229
  $product_data['rating_total'] = $product->get_rating_count();
1230
  $product_data['rating_average'] = $product->get_average_rating();
1231
  $product_data['shipping'] = 0;
1232
+
1233
+ $tax_rates = WC_Tax::get_base_tax_rates( $product->get_tax_class() );
1234
  $shipping_class_id = $product->get_shipping_class_id();
1235
  $shipping_class= $product->get_shipping_class();
1236
  $class_cost_id = "class_cost_".$shipping_class_id;
1237
+
1238
  // Get prices including taxes
1239
+ $product_data['price'] = wc_format_localized_price(wc_get_price_to_display($product));
 
1240
  $product_data['sale_price'] = wc_format_localized_price(wc_get_price_including_tax($product, array('price'=> $product->get_sale_price())));
1241
+ $product_data['regular_price'] = wc_format_localized_price(wc_get_price_including_tax($product, array('price'=> $product->get_regular_price())));
1242
+
1243
+ if($product_data['regular_price'] == $product_data['sale_price']){
1244
+ $product_data['sale_price'] = "";
1245
+ }
1246
 
1247
  // Workaround for price caching issues
1248
+ if(!empty($tax_rates)){
1249
+ foreach ($tax_rates as $tk => $tv){
1250
+ if($tv['rate'] > 0){
1251
+ $tax_rates[1]['rate'] = $tv['rate'];
1252
+ } else {
1253
+ $tax_rates[1]['rate'] = 0;
1254
+ }
1255
+ }
1256
+ } else {
1257
  $tax_rates[1]['rate'] = 0;
1258
  }
1259
+ $product_data['price_forced'] = wc_format_localized_price(wc_get_price_excluding_tax($product,array('price'=> $product->get_price())) * (100+$tax_rates[1]['rate'])/100);
1260
+ $product_data['regular_price_forced'] = wc_format_localized_price(wc_get_price_excluding_tax($product, array('price'=> $product->get_regular_price())) * (100+$tax_rates[1]['rate'])/100);
1261
 
1262
+ if(!empty($product->get_sale_price())){
1263
+ $product_data['sale_price_forced'] = wc_format_localized_price(wc_get_price_excluding_tax($product, array('price'=> $product->get_sale_price())) * (100+$tax_rates[1]['rate'])/100);
1264
+ }
 
 
1265
  $product_data['net_price'] = wc_format_localized_price($product->get_price());
1266
  $product_data['net_regular_price'] = wc_format_localized_price($product->get_regular_price());
1267
  $product_data['net_sale_price'] = wc_format_localized_price($product->get_sale_price());
 
1268
  $price = wc_format_localized_price(wc_get_price_including_tax($product,array('price'=> $product->get_price())));
1269
  if($product_data['sale_price'] > 0){
1270
  $price = $product_data['sale_price'];
1271
  }
1272
 
1273
  $product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $price, $tax_rates, $shipping_zones);
1274
+ $shipping_str = $product_data['shipping'];
1275
+ $product_data['installment'] = $this->woosea_get_installment($project_config, $product_data['id']);
 
 
 
 
 
 
 
 
1276
  $product_data['weight'] = ($product->get_weight()) ? $product->get_weight() : false;
1277
  $product_data['height'] = ($product->get_height()) ? $product->get_height() : false;
1278
  $product_data['length'] = ($product->get_length()) ? $product->get_length() : false;
1307
 
1308
  foreach($diff_taxonomies as $taxo){
1309
  $term_value = get_the_terms($product_data['id'], $taxo);
1310
+
1311
  if(is_array($term_value)){
1312
  foreach($term_value as $term){
1313
  $product_data[$taxo] = $term->name;
1315
  }
1316
  }
1317
 
1318
+ /**
1319
+ * Add product tags to the product data array
1320
+ */
1321
+ $product_tags = get_the_terms($product_data['id'], "product_tag");
1322
+ if(is_array($product_tags)){
1323
+
1324
+ foreach($product_tags as $term){
1325
+
1326
+ if(!array_key_exists("product_tag", $product_data)){
1327
+ $product_data["product_tag"] = array($term->name);
1328
+ } else {
1329
+ array_push ($product_data["product_tag"], $term->name);
1330
+ }
1331
+ }
1332
+ }
1333
+
1334
  /**
1335
  * Get Custom Attributes for Single products
1336
  */
1351
  if(($custom_kk == "_woosea_condition") && ($custom_value == "")){
1352
  $custom_value = $product_data['condition'];
1353
  }
1354
+ $product_data[$new_key] = $custom_value;
1355
+ }
1356
+ /**
1357
+ * We need to check if this product has individual custom product attributes
1358
+ */
1359
+ global $wpdb;
1360
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id=".$product_data['id']." AND meta.post_id = posts.id GROUP BY meta.meta_key ORDER BY meta.meta_key ASC";
1361
+ $data = $wpdb->get_results($sql);
1362
+ if (count($data)) {
1363
+ foreach ($data as $key => $value) {
1364
+ $value_display = str_replace("_", " ",$value->name);
1365
+ if (preg_match("/_product_attributes/i",$value->name)){
1366
+ $product_attr = unserialize($value->type);
1367
+ foreach ($product_attr as $key => $arr_value) {
1368
+ $new_key ="custom_attributes_" . $key;
1369
+ $product_data[$new_key] = $arr_value['value'];
1370
+ }
1371
  }
 
 
1372
  }
1373
+ }
1374
+ }
 
1375
  /**
1376
  * Get Product Attributes for Single products
1377
  */
1384
  $product_data[$attr_name] = $attr_value;
1385
  }
1386
  }
1387
+
1388
+ // Check if user would like to use the mother main image for all variation products
1389
+ $add_mother_image = get_option ('add_mother_image');
1390
+ if(($add_mother_image == "yes") AND ($product_data['item_group_id'] > 0)){
1391
+ $mother_image = wp_get_attachment_image_src( get_post_thumbnail_id( $product_data['item_group_id'] ), 'full' );
1392
+ $product_data['image'] = $mother_image[0];
1393
+ }
1394
+
1395
  /**
1396
  * Versioned products need a seperate approach
1397
  * Get data for these products based on the mother products item group id
1401
  $product_variations = new WC_Product_Variation( $product_data['id'] );
1402
  $variations = $product_variations->get_variation_attributes();
1403
  $append = "";
1404
+
1405
+ $variable_description = get_post_meta( $product_data['id'], '_variation_description', true );
1406
+
1407
+ /**
1408
+ * When there is a specific description for a variation product than override the description of the mother product
1409
+ */
1410
+ if(!empty($variable_description)){
1411
+ $product_data['description'] = html_entity_decode((str_replace("\r", "", $variable_description)), ENT_QUOTES | ENT_XML1, 'UTF-8');
1412
+ $product_data['short_description'] = html_entity_decode((str_replace("\r", "", $variable_description)), ENT_QUOTES | ENT_XML1, 'UTF-8');
1413
+
1414
+ // Strip HTML from (short) description
1415
+ $product_data['description'] = strip_tags($product_data['description']);
1416
+ $product_data['short_description'] = strip_tags($product_data['short_description']);
1417
+ // Strip out Visual Composer short codes
1418
+ $product_data['description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['description'] );
1419
+ $product_data['short_description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['short_description'] );
1420
+
1421
+ // Strip out the non-line-brake character
1422
+ $product_data['description'] = str_replace("&#xa0;", "", $product_data['description']);
1423
+ $product_data['short_description'] = str_replace("&#xa0;", "", $product_data['short_description']);
1424
+
1425
+ // Strip unwanted UTF8 chars
1426
+ $product_data['description'] = $this->woosea_utf8_for_xml( $product_data['description'] );
1427
+ $product_data['short_description'] = $this->woosea_utf8_for_xml( $product_data['short_description'] );
1428
+ }
1429
+
1430
+ /**
1431
+ * Add the product visibility values for variations based on the simple mother product
1432
+ */
1433
+ $product_data['exclude_from_catalog'] = "no";
1434
+ $product_data['exclude_from_search'] = "no";
1435
+ $product_data['exclude_from_all'] = "no";
1436
+
1437
+ $visibility_list = wp_get_post_terms($product_data['item_group_id'], 'product_visibility', array("fields" => "all"));
1438
+ foreach($visibility_list as $visibility_single){
1439
+ if($visibility_single->slug == "exclude-from-catalog"){
1440
+ $product_data['exclude_from_catalog'] = "yes";
1441
+ }
1442
+ if($visibility_single->slug == "exclude-from-search"){
1443
+ $product_data['exclude_from_search'] = "yes";
1444
+ }
1445
+ }
1446
+
1447
+ if(($product_data['exclude_from_search'] == "yes") AND ($product_data['exclude_from_catalog'] == "yes")){
1448
+ $product_data['exclude_from_all'] = "yes";
1449
+ }
1450
+
1451
  /**
1452
  * Although this is a product variation we also need to grap the Product attributes belonging to the simple mother product
1453
  */
1454
  $mother_attributes = get_post_meta($product_data['item_group_id'], '_product_attributes');
1455
+
1456
  foreach ($mother_attributes as $attribute){
1457
  foreach($attribute as $attr){
1458
 
1478
 
1479
  if(is_array($term_value)){
1480
  foreach($term_value as $term){
1481
+ $product_data[$taxo] = $term->name;
1482
  }
1483
  }
1484
  }
1485
 
1486
+
1487
+ /**
1488
+ * Add product tags to the product data array
1489
+ */
1490
+ $product_tags = get_the_terms($product_data['item_group_id'], "product_tag");
1491
+ if(is_array($product_tags)){
1492
+
1493
+ foreach($product_tags as $term){
1494
+
1495
+ if(!array_key_exists("product_tag", $product_data)){
1496
+ $product_data["product_tag"] = array($term->name);
1497
+ } else {
1498
+ array_push ($product_data["product_tag"], $term->name);
1499
+ }
1500
+ }
1501
+ }
1502
+
1503
  // User does need to also add the attributes to the feed otherwise they cannot be appended to the productname
1504
  foreach($variations as $kk => $vv){
1505
  $custom_key = $kk;
1506
 
1507
  if (isset($project_config['product_variations']) AND ($project_config['product_variations'] == "on")){
1508
+
1509
  $taxonomy = str_replace("attribute_","",$kk);
1510
  $term = get_term_by('slug', $vv, $taxonomy);
1511
+
1512
  if($term){
1513
  $append = ucfirst($term->name);
1514
+ $vv = $append;
1515
+
1516
+ if (!empty($append)){
1517
+ // Prevent duplicate attribute values from being added to the product name
1518
+ if(!preg_match("/" . preg_quote($product_data['title'], '/') . "/", $append)){
1519
+ $product_data['title'] = $product_data['title']." ".$append;
1520
+ }
1521
+ }
1522
  }
 
 
 
 
 
1523
  }
1524
 
1525
  $custom_key = str_replace("attribute_","",$custom_key);
1532
  */
1533
  $custom_attributes = $this->get_custom_attributes( $product_data['id'] );
1534
 
1535
+ // if(!empty($custom_attributes)){
1536
+ foreach($custom_attributes as $custom_kk => $custom_vv){
1537
+ $custom_value = get_post_meta( $product_data['id'], $custom_kk, true );
1538
 
1539
+ // Product variant brand is empty, grap that of the mother product
1540
+ if(($custom_kk == "_woosea_brand") && ($custom_value == "")){
1541
+ $custom_value = get_post_meta( $product_data['item_group_id'], $custom_kk, true );
1542
+ }
1543
 
1544
+ // Product variant optimized title is empty, grap the mother product title
1545
+ if(($custom_kk == "_woosea_optimized_title") && ($custom_value == "")){
1546
+ $custom_value = $product_data['title'];
1547
+ }
 
 
1548
 
1549
+ if(!is_array($custom_value)){
1550
+
1551
+ $new_key ="custom_attributes_" . $custom_kk;
1552
+ // In order to make the mapping work again, replace var by product
1553
+ $new_key = str_replace("var","product",$new_key);
1554
+ if(!empty( $custom_value )){
1555
+ $product_data[$new_key] = $custom_value;
1556
+ }
1557
+ }
1558
  }
1559
+ // }
1560
+
1561
+ /**
1562
+ * We need to check if this product has individual custom product attributes
1563
+ */
1564
+ global $wpdb;
1565
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id=".$product_data['item_group_id']." AND meta.post_id = posts.id GROUP BY meta.meta_key ORDER BY meta.meta_key ASC";
1566
+ $data = $wpdb->get_results($sql);
1567
+ if (count($data)) {
1568
+ foreach ($data as $key => $value) {
1569
+ $value_display = str_replace("_", " ",$value->name);
1570
+ if (preg_match("/_product_attributes/i",$value->name)){
1571
+ $product_attr = unserialize($value->type);
1572
+ foreach ($product_attr as $key => $arr_value) {
1573
+ $new_key ="custom_attributes_" . $key;
1574
+ $product_data[$new_key] = $arr_value['value'];
1575
+ }
1576
+ }
1577
+ }
1578
+ }
1579
 
1580
  /**
1581
  * We also need to make sure that we get the custom attributes belonging to the simple mother product
1583
  $custom_attributes_mother = $this->get_custom_attributes( $product_data['item_group_id'] );
1584
 
1585
  foreach($custom_attributes_mother as $custom_kk_m => $custom_value_m){
1586
+
1587
  if(!array_key_exists($custom_kk_m, $product_data)){
1588
  $custom_value_m = get_post_meta( $product_data['item_group_id'], $custom_kk_m, true );
1589
+ $new_key_m ="custom_attributes_" . $custom_kk_m;
1590
  // In order to make the mapping work again, replace var by product
1591
  $new_key_m = str_replace("var","product",$new_key_m);
1592
 
1593
  if(!key_exists($new_key_m, $product_data) AND (!empty($custom_value_m))){
1594
+ if(is_array($custom_value_m)){
1595
  // determine what to do with this later
1596
  } else {
1597
  $product_data[$new_key_m] = $custom_value_m;
1600
  }
1601
  }
1602
 
1603
+ // Get versioned product categories
1604
  $categories = wc_get_product_cat_ids( $product_data['item_group_id'] );
1605
+
1606
  // Check if the Yoast plugin is installed and active
1607
  if ( class_exists('WPSEO_Primary_Term') ){
1608
  $product_id = $product_data['item_group_id'];
 
1609
  $primary_cat_id=get_post_meta($product_id ,'_yoast_wpseo_primary_product_cat',true);
1610
+
1611
  if($primary_cat_id){
1612
  $product_cat = get_term($primary_cat_id, 'product_cat');
1613
+
1614
+ if(empty($product_cat)){
1615
+
1616
+ // No primary category was set
1617
+ foreach ($categories as $key => $value){
1618
+ if (!$catname){
1619
+ $product_cat = get_term($value, 'product_cat');
1620
+ $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $project_taxonomy = $project_config['taxonomy'], $link = false, $nicename = false, $visited = array() );
1621
+
1622
+ if(!is_object($category_path)){
1623
+ $product_data['category_path'] = $category_path;
1624
+ }
1625
 
1626
+ if(isset($product_cat->name)) {
1627
+ $catname = $product_cat->name;
1628
+ $catlink = get_term_link($value,'product_cat');
1629
+ }
1630
+ } else {
1631
+ $product_cat = get_term($value, 'product_cat');
1632
+ $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1633
+ if(!is_object($category_path)){
1634
+ $product_data['category_path'] = $category_path;
1635
+ }
1636
+
1637
+ if(isset($product_cat->name)) {
1638
+ $catname_concat = $product_cat->name;
1639
+ $catlink_concat = get_term_link($value,'product_cat');
1640
+ }
1641
+ $catname .= "||".$catname_concat;
1642
+ $catlink .= "||".$catlink_concat;
1643
+ }
1644
+ }
1645
+ } else {
1646
+ $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1647
+ if(!is_object($category_path)){
1648
+ $product_data['category_path'] = $category_path;
1649
+ }
1650
+
1651
+ if(isset($product_cat->name)) {
1652
+ $catname = $product_cat->name;
1653
+ $catlink = get_category_link($product_cat->term_id);
1654
+ }
1655
  }
1656
  } else {
1657
  foreach ($categories as $key => $value){
1683
  }
1684
  }
1685
  }
1686
+ $product_data['raw_categories'] = $catname;
1687
  } else {
1688
  foreach ($categories as $key => $value){
1689
  if (!$catname){
1690
  $product_cat = get_term($value, 'product_cat');
1691
+
1692
+ if($product_cat->parent > 0){
1693
+ $set_parent = $product_cat->parent;
 
 
 
 
 
 
 
 
 
 
1694
  }
1695
+
1696
+ $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1697
+ if(!is_object($category_path)){
1698
+ $product_data['category_path'] = $category_path;
1699
+ }
1700
+ if(isset($product_cat->name)) {
1701
+ $catname = $product_cat->name;
1702
+ $catlink = get_term_link($value,'product_cat');
1703
+ }
1704
+
1705
+ } else {
1706
+ $product_cat = get_term($value, 'product_cat');
1707
+
1708
+ if($product_cat->parent > 0){
1709
+ $category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1710
+ if(!is_object($category_path)){
1711
+ $product_data['category_path'] = $category_path;
1712
+ }
1713
+ if(isset($product_cat->name)) {
1714
+ $catname_concat = $product_cat->name;
1715
+ $catlink_concat = get_term_link($value,'product_cat');
1716
+ }
1717
+ $catname .= "||".$catname_concat;
1718
+ $catlink .= "||".$catlink_concat;
1719
+ }
1720
+ }
1721
  }
1722
  }
1723
+ $product_data['raw_categories'] = $catname;
1724
  $product_data['category_link'] = $catlink;
1725
  $product_data['categories'] = $catname;
1726
  }
 
 
 
 
 
 
 
 
 
1727
  /**
1728
  * In order to prevent XML formatting errors in Google's Merchant center
1729
  * we will add CDATA brackets to the title and description attributes
1732
  $product_data['description'] = $this->woosea_append_cdata ( $product_data['description'] );
1733
  $product_data['short_description'] = $this->woosea_append_cdata ( $product_data['short_description'] );
1734
 
 
1735
  /**
1736
  * Check if individual products need to be excluded
1737
  */
1738
  $product_data = $this->woosea_exclude_individual( $product_data );
1739
 
1740
+ /**
1741
+ * Rules execution
1742
+ */
1743
+ if (array_key_exists('rules2', $project_config)){
1744
+ $product_data = $this->woocommerce_sea_rules( $project_config['rules2'], $product_data );
1745
+ }
1746
+
1747
  /**
1748
  * Filter execution
1749
  */
1750
  if (array_key_exists('rules', $project_config)){
1751
+ $product_data = $this->woocommerce_sea_filters( $project_config['rules'], $product_data );
1752
  }
1753
 
1754
  /**
1755
+ * Check if we need to add category taxonomy mappings (Google Shopping)
1756
  */
1757
+ if ((array_key_exists('mappings', $project_config)) AND ($project_config['taxonomy'] == 'google_shopping')){
1758
+ if(isset($product_data['id'])){
1759
+ $product_data = $this->woocommerce_sea_mappings( $project_config['mappings'], $product_data );
1760
+ }
1761
+ } elseif ((!array_key_exists('mappings', $project_config)) AND ($project_config['taxonomy'] == 'google_shopping')){
1762
+ if(isset($product_data['id'])){
1763
+ $product_data['categories'] = "";
1764
+ }
1765
  }
 
1766
  /**
1767
  * When a product is a variable product we need to delete the original product from the feed, only the originals are allowed
1768
  */
1820
  }
1821
 
1822
  if (array_key_exists($attr_value['mapfrom'], $product_data)){
1823
+
1824
  if(is_array($product_data[$attr_value['mapfrom']])){
1825
+
1826
+ if($attr_value['mapfrom'] == "product_tag"){
1827
+ $product_tag_str = "";
1828
+
1829
+ foreach ($product_data['product_tag'] as $key => $value){
1830
+ $product_tag_str .= ",";
1831
+ $product_tag_str .= "$value";
1832
+ }
1833
+ $product_tag_str = rtrim($product_tag_str, ",");
1834
+ $product_tag_str = ltrim($product_tag_str, ",");
1835
+
1836
+ $attr_line .= ",'".$product_tag_str."'";
1837
+
1838
+ } else {
1839
+ $shipping_str = "";
1840
+ foreach ($product_data[$attr_value['mapfrom']] as $key => $value){
1841
+ $shipping_str .= "||";
1842
+ foreach($value as $k => $v){
1843
+ if(preg_match('/[0-9]/', $v)){
1844
+ $shipping_str .= ":$attr_value[prefix]".$v."$attr_value[suffix]";
1845
+ } else {
1846
+ $shipping_str .= ":$v";
1847
+ }
1848
+ }
1849
+ }
1850
+ $shipping_str = ltrim($shipping_str, "||");
1851
+ $shipping_str = rtrim($shipping_str, ":");
1852
+ $shipping_str = ltrim($shipping_str, ":");
1853
+ $shipping_str = str_replace("||:", "||", $shipping_str);
1854
+
1855
+ $attr_line .= ",'".$shipping_str."'";
1856
+ }
1857
+ } else {
1858
+
1859
+ if(strlen($product_data[$attr_value['mapfrom']])){
1860
+ $attr_line .= ",'".$attr_value['prefix']. "".$product_data[$attr_value['mapfrom']]."" .$attr_value['suffix']."'";
1861
+ } else {
1862
+ $attr_line .= ",''";
1863
+ }
1864
  }
1865
  } else {
1866
  $attr_line .= ",''";
1900
  } else {
1901
  $attr_line .= ",'".$product_data[$attribute_key]."'";
1902
  }
1903
+ }
1904
  }
1905
  $attr_line = trim($attr_line, "'");
1906
  $products[] = array ( $attr_line );
1934
  $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $attr_value['mapfrom'] ." $attr_value[suffix]";
1935
  }
1936
  } elseif ($attr_value['mapfrom'] == $attribute_key){
1937
+
1938
  if(!isset($xml_product)){
1939
  $xml_product = array (
1940
  $attr_value['attribute'] => "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]"
1942
  } else {
1943
  if(key_exists($attr_value['mapfrom'],$product_data)){
1944
  if(is_array($product_data[$attr_value['mapfrom']])){
1945
+ if($attr_value['mapfrom'] == "product_tag"){
1946
+ $product_tag_str = "";
1947
+
1948
+ foreach ($product_data['product_tag'] as $key => $value){
1949
+ $product_tag_str .= ",";
1950
+ $product_tag_str .= "$value";
1951
+ }
1952
+ $product_tag_str = ltrim($product_tag_str, ",");
1953
+ $product_tag_str = rtrim($product_tag_str, ",");
1954
+
1955
+ $xml_product[$attr_value['attribute']] = "$product_tag_str";
1956
+ } else {
1957
+ $shipping_str = "";
1958
+ foreach ($product_data[$attr_value['mapfrom']] as $key => $value){
1959
+ $shipping_str .= "||";
1960
+
1961
+ foreach($value as $k => $v){
1962
+
1963
+ if($k == "country"){
1964
+ $shipping_str .= ":WOOSEA_COUNTRY##$v";
1965
+ } elseif ($k == "region"){
1966
+ $shipping_str .= ":WOOSEA_REGION##$v";
1967
+ } elseif ($k == "service"){
1968
+ $shipping_str .= ":WOOSEA_SERVICE##$v";
1969
+ } elseif ($k == "postal_code"){
1970
+ $shipping_str .= ":WOOSEA_POSTAL_CODE##$v";
1971
+ } elseif ($k == "price"){
1972
+ $shipping_str .= ":WOOSEA_PRICE##$attr_value[prefix] $v $attr_value[suffix]";
1973
  } else {
1974
+ // UNKNOWN, DO NOT ADD
1975
+ }
1976
  }
1977
  }
1978
  $shipping_str = ltrim($shipping_str, "||");
1980
  $shipping_str = ltrim($shipping_str, ":");
1981
  $shipping_str = str_replace("||:", "||", $shipping_str);
1982
 
1983
+ $xml_product[$attr_value['attribute']] = "$shipping_str";
1984
+ }
1985
  } else {
1986
  if(array_key_exists($attr_value['attribute'], $xml_product)){
1987
+ $ca = explode("_", $attr_value['mapfrom']);
1988
+ $xml_product[$attr_value['attribute']."_$ca[1]"] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
1989
  } else {
1990
+ if(strlen($product_data[$attr_value['mapfrom']])){
1991
+ $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
1992
+ }
1993
  }
1994
  }
1995
  }
2021
  array_push ($xml_piece, $xml_product);
2022
  unset($xml_product);
2023
  }
2024
+
2025
+ // error_log(print_r($product_data, TRUE));
2026
  unset($product_data);
2027
  }
2028
  endwhile;
2031
  /**
2032
  * Update processing status of project
2033
  */
2034
+ //$project_updated = $this->woosea_project_update($project_config['project_hash'], $offset_step_size, $xml_piece);
2035
 
2036
  /**
2037
  * Write row to CSV/TXT or XML file
2047
  unset($products);
2048
  }
2049
 
2050
+ /**
2051
+ * Update processing status of project
2052
+ */
2053
+ $project_updated = $this->woosea_project_update($project_config['project_hash'], $offset_step_size);
2054
+
2055
  /**
2056
  * Ready creating file, clean up our feed configuration mess now
2057
  */
2062
  /**
2063
  * Update processing statistics of batched projects
2064
  */
2065
+ public function woosea_project_update($project_hash, $offset_step_size){
2066
  $feed_config = get_option( 'cron_projects' );
2067
  $nr_projects = count ($feed_config);
2068
 
2114
  $nrpr = $feed_config[$key]['nr_products_processed'];
2115
  $nr_prods_processed = $nrpr+$offset_step_size;
2116
 
2117
+ // if(is_array($xml_piece)){
2118
  // End of processing batched feed
2119
  if($nrpr >= $feed_config[$key]['nr_products']){
2120
+
2121
  // Set counters back to 0
2122
  $feed_config[$key]['nr_products_processed'] = 0;
2123
 
2124
  // Set processing status on ready
2125
  $feed_config[$key]['running'] = "ready";
2126
  $project_data['last_updated'] = date("d M Y H:i");
2127
+ $upload_dir = wp_upload_dir();
2128
+ $base = $upload_dir['basedir'];
2129
+ $path = $base . "/woo-product-feed-pro/" . $feed_config[$key]['fileformat'];
2130
+ $tmp_file = $path . "/" . sanitize_file_name($feed_config[$key]['filename']) . "_tmp." . $feed_config[$key]['fileformat'];
2131
+ $new_file = $path . "/" . sanitize_file_name($feed_config[$key]['filename']) . "." . $feed_config[$key]['fileformat'];
2132
+
2133
+ if (!copy($tmp_file, $new_file)) {
2134
+ error_log("Copy of file failed");
2135
+ }
2136
+ // END
2137
+
2138
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
2139
  delete_option( $batch_project );
2140
 
2143
  } else {
2144
  $feed_config[$key]['nr_products_processed'] = $nr_prods_processed;
2145
  $feed_config[$key]['running'] = "processing";
2146
+
2147
  // Set new scheduled event for next batch in 3 seconds
2148
  if($offset_step_size < $published_products){
2149
  if (! wp_next_scheduled ( 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) ) ) {
2153
  }
2154
  } else {
2155
  // No batch is needed, already done processing all products
2156
+
2157
  // Set counters back to 0
2158
  $feed_config[$key]['nr_products_processed'] = 0;
2159
+ $upload_dir = wp_upload_dir();
2160
+ $base = $upload_dir['basedir'];
2161
+ $path = $base . "/woo-product-feed-pro/" . $feed_config[$key]['fileformat'];
2162
+ $tmp_file = $path . "/" . sanitize_file_name($feed_config[$key]['filename']) . "_tmp." . $feed_config[$key]['fileformat'];
2163
+ $new_file = $path . "/" . sanitize_file_name($feed_config[$key]['filename']) . "." . $feed_config[$key]['fileformat'];
2164
+
2165
+ if (!copy($tmp_file, $new_file)) {
2166
+ error_log("Copy of file failed - small file");
2167
+ }
2168
+ // END
2169
+
2170
  // Set processing status on ready
2171
  $feed_config[$key]['running'] = "ready";
2172
  $project_data['last_updated'] = date("d M Y H:i");
2178
  wp_schedule_single_event( time() + 120, 'woosea_update_project_stats', array($val['project_hash']) );
2179
  }
2180
  }
 
 
 
 
 
 
 
 
 
 
 
 
2181
  }
2182
  }
2183
  $nr_projects_cron = count ( get_option ( 'cron_projects' ) );
2312
  $term = get_term_by('slug', $meta, $taxonomy);
2313
  return $term->name;
2314
  } else {
2315
+ $blaat = get_post_meta($id, $name, true);
2316
  return get_post_meta($id, $name, true);
2317
  }
2318
  }
2323
  $original_cat = $product_data['categories'];
2324
  $original_cat = preg_replace('/&amp;/','&',$original_cat);
2325
 
 
 
 
 
 
 
 
2326
  $tmp_cat = "";
2327
  $match = "false";
2328
 
2329
  foreach ($project_mappings as $pm_key => $pm_array){
2330
+
2331
  // Strip slashes
2332
  $pm_array['criteria'] = str_replace("\\","",$pm_array['criteria']);
2333
+ $pm_array['criteria'] = str_replace("/","",$pm_array['criteria']);
2334
+ $original_cat = str_replace("\\","",$original_cat);
2335
+ $original_cat = str_replace("/","",$original_cat);
2336
 
2337
  // First check if there is a category mapping for this specific product
2338
+ if(preg_match('/'.$pm_array['criteria'].'/', $original_cat) AND (!empty($pm_array['map_to_category']))){
2339
+ $category_pieces = explode("-", $pm_array['map_to_category']);
2340
+ $tmp_cat = $category_pieces[0];
2341
+ $match = "true";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2342
  }
2343
  }
2344
 
2345
  if($match == "true"){
2346
+ if(array_key_exists('id', $product_data)){
2347
+ $product_data['categories'] = $tmp_cat;
2348
+ }
2349
  } else {
2350
+ // No mapping found so make google_product_category empty
2351
  $product_data['categories'] = "";
2352
  }
2353
 
2357
  /**
2358
  * Execute project rules
2359
  */
2360
+ private function woocommerce_sea_rules( $project_rules2, $product_data ){
 
2361
  $aantal_prods = count($product_data);
2362
  if($aantal_prods > 0){
2363
 
2364
  foreach ($project_rules2 as $pr_key => $pr_array){
2365
+
2366
  foreach ($product_data as $pd_key => $pd_value){
2367
 
2368
  // Check is there is a rule on specific attributes
2369
  if($pd_key == $pr_array['attribute']){
2370
 
2371
+ // This is because for data manipulation the than attribute is empty
2372
+ if(!array_key_exists('than_attribute', $pr_array)){
2373
+ $pr_array['than_attribute'] = $pd_key;
2374
+ }
2375
+
2376
  // Check if a rule has been set for Google categories
2377
  if ($product_data[$pr_array['than_attribute']] == "google_category"){
2378
  $pr_array['than_attribute'] = "categories";
2380
  $pr_array['newvalue'] = $category_id[0];
2381
  }
2382
 
2383
+ // Make sure that rules on numerics are on true numerics
2384
+ if (!preg_match('/[A-Za-z]/', $pd_value)){
2385
+ $pd_value = strtr($pd_value, ',', '.');
2386
+ }
2387
+
2388
+ //$tmp_numeric = round($pd_value);
2389
+ if (((is_numeric($pd_value)) AND ($pr_array['than_attribute'] != "shipping"))){
2390
+
2391
+ // Rules for numeric values
2392
  switch ($pr_array['condition']) {
2393
  case($pr_array['condition'] = "contains"):
2394
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
2435
  $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
2436
  }
2437
  break;
2438
+ case($pr_array['condition'] = "multiply"):
2439
+ $pr_array['criteria'] = strtr($pr_array['criteria'], ',', '.');
2440
+ $pd_value = strtr($pd_value, ',', '.');
2441
+ $newvalue = $pd_value*$pr_array['criteria'];
2442
+ $newvalue = round($newvalue, 2);
2443
+ $newvalue = strtr($newvalue, '.',',');
2444
+ $product_data[$pr_array['attribute']] = $newvalue;
2445
+ break;
2446
+ case($pr_array['condition'] = "divide"):
2447
+ $newvalue = ($pd_value / $pr_array['criteria']);
2448
+ $product_data[$pr_array['attribute']] = $newvalue;
2449
+ break;
2450
+ case($pr_array['condition'] = "plus"):
2451
+ $newvalue = ($pd_value + $pr_array['criteria']);
2452
+ $product_data[$pr_array['attribute']] = $newvalue;
2453
+ break;
2454
+ case($pr_array['condition'] = "minus"):
2455
+ $newvalue = ($pd_value - $pr_array['criteria']);
2456
+ $product_data[$pr_array['attribute']] = $newvalue;
2457
+ break;
2458
  default:
2459
  break;
2460
  }
2461
  } elseif (is_array($pd_value)) {
2462
+
2463
  // For now only shipping details are in an array
2464
  foreach ($pd_value as $k => $v){
2465
  foreach ($v as $kk => $vv){
2531
  if (!array_key_exists('cs', $pr_array)){
2532
  $pd_value = strtolower($pd_value);
2533
  $pr_array['criteria'] = strtolower($pr_array['criteria']);
2534
+ }
2535
+
2536
  switch ($pr_array['condition']) {
2537
  case($pr_array['condition'] = "contains"):
2538
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
2645
  break;
2646
 
2647
  case($pr_array['condition'] = "empty"):
2648
+ if(empty($product_data[$pr_array['attribute']])){
2649
+ $product_data[$pr_array['attribute']] = $product_data[$pr_array['than_attribute']];
2650
+ }
2651
+ break;
2652
+ case($pr_array['condition'] = "replace"):
2653
+ $product_data[$pr_array['than_attribute']] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $product_data[$pr_array['than_attribute']]);
2654
  break;
2655
+
2656
  default:
2657
  break;
2658
  }
2659
  }
2660
+ } else {
2661
+ // When a rule has been set on an attribute that is not in product_data
2662
+ // Add the newvalue to product_data
2663
+ if (!array_key_exists($pr_array['attribute'], $product_data)){
2664
+ $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
2665
+ }
2666
  }
2667
  }
2668
  }
2694
  /**
2695
  * Execute project filters (include / exclude)
2696
  */
2697
+ private function woocommerce_sea_filters( $project_rules, $product_data ){
2698
  $allowed = 1;
2699
 
2700
  // Check if product was already excluded from the feed
2784
  break;
2785
  }
2786
  } elseif (is_array($pd_value)){
2787
+ // Tis can either be a shipping or product_tag array
2788
+ if($pr_array['attribute'] == "product_tag"){
2789
+ foreach ($pd_value as $k => $v){
2790
+ switch ($pr_array['condition']) {
2791
+ case($pr_array['condition'] = "contains"):
2792
+ if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
2793
+ $allowed = 0;
2794
+ }
2795
+ break;
2796
+ case($pr_array['condition'] = "containsnot"):
2797
+ if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
2798
+ $allowed = 0;
2799
+ }
2800
+ break;
2801
+ case($pr_array['condition'] = "="):
2802
+ if (($v == $pr_array['criteria'])){
2803
+ $allowed = 0;
2804
+ }
2805
+ break;
2806
+ case($pr_array['condition'] = "!="):
2807
+ if (($v != $pr_array['criteria'])){
2808
+ $allowed = 0;
2809
+ }
2810
+ break;
2811
+ case($pr_array['condition'] = ">"):
2812
+ if (($v > $pr_array['criteria'])){
2813
+ $allowed = 0;
2814
+ }
2815
+ break;
2816
+ case($pr_array['condition'] = ">="):
2817
+ if (($v >= $pr_array['criteria'])){
2818
+ $allowed = 0;
2819
+ }
2820
+ break;
2821
+ case($pr_array['condition'] = "<"):
2822
+ if (($v < $pr_array['criteria'])){
2823
+ $allowed = 0;
2824
+ }
2825
+ break;
2826
+ case($pr_array['condition'] = "=<"):
2827
+ if (($v <= $pr_array['criteria'])){
2828
+ $allowed = 0;
2829
+ }
2830
+ break;
2831
+ case($pr_array['condition'] = "empty"):
2832
+ if (strlen($v) < 1){
2833
+ $allowed = 0;
2834
+ }
2835
+ break;
2836
+ default:
2837
+ break;
2838
+ }
2839
+ }
2840
+ } else {
2841
+ // For now only shipping details are in an array
2842
+ foreach ($pd_value as $k => $v){
2843
+ foreach ($v as $kk => $vv){
2844
+ // Only shipping detail rule can be on price for now
2845
+ if($kk == "price"){
2846
+ switch ($pr_array['condition']) {
2847
+ case($pr_array['condition'] = "contains"):
2848
+ if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
2849
+ $allowed = 0;
2850
+ }
2851
+ break;
2852
+ case($pr_array['condition'] = "containsnot"):
2853
+ if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
2854
+ $allowed = 0;
2855
+ }
2856
+ break;
2857
+ case($pr_array['condition'] = "="):
2858
+ if (($vv == $pr_array['criteria'])){
2859
+ $allowed = 0;
2860
+ }
2861
+ break;
2862
+ case($pr_array['condition'] = "!="):
2863
+ if (($vv != $pr_array['criteria'])){
2864
+ $allowed = 0;
2865
+ }
2866
+ break;
2867
+ case($pr_array['condition'] = ">"):
2868
+ if (($vv > $pr_array['criteria'])){
2869
+ $allowed = 0;
2870
+ }
2871
+ break;
2872
+ case($pr_array['condition'] = ">="):
2873
+ if (($vv >= $pr_array['criteria'])){
2874
+ $allowed = 0;
2875
+ }
2876
+ break;
2877
+ case($pr_array['condition'] = "<"):
2878
+ if (($vv < $pr_array['criteria'])){
2879
+ $allowed = 0;
2880
+ }
2881
+ break;
2882
+ case($pr_array['condition'] = "=<"):
2883
+ if (($vv <= $pr_array['criteria'])){
2884
+ $allowed = 0;
2885
+ }
2886
+ break;
2887
+ case($pr_array['condition'] = "empty"):
2888
+ if (strlen($vv) < 1){
2889
+ $allowed = 0;
2890
+ }
2891
+ break;
2892
+ default:
2893
+ break;
2894
+ }
2895
  }
2896
  }
2897
  }
2898
  }
2899
  } else {
2900
+ // Filters for string values
2901
+
2902
  // If case-sensitve is off than lowercase both the criteria and attribute value
2903
  if (array_key_exists('cs', $pr_array)){
2904
  if ($pr_array['cs'] != "on"){
2973
  }
2974
  break;
2975
  case($pr_array['condition'] = "empty"):
2976
+
2977
  if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
2978
  $allowed = 0;
2979
  } elseif ((strlen($pd_value > 0)) && ($pr_array['than'] == "include_only")){
2990
  // A empty rule has been set on an attribute that is not in a product anyhow. Still, remove this product from the feed
2991
  if($pr_array['condition'] == "empty"){
2992
  $allowed = 0;
2993
+ } elseif($pr_array['condition'] == "="){
2994
+ $allowed = 0;
2995
+ } elseif($pr_array['condition'] == "contains"){
2996
+ if($pr_array['than'] == "exclude"){
2997
+ $allowed = 1;
2998
+ } else {
2999
+ $allowed = 0;
3000
+ }
3001
+ } else {
3002
+
3003
+ if($pr_array['than'] == "exclude"){
3004
+ $allowed = 0;
3005
+ } else {
3006
+ $allowed = 1;
3007
+ }
3008
  }
3009
  }
3010
  }
classes/class-google-remarketing.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This class sets Google Remarketing functions
4
+ */
5
+ class WooSEA_Google_Remarketing {
6
+
7
+ public static function woosea_google_remarketing_pagetype ( ) {
8
+ $ecomm_pagetype = "other"; // set a default
9
+
10
+ if(is_product()){
11
+ $ecomm_pagetype = "product";
12
+ } elseif (is_cart()){
13
+ $ecomm_pagetype = "cart";
14
+ } elseif (is_checkout()){
15
+ $ecomm_pagetype = "cart";
16
+ } elseif (is_product_category()){
17
+ $ecomm_pagetype = "category";
18
+ } elseif (is_front_page()){
19
+ $ecomm_pagetype = "home";
20
+ } elseif (is_search()){
21
+ $ecomm_pagetype = "searchresults";
22
+ } else {
23
+ $ecomm_pagetype = "other";
24
+ }
25
+
26
+ return $ecomm_pagetype;
27
+ }
28
+ }
classes/class-uninstall-cleanup.php CHANGED
@@ -6,10 +6,10 @@
6
  */
7
  class WooSEA_Uninstall_Cleanup {
8
  public static function uninstall_cleanup() {
9
- wp_clear_scheduled_hook( 'woosea_cron_hook' );
10
- wp_clear_scheduled_hook( 'woosea_check_license' );
11
  delete_option( 'channel_statics' );
12
- delete_option( 'license_information' );
13
- delete_option( 'cron_projects' );
14
  }
15
  }
6
  */
7
  class WooSEA_Uninstall_Cleanup {
8
  public static function uninstall_cleanup() {
9
+ wp_clear_scheduled_hook( 'woosea_cron_hook' );
10
+ wp_clear_scheduled_hook( 'woosea_check_license' );
11
  delete_option( 'channel_statics' );
12
+ delete_option( 'license_information' );
13
+ delete_option( 'cron_projects' );
14
  }
15
  }
js/woosea_autocomplete.js CHANGED
@@ -5438,23 +5438,24 @@ jQuery(document).ready(function($) {
5438
  input: '.js-autosuggest',
5439
  source: google_taxonomy,
5440
  hint: true,
5441
- loadingAnimation: true,
5442
  items: 10,
5443
- minLength: 2,
5444
  alignWidth: false,
5445
  debug: true
5446
  });
5447
  jQuery( ".autocomplete_" + rowCount ).focus();
5448
 
5449
- jQuery(this).blur(function (){
5450
- var minimum = 5;
 
5451
  var len = jQuery(this).val().length;
5452
  var project_hash = $("#project_hash").val();
5453
  var criteria = $("#" + rowCount).val();
 
5454
 
5455
  if (len >= minimum){
5456
- jQuery(this).blur(function(){
5457
- var map_to_category = jQuery(this).val();
5458
 
5459
  jQuery.ajax({
5460
  method: "POST",
@@ -5464,44 +5465,39 @@ jQuery(document).ready(function($) {
5464
 
5465
  .done(function( data ) {
5466
  data = JSON.parse( data );
5467
-
5468
  jQuery(data.className).removeClass("input-field-large");
5469
  jQuery(data.className).addClass("input-field-large-active");
5470
  })
5471
 
5472
  .fail(function( data ) {
5473
  console.log('Failed AJAX Call :( /// Return Data: ' + data);
5474
- });
5475
- });
5476
- jQuery(this).closest("input").removeClass("input-field-large");
5477
- jQuery(this).closest("input").addClass("input-field-large-active");
 
5478
  } else {
5479
  var map_to_category = "";
5480
 
5481
  jQuery.ajax({
5482
  method: "POST",
5483
- url: ajaxurl,
5484
  data: { 'action': 'woosea_add_cat_mapping', 'rowCount': rowCount, 'map_to_category': map_to_category, 'className': className, 'project_hash': project_hash, 'criteria': criteria }
5485
  })
5486
- jQuery(this).closest("input").removeClass("input-field-large-active");
5487
- jQuery(this).closest("input").addClass("input-field-large");
5488
- }
5489
- });
5490
 
5491
- jQuery(this).click(function (){
5492
- var len = jQuery(this).val().length;
5493
- if (len < 1){
5494
- var map_to_category = "";
5495
 
5496
- jQuery.ajax({
5497
- method: "POST",
5498
- url: ajaxurl,
5499
- data: { 'action': 'woosea_add_cat_mapping', 'rowCount': rowCount, 'map_to_category': map_to_category, 'className': className, 'project_hash': project_hash, 'criteria': criteria }
5500
- })
5501
-
5502
- jQuery(this).closest("input").removeClass("input-field-large-active");
5503
- jQuery(this).closest("input").addClass("input-field-large");
5504
  }
5505
  });
 
5506
  });
5507
  });
5438
  input: '.js-autosuggest',
5439
  source: google_taxonomy,
5440
  hint: true,
5441
+ loadingAnimation: false,
5442
  items: 10,
5443
+ minLength: 4,
5444
  alignWidth: false,
5445
  debug: true
5446
  });
5447
  jQuery( ".autocomplete_" + rowCount ).focus();
5448
 
5449
+
5450
+ jQuery(this).on('change', function(){ // on change of state
5451
+ var minimum = 1;
5452
  var len = jQuery(this).val().length;
5453
  var project_hash = $("#project_hash").val();
5454
  var criteria = $("#" + rowCount).val();
5455
+ var map_to_category = jQuery(this).val();
5456
 
5457
  if (len >= minimum){
5458
+ if ( !isNaN(parseInt(map_to_category)) ) {
 
5459
 
5460
  jQuery.ajax({
5461
  method: "POST",
5465
 
5466
  .done(function( data ) {
5467
  data = JSON.parse( data );
 
5468
  jQuery(data.className).removeClass("input-field-large");
5469
  jQuery(data.className).addClass("input-field-large-active");
5470
  })
5471
 
5472
  .fail(function( data ) {
5473
  console.log('Failed AJAX Call :( /// Return Data: ' + data);
5474
+ console.log('Category mapping failed!');
5475
+ });
5476
+ // jQuery(this).closest("input").removeClass("input-field-large");
5477
+ // jQuery(this).closest("input").addClass("input-field-large-active");
5478
+ }
5479
  } else {
5480
  var map_to_category = "";
5481
 
5482
  jQuery.ajax({
5483
  method: "POST",
5484
+ url: ajaxurl,
5485
  data: { 'action': 'woosea_add_cat_mapping', 'rowCount': rowCount, 'map_to_category': map_to_category, 'className': className, 'project_hash': project_hash, 'criteria': criteria }
5486
  })
 
 
 
 
5487
 
5488
+ .done(function( data ) {
5489
+ data = JSON.parse( data );
 
 
5490
 
5491
+ jQuery(data.className).closest("input").removeClass("input-field-large-active");
5492
+ jQuery(data.className).closest("input").addClass("input-field-large");
5493
+ })
5494
+
5495
+ .fail(function( data ) {
5496
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
5497
+ console.log('category mapping failed');
5498
+ });
5499
  }
5500
  });
5501
+
5502
  });
5503
  });
js/woosea_channel.js CHANGED
@@ -26,6 +26,33 @@ jQuery(document).ready(function($) {
26
  if(channel_hash == 'Google Remarketing - DRM'){ // Ugly hack, should be configurable per channel
27
  $("#fileformat option[value='xml']").remove();
28
  $("#fileformat option[value='txt']").remove();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  } else {
30
  $("#fileformat")
31
  .empty()
26
  if(channel_hash == 'Google Remarketing - DRM'){ // Ugly hack, should be configurable per channel
27
  $("#fileformat option[value='xml']").remove();
28
  $("#fileformat option[value='txt']").remove();
29
+ $("#fileformat option[value='tsv']").remove();
30
+
31
+ $('#file').after('<tr id="delimiter"><td><span>Delimiter:</span></td><td><select name="delimiter" class="select-field"><option value=",">, comma</option><option value="|">| pipe</option><option value=";">;</option><option value="tab">tab</option></select></td></tr>');
32
+ } else if(channel_hash == 'Guenstiger.de'){ // Ugly hack, should be configurable per channel
33
+ $("#fileformat option[value='xml']").remove();
34
+ $("#fileformat option[value='txt']").remove();
35
+ $("#fileformat option[value='tsv']").remove();
36
+
37
+ $('#file').after('<tr id="delimiter"><td><span>Delimiter:</span></td><td><select name="delimiter" class="select-field"><option value=",">, comma</option><option value="|">| pipe</option><option value=";">;</option><option value="tab">tab</option></select></td></tr>');
38
+ } else if(channel_hash == 'Google - DSA'){ // Ugly hack, should be configurable per channel
39
+ $("#fileformat option[value='xml']").remove();
40
+ $("#fileformat option[value='txt']").remove();
41
+ $("#fileformat option[value='tsv']").remove();
42
+
43
+ $('#file').after('<tr id="delimiter"><td><span>Delimiter:</span></td><td><select name="delimiter" class="select-field"><option value=",">, comma</option><option value="|">| pipe</option><option value=";">;</option><option value="tab">tab</option></select></td></tr>');
44
+ } else if(channel_hash == 'Google Local Products Inventory'){ // Ugly hack, should be configurable per channel
45
+ $("#fileformat option[value='xml']").remove();
46
+ $("#fileformat option[value='csv']").remove();
47
+ $("#fileformat option[value='tsv']").remove();
48
+
49
+ $('#file').after('<tr id="delimiter"><td><span>Delimiter:</span></td><td><select name="delimiter" class="select-field"><option value=",">, comma</option><option value="|">| pipe</option><option value=";">;</option><option value="tab">tab</option></select></td></tr>');
50
+ } else if(channel_hash == 'Google Shopping'){ // Ugly hack, should be configurable per channel
51
+ $("#fileformat option[value='txt']").remove();
52
+ $("#fileformat option[value='csv']").remove();
53
+ $("#fileformat option[value='tsv']").remove();
54
+
55
+ $('#file').after('<tr id="delimiter"><td><span>Delimiter:</span></td><td><select name="delimiter" class="select-field"><option value=",">, comma</option><option value="|">| pipe</option><option value=";">;</option><option value="tab">tab</option></select></td></tr>');
56
  } else {
57
  $("#fileformat")
58
  .empty()
js/woosea_field_mapping.js CHANGED
@@ -36,12 +36,15 @@ jQuery(document).ready(function($) {
36
 
37
  // Add a mapping row to the table for field mappings
38
  jQuery(".add-field-mapping").click(function(){
39
- //var rowCount = $('#woosea-fieldmapping-table >tbody >tr').length-1;
40
  var channel_hash = $('#channel_hash').val();
41
- var prevRow = $("tr.rowCount:last input[type=hidden]").val();
42
- //var rowCount = Number(prevRow) + Number(1);
43
  var addrow_value = $('#addrow').val();
44
-
 
 
 
 
 
45
  var rowCount = Number(prevRow) + Number(addrow_value);
46
  var newrow_value = Number(addrow_value) + Number(1);
47
  $('#addrow').val(newrow_value);
@@ -71,10 +74,18 @@ jQuery(document).ready(function($) {
71
 
72
  // Add a mapping row to the table for own mappings
73
  jQuery(".add-own-mapping").click(function(){
74
- // var rowCount = $('#woosea-fieldmapping-table >tbody >tr').length-1;
75
  var channel_hash = $('#channel_hash').val();
76
  var prevRow = $("tr.rowCount:last input[type=hidden]").val();
77
- var rowCount = Number(prevRow) + Number(1);
 
 
 
 
 
 
 
 
 
78
 
79
  jQuery.ajax({
80
  method: "POST",
@@ -101,9 +112,9 @@ jQuery(document).ready(function($) {
101
 
102
  $("#own-input-field").each(function() {
103
  var input=$(this).val();
104
- var re = /^[a-zA-Z_]*$/;
105
  var minLength = 2;
106
- var maxLength = 20;
107
 
108
  var is_input=re.test(input);
109
  // Check for allowed characters
36
 
37
  // Add a mapping row to the table for field mappings
38
  jQuery(".add-field-mapping").click(function(){
 
39
  var channel_hash = $('#channel_hash').val();
40
+ var prevRow = $("tr.rowCount:last input[type=hidden]").val();
 
41
  var addrow_value = $('#addrow').val();
42
+
43
+ // When user deletes all default fields
44
+ if (prevRow === undefined){
45
+ prevRow = 0;
46
+ }
47
+
48
  var rowCount = Number(prevRow) + Number(addrow_value);
49
  var newrow_value = Number(addrow_value) + Number(1);
50
  $('#addrow').val(newrow_value);
74
 
75
  // Add a mapping row to the table for own mappings
76
  jQuery(".add-own-mapping").click(function(){
 
77
  var channel_hash = $('#channel_hash').val();
78
  var prevRow = $("tr.rowCount:last input[type=hidden]").val();
79
+ var addrow_value = $('#addrow').val();
80
+
81
+ // When user deletes all default fields
82
+ if (prevRow === undefined){
83
+ prevRow = 0;
84
+ }
85
+
86
+ var rowCount = Number(prevRow) + Number(addrow_value);
87
+ var newrow_value = Number(addrow_value) + Number(1);
88
+ $('#addrow').val(newrow_value);
89
 
90
  jQuery.ajax({
91
  method: "POST",
112
 
113
  $("#own-input-field").each(function() {
114
  var input=$(this).val();
115
+ var re = /^[a-zA-Z_-]*$/;
116
  var minLength = 2;
117
+ var maxLength = 50;
118
 
119
  var is_input=re.test(input);
120
  // Check for allowed characters
js/woosea_key.js ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ jQuery("#deactivate_license").click(function(){
4
+
5
+ $('.notice').replaceWith("<div class='notice notice-info is-dismissible'><p>Your license has been deactivated.</p></div>");
6
+ $('#license_email').val('');
7
+ $('#license_key').val('');
8
+
9
+ jQuery.ajax({
10
+ method: "POST",
11
+ url: ajaxurl,
12
+ data: { 'action': 'woosea_deactivate_license' }
13
+ })
14
+ .done(function( data ) {
15
+ data = JSON.parse( data );
16
+ })
17
+ .fail(function( data ) {
18
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
19
+ });
20
+ });
21
+
22
+ jQuery("#checklicense").click(function(){
23
+
24
+ var temp = location.host.split('.').reverse();
25
+ var root_domain = $(location).attr('hostname');
26
+ var license_email = $('#license-email').val();
27
+ var license_key = $('#license-key').val();
28
+
29
+ jQuery.ajax({
30
+ url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=4.0.0',
31
+ jsonp: 'callback',
32
+ dataType: 'jsonp',
33
+ type: 'GET',
34
+ success: function( licenseData ) {
35
+
36
+ var license_valid = licenseData.valid;
37
+ if (license_valid == "true"){
38
+ $('.notice').replaceWith("<div class='notice notice-success is-dismissible'><p>Thank you for registering your Elite product, your yearly license has been activated. Please do not hesitate to contact us whenever you have questions (support@adtribes.io).</p></div>");
39
+ } else {
40
+ $('.notice').replaceWith("<div class='notice notice-error is-dismissible'><p>Sorry, this does not seem to be a valid or active license key and email. Please feel free to contact us at support@adtribes.io whenever you have questions with regards to your license.</p></div>");
41
+ }
42
+
43
+ var license_created = licenseData.created;
44
+ var message = licenseData.message;
45
+ var message_type = licenseData.message_type;
46
+ var license_email = licenseData.license_email;
47
+ var license_key = licenseData.license_key;
48
+ var notice = licenseData.notice;
49
+
50
+ jQuery.ajax({
51
+ method: "POST",
52
+ url: ajaxurl,
53
+ data: { 'action': 'woosea_register_license', 'notice': notice, 'message_type': message_type, 'license_email': license_email, 'license_key': license_key, 'license_valid': license_valid, 'license_created': license_created, 'message': message }
54
+ })
55
+ .done(function( data ) {
56
+ data = JSON.parse( data );
57
+ })
58
+ .fail(function( data ) {
59
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
60
+ });
61
+ console.log( licenseData );
62
+ }
63
+ })
64
+ });
65
+
66
+ // On succes this call will return yes/no in jsonp for the domain name check. It will also return the license key. This key needs to correlate with the one user entered.
67
+ });
js/woosea_license.js CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function($) {
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
- url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=3.0.0',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
@@ -45,11 +45,12 @@ jQuery(document).ready(function($) {
45
  var message_type = licenseData.message_type;
46
  var license_email = licenseData.license_email;
47
  var license_key = licenseData.license_key;
48
-
 
49
  jQuery.ajax({
50
  method: "POST",
51
  url: ajaxurl,
52
- data: { 'action': 'woosea_register_license', 'message_type': message_type, 'license_email': license_email, 'license_key': license_key, 'license_valid': license_valid, 'license_created': license_created, 'message': message }
53
  })
54
  .done(function( data ) {
55
  data = JSON.parse( data );
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
+ url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=3.1.5',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
45
  var message_type = licenseData.message_type;
46
  var license_email = licenseData.license_email;
47
  var license_key = licenseData.license_key;
48
+ var notice = licenseData.notice;
49
+
50
  jQuery.ajax({
51
  method: "POST",
52
  url: ajaxurl,
53
+ data: { 'action': 'woosea_register_license', 'notice': notice, 'message_type': message_type, 'license_email': license_email, 'license_key': license_key, 'license_valid': license_valid, 'license_created': license_created, 'message': message }
54
  })
55
  .done(function( data ) {
56
  data = JSON.parse( data );
js/woosea_manage.js CHANGED
@@ -1,6 +1,23 @@
1
  jQuery(document).ready(function($) {
2
  var project_hash = null;
3
  var project_status = null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  $(".dismiss-review-notification").click(function(){
6
  $(".review-notification").remove();
@@ -23,89 +40,181 @@ jQuery(document).ready(function($) {
23
  });
24
 
25
 
26
- $("td[colspan=8]").find("div").parents("tr").hide();
27
 
28
  $('.checkbox-field').change(function(index, obj){
29
- project_hash = $(this).val();
30
- project_status = $(this).prop("checked")
31
 
32
- jQuery.ajax({
33
- method: "POST",
34
- url: ajaxurl,
35
- data: { 'action': 'woosea_project_status', 'project_hash': project_hash, 'active': project_status }
36
- })
37
 
38
- $("table tbody").find('input[name="manage_record"]').each(function(){
39
- var hash = this.value;
40
- if(hash == project_hash){
41
- if (project_status == false){
42
- $(this).parents("tr").addClass('strikethrough');
43
- } else {
44
- $(this).parents("tr").removeClass('strikethrough');
45
- }
46
- }
47
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  });
49
 
50
- // Check if user would like to add attributes
51
- $('#add_identifiers').on('change', function(){ // on change of state
52
  if(this.checked){
 
53
  // Checkbox is on
54
  jQuery.ajax({
55
  method: "POST",
56
  url: ajaxurl,
57
- data: { 'action': 'woosea_add_identifiers', 'status': "on" }
58
  })
59
  } else {
60
  // Checkbox is off
61
  jQuery.ajax({
62
  method: "POST",
63
  url: ajaxurl,
64
- data: { 'action': 'woosea_add_identifiers', 'status': "off" }
65
  })
66
  }
67
  })
68
 
69
- // Check if user would like to fix the WooCommerce structured data bug
70
- $('#fix_json_ld').on('change', function(){ // on change of state
71
  if(this.checked){
 
72
  // Checkbox is on
73
  jQuery.ajax({
74
  method: "POST",
75
  url: ajaxurl,
76
- data: { 'action': 'woosea_enable_structured_data', 'status': "on" }
77
  })
78
  } else {
79
  // Checkbox is off
80
  jQuery.ajax({
81
  method: "POST",
82
  url: ajaxurl,
83
- data: { 'action': 'woosea_enable_structured_data', 'status': "off" }
84
  })
85
  }
86
  })
87
 
88
- // Check if user would like to create an AdTribes.io Support user account
89
- $('#grant_access').on('change', function(){ // on change of state
90
  if(this.checked){
 
91
  // Checkbox is on
92
  jQuery.ajax({
93
  method: "POST",
94
  url: ajaxurl,
95
- data: { 'action': 'woosea_create_support_user', 'status': "on" }
96
  })
 
 
 
 
 
 
97
  } else {
98
  // Checkbox is off
99
  jQuery.ajax({
100
  method: "POST",
101
  url: ajaxurl,
102
- data: { 'action': 'woosea_create_support_user', 'status': "off" }
103
  })
 
 
 
 
 
 
104
  }
105
  })
106
 
107
- $(".actions").delegate("span", "click", function() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  var id=$(this).attr('id');
110
  var idsplit = id.split('_');
111
  var project_hash = idsplit[1];
@@ -120,6 +229,24 @@ jQuery(document).ready(function($) {
120
  );
121
  }
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  if (action == "trash"){
124
 
125
  var popup_dialog = confirm("Are you sure you want to delete this feed?");
@@ -178,11 +305,46 @@ jQuery(document).ready(function($) {
178
  if(hash == project_hash){
179
  $(".woo-product-feed-pro-blink_off_"+hash).text(function () {
180
  $(this).addClass('woo-product-feed-pro-blink_me');
181
- return $(this).text().replace("ready", "processing");
 
182
  });
183
  }
184
  });
185
  }
186
  }
187
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  });
1
  jQuery(document).ready(function($) {
2
  var project_hash = null;
3
  var project_status = null;
4
+ var get_value = null;
5
+ var tab_value = null;
6
+
7
+ // make sure to only check the feed status on the woosea_manage_feed page
8
+ url = new URL(window.location.href);
9
+ if (url.searchParams.get('page')) {
10
+ get_value = url.searchParams.get('page');
11
+ }
12
+ if (url.searchParams.get('tab')) {
13
+ tab_value = url.searchParams.get('tab');
14
+ }
15
+
16
+ if (get_value == 'woosea_manage_feed') {
17
+ $(document).on('ready',function(){
18
+ myInterval = setInterval(woosea_check_perc,3000);
19
+ });
20
+ }
21
 
22
  $(".dismiss-review-notification").click(function(){
23
  $(".review-notification").remove();
40
  });
41
 
42
 
43
+ $("td[colspan=8]").find("div").parents("tr").hide();
44
 
45
  $('.checkbox-field').change(function(index, obj){
 
 
46
 
47
+ if(get_value == 'woosea_manage_settings' && tab_value == 'woosea_manage_attributes'){
48
+ var attribute_value = $(this).val();
49
+ var attribute_name = $(this).attr('name');
50
+ var attribute_status = $(this).prop("checked");
 
51
 
52
+ jQuery.ajax({
53
+ method: "POST",
54
+ url: ajaxurl,
55
+ data: { 'action': 'woosea_add_attributes', 'attribute_name': attribute_name, 'attribute_value': attribute_value, 'active': attribute_status }
56
+ })
57
+ } else if (get_value == 'woosea_manage_feed') {
58
+ project_hash = $(this).val();
59
+ project_status = $(this).prop("checked");
60
+
61
+ jQuery.ajax({
62
+ method: "POST",
63
+ url: ajaxurl,
64
+ data: { 'action': 'woosea_project_status', 'project_hash': project_hash, 'active': project_status }
65
+ })
66
+
67
+ $("table tbody").find('input[name="manage_record"]').each(function(){
68
+ var hash = this.value;
69
+ if(hash == project_hash){
70
+ if (project_status == false){
71
+ $(this).parents("tr").addClass('strikethrough');
72
+ } else {
73
+ $(this).parents("tr").removeClass('strikethrough');
74
+ }
75
+ }
76
+ });
77
+ } else {
78
+ // Do nothing, waste of resources
79
+ }
80
  });
81
 
82
+ // Check if user would like to enable WPML support
83
+ $('#add_wpml_support').on('change', function(){ // on change of state
84
  if(this.checked){
85
+
86
  // Checkbox is on
87
  jQuery.ajax({
88
  method: "POST",
89
  url: ajaxurl,
90
+ data: { 'action': 'woosea_add_wpml', 'status': "on" }
91
  })
92
  } else {
93
  // Checkbox is off
94
  jQuery.ajax({
95
  method: "POST",
96
  url: ajaxurl,
97
+ data: { 'action': 'woosea_add_wpml', 'status': "off" }
98
  })
99
  }
100
  })
101
 
102
+ // Check if user would like to use mother image for variations
103
+ $('#add_mother_image').on('change', function(){ // on change of state
104
  if(this.checked){
105
+
106
  // Checkbox is on
107
  jQuery.ajax({
108
  method: "POST",
109
  url: ajaxurl,
110
+ data: { 'action': 'woosea_add_mother_image', 'status': "on" }
111
  })
112
  } else {
113
  // Checkbox is off
114
  jQuery.ajax({
115
  method: "POST",
116
  url: ajaxurl,
117
+ data: { 'action': 'woosea_add_mother_image', 'status': "off" }
118
  })
119
  }
120
  })
121
 
122
+ // Check if user would like to enable Dynamic Remarketing
123
+ $('#add_remarketing').on('change', function(){ // on change of state
124
  if(this.checked){
125
+
126
  // Checkbox is on
127
  jQuery.ajax({
128
  method: "POST",
129
  url: ajaxurl,
130
+ data: { 'action': 'woosea_add_remarketing', 'status': "on" }
131
  })
132
+ .done(function( data ) {
133
+ $('#remarketing').after('<tr id="adwords_conversion_id"><td colspan="2"><span>Insert your Dynamic Remarketing Conversion tracking ID:</span>&nbsp;<input type="text" class="input-field-medium" id="adwords_conv_id" name="adwords_conv_id">&nbsp;<input type="submit" id="save_conversion_id" value="Save"></td></tr>');
134
+ })
135
+ .fail(function( data ) {
136
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
137
+ });
138
  } else {
139
  // Checkbox is off
140
  jQuery.ajax({
141
  method: "POST",
142
  url: ajaxurl,
143
+ data: { 'action': 'woosea_add_remarketing', 'status': "off" }
144
  })
145
+ .done(function( data ) {
146
+ $('#adwords_conversion_id').remove();
147
+ })
148
+ .fail(function( data ) {
149
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
150
+ });
151
  }
152
  })
153
 
154
+ // Add a mapping row to the table for field mappings
155
+ jQuery("#save_conversion_id").click(function(){
156
+ var adwords_conversion_id = $('#adwords_conv_id').val();
157
+ var re = /^[0-9]*$/;
158
+
159
+ var woosea_valid_conversion_id=re.test(adwords_conversion_id);
160
+ // Check for allowed characters
161
+ if (!woosea_valid_conversion_id){
162
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-conversion is-dismissible'><p>Sorry, only numbers are allowed for your Dynamic Remarketing Conversion tracking ID.</p></div>");
163
+ // Disable submit button too
164
+ $('#save_conversion_id').attr('disabled',true);
165
+ } else {
166
+ $('.woosea-notice-conversion').remove();
167
+ $('#save_conversion_id').attr('disabled',false);
168
+
169
+ // Now we need to save the conversion ID so we can use it in the dynamic remarketing JS
170
+ jQuery.ajax({
171
+ method: "POST",
172
+ url: ajaxurl,
173
+ data: { 'action': 'woosea_save_adwords_conversion_id', 'adwords_conversion_id': adwords_conversion_id }
174
+ })
175
+ }
176
+ })
177
 
178
+
179
+ // Check if user would like to add attributes
180
+ $('#add_identifiers').on('change', function(){ // on change of state
181
+ if(this.checked){
182
+ // Checkbox is on
183
+ jQuery.ajax({
184
+ method: "POST",
185
+ url: ajaxurl,
186
+ data: { 'action': 'woosea_add_identifiers', 'status': "on" }
187
+ })
188
+ } else {
189
+ // Checkbox is off
190
+ jQuery.ajax({
191
+ method: "POST",
192
+ url: ajaxurl,
193
+ data: { 'action': 'woosea_add_identifiers', 'status': "off" }
194
+ })
195
+ }
196
+ })
197
+
198
+ // Check if user would like to fix the WooCommerce structured data bug
199
+ $('#fix_json_ld').on('change', function(){ // on change of state
200
+ if(this.checked){
201
+ // Checkbox is on
202
+ jQuery.ajax({
203
+ method: "POST",
204
+ url: ajaxurl,
205
+ data: { 'action': 'woosea_enable_structured_data', 'status': "on" }
206
+ })
207
+ } else {
208
+ // Checkbox is off
209
+ jQuery.ajax({
210
+ method: "POST",
211
+ url: ajaxurl,
212
+ data: { 'action': 'woosea_enable_structured_data', 'status': "off" }
213
+ })
214
+ }
215
+ })
216
+
217
+ $(".actions").delegate("span", "click", function() {
218
  var id=$(this).attr('id');
219
  var idsplit = id.split('_');
220
  var project_hash = idsplit[1];
229
  );
230
  }
231
 
232
+ if (action == "copy"){
233
+
234
+ var popup_dialog = confirm("Are you sure you want to copy this feed?");
235
+ if (popup_dialog == true){
236
+ jQuery.ajax({
237
+ method: "POST",
238
+ url: ajaxurl,
239
+ data: { 'action': 'woosea_project_copy', 'project_hash': project_hash }
240
+ })
241
+
242
+ .done(function( data ) {
243
+ data = JSON.parse( data );
244
+ $('#woosea_main_table').append('<tr class><td>&nbsp;</td><td colspan="5"><span>The plugin is creating a new product feed now: <b><i>"' + data.projectname + '"</i></b>. Please refresh your browser to manage the copied product feed project.</span></span></td></tr>');
245
+ })
246
+ }
247
+ }
248
+
249
+
250
  if (action == "trash"){
251
 
252
  var popup_dialog = confirm("Are you sure you want to delete this feed?");
305
  if(hash == project_hash){
306
  $(".woo-product-feed-pro-blink_off_"+hash).text(function () {
307
  $(this).addClass('woo-product-feed-pro-blink_me');
308
+ myInterval = setInterval(woosea_check_perc,500);
309
+ return $(this).text().replace("ready", "processing (0%)");
310
  });
311
  }
312
  });
313
  }
314
  }
315
  });
316
+
317
+ function woosea_check_perc(){
318
+ // Check if we need to UP the processing percentage
319
+ $("table tbody").find('input[name="manage_record"]').each(function(){
320
+ var hash = this.value;
321
+
322
+ jQuery.ajax({
323
+ method: "POST",
324
+ url: ajaxurl,
325
+ data: { 'action': 'woosea_project_processing_status', 'project_hash': hash }
326
+ })
327
+
328
+ .done(function( data ) {
329
+ data = JSON.parse( data );
330
+
331
+ if(data.proc_perc < 100){
332
+ return $("#woosea_proc_"+hash).text("processing ("+data.proc_perc+"%)");
333
+ } else if(data.proc_perc == 100){
334
+ clearInterval(myInterval);
335
+ $("#woosea_proc_"+hash).removeClass('woo-product-feed-pro-blink_me');
336
+ return $("#woosea_proc_"+hash).text("ready");
337
+ } else if(data.proc_perc == 999){
338
+ // Do not do anything
339
+ } else {
340
+ clearInterval(myInterval);
341
+ $("#woosea_proc_"+hash).removeClass('woo-product-feed-pro-blink_me');
342
+ return $("#woosea_proc_"+hash).text("ready");
343
+ }
344
+ })
345
+ .fail(function( data ) {
346
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
347
+ });
348
+ });
349
+ }
350
  });
js/woosea_rules.js CHANGED
@@ -14,7 +14,23 @@ jQuery(document).ready(function($) {
14
  })
15
  .done(function( data ) {
16
  data = JSON.parse( data );
17
- $( '#woosea-ajax-table' ).append('<tr><td><input type="hidden" name="rules[' + data.rowCount + '][rowCount]" value="' + data.rowCount + '"><input type="checkbox" name="record" class="checkbox-field"></td><td><i>Standard filter:</i></td><td><select name="rules[' + data.rowCount + '][attribute]">' + data.dropdown + '</select></td><td><select name="rules[' + data.rowCount + '][condition]" class="select-field"><option value="contains">contains</option><option value="containsnot">does not contain</option><option value="=">is equal to</option><option value="!=">is not equal to</option><option value=">">is greater than</option><option value=">=">is greater or equal to</option><option value="<">is less than</option><option value="=<">is less or equal to</option><option value="empty">is empty</option></select></td><td><input type="text" name="rules[' + rowCount + '][criteria]" class="input-field-large"></td><td><input type="checkbox" name="rules[' + rowCount + '][cs]" class="checkbox-field" alt="Case sensitive"></td><td><select name="rules[' + rowCount + '][than]" class="select-field"><optgroup label="Action">Action:<option value="exclude"> Exclude</option><option value="include_only">Include only</option></optgroup></select></td><td>&nbsp;</td></tr>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  })
19
  .fail(function( data ) {
20
  console.log('Failed AJAX Call :( /// Return Data: ' + data);
@@ -23,6 +39,7 @@ jQuery(document).ready(function($) {
23
 
24
  // Add rules
25
  jQuery(".add-rule").click(function(){
 
26
  // Count amount of rows, used to create the form array field and values
27
  // var rowCount = $('#woosea-ajax-table >tbody >tr').length-1;
28
  var rowCount = Math.round(new Date().getTime() + (Math.random() * 100));
@@ -34,10 +51,33 @@ jQuery(document).ready(function($) {
34
  })
35
  .done(function( data ) {
36
  data = JSON.parse( data );
37
- $( '#woosea-ajax-table' ).append('<tr><td><input type="hidden" name="rules2[' + data.rowCount + '][rowCount]" value="' + data.rowCount + '"><input type="checkbox" name="record" class="checkbox-field"></td><td><i>Rule:</i></td><td><select name="rules2[' + data.rowCount + '][attribute]" class="select-field">' + data.dropdown + '</select></td><td><select name="rules2[' + data.rowCount + '][condition]" class="select-field"><option value="contains">contains</option><option value="containsnot">does not contain</option><option value="=">is equal to</option><option value="!=">is not equal to</option><option value=">">is greater than</option><option value=">=">is greater or equal to</option><option value="<">is less than</option><option value="=<">is less or equal to</option><option value="empty">is empty</option></select></td><td><input type="text" name="rules2[' + rowCount + '][criteria]" class="input-field-large"></td><td><input type="checkbox" name="rules2[' + rowCount + '][cs]" class="checkbox-field" alt="Case sensitive"></td><td><select name="rules2[' + data.rowCount + '][than_attribute]" class="select-field" id="than_attribute_' + rowCount +'" style="width:150px;">' + data.dropdown + '</select> </td><td><input type="text" name="rules2[' + rowCount + '][newvalue]" class="input-field-large" id="is-field_' + rowCount +'"></td></tr>');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  // Check if user created a Google category rule
40
  jQuery("#than_attribute_" + rowCount).on("change", function(){
 
41
  if ($(this).val() == "google_category") {
42
  var rownr = $(this).closest("tr").prevAll("tr").length;
43
 
14
  })
15
  .done(function( data ) {
16
  data = JSON.parse( data );
17
+ $( '#woosea-ajax-table' ).append('<tr><td><input type="hidden" name="rules[' + data.rowCount + '][rowCount]" value="' + data.rowCount + '"><input type="checkbox" name="record" class="checkbox-field"></td><td><i>Standard filter:</i></td><td><select name="rules[' + data.rowCount + '][attribute]" id="rules_' + data.rowCount + '">' + data.dropdown + '</select></td><td><select name="rules[' + data.rowCount + '][condition]" class="select-field"><option value="contains">contains</option><option value="containsnot">does not contain</option><option value="=">is equal to</option><option value="!=">is not equal to</option><option value=">">is greater than</option><option value=">=">is greater or equal to</option><option value="<">is less than</option><option value="=<">is less or equal to</option><option value="empty">is empty</option></select></td><td><input type="text" name="rules[' + rowCount + '][criteria]" class="input-field-large" id="criteria_' + data.rowCount + '"></td><td><input type="checkbox" name="rules[' + rowCount + '][cs]" class="checkbox-field" alt="Case sensitive"></td><td><select name="rules[' + rowCount + '][than]" class="select-field"><optgroup label="Action">Action:<option value="exclude"> Exclude</option><option value="include_only">Include only</option></optgroup></select></td><td>&nbsp;</td></tr>');
18
+
19
+ // Check if user selected a data manipulation condition
20
+ jQuery("#rules_" + rowCount).on("change", function(){
21
+ if ($(this).val() == "categories") {
22
+ jQuery.ajax({
23
+ method: "POST",
24
+ url: ajaxurl,
25
+ data: { 'action': 'woosea_categories_dropdown', 'rowCount': rowCount }
26
+ })
27
+
28
+ .done(function( data ) {
29
+ data = JSON.parse( data );
30
+ jQuery("#criteria_" + rowCount).replaceWith('' + data.dropdown + '');
31
+ });
32
+ }
33
+ });
34
  })
35
  .fail(function( data ) {
36
  console.log('Failed AJAX Call :( /// Return Data: ' + data);
39
 
40
  // Add rules
41
  jQuery(".add-rule").click(function(){
42
+
43
  // Count amount of rows, used to create the form array field and values
44
  // var rowCount = $('#woosea-ajax-table >tbody >tr').length-1;
45
  var rowCount = Math.round(new Date().getTime() + (Math.random() * 100));
51
  })
52
  .done(function( data ) {
53
  data = JSON.parse( data );
54
+ $( '#woosea-ajax-table' ).append('<tr><td><input type="hidden" name="rules2[' + data.rowCount + '][rowCount]" value="' + data.rowCount + '"><input type="checkbox" name="record" class="checkbox-field"></td><td><i>Rule:</i></td><td><select name="rules2[' + data.rowCount + '][attribute]" class="select-field">' + data.dropdown + '</select></td><td><select name="rules2[' + data.rowCount + '][condition]" class="select-field" id="condition_' + data.rowCount + '""><option value="contains">contains</option><option value="containsnot">does not contain</option><option value="=">is equal to</option><option value="!=">is not equal to</option><option value=">">is greater than</option><option value=">=">is greater or equal to</option><option value="<">is less than</option><option value="=<">is less or equal to</option><option value="empty">is empty</option><option value="multiply">multiply</option><option value="divide">divide</option><option value="plus">plus</option><option value="minus">minus</option><option value="replace">replace</option></select></td><td><input type="text" name="rules2[' + rowCount + '][criteria]" class="input-field-large"></td><td><input type="checkbox" name="rules2[' + rowCount + '][cs]" class="checkbox-field" alt="Case sensitive" id="cs_' + data.rowCount + '"></td><td><select name="rules2[' + data.rowCount + '][than_attribute]" class="select-field" id="than_attribute_' + rowCount +'" style="width:150px;">' + data.dropdown + '</select> </td><td><input type="text" name="rules2[' + rowCount + '][newvalue]" class="input-field-large" id="is-field_' + rowCount +'"></td></tr>');
55
+
56
+ // Check if user selected a data manipulation condition
57
+ jQuery("#condition_" + rowCount).on("change", function(){
58
+
59
+ var manipulators = ['multiply', 'divide', 'plus', 'minus'];
60
+ var cond = $(this).val();
61
+
62
+ // User selected a data manipulation value so remove some input fields
63
+ if(jQuery.inArray(cond, manipulators) != -1){
64
+ jQuery("#than_attribute_" + rowCount).remove();
65
+ jQuery("#is-field_" + rowCount).remove();
66
+ jQuery("#cs_" + rowCount).remove();
67
+ }
68
+
69
+ // Replace pieces of string
70
+ var modifiers = ['replace'];
71
+ if(jQuery.inArray(cond, modifiers) != -1){
72
+ jQuery("#than_attribute_" + rowCount).remove();
73
+ jQuery("#cs_" + rowCount).remove();
74
+ }
75
+ });
76
+
77
 
78
  // Check if user created a Google category rule
79
  jQuery("#than_attribute_" + rowCount).on("change", function(){
80
+
81
  if ($(this).val() == "google_category") {
82
  var rownr = $(this).closest("tr").prevAll("tr").length;
83
 
js/woosea_validation.js CHANGED
@@ -3,16 +3,179 @@ jQuery(document).ready(function($) {
3
  // Disable submit button, will only enable if all fields validate
4
  $('#goforit').attr('disabled',true);
5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  // Validate project name
7
  $( "#projectname" ).blur("input", function(){
8
  var input=$(this);
9
- var re = /^[a-zA-Z0-9-_. ]*$/;
10
  var minLength = 3;
11
  var maxLength = 30;
12
  var is_projectname=re.test(input.val());
13
  // Check for allowed characters
14
  if (!is_projectname){
15
- $('.notice').replaceWith("<div class='notice notice-error is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed.</p></div>");
16
  // Disable submit button too
17
  $('#goforit').attr('disabled',true);
18
  } else {
3
  // Disable submit button, will only enable if all fields validate
4
  $('#goforit').attr('disabled',true);
5
 
6
+ // Validate woosea installment months
7
+ $( "#_woosea_installment_months" ).blur("input", function(){
8
+ var input=$(this);
9
+ var re = /^[0-9]*$/;
10
+ var woosea_installment_months=re.test(input.val());
11
+ // Check for allowed characters
12
+ if (!woosea_installment_months){
13
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-month is-dismissible'><p>Sorry, only numbers are allowed for the installment month field.</p></div>");
14
+ // Disable submit button too
15
+ $('#publish').attr('disabled',true);
16
+ } else {
17
+ $('.woosea-notice-month').remove();
18
+ $('#publish').attr('disabled',false);
19
+ }
20
+ });
21
+
22
+ // Validate woosea installment amount
23
+ $( "#_woosea_installment_amount" ).blur("input", function(){
24
+ var input=$(this);
25
+ var re = /^[0-9]*$/;
26
+ var woosea_installment_amount=re.test(input.val());
27
+ // Check for allowed characters
28
+ if (!woosea_installment_amount){
29
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-amount is-dismissible'><p>Sorry, only numbers are allowed for the installment amount field.</p></div>");
30
+ // Disable submit button too
31
+ $('#publish').attr('disabled',true);
32
+ } else {
33
+ $('.woosea-notice-amount').remove();
34
+ $('#publish').attr('disabled',false);
35
+ }
36
+ });
37
+
38
+ // Validate woosea GTIN field
39
+ $( "#_woosea_gtin" ).blur("input", function(){
40
+ var input=$(this);
41
+ var re = /^[0-9]*$/;
42
+ var woosea_gtin=re.test(input.val());
43
+ // Check for allowed characters
44
+ if (!woosea_gtin){
45
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-gtin is-dismissible'><p>Sorry, only numbers are allowed for the GTIN field.</p></div>");
46
+ // Disable submit button too
47
+ $('#publish').attr('disabled',true);
48
+ } else {
49
+ $('.woosea-notice-gtin').remove();
50
+ $('#publish').attr('disabled',false);
51
+ }
52
+ });
53
+
54
+ // Validate woosea MPN field
55
+ $( "#_woosea_mpn" ).blur("input", function(){
56
+ var input=$(this);
57
+ var re = /^[a-zA-Z0-9-_]*$/;
58
+ var woosea_mpn=re.test(input.val());
59
+ // Check for allowed characters
60
+ if (!woosea_mpn){
61
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-mpn is-dismissible'><p>Sorry, only numbers are allowed for the MPN field.</p></div>");
62
+ // Disable submit button too
63
+ $('#publish').attr('disabled',true);
64
+ } else {
65
+ $('.woosea-notice-mpn').remove();
66
+ $('#publish').attr('disabled',false);
67
+ }
68
+ });
69
+
70
+ // Validate woosea UPC field
71
+ $( "#_woosea_upc" ).blur("input", function(){
72
+ var input=$(this);
73
+ var re = /^[0-9]*$/;
74
+ var woosea_upc=re.test(input.val());
75
+ // Check for allowed characters
76
+ if (!woosea_upc){
77
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-upc is-dismissible'><p>Sorry, only numbers are allowed for the UPC field.</p></div>");
78
+ // Disable submit button too
79
+ $('#publish').attr('disabled',true);
80
+ } else {
81
+ $('.woosea-notice-upc').remove();
82
+ $('#publish').attr('disabled',false);
83
+ }
84
+ });
85
+
86
+ // Validate woosea EAN field
87
+ $( "#_woosea_ean" ).blur("input", function(){
88
+ var input=$(this);
89
+ var re = /^[0-9]*$/;
90
+ var woosea_ean=re.test(input.val());
91
+ // Check for allowed characters
92
+ if (!woosea_ean){
93
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-ean is-dismissible'><p>Sorry, only numbers are allowed for the EAN field.</p></div>");
94
+ // Disable submit button too
95
+ $('#publish').attr('disabled',true);
96
+ } else {
97
+ $('.woosea-notice-ean').remove();
98
+ $('#publish').attr('disabled',false);
99
+ }
100
+ });
101
+
102
+ // Validate woosea Brand field
103
+ $( "#_woosea_brand" ).blur("input", function(){
104
+ var input=$(this);
105
+ var re = /^[a-zA-Z0-9-_. ]*$/;
106
+ var woosea_brand=re.test(input.val());
107
+ // Check for allowed characters
108
+ if (!woosea_brand){
109
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-brand is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed for the brand field.</p></div>");
110
+ // Disable submit button too
111
+ $('#publish').attr('disabled',true);
112
+ } else {
113
+ $('.woosea-notice-brand').remove();
114
+ $('#publish').attr('disabled',false);
115
+ }
116
+ });
117
+
118
+ // Validate woosea unit pricing base measure field
119
+ $( "#_woosea_unit_pricing_base_measure" ).blur("input", function(){
120
+ var input=$(this);
121
+ var re = /^[a-zA-Z0-9-_. ]*$/;
122
+ var woosea_unit_pricing_base_measure=re.test(input.val());
123
+ // Check for allowed characters
124
+ if (!woosea_unit_pricing_base_measure){
125
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-unit-pricing-base-measure is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed for the unit pricing base measure field.</p></div>");
126
+ // Disable submit button too
127
+ $('#publish').attr('disabled',true);
128
+ } else {
129
+ $('.woosea-notice-unit-pricing-base-measure').remove();
130
+ $('#publish').attr('disabled',false);
131
+ }
132
+ });
133
+
134
+ // Validate woosea unit pricing measure field
135
+ $( "#_woosea_unit_pricing_measure" ).blur("input", function(){
136
+ var input=$(this);
137
+ var re = /^[a-zA-Z0-9-_. ]*$/;
138
+ var woosea_unit_pricing_measure=re.test(input.val());
139
+ // Check for allowed characters
140
+ if (!woosea_unit_pricing_measure){
141
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-unit-pricing-measure is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed for the unit pricing measure field.</p></div>");
142
+ // Disable submit button too
143
+ $('#publish').attr('disabled',true);
144
+ } else {
145
+ $('.woosea-notice-unit-pricing-measure').remove();
146
+ $('#publish').attr('disabled',false);
147
+ }
148
+ });
149
+
150
+
151
+
152
+
153
+ // Validate woosea Optimized title field
154
+ $( "#_woosea_optimized_title" ).blur("input", function(){
155
+ var input=$(this);
156
+ var re = /^[AaĄąBbCcĆćDdEeĘęFfGgHhIiJjKkLlŁłMmNnŃńOoÓóPpRrSsŚśTtUuWwYyZzŹźŻża-zA-Z0-9-_.àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ ]*$/;
157
+ var woosea_optimized_title=re.test(input.val());
158
+ // Check for allowed characters
159
+ if (!woosea_optimized_title){
160
+ $('.notice').replaceWith("<div class='notice notice-error woosea-notice-optimized-title is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed for the optimized title field.</p></div>");
161
+ // Disable submit button too
162
+ $('#publish').attr('disabled',true);
163
+ } else {
164
+ $('.woosea-notice-optimized-title').remove();
165
+ $('#publish').attr('disabled',false);
166
+ }
167
+ });
168
+
169
  // Validate project name
170
  $( "#projectname" ).blur("input", function(){
171
  var input=$(this);
172
+ var re = /^[a-zA-Z0-9-_.àèìòùÀÈÌÒÙáéíóúýÁÉÍÓÚÝâêîôûÂÊÎÔÛãñõÃÑÕäëïöüÿÄËÏÖÜŸçÇßØøÅåÆæœ ]*$/;
173
  var minLength = 3;
174
  var maxLength = 30;
175
  var is_projectname=re.test(input.val());
176
  // Check for allowed characters
177
  if (!is_projectname){
178
+ $('.notice').replaceWith("<div class='notice notice-error is-dismissible'><p>Sorry, only letters, numbers, whitespaces, -, . and _ are allowed for the projectname</p></div>");
179
  // Disable submit button too
180
  $('#goforit').attr('disabled',true);
181
  } else {
pages/admin/woosea-generate-feed-step-0.php CHANGED
@@ -18,6 +18,8 @@ $versions = array (
18
  "WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
19
  );
20
 
 
 
21
  $notifications_obj = new WooSEA_Get_Admin_Notifications;
22
  if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
23
  $notifications_box = $notifications_obj->get_admin_notifications ( "9", "false" );
@@ -28,6 +30,11 @@ if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
28
  $locale = apply_filters( 'woocommerce_countries_base_country', $default['country'] );
29
  }
30
 
 
 
 
 
 
31
  if ($versions['PHP'] < 5.6){
32
  $notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
33
  }
@@ -69,16 +76,6 @@ if (array_key_exists('project_hash', $_GET)){
69
 
70
  <div class="woo-product-feed-pro-form-style-2-heading">File name, format and channel</div>
71
 
72
- <?php
73
- if(!isset($manage_project)){
74
- ?>
75
- <div class="<?php _e($notifications_box['message_type']); ?>">
76
- <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
77
- </div>
78
- <?php
79
- }
80
- ?>
81
-
82
  <form action="" id="myForm" method="post" name="myForm">
83
 
84
  <div class="woo-product-feed-pro-table-wrapper">
@@ -101,6 +98,55 @@ if (array_key_exists('project_hash', $_GET)){
101
  </div>
102
  </td>
103
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  <tr>
105
  <td><span>Country:</span></td>
106
  <td>
@@ -324,17 +370,34 @@ if (array_key_exists('project_hash', $_GET)){
324
  <tr>
325
  <td>
326
  Need assistance? Check out our:
327
- <ul>
328
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
329
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
330
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
331
- <li><strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite</a></strong></li>
332
  </ul>
333
- Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
334
  </td>
335
  </tr>
336
  </table><br/>
337
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
338
  <table class="woo-product-feed-pro-table">
339
  <tr>
340
  <td><strong>Why upgrade to Elite?</strong></td>
@@ -343,18 +406,19 @@ if (array_key_exists('project_hash', $_GET)){
343
  <td>
344
  Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
345
  <ul>
346
- <li><strong>1.</strong> More products approved by Google</li>
347
- <li><strong>2.</strong> Add GTIN, brand and more fields to your store</li>
348
- <li><strong>3.</strong> Exclude individual products from your feeds</li>
349
- <li><strong>4.</strong> Priority support</li>
350
- </ul>
 
351
  <strong>
352
  <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
353
  </strong>
354
  </td>
355
  </tr>
356
  </table><br/>
357
-
358
  </div>
359
  </div>
360
 
18
  "WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
19
  );
20
 
21
+ $license_information = get_option( 'license_information' );
22
+
23
  $notifications_obj = new WooSEA_Get_Admin_Notifications;
24
  if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
25
  $notifications_box = $notifications_obj->get_admin_notifications ( "9", "false" );
30
  $locale = apply_filters( 'woocommerce_countries_base_country', $default['country'] );
31
  }
32
 
33
+ if($license_information['notice'] == "true"){
34
+ $notifications_box['message_type'] = $license_information['message_type'];
35
+ $notifications_box['message'] = $license_information['message'];
36
+ }
37
+
38
  if ($versions['PHP'] < 5.6){
39
  $notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
40
  }
76
 
77
  <div class="woo-product-feed-pro-form-style-2-heading">File name, format and channel</div>
78
 
 
 
 
 
 
 
 
 
 
 
79
  <form action="" id="myForm" method="post" name="myForm">
80
 
81
  <div class="woo-product-feed-pro-table-wrapper">
98
  </div>
99
  </td>
100
  </tr>
101
+ <?php
102
+
103
+ if ( function_exists('icl_object_id') ) {
104
+
105
+ $add_wpml_support = get_option ('add_wpml_support');
106
+ if($add_wpml_support == "yes"){
107
+ // Adding WPML support here
108
+ $my_current_lang = apply_filters( 'wpml_current_language', NULL );
109
+
110
+ global $sitepress;
111
+ $list_lang = $sitepress->get_active_languages();
112
+ $nr_lang = count($list_lang);
113
+
114
+ if($nr_lang > 0){
115
+ if (isset($manage_project)){
116
+ print "<tr>";
117
+ print "<td><span>WPML Language:</span></td>";
118
+ print "<td>";
119
+ print "<select name=\"WPML\" disabled>";
120
+ foreach ($list_lang as $key => $value){
121
+ if($key == $project['WPML']){
122
+ print "<option value=\"$key\" selected>$value[english_name]</option>";
123
+ } else {
124
+ print "<option value=\"$key\">$value[english_name]</option>";
125
+ }
126
+ }
127
+ print "</select>";
128
+ print "</td>";
129
+ print "</tr>";
130
+ } else {
131
+ print "<tr>";
132
+ print "<td><span>WPML Language:</span></td>";
133
+ print "<td>";
134
+ print "<select name=\"WPML\">";
135
+ foreach ($list_lang as $key => $value){
136
+ if($key == $my_current_lang){
137
+ print "<option value=\"$key\" selected>$value[english_name]</option>";
138
+ } else {
139
+ print "<option value=\"$key\">$value[english_name]</option>";
140
+ }
141
+ }
142
+ print "</select>";
143
+ print "</td>";
144
+ print "</tr>";
145
+ }
146
+ }
147
+ }
148
+ }
149
+ ?>
150
  <tr>
151
  <td><span>Country:</span></td>
152
  <td>
370
  <tr>
371
  <td>
372
  Need assistance? Check out our:
373
+ <ul>
374
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
375
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
376
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
 
377
  </ul>
 
378
  </td>
379
  </tr>
380
  </table><br/>
381
 
382
+ <table class="woo-product-feed-pro-table">
383
+ <tr>
384
+ <td><strong>Our latest blog articles</strong></td>
385
+ </tr>
386
+ <tr>
387
+ <td>
388
+ <ul>
389
+ <li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
390
+ <li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
391
+ <li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
392
+ <li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
393
+ <li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
394
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
395
+ </ul>
396
+ </td>
397
+ </tr>
398
+ </table><br/>
399
+
400
+ <!--
401
  <table class="woo-product-feed-pro-table">
402
  <tr>
403
  <td><strong>Why upgrade to Elite?</strong></td>
406
  <td>
407
  Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
408
  <ul>
409
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
410
+ <li><strong>2.</strong> More products approved by Google</li>
411
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
412
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
413
+ <li><strong>5.</strong> WPML support</li>
414
+ </ul>
415
  <strong>
416
  <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
417
  </strong>
418
  </td>
419
  </tr>
420
  </table><br/>
421
+ -->
422
  </div>
423
  </div>
424
 
pages/admin/woosea-generate-feed-step-1.php CHANGED
@@ -20,9 +20,27 @@ if (array_key_exists('project_hash', $_GET)){
20
  $project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
21
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
22
  $manage_project = "yes";
 
 
 
 
 
 
 
 
 
23
  } else {
24
  $project = WooSEA_Update_Project::update_project($_POST);
25
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
  function woosea_hierarchical_term_tree($category, $prev_mapped){
@@ -48,16 +66,16 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
48
  if (array_key_exists($woo_category, $prev_mapped)){
49
  $mapped_category = $prev_mapped[$woo_category];
50
  $mapped_active_class = "input-field-large-active";
51
- }
52
 
53
  if($sub_category->parent == 0){
54
  $r .= "<tr>";
55
- $r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value=\"$woo_category\">$woo_category ($sub_category->count)</td>";
56
  $r .= "<td><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></td>";
57
  $r .= "</tr>";
58
  } else {
59
  $r .= "<tr>";
60
- $r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value=\"$woo_category\">-- $woo_category ($sub_category->count)</td>";
61
  $r .= "<td><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></td>";
62
  $r .= "</tr>";
63
  }
@@ -143,14 +161,33 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
143
  <td>
144
  Need assistance? Check out our:
145
  <ul>
146
- <li><strong><a href="https://adtribes.io/support/" target="_blank">F.A.Q.</a></strong></li>
147
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  </ul>
149
- Or just reach out to us at <a href="mailto:support@adtribes.io">support@adtribes.io</a> and we'll make sure your product feeds will be up-and-running within no-time.
150
  </td>
151
  </tr>
152
  </table><br/>
153
 
 
154
  <table class="woo-product-feed-pro-table">
155
  <tr>
156
  <td><strong>Upgrade to Elite</strong></td>
@@ -168,6 +205,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
168
  </td>
169
  </tr>
170
  </table><br/>
 
171
  </div>
172
  </div>
173
  </div>
20
  $project = WooSEA_Update_Project::get_project_data(sanitize_text_field($_GET['project_hash']));
21
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
22
  $manage_project = "yes";
23
+
24
+ if(isset($project['WPML'])){
25
+ if ( function_exists('icl_object_id') ) {
26
+ // Get WPML language
27
+ global $sitepress;
28
+ $lang = $project['WPML'];
29
+ $sitepress->switch_lang($lang);
30
+ }
31
+ }
32
  } else {
33
  $project = WooSEA_Update_Project::update_project($_POST);
34
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
35
+
36
+ if(isset($project['WPML'])){
37
+ if ( function_exists('icl_object_id') ) {
38
+ // Get WPML language
39
+ global $sitepress;
40
+ $lang = $project['WPML'];
41
+ $sitepress->switch_lang($lang);
42
+ }
43
+ }
44
  }
45
 
46
  function woosea_hierarchical_term_tree($category, $prev_mapped){
66
  if (array_key_exists($woo_category, $prev_mapped)){
67
  $mapped_category = $prev_mapped[$woo_category];
68
  $mapped_active_class = "input-field-large-active";
69
+ }
70
 
71
  if($sub_category->parent == 0){
72
  $r .= "<tr>";
73
+ $r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value='$woo_category'>$woo_category ($sub_category->count)</td>";
74
  $r .= "<td><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></td>";
75
  $r .= "</tr>";
76
  } else {
77
  $r .= "<tr>";
78
+ $r .= "<td><input type=\"hidden\" name=\"mappings[$x][rowCount]\" value=\"$x\"><input type=\"hidden\" name=\"mappings[$x][categoryId]\" value=\"$woo_category_id\"><input type=\"hidden\" name=\"mappings[$x][criteria]\" class=\"input-field-large\" id=\"$woo_category_id\" value='$woo_category'>-- $woo_category ($sub_category->count)</td>";
79
  $r .= "<td><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></td>";
80
  $r .= "</tr>";
81
  }
161
  <td>
162
  Need assistance? Check out our:
163
  <ul>
164
+ <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
165
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
166
+ <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
167
+ </ul>
168
+ </td>
169
+ </tr>
170
+ </table><br/>
171
+
172
+ <table class="woo-product-feed-pro-table">
173
+ <tr>
174
+ <td><strong>Our latest blog articles</strong></td>
175
+ </tr>
176
+ <tr>
177
+ <td>
178
+ <ul>
179
+ <li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
180
+ <li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
181
+ <li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
182
+ <li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
183
+ <li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
184
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
185
  </ul>
 
186
  </td>
187
  </tr>
188
  </table><br/>
189
 
190
+ <!--
191
  <table class="woo-product-feed-pro-table">
192
  <tr>
193
  <td><strong>Upgrade to Elite</strong></td>
205
  </td>
206
  </tr>
207
  </table><br/>
208
+ -->
209
  </div>
210
  </div>
211
  </div>
pages/admin/woosea-generate-feed-step-4.php CHANGED
@@ -279,6 +279,28 @@ if (array_key_exists('project_hash', $_GET)){
279
  } else {
280
  print "<option value=\"empty\">is empty</option>";
281
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
282
  ?>
283
  </select>
284
  </td>
@@ -287,30 +309,39 @@ if (array_key_exists('project_hash', $_GET)){
287
  <input type="text" id="rulevalue" name="rules2[<?php print "$rule2_key";?>][criteria]" class="input-field-large" value="<?php print "$criteria";?>">
288
  </div>
289
  </td>
290
- <td>
291
- <?php
292
- if (isset($project['rules2'][$rule2_key]['cs'])){
293
- print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\" checked>";
294
- } else {
295
- print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\">";
296
- }
297
  ?>
298
- </td>
299
- <td>
300
- <select name="rules2[<?php print "$rule2_key";?>][than_attribute]" class="select-field" style="width:150px;">
301
- <option></option>
302
  <?php
303
- foreach ($attributes as $k => $v){
304
- if (isset($project['rules2'][$rule2_key]['than_attribute']) AND ($project['rules2'][$rule2_key]['than_attribute'] == $k)){
305
- print "<option value=\"$k\" selected>$v</option>";
306
- } else {
307
- print "<option value=\"$k\">$v</option>";
308
- }
309
  }
310
  ?>
311
- </select>
312
- </td>
313
- <td><input type="text" name="rules2[<?php print "$rule2_key";?>][newvalue]" class="input-field-large" value="<?php print "$newvalue";?>"></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  </tr>
315
  <?php
316
  }
279
  } else {
280
  print "<option value=\"empty\">is empty</option>";
281
  }
282
+
283
+ // Data manipulators
284
+ if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "multiply")){
285
+ print "<option value=\"multiply\" selected>multiply</option>";
286
+ } else {
287
+ print "<option value=\"multiply\">multiply</option>";
288
+ }
289
+ if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "divide")){
290
+ print "<option value=\"divide\" selected>divide</option>";
291
+ } else {
292
+ print "<option value=\"divide\">divide</option>";
293
+ }
294
+ if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "plus")){
295
+ print "<option value=\"plus\" selected>plus</option>";
296
+ } else {
297
+ print "<option value=\"plus\">plus</option>";
298
+ }
299
+ if (isset($project['rules2'][$rule2_key]['condition']) AND ($project['rules2'][$rule2_key]['condition'] == "minus")){
300
+ print "<option value=\"minus\" selected>minus</option>";
301
+ } else {
302
+ print "<option value=\"minus\">minus</option>";
303
+ }
304
  ?>
305
  </select>
306
  </td>
309
  <input type="text" id="rulevalue" name="rules2[<?php print "$rule2_key";?>][criteria]" class="input-field-large" value="<?php print "$criteria";?>">
310
  </div>
311
  </td>
312
+ <?php
313
+ $manipulators = array('multiply','divide','plus','minus');
314
+ if (in_array($project['rules2'][$rule2_key]['condition'], $manipulators)){
315
+ print "<td colspan=3></td>";
316
+ } else {
 
 
317
  ?>
318
+ <td>
 
 
 
319
  <?php
320
+ if (isset($project['rules2'][$rule2_key]['cs'])){
321
+ print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\" checked>";
322
+ } else {
323
+ print "<input type=\"checkbox\" name=\"rules2[$rule2_key][cs]\" class=\"checkbox-field\" alt=\"Case sensitive\">";
 
 
324
  }
325
  ?>
326
+ </td>
327
+ <td>
328
+ <select name="rules2[<?php print "$rule2_key";?>][than_attribute]" class="select-field" style="width:150px;">
329
+ <option></option>
330
+ <?php
331
+ foreach ($attributes as $k => $v){
332
+ if (isset($project['rules2'][$rule2_key]['than_attribute']) AND ($project['rules2'][$rule2_key]['than_attribute'] == $k)){
333
+ print "<option value=\"$k\" selected>$v</option>";
334
+ } else {
335
+ print "<option value=\"$k\">$v</option>";
336
+ }
337
+ }
338
+ ?>
339
+ </select>
340
+ </td>
341
+ <td><input type="text" name="rules2[<?php print "$rule2_key";?>][newvalue]" class="input-field-large" value="<?php print "$newvalue";?>"></td>
342
+ <?php
343
+ }
344
+ ?>
345
  </tr>
346
  <?php
347
  }
pages/admin/woosea-generate-feed-step-7.php CHANGED
@@ -27,9 +27,27 @@ if (array_key_exists('project_hash', $_GET)){
27
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
28
  $count_mappings = count($project['attributes']);
29
  $manage_project = "yes";
 
 
 
 
 
 
 
 
 
30
  } else {
31
  $project = WooSEA_Update_Project::update_project($_POST);
32
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  /**
27
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_GET['channel_hash']));
28
  $count_mappings = count($project['attributes']);
29
  $manage_project = "yes";
30
+
31
+ if(isset($project['WPML'])){
32
+ if ( function_exists('icl_object_id') ) {
33
+ // Get WPML language
34
+ global $sitepress;
35
+ $lang = $project['WPML'];
36
+ $sitepress->switch_lang($lang);
37
+ }
38
+ }
39
  } else {
40
  $project = WooSEA_Update_Project::update_project($_POST);
41
  $channel_data = WooSEA_Update_Project::get_channel_data(sanitize_text_field($_POST['channel_hash']));
42
+
43
+ if(isset($project['WPML'])){
44
+ if ( function_exists('icl_object_id') ) {
45
+ // Get WPML language
46
+ global $sitepress;
47
+ $lang = $project['WPML'];
48
+ $sitepress->switch_lang($lang);
49
+ }
50
+ }
51
  }
52
 
53
  /**
pages/admin/woosea-key.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $plugin_settings = get_option( 'plugin_settings' );
3
+ $license_information = get_option( 'license_information' );
4
+
5
+ print "<pre>";
6
+ print_r($license_information, TRUE);
7
+ print "</pre>";
8
+
9
+
10
+ $domain = $_SERVER['HTTP_HOST'];
11
+ $error = "false";
12
+ $plugin_data = get_plugin_data( __FILE__ );
13
+
14
+ $versions = array (
15
+ "PHP" => (float)phpversion(),
16
+ "Wordpress" => get_bloginfo('version'),
17
+ "WooCommerce" => WC()->version,
18
+ "WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
19
+ );
20
+
21
+ // When license has not been checked yet
22
+ if(empty($license_information['message'])){
23
+ $license_information['message'] = "You did not purchase a license for our Elite features yet. The structured data fix feature and adding of extra Google Shopping fields to your store can be enabled if you upgrade. Please purchase a license key on <a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">AdTribes.io</a> when you would like to use the Elite features.";
24
+ $license_information['message_type'] = "notice notice-info is-dismissible";
25
+ $license_information['license_key'] = "";
26
+ $license_information['license_email'] = "";
27
+ }
28
+
29
+ /**
30
+ * Create notification object and get message and message type as WooCommerce is inactive
31
+ * also set variable allowed on 0 to disable submit button on step 1 of configuration
32
+ */
33
+ $notifications_obj = new WooSEA_Get_Admin_Notifications;
34
+ if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
35
+ $notifications_box = $notifications_obj->get_admin_notifications ( '9', 'false' );
36
+ } else {
37
+ $notifications_box = $notifications_obj->get_admin_notifications ( '14', 'false' );
38
+ }
39
+
40
+ if ($versions['PHP'] < 5.6){
41
+ $notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
42
+ }
43
+
44
+ if ($versions['WooCommerce'] < 3){
45
+ $notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
46
+ }
47
+
48
+ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
49
+ $notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
50
+ }
51
+ ?>
52
+
53
+ <div id="dialog" title="Basic dialog">
54
+ <p>
55
+ <div id="dialogText"></div>
56
+ </p>
57
+ </div>
58
+
59
+ <div class="wrap">
60
+ <div class="woo-product-feed-pro-form-style-2">
61
+ <tbody class="woo-product-feed-pro-body">
62
+ <div class="woo-product-feed-pro-form-style-2-heading">Upgrade to Elite</div>
63
+ <div class="<?php _e($license_information['message_type']); ?>">
64
+ <p><?php _e($license_information['message'], 'sample-text-domain' ); ?></p>
65
+ </div>
66
+
67
+ <div class="woo-product-feed-pro-table-wrapper">
68
+ <div class="woo-product-feed-pro-table-left">
69
+
70
+ <table class="woo-product-feed-pro-table">
71
+ <tr>
72
+ <td>
73
+ <span>License e-mail:</span>
74
+ </td>
75
+ <td>
76
+ <input type="text" class="input-field-large" id="license-email" name="license-email" value="<?php print "$license_information[license_email]";?>">
77
+ </td>
78
+ </tr>
79
+ <tr>
80
+ <td>
81
+ <span>License key:</span>
82
+ </td>
83
+ <td>
84
+ <input type="text" class="input-field-large" id="license-key" name="license-key" value="<?php print "$license_information[license_key]";?>">
85
+ </td>
86
+ </tr>
87
+ <tr>
88
+ <td colspan="2"><span class="ui-icon ui-icon-alert"></span> <i>Please note that we will automatically validate your license once a day.</i></td>
89
+ </tr>
90
+ <tr>
91
+ <td colspan="2">
92
+ <input type="submit" id="checklicense" value="Activate license">
93
+ <input type="submit" id="deactivate_license" value="Deactivate license">
94
+ </td>
95
+ </tr>
96
+
97
+ </table>
98
+ </div>
99
+
100
+ <div class="woo-product-feed-pro-table-right">
101
+
102
+ <table class="woo-product-feed-pro-table">
103
+ <tr>
104
+ <td><strong>We’ve got you covered!</strong></td>
105
+ </tr>
106
+ <tr>
107
+ <td>
108
+ Need assistance? Check out our:
109
+ <ul>
110
+ <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
111
+ <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
112
+ <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
113
+ </ul>
114
+ Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
115
+ </td>
116
+ </tr>
117
+ </table><br/>
118
+
119
+ <table class="woo-product-feed-pro-table">
120
+ <tr>
121
+ <td><strong>Our latest blog articles</strong></td>
122
+ </tr>
123
+ <tr>
124
+ <td>
125
+ <ul>
126
+ <li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
127
+ <li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
128
+ <li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
129
+ <li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
130
+ <li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
131
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
132
+ </ul>
133
+ </td>
134
+ </tr>
135
+ </table><br/>
136
+
137
+ </div>
138
+ </div>
139
+ </tbody>
140
+ </div>
141
+ </div>
pages/admin/woosea-manage-feed.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
  $cron_projects = get_option( 'cron_projects' );
3
- $error = "false";
4
-
5
  $count_variation = wp_count_posts('product_variation');
6
  $count_single = wp_count_posts('product');
7
  $published_single = $count_single->publish;
@@ -56,6 +55,11 @@ if ($versions['WooCommerce'] < 3){
56
  $notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
57
  }
58
 
 
 
 
 
 
59
  if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
60
  $notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
61
  }
@@ -65,7 +69,11 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
65
  <tbody class="woo-product-feed-pro-body">
66
  <?php
67
  if (array_key_exists('debug', $_GET)){
68
- if($_GET['debug'] == "true"){
 
 
 
 
69
  $external_debug_file = $notifications_obj->woosea_debug_informations ($versions, $product_numbers, $order_rows, $cron_projects);
70
  ?>
71
  <div class="woo-product-feed-pro-form-style-2-heading">Debugging mode</div>
@@ -83,14 +91,10 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
83
  ?>
84
 
85
  <div class="woo-product-feed-pro-form-style-2-heading">Manage feeds</div>
86
- <div class="<?php _e($notifications_box['message_type']); ?>">
87
- <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
88
- </div>
89
-
90
  <div class="woo-product-feed-pro-table-wrapper">
91
  <div class="woo-product-feed-pro-table-left">
92
 
93
- <table class="woo-product-feed-pro-table">
94
  <tr>
95
  <td><strong>Active</strong></td>
96
  <td><strong>Project name and channel</strong></td>
@@ -106,13 +110,14 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
106
  $class = "";
107
 
108
  foreach ($cron_projects as $key=>$val){
 
 
109
 
110
  if($val['active'] == "true"){
111
  $checked = "checked";
112
  $class = "";
113
  } else {
114
  $checked = "";
115
- $class = "woo-product-feed-pro-strikethrough";
116
  }
117
 
118
  if(isset($val['filename'])){
@@ -126,15 +131,15 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
126
  <div class="woo-product-feed-pro-slider round"></div>
127
  </label>
128
  </td>
129
- <td><span><?php print "$projectname<br/</span><span class=\"woo-product-feed-pro-channel\">Channel: $val[name]</span>";?></span></td>
130
  <td><span><?php print "$val[fileformat]";?></span></td>
131
  <td><span><?php print "$val[cron]";?></span></td>
132
  <?php
133
  if ($val['running'] == "processing"){
134
  $proc_perc = round(($val['nr_products_processed']/$val['nr_products'])*100);
135
- print "<td><span class=\"woo-product-feed-pro-blink_me\">$val[running] ($proc_perc%)</span></td>";
136
  } else {
137
- print "<td><span class=\"woo-product-feed-pro-blink_off_$val[project_hash]\">$val[running]</span></td>";
138
  }
139
  ?>
140
  <td>
@@ -145,11 +150,14 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
145
  ?>
146
  <?php
147
  if ($val['active'] == "true"){
 
148
  print "<span class=\"ui-icon ui-icon-refresh\" id=\"refresh_$val[project_hash]\" title=\"manually refresh productfeed\" style=\"display: inline-block;\"></span>";
149
- print "<a href=\"$val[external_file]\" target=\"_blank\"><span class=\"ui-icon ui-icon-arrowthickstop-1-s\" id=\"download\" title=\"download productfeed\" style=\"display: inline-block\"></span></a>";
 
 
 
150
  }?>
151
  <span class="trash ui-icon ui-icon-trash" id="trash_<?php print "$val[project_hash]";?>" title="delete project and productfeed" style="display: inline-block;"></span>
152
-
153
  <?php
154
  } else {
155
  print "<span class=\"ui-icon ui-icon-cancel\" id=\"cancel_$val[project_hash]\" title=\"cancel processing productfeed\" style=\"display: inline-block;\"></span>";
@@ -164,7 +172,7 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
164
  <table class="woo-product-feed-pro-inline_manage">
165
 
166
  <?php
167
- if (($val['running'] == "ready") OR ($val['running'] == "stopped")){
168
  ?>
169
  <tr>
170
  <td>
@@ -192,10 +200,10 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
192
  <td>
193
  <strong>Feed URL</strong><br/>
194
  <?php
195
- if ($val['active'] == "true"){
196
  print "<span class=\"ui-icon ui-icon-caret-1-e\" style=\"display: inline-block;\"></span> $val[external_file]";
197
  } else {
198
- print "<span class=\"ui-icon ui-icon-alert\"></span> Whoops, there is no active product feed for this project as the project has been disabled.";
199
  }
200
  ?>
201
  </td>
@@ -244,13 +252,13 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
244
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
245
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
246
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
247
- <li><strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite</a></strong></li>
248
  </ul>
249
  Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
250
  </td>
251
  </tr>
252
  </table><br/>
253
 
 
254
  <table class="woo-product-feed-pro-table">
255
  <tr>
256
  <td><strong>Why upgrade to Elite?</strong></td>
@@ -259,17 +267,19 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
259
  <td>
260
  Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
261
  <ul>
262
- <li><strong>1.</strong> More products approved by Google</li>
263
- <li><strong>2.</strong> Add GTIN, brand and more fields to your store</li>
264
- <li><strong>3.</strong> Exclude individual products from your feeds</li>
265
- <li><strong>4.</strong> Priority support</li>
266
- </ul>
 
267
  <strong>
268
  <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
269
  </strong>
270
  </td>
271
  </tr>
272
  </table><br/>
 
273
 
274
  <table class="woo-product-feed-pro-table">
275
  <tr>
@@ -278,9 +288,12 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
278
  <tr>
279
  <td>
280
  <ul>
281
- <li><strong>1. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
282
- <li><strong>2. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
283
- <li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
 
 
 
284
  </ul>
285
  </td>
286
  </tr>
1
  <?php
2
  $cron_projects = get_option( 'cron_projects' );
3
+ $license_information = get_option( 'license_information' );
 
4
  $count_variation = wp_count_posts('product_variation');
5
  $count_single = wp_count_posts('product');
6
  $published_single = $count_single->publish;
55
  $notifications_box = $notifications_obj->get_admin_notifications ( '13', 'false' );
56
  }
57
 
58
+ if($license_information['notice'] == "true"){
59
+ $notifications_box['message_type'] = $license_information['message_type'];
60
+ $notifications_box['message'] = $license_information['message'];
61
+ }
62
+
63
  if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
64
  $notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
65
  }
69
  <tbody class="woo-product-feed-pro-body">
70
  <?php
71
  if (array_key_exists('debug', $_GET)){
72
+
73
+ // KILL SWITCH, THIS WILL REMOVE ALL YOUR FEED PROJECTS
74
+ // delete_option( 'cron_projects');
75
+
76
+ if(sanitize_text_field($_GET['debug']) == "true"){
77
  $external_debug_file = $notifications_obj->woosea_debug_informations ($versions, $product_numbers, $order_rows, $cron_projects);
78
  ?>
79
  <div class="woo-product-feed-pro-form-style-2-heading">Debugging mode</div>
91
  ?>
92
 
93
  <div class="woo-product-feed-pro-form-style-2-heading">Manage feeds</div>
 
 
 
 
94
  <div class="woo-product-feed-pro-table-wrapper">
95
  <div class="woo-product-feed-pro-table-left">
96
 
97
+ <table id="woosea_main_table" class="woo-product-feed-pro-table">
98
  <tr>
99
  <td><strong>Active</strong></td>
100
  <td><strong>Project name and channel</strong></td>
110
  $class = "";
111
 
112
  foreach ($cron_projects as $key=>$val){
113
+
114
+ //echo '<pre>' . print_r( $val, true ) . '</pre>';
115
 
116
  if($val['active'] == "true"){
117
  $checked = "checked";
118
  $class = "";
119
  } else {
120
  $checked = "";
 
121
  }
122
 
123
  if(isset($val['filename'])){
131
  <div class="woo-product-feed-pro-slider round"></div>
132
  </label>
133
  </td>
134
+ <td><span><?php print "$projectname</span><br/><span class=\"woo-product-feed-pro-channel\">Channel: $val[name]</span>";?></span></td>
135
  <td><span><?php print "$val[fileformat]";?></span></td>
136
  <td><span><?php print "$val[cron]";?></span></td>
137
  <?php
138
  if ($val['running'] == "processing"){
139
  $proc_perc = round(($val['nr_products_processed']/$val['nr_products'])*100);
140
+ print "<td><span class=\"woo-product-feed-pro-blink_me\" id=\"woosea_proc_$val[project_hash]\">$val[running] ($proc_perc%)</span></td>";
141
  } else {
142
+ print "<td><span class=\"woo-product-feed-pro-blink_off_$val[project_hash]\" id=\"woosea_proc_$val[project_hash]\">$val[running]</span></td>";
143
  }
144
  ?>
145
  <td>
150
  ?>
151
  <?php
152
  if ($val['active'] == "true"){
153
+ print "<span class=\"trash ui-icon ui-icon-copy\" id=\"copy_$val[project_hash]\" title=\"copy project\" style=\"display: inline-block;\"></span>";
154
  print "<span class=\"ui-icon ui-icon-refresh\" id=\"refresh_$val[project_hash]\" title=\"manually refresh productfeed\" style=\"display: inline-block;\"></span>";
155
+
156
+ if($val['running'] != "not run yet"){
157
+ print "<a href=\"$val[external_file]\" target=\"_blank\"><span class=\"ui-icon ui-icon-arrowthickstop-1-s\" id=\"download\" title=\"download productfeed\" style=\"display: inline-block\"></span></a>";
158
+ }
159
  }?>
160
  <span class="trash ui-icon ui-icon-trash" id="trash_<?php print "$val[project_hash]";?>" title="delete project and productfeed" style="display: inline-block;"></span>
 
161
  <?php
162
  } else {
163
  print "<span class=\"ui-icon ui-icon-cancel\" id=\"cancel_$val[project_hash]\" title=\"cancel processing productfeed\" style=\"display: inline-block;\"></span>";
172
  <table class="woo-product-feed-pro-inline_manage">
173
 
174
  <?php
175
+ if (($val['running'] == "ready") OR ($val['running'] == "stopped") OR($val['running'] == "not run yet")){
176
  ?>
177
  <tr>
178
  <td>
200
  <td>
201
  <strong>Feed URL</strong><br/>
202
  <?php
203
+ if (($val['active'] == "true") AND ($val['running'] != "not run yet")){
204
  print "<span class=\"ui-icon ui-icon-caret-1-e\" style=\"display: inline-block;\"></span> $val[external_file]";
205
  } else {
206
+ print "<span class=\"ui-icon ui-icon-alert\"></span> Whoops, there is no active product feed for this project as the project has been disabled or did not run yet.";
207
  }
208
  ?>
209
  </td>
252
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
253
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
254
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
 
255
  </ul>
256
  Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
257
  </td>
258
  </tr>
259
  </table><br/>
260
 
261
+ <!--
262
  <table class="woo-product-feed-pro-table">
263
  <tr>
264
  <td><strong>Why upgrade to Elite?</strong></td>
267
  <td>
268
  Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
269
  <ul>
270
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
271
+ <li><strong>2.</strong> More products approved by Google</li>
272
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
273
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
274
+ <li><strong>5.</strong> WPML support</li>
275
+ </ul>
276
  <strong>
277
  <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
278
  </strong>
279
  </td>
280
  </tr>
281
  </table><br/>
282
+ -->
283
 
284
  <table class="woo-product-feed-pro-table">
285
  <tr>
288
  <tr>
289
  <td>
290
  <ul>
291
+ <li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
292
+ <li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
293
+ <li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
294
+ <li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
295
+ <li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
296
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
297
  </ul>
298
  </td>
299
  </tr>
pages/admin/woosea-manage-settings.php CHANGED
@@ -2,9 +2,7 @@
2
  $domain = $_SERVER['HTTP_HOST'];
3
  $plugin_settings = get_option( 'plugin_settings' );
4
  $license_information = get_option( 'license_information' );
5
- $error = "false";
6
- $disabled = "";
7
- $plugin_data = get_plugin_data( __FILE__ );
8
 
9
  $versions = array (
10
  "PHP" => (float)phpversion(),
@@ -13,14 +11,6 @@ $versions = array (
13
  "WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
14
  );
15
 
16
- /**
17
- * Change default footer text, asking to review our plugin
18
- **/
19
- function my_footer_text($default) {
20
- return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. Thanks in advance!';
21
- }
22
- add_filter('admin_footer_text', 'my_footer_text');
23
-
24
  /**
25
  * Create notification object and get message and message type as WooCommerce is inactive
26
  * also set variable allowed on 0 to disable submit button on step 1 of configuration
@@ -34,6 +24,9 @@ if (!in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
34
 
35
  if ($versions['PHP'] < 5.6){
36
  $notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
 
 
 
37
  }
38
 
39
  if ($versions['WooCommerce'] < 3){
@@ -43,41 +36,135 @@ if ($versions['WooCommerce'] < 3){
43
  if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
44
  $notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
45
  }
46
- ?>
47
 
48
- <div id="dialog" title="Basic dialog">
49
- <p>
50
- <div id="dialogText"></div>
51
- </p>
52
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  <div class="wrap">
 
55
  <div class="woo-product-feed-pro-form-style-2">
56
  <tbody class="woo-product-feed-pro-body">
57
- <div class="woo-product-feed-pro-form-style-2-heading">Plugin settings</div>
58
- <div class="<?php _e($notifications_box['message_type']); ?>">
59
- <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
 
 
 
 
 
 
 
 
60
  </div>
61
-
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  <div class="woo-product-feed-pro-table-wrapper">
63
  <div class="woo-product-feed-pro-table-left">
 
 
 
 
64
  <table class="woo-product-feed-pro-table">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  <tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  </tr>
67
-
68
- <form action="" method="post">
69
  <tr>
70
  <td>
71
- <span>Grant access to AdTribes.io support:</span>
72
  </td>
73
  <td>
74
  <label class="woo-product-feed-pro-switch">
75
  <?php
76
- $woosea_support_user = get_option('woosea_support_user');
77
- if($woosea_support_user == "yes"){
78
- print "<input type=\"checkbox\" id=\"grant_access\" name=\"grant_access\" class=\"checkbox-field\" checked>";
79
- } else {
80
- print "<input type=\"checkbox\" id=\"grant_access\" name=\"grant_access\" class=\"checkbox-field\">";
81
  }
82
  ?>
83
  <div class="woo-product-feed-pro-slider round"></div>
@@ -87,23 +174,16 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
87
 
88
  <tr>
89
  <td>
90
- <span>Increase the number of products that will be approved in Google's Merchant Center:<br/>
91
- This option will fix WooCommerce's (JSON-LD) structured data bug and add extra structured data elements to your pages (<a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">Read more about this)</a></span>
92
- <?php
93
- if ($license_information['license_valid'] == "false"){
94
- print "<span><a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">Upgrade to Elite</a> to activate this feature</span>";
95
- $disabled = "disabled";
96
- }
97
- ?>
98
  </td>
99
  <td>
100
  <label class="woo-product-feed-pro-switch">
101
- <?php
102
- $structured_data_fix = get_option ('structured_data_fix');
103
- if($structured_data_fix == "yes"){
104
- print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\" checked $disabled>";
105
- } else {
106
- print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\" $disabled>";
107
  }
108
  ?>
109
  <div class="woo-product-feed-pro-slider round"></div>
@@ -111,31 +191,159 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
111
  </td>
112
  </tr>
113
 
114
- <tr>
115
  <td>
116
- <span>Add GTIN, MPN, UPC, EAN, Product condition, Optimised title and Brand attributes to your store: (<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Read more about this)</a></span>
117
- <?php
118
- if ($license_information['license_valid'] == "false"){
119
- print "<span><a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">Upgrade to Elite</a> to activate this feature</span>";
120
- }
121
- ?>
122
  </td>
123
  <td>
124
  <label class="woo-product-feed-pro-switch">
125
  <?php
126
- $add_unique_identifiers = get_option ('add_unique_identifiers');
127
- if($add_unique_identifiers == "yes"){
128
- print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\" checked $disabled>";
129
- } else {
130
- print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\" $disabled>";
131
  }
132
  ?>
133
  <div class="woo-product-feed-pro-slider round"></div>
134
  </label>
135
  </td>
136
  </tr>
 
 
 
 
 
 
 
137
  </form>
138
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  </div>
140
 
141
  <div class="woo-product-feed-pro-table-right">
@@ -152,33 +360,34 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
152
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
153
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
154
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
155
- <li><strong><a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite</a></strong></li>
156
  </ul>
157
  Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
158
  </td>
159
  </tr>
160
  </table><br/>
161
 
 
162
  <table class="woo-product-feed-pro-table">
163
  <tr>
164
  <td><strong>Why upgrade to Elite?</strong></td>
165
  </tr>
166
  <tr>
167
  <td>
168
- Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
169
  <ul>
170
- <li><strong>1.</strong> More products approved by Google </li>
171
- <li><strong>2.</strong> Add GTIN, brand and more fields to your store</li>
172
- <li><strong>3.</strong> Exclude individual products from your feeds</li>
173
- <li><strong>4.</strong> Priority support</li>
174
- </ul>
175
- <strong>
176
- <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
177
- </strong>
178
- </td>
 
179
  </tr>
180
  </table><br/>
181
-
182
 
183
  <table class="woo-product-feed-pro-table">
184
  <tr>
@@ -187,15 +396,17 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
187
  <tr>
188
  <td>
189
  <ul>
190
- <li><strong>1. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
191
- <li><strong>2. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
192
- <li><strong>3. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
 
 
 
193
  </ul>
194
  </td>
195
  </tr>
196
  </table><br/>
197
 
198
-
199
  </div>
200
  </div>
201
  </tbody>
2
  $domain = $_SERVER['HTTP_HOST'];
3
  $plugin_settings = get_option( 'plugin_settings' );
4
  $license_information = get_option( 'license_information' );
5
+ $license_information['license_valid'] = "yes"; // This is only temp untill we activate the license module again
 
 
6
 
7
  $versions = array (
8
  "PHP" => (float)phpversion(),
11
  "WooCommerce Product Feed PRO" => WOOCOMMERCESEA_PLUGIN_VERSION
12
  );
13
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Create notification object and get message and message type as WooCommerce is inactive
16
  * also set variable allowed on 0 to disable submit button on step 1 of configuration
24
 
25
  if ($versions['PHP'] < 5.6){
26
  $notifications_box = $notifications_obj->get_admin_notifications ( '11', 'false' );
27
+ $php_validation = "False";
28
+ } else {
29
+ $php_validation = "True";
30
  }
31
 
32
  if ($versions['WooCommerce'] < 3){
36
  if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
37
  $notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
38
  }
 
39
 
40
+ if(array_key_exists('notice', $license_information)){
41
+ if($license_information['notice'] == "true"){
42
+ $notifications_box['message_type'] = $license_information['message_type'];
43
+ $notifications_box['message'] = $license_information['message'];
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Change default footer text, asking to review our plugin
49
+ **/
50
+ function my_footer_text($default) {
51
+ return 'If you like our <strong>WooCommerce Product Feed PRO</strong> plugin please leave us a <a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="woo-product-feed-pro-ratingRequest">&#9733;&#9733;&#9733;&#9733;&#9733;</a> rating. Thanks in advance!';
52
+ }
53
+ add_filter('admin_footer_text', 'my_footer_text');
54
+
55
+
56
+ //we check if the page is visited by click on the tabs or on the menu button.
57
+ //then we get the active tab.
58
+ $active_tab = "woosea_manage_settings";
59
+ $header_text = "Plugin settings";
60
+ if(isset($_GET["tab"])) {
61
+ if($_GET["tab"] == "woosea_manage_settings"){
62
+ $active_tab = "woosea_manage_settings";
63
+ $header_text = "Plugin settings";
64
+ } elseif ($_GET["tab"] == "woosea_system_check"){
65
+ $active_tab = "woosea_system_check";
66
+ $header_text = "Plugin systems check";
67
+ } elseif ($_GET["tab"] == "woosea_license_check"){
68
+ $active_tab = "woosea_license_check";
69
+ $header_text = "License";
70
+ } else {
71
+ $active_tab = "woosea_manage_attributes";
72
+ $header_text = "Attribute settings";
73
+ $license_information['message'] = "This plugin, by default, only shows a limit amount of custom attributes in the configuration and filter/rule drop-downs. We have done so for performance reasons. You can however add missing custom attributes by enabling them below. After enabling a custom attribute it shows in the drop-downs during configuration so you can use them for your product feeds.";
74
+ }
75
+ }
76
+ ?>
77
 
78
  <div class="wrap">
79
+
80
  <div class="woo-product-feed-pro-form-style-2">
81
  <tbody class="woo-product-feed-pro-body">
82
+ <div class="woo-product-feed-pro-form-style-2-heading">
83
+ <?php
84
+ print "$header_text";
85
+ ?>
86
+ </div>
87
+
88
+ <?php
89
+ if(array_key_exists('message', $license_information)){
90
+ ?>
91
+ <div class="<?php _e($license_information['message_type']); ?>">
92
+ <p><?php _e($license_information['message'], 'sample-text-domain' ); ?></p>
93
  </div>
94
+ <?php
95
+ }
96
+ ?>
97
+
98
+
99
+ <!-- wordpress provides the styling for tabs. -->
100
+ <h2 class="nav-tab-wrapper">
101
+ <!-- when tab buttons are clicked we jump back to the same page but with a new parameter that represents the clicked tab. accordingly we make it active -->
102
+ <a href="?page=woosea_manage_settings&tab=woosea_manage_settings" class="nav-tab <?php if($active_tab == 'woosea_manage_settings'){echo 'nav-tab-active';} ?> "><?php _e('Plugin settings', 'sandbox'); ?></a>
103
+ <a href="?page=woosea_manage_settings&tab=woosea_manage_attributes" class="nav-tab <?php if($active_tab == 'woosea_manage_attributes'){echo 'nav-tab-active';} ?>"><?php _e('Attribute settings', 'sandbox'); ?></a>
104
+ <a href="?page=woosea_manage_settings&tab=woosea_system_check" class="nav-tab <?php if($active_tab == 'woosea_system_check'){echo 'nav-tab-active';} ?>"><?php _e('Plugin systems check', 'sandbox'); ?></a>
105
+ <a href="?page=woosea_manage_settings&tab=woosea_license_check" class="nav-tab <?php if($active_tab == 'woosea_license_check'){echo 'nav-tab-active';} ?>"><?php _e('License', 'sandbox'); ?></a>
106
+ </h2>
107
+
108
  <div class="woo-product-feed-pro-table-wrapper">
109
  <div class="woo-product-feed-pro-table-left">
110
+ <?php
111
+ if($active_tab == "woosea_manage_settings"){
112
+ ?>
113
+
114
  <table class="woo-product-feed-pro-table">
115
+ <tr><td><strong>Plugin setting</strong></td><td><strong>On / Off</strong></td></tr>
116
+
117
+ <form action="" method="post">
118
+ <tr>
119
+ <td>
120
+ <span>Increase the number of products that will be approved in Google's Merchant Center:<br/>
121
+ This option will fix WooCommerce's (JSON-LD) structured data bug and add extra structured data elements to your pages (<a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">Read more about this)</a></span>
122
+ </td>
123
+ <td>
124
+ <label class="woo-product-feed-pro-switch">
125
+ <?php
126
+ $structured_data_fix = get_option ('structured_data_fix');
127
+ if($structured_data_fix == "yes"){
128
+ print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\" checked>";
129
+ } else {
130
+ print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\">";
131
+ }
132
+ ?>
133
+ <div class="woo-product-feed-pro-slider round"></div>
134
+ </label>
135
+ </td>
136
+ </tr>
137
+
138
  <tr>
139
+ <td>
140
+ <span>Add GTIN, MPN, UPC, EAN, Product condition, Optimised title, Installment, Unit measure and Brand attributes to your store: (<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Read more about this)</a></span>
141
+ </td>
142
+ <td>
143
+ <label class="woo-product-feed-pro-switch">
144
+ <?php
145
+ $add_unique_identifiers = get_option ('add_unique_identifiers');
146
+ if($add_unique_identifiers == "yes"){
147
+ print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\" checked>";
148
+ } else {
149
+ print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\">";
150
+ }
151
+ ?>
152
+ <div class="woo-product-feed-pro-slider round"></div>
153
+ </label>
154
+ </td>
155
  </tr>
 
 
156
  <tr>
157
  <td>
158
+ <span>Enable WPML support: (<a href="https://adtribes.io/wpml-support/" target="_blank">Read more about this)</a></span>
159
  </td>
160
  <td>
161
  <label class="woo-product-feed-pro-switch">
162
  <?php
163
+ $add_wpml_support = get_option ('add_wpml_support');
164
+ if($add_wpml_support == "yes"){
165
+ print "<input type=\"checkbox\" id=\"add_wpml_support\" name=\"add_wpml_support\" class=\"checkbox-field\" checked>";
166
+ } else {
167
+ print "<input type=\"checkbox\" id=\"add_wpml_support\" name=\"add_wpml_support\" class=\"checkbox-field\">";
168
  }
169
  ?>
170
  <div class="woo-product-feed-pro-slider round"></div>
174
 
175
  <tr>
176
  <td>
177
+ <span>Use mother main image for variations</span>
 
 
 
 
 
 
 
178
  </td>
179
  <td>
180
  <label class="woo-product-feed-pro-switch">
181
+ <?php
182
+ $add_mother_image = get_option ('add_mother_image');
183
+ if($add_mother_image == "yes"){
184
+ print "<input type=\"checkbox\" id=\"add_mother_image\" name=\"add_mother_image\" class=\"checkbox-field\" checked>";
185
+ } else {
186
+ print "<input type=\"checkbox\" id=\"add_mother_image\" name=\"add_mother_image\" class=\"checkbox-field\">";
187
  }
188
  ?>
189
  <div class="woo-product-feed-pro-slider round"></div>
191
  </td>
192
  </tr>
193
 
194
+ <tr id="remarketing">
195
  <td>
196
+ <span>Enable Google Dynamic Remarketing:</span>
 
 
 
 
 
197
  </td>
198
  <td>
199
  <label class="woo-product-feed-pro-switch">
200
  <?php
201
+ $add_remarketing = get_option ('add_remarketing');
202
+ if($add_remarketing == "yes"){
203
+ print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" checked>";
204
+ } else {
205
+ print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\">";
206
  }
207
  ?>
208
  <div class="woo-product-feed-pro-slider round"></div>
209
  </label>
210
  </td>
211
  </tr>
212
+ <?php
213
+ if($add_remarketing == "yes"){
214
+ $adwords_conversion_id = get_option('woosea_adwords_conversion_id');
215
+
216
+ print "<tr id=\"adwords_conversion_id\"><td colspan=\"2\"><span>Insert your Dynamic Remarketing Conversion tracking ID:</span>&nbsp;<input type=\"text\" class=\"input-field-medium\" id=\"adwords_conv_id\" name=\"adwords_conv_id\" value=\"$adwords_conversion_id\">&nbsp;<input type=\"submit\" id=\"save_conversion_id\" value=\"Save\"></td></tr>";
217
+ }
218
+ ?>
219
  </form>
220
  </table>
221
+ <?php
222
+ } elseif ($active_tab == "woosea_license_check"){
223
+ ?>
224
+ <table class="woo-product-feed-pro-table">
225
+ <tr>
226
+ <td>
227
+ <span>License e-mail:</span>
228
+ </td>
229
+ <td>
230
+ <input type="text" class="input-field-large" id="license-email" name="license-email" value="<?php print "$license_information[license_email]";?>">
231
+ </td>
232
+ </tr>
233
+ <tr>
234
+ <td>
235
+ <span>License key:</span>
236
+ </td>
237
+ <td>
238
+ <input type="text" class="input-field-large" id="license-key" name="license-key" value="<?php print "$license_information[license_key]";?>">
239
+ </td>
240
+ </tr>
241
+ <tr>
242
+ <td colspan="2"><i>Please note that leaving your license details you allow us to automatically validate your license once a day.</i></td>
243
+ </tr>
244
+ <tr>
245
+ <td colspan="2">
246
+ <input type="submit" id="checklicense" value="Activate license">
247
+ <!--
248
+ <input type="submit" id="deactivate_license" value="Deactivate license">
249
+ -->
250
+ </td>
251
+ </tr>
252
+
253
+ </table>
254
+ <?php
255
+ } elseif ($active_tab == "woosea_system_check"){
256
+ // Check if the product feed directory is writeable
257
+ $upload_dir = wp_upload_dir();
258
+ $external_base = $upload_dir['basedir'];
259
+ $external_path = $external_base . "/woo-product-feed-pro/";
260
+
261
+ if (is_writable($external_path)) {
262
+ $directory_perm = "True";
263
+ } else {
264
+ $directory_perm = "False";
265
+ }
266
+
267
+ // Check if the cron is enabled
268
+ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
269
+ $cron_enabled = "False";
270
+ } else {
271
+ $cron_enabled = "True";
272
+ }
273
+
274
+ print "<table class=\"woo-product-feed-pro-table\">";
275
+ print "<tr><td><strong>System check</strong></td><td><strong>Status</strong></td></tr>";
276
+ print "<tr><td>WP-Cron enabled</td><td>$cron_enabled</td></tr>";
277
+ print "<tr><td>PHP-version sufficient</td><td>$php_validation ($versions[PHP])</td></tr>";
278
+ print "<tr><td>Product feed directory writable</td><td>$directory_perm</td></tr>";
279
+ print "<tr><td colspan=\"2\">&nbsp;</td></tr>";
280
+ print "</table>";
281
+
282
+ } else {
283
+ ?>
284
+ <table class="woo-product-feed-pro-table">
285
+ <?php
286
+ if(!get_option( 'woosea_extra_attributes' )){
287
+ $extra_attributes = array();
288
+ } else {
289
+ $extra_attributes = get_option( 'woosea_extra_attributes' );
290
+ }
291
+
292
+ global $wpdb;
293
+ $list = array();
294
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id = posts.id AND posts.post_type LIKE '%product%'
295
+ GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
296
+ $data = $wpdb->get_results($sql);
297
+
298
+ if (count($data)) {
299
+ foreach ($data as $key => $value) {
300
+
301
+ if (!preg_match("/_product_attributes/i",$value->name)){
302
+ $value_display = str_replace("_", " ",$value->name);
303
+ $list["custom_attributes_" . $value->name] = ucfirst($value_display);
304
+ } else {
305
+ $sql = "SELECT meta.meta_id, meta.meta_key as name, meta.meta_value as type FROM " . $wpdb->prefix . "postmeta" . " AS meta, " . $wpdb->prefix . "posts" . " AS posts WHERE meta.post_id = posts.id AND posts.post_type LIKE '%product%' AND meta.meta_key='_product_attributes';";
306
+ $data = $wpdb->get_results($sql);
307
+ if (count($data)) {
308
+ foreach ($data as $key => $value) {
309
+ $product_attr = unserialize($value->type);
310
+ if(!empty($product_attr)){
311
+ foreach ($product_attr as $key => $arr_value) {
312
+ $value_display = str_replace("_", " ",$arr_value['name']);
313
+ $list["custom_attributes_" . $key] = ucfirst($value_display);
314
+ }
315
+ }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ }
321
+ print "<tr><td><strong>Attribute name</strong></td><td><strong>On / Off</strong></td></tr>";
322
+
323
+ foreach ($list as $key => $value){
324
+
325
+ if(in_array($value, $extra_attributes)){
326
+ $checked = "checked";
327
+ } else {
328
+ $checked = "";
329
+ }
330
+
331
+ print "<tr id=\"$key\"><td><span>$value</span></td>";
332
+ print "<td>";
333
+ ?>
334
+ <label class="woo-product-feed-pro-switch">
335
+ <input type="hidden" name="manage_attribute" value="<?php print "$key";?>"><input type="checkbox" id="attribute_active" name="<?php print "$value";?>" class="checkbox-field" value="<?php print "$key";?>" <?php print "$checked";?>>
336
+ <div class="woo-product-feed-pro-slider round"></div>
337
+ </label>
338
+ <?php
339
+ print "</td>";
340
+ print "</tr>";
341
+ }
342
+ ?>
343
+ </table>
344
+ <?php
345
+ }
346
+ ?>
347
  </div>
348
 
349
  <div class="woo-product-feed-pro-table-right">
360
  <li><strong><a href="https://adtribes.io/support/" target="_blank">Frequently Asked Questions</a></strong></li>
361
  <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
362
  <li><strong><a href="https://adtribes.io/blog/" target="_blank">Blog</a></strong></li>
 
363
  </ul>
364
  Or just reach out to us at <strong><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/" target="_blank">the support forum</a></strong> and we'll make sure your product feeds will be up-and-running within no-time.
365
  </td>
366
  </tr>
367
  </table><br/>
368
 
369
+ <!--
370
  <table class="woo-product-feed-pro-table">
371
  <tr>
372
  <td><strong>Why upgrade to Elite?</strong></td>
373
  </tr>
374
  <tr>
375
  <td>
376
+ Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
377
  <ul>
378
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
379
+ <li><strong>2.</strong> More products approved by Google</li>
380
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
381
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
382
+ <li><strong>5.</strong> WPML support</li>
383
+ </ul>
384
+ <strong>
385
+ <a href="https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite" target="_blank">Upgrade to Elite here!</a>
386
+ </strong>
387
+ </td>
388
  </tr>
389
  </table><br/>
390
+ -->
391
 
392
  <table class="woo-product-feed-pro-table">
393
  <tr>
396
  <tr>
397
  <td>
398
  <ul>
399
+ <li><strong>1. <a href="https://adtribes.io/adding-missing-custom-attributes/" target="_blank">Adding missing custom attributes</a></strong></li>
400
+ <li><strong>2. <a href="https://adtribes.io/can-i-add-mother-products-to-my-feed-and-leave-out-the-variations/" target="_blank">Can I leave out mother products?</a></strong></li>
401
+ <li><strong>3. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
402
+ <li><strong>4. <a href="https://adtribes.io/woocommerce-structured-data-bug/" target="_blank">WooCommerce structured data markup bug</a></strong></li>
403
+ <li><strong>5. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/" target="_blank">How to create filters for your product feed</a></strong></li>
404
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/" target="_blank">Enable WPML support</a></strong></li>
405
  </ul>
406
  </td>
407
  </tr>
408
  </table><br/>
409
 
 
410
  </div>
411
  </div>
412
  </tbody>
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === WooCommerce Product Feed Plugin PRO for Google Shopping, Facebook and many more - AdTribes.io ===
2
  Contributors: jorisverwater,evavangelooven
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=j_verwater%40hotmail%2ecom&lc=NL&item_name=Donation%20WooCommerce%20Product%20Feed%20Pro%20%2d%20AdTribes%2eio&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  License: GPLv3
5
  License URI: http://www.gnu.org/licenses/gpl.html
6
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger
7
  Requires at least: 4.5
8
- Tested up to: 4.9
9
- Stable tag: 3.0.0
10
 
11
  == Description ==
12
 
@@ -21,7 +21,7 @@ Offer free and advanced, intuitive, tooling and plugins for website owners and m
21
  == Plugin Features ==
22
 
23
  = Unlimited number of products =
24
- No limitations on the number of products you can put in your product feeds. This makes the AdTribes.io WooCommerce Product Feed PRO plugin suitable for small, medium and big webshops.
25
 
26
  = Unlimited number of product feeds =
27
  No limitations on the number of product feeds.
@@ -36,10 +36,10 @@ Determine yourself what attributes to in- or exclude in your product feed. This
36
  Map your field attributes to those of the channels of your choice. For many channels using the right field names is obliged.
37
 
38
  = Fix for WooCommerce structured data bug =
39
- Because of a bug in WooCommerce variable products will get disapproved in Google's Merchant Center. WooCommerce adds the price of the cheapest variable product in the structured data for all variations of a product. Because of this there will be a mismatch between the product price you provide to Google in your Google Shopping product feed and the structured data price on the product landingpage. Google will therefor disapprove the product in its merchant center. You won't be able to advertise on that product in your Google Shopping campaign. Our plugin has a feature that will fix the structured data on variable product pages by adding the correct variable product price in the JSON-LD structured data so Google will approve the variable products you submitted. This feature is only available to plugin users who upgraded to the paid Elite version of the plugin.
40
 
41
  = Add critical Google Shopping Feed fields to your store =
42
- Google requires you to add certain fields to the feed you create for Google Shopping. However not all of the required fields are present in WooCommerce. Our plugin add's these fields / attributes for you so you can create a product feed that meets Google's requirements. The plugin will add the following product input fields for you: Brand, GTIN, UPC, MPN, EAN, Product condition (New, Refurbished, Used) unit pricing measure, unit pricing base measure and an Optimised title field. This feature is only available to plugin users who upgraded to the paid Elite version of the plugin.
43
 
44
  = Conversion tracking =
45
  As of version 1.8.8 the plugin is able to track sales and conversions coming from your product feeds. Just enable the 'conversion tracking' and the plugin will measure how much turn-over is coming from your marketing campaigns. The plugin uses both session- and cookie-conversions to make sure all sales are tracked.
@@ -60,14 +60,20 @@ Our plugin offers added and advanced features for creating the best possible pro
60
  This plugin enables you to add and configure Google Analytics UTM tracking-codes to your product URL’s so you can measure the effectiveness of your marketing channels in Google Analytics.
61
 
62
  = Shipping class support =
63
- This plugin enables you to set the shipping zone (and shipping class) so the right shipping cost end up in your product feed. Our plugin uses all shipping zone settings you have configured in WooCommerce (flat rates, classes and free shipping).
64
 
65
  = Product variations / Variables =
66
  This plugin supports product variables so all your variations make it to product feeds as individual products too.
67
 
 
 
 
68
  = Product feed statistics =
69
  Product feed statistics showing you the amount of products in yor product feed after every update and refresh.
70
 
 
 
 
71
  = Google Shopping product feed tutorial =
72
  [youtube https://www.youtube.com/watch?v=2XzxwKDufGw]
73
 
@@ -80,6 +86,7 @@ Product feed statistics showing you the amount of products in yor product feed a
80
  * > 100 pre-configured product feed channel-templates for ~ 200 countries;
81
  * Create custom product feeds;
82
  * XML, CSV, TSV and TXT formats;
 
83
  * Tracks conversions and sales;
84
  * Intuitive interface;
85
  * Supports product variations / variables;
@@ -96,12 +103,16 @@ Product feed statistics showing you the amount of products in yor product feed a
96
  * Supports Yoasts primary category feature
97
  * Supports Yith brand attributes
98
  * Supports WooCommerce Dynamic Pricing & Discounts from RightPress
 
99
 
100
  === Channels ===
101
  * Custom feeds
102
  * Google Shopping
103
  * Google DRM / Dynamic remarketing
104
  * Google Merchant Promotions feed
 
 
 
105
  * Facebook Dynamic Ad’s / remarketing
106
  * Bing Shopping
107
  * <a href="https://yandex.com/support/market-tech-requirements/index.html" target="_blank">Yandex</a>
@@ -128,14 +139,18 @@ Product feed statistics showing you the amount of products in yor product feed a
128
  * Smartly.io
129
  * Spartoo
130
  * Pricerunner
131
- * Miinto
 
 
132
  * <a href="https://www.vertaa.fi" target="_blank">Vertaa.fi</a>
133
  * Prisjakt
134
  * Hintaseuranta
135
  * Connexity
 
136
  * Cdiscount
137
  * Fnac
138
  * ManoMano
 
139
  * Cherchons.com
140
  * Choozen.fr
141
  * Ciao.fr
@@ -156,12 +171,12 @@ Product feed statistics showing you the amount of products in yor product feed a
156
  * Choozen
157
  * Domodi
158
  * Geizhals
159
- * Guenstiger
160
  * Hood.de
161
  * Ladenzeile.de
162
  * Livingo.de
163
  * Medizinfuchs.de
164
- * Moebel.de
165
  * My Best Brands
166
  * Preis.de
167
  * Rakuten
@@ -177,12 +192,12 @@ Product feed statistics showing you the amount of products in yor product feed a
177
 
178
  === From within Wordpress ===
179
  1. Visit ‘Plugins > Add New’;
180
- 1. Search for ‘WooCommerce Product Feed PRO’;
181
- 1. Activate ‘WooCommerce Product Feed PRO’ from your plugins page.
182
 
183
  === Manually ===
184
  1. Upload the woo-product-feed-pro folder to your /wp-content/plugins/ directory;
185
- 1. Activate ‘WooCommerce Product Feed PRO’ from your plugins page.
186
 
187
  == Frequently Asked Questions ==
188
 
@@ -249,6 +264,356 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
249
 
250
  === Changelog ===
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  = 3.0.0 (2018-05-16) =
253
  * Bug fix for include_only filters
254
 
@@ -834,6 +1199,354 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
834
 
835
  == Upgrade Notice ==
836
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
837
  = 3.0.0 =
838
  Bug fix for include_only filters
839
 
1
+ === Product Feed PRO for WooCommerce ===
2
  Contributors: jorisverwater,evavangelooven
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=j_verwater%40hotmail%2ecom&lc=NL&item_name=Donation%20WooCommerce%20Product%20Feed%20Pro%20%2d%20AdTribes%2eio&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
  License: GPLv3
5
  License URI: http://www.gnu.org/licenses/gpl.html
6
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger
7
  Requires at least: 4.5
8
+ Tested up to: 5.0
9
+ Stable tag: 4.0.0
10
 
11
  == Description ==
12
 
21
  == Plugin Features ==
22
 
23
  = Unlimited number of products =
24
+ No limitations on the number of products you can put in your product feeds. This makes the AdTribes.io Product Feed PRO for WooCommerce plugin suitable for small, medium and big webshops.
25
 
26
  = Unlimited number of product feeds =
27
  No limitations on the number of product feeds.
36
  Map your field attributes to those of the channels of your choice. For many channels using the right field names is obliged.
37
 
38
  = Fix for WooCommerce structured data bug =
39
+ Because of a bug in WooCommerce variable products will get disapproved in Google's Merchant Center. WooCommerce adds the price of the cheapest variable product in the structured data for all variations of a product. Because of this there will be a mismatch between the product price you provide to Google in your Google Shopping product feed and the structured data price on the product landingpage. Google will therefor disapprove the product in its merchant center. You won't be able to advertise on that product in your Google Shopping campaign. Our plugin has a feature that will fix the structured data on variable product pages by adding the correct variable product price in the JSON-LD structured data so Google will approve the variable products you submitted.
40
 
41
  = Add critical Google Shopping Feed fields to your store =
42
+ Google requires you to add certain fields to the feed you create for Google Shopping. However not all of the required fields are present in WooCommerce. Our plugin add's these fields / attributes for you so you can create a product feed that meets Google's requirements. The plugin will add the following product input fields for you: Brand, GTIN, UPC, MPN, EAN, Product condition (New, Refurbished, Used) unit pricing measure, unit pricing base measure, installment and an Optimised title field.
43
 
44
  = Conversion tracking =
45
  As of version 1.8.8 the plugin is able to track sales and conversions coming from your product feeds. Just enable the 'conversion tracking' and the plugin will measure how much turn-over is coming from your marketing campaigns. The plugin uses both session- and cookie-conversions to make sure all sales are tracked.
60
  This plugin enables you to add and configure Google Analytics UTM tracking-codes to your product URL’s so you can measure the effectiveness of your marketing channels in Google Analytics.
61
 
62
  = Shipping class support =
63
+ This plugin enables you to set the shipping zone (and shipping class) so the right shipping cost end up in your product feed. Our plugin uses all shipping zone settings you have configured in WooCommerce (flat rates, classes and free shipping). Our support also supports US and Australian postal codes and regions.
64
 
65
  = Product variations / Variables =
66
  This plugin supports product variables so all your variations make it to product feeds as individual products too.
67
 
68
+ = Product tags =
69
+ Use the product tag information for your product feeds or to create filters and rules on
70
+
71
  = Product feed statistics =
72
  Product feed statistics showing you the amount of products in yor product feed after every update and refresh.
73
 
74
+ = WPML =
75
+ Our plugin supports WPML (WPML Multilingual CMS)
76
+
77
  = Google Shopping product feed tutorial =
78
  [youtube https://www.youtube.com/watch?v=2XzxwKDufGw]
79
 
86
  * > 100 pre-configured product feed channel-templates for ~ 200 countries;
87
  * Create custom product feeds;
88
  * XML, CSV, TSV and TXT formats;
89
+ * Supports WPML
90
  * Tracks conversions and sales;
91
  * Intuitive interface;
92
  * Supports product variations / variables;
103
  * Supports Yoasts primary category feature
104
  * Supports Yith brand attributes
105
  * Supports WooCommerce Dynamic Pricing & Discounts from RightPress
106
+ * Supports WC Fields Factory
107
 
108
  === Channels ===
109
  * Custom feeds
110
  * Google Shopping
111
  * Google DRM / Dynamic remarketing
112
  * Google Merchant Promotions feed
113
+ * Google DSA (Dynamic Search Ads)
114
+ * Google Local Products
115
+ * Google Local Products Inventory
116
  * Facebook Dynamic Ad’s / remarketing
117
  * Bing Shopping
118
  * <a href="https://yandex.com/support/market-tech-requirements/index.html" target="_blank">Yandex</a>
139
  * Smartly.io
140
  * Spartoo
141
  * Pricerunner
142
+ * <a href="https://www.miinto.dk" target="_blank">Miinto Denmark</a>
143
+ * <a href="https://www.miinto.nl" target="_blank">Miinto Netherlands</a>
144
+ * <a href="https://www.miinto.pl" target="_blank">Miinto Poland</a>
145
  * <a href="https://www.vertaa.fi" target="_blank">Vertaa.fi</a>
146
  * Prisjakt
147
  * Hintaseuranta
148
  * Connexity
149
+ * <a href="https://www.katoni.dk" target="_blank">Katoni.dk</a>
150
  * Cdiscount
151
  * Fnac
152
  * ManoMano
153
+ * <a href="https://www.fruugo.co.uk" target="_blank">Fruugo.co.uk</a>
154
  * Cherchons.com
155
  * Choozen.fr
156
  * Ciao.fr
171
  * Choozen
172
  * Domodi
173
  * Geizhals
174
+ * <a href="https://www.guenstiger.de" target="_blank" rel="nofollow">Guenstiger.de</a>
175
  * Hood.de
176
  * Ladenzeile.de
177
  * Livingo.de
178
  * Medizinfuchs.de
179
+ * <a href="https://www.moebel.de" target="_blank">Moebel.de</a>
180
  * My Best Brands
181
  * Preis.de
182
  * Rakuten
192
 
193
  === From within Wordpress ===
194
  1. Visit ‘Plugins > Add New’;
195
+ 1. Search for ‘Product Feed PRO for WooCommerce’;
196
+ 1. Activate ‘Product Feed PRO for WooCommerce’ from your plugins page.
197
 
198
  === Manually ===
199
  1. Upload the woo-product-feed-pro folder to your /wp-content/plugins/ directory;
200
+ 1. Activate ‘Product Feed PRO for WooCommerce’ from your plugins page.
201
 
202
  == Frequently Asked Questions ==
203
 
264
 
265
  === Changelog ===
266
 
267
+ = 4.0.0 (2018-12-17) =
268
+ * Fixed another issue with cached prices ending up in product feeds.
269
+
270
+ = 3.9.9 (2018-12-16) =
271
+ * Added support for Cyrillic characters for CSV files.
272
+
273
+ = 3.9.8 (2018-12-16) =
274
+ * Fixed a bug: caching caused product feeds to contain wrong and changing prices in product feeds. This only happened on very rare occaccions but has been fixed now.
275
+
276
+ = 3.9.7 (2018-12-14) =
277
+ * Fixed a bug: when all pre-defined fields for custom feeds where deleted and new fields were added the product feed would break. This has now been fixed.
278
+ * Made improvements to the JSON (structured data fix for the WooCommerce bug)
279
+
280
+ = 3.9.6 (2018-12-11) =
281
+ * Removed the option to create Google Shopping / Merchant Center CSV feeds. The only option left is XML feeds. Current CSV feeds remain working ofcourse.
282
+ * Added support for "fee percentage" Shipping formula's
283
+
284
+ = 3.9.5 (2018-12-10) =
285
+ * Tested for Wordpress 5.0 compatibility, no issues found
286
+ * Added support for diacritics characters in the optimized title field
287
+
288
+ = 3.9.4 (2018-12-03) =
289
+ * Added functionality: one can now create rules saying: if attribute X is empty use the value from attribute Y
290
+ * Added functionality: free shipping zones are now also added to product feeds, even when the price is 0
291
+
292
+ = 3.9.3 (2018-12-02) =
293
+ * Fixed a bug: the last release (3.9.2) broke support for Cyrillic characters. This has now been fixed.
294
+
295
+ = 3.9.2 (2018-11-29) =
296
+ * Fixed a validation bug where spaces where not allowed in the optimized product title field. This has been fixed now.
297
+
298
+ = 3.9.1 (2018-11-29) =
299
+ * Added stricter encoding on the product name, description and short description attributes in order to prevent warnings in Google's Merchant Center
300
+
301
+ = 3.9.0 (2018-11-29) =
302
+ * Product feeds are now only being refreshed when the complete update of a feed has finished. Previously we updated product feeds on the fly which caused issues when for example Google Shopping was retrieving the product feed at the exact same time.
303
+ * You can now create filter and rules on catalogue and search visibility
304
+ * When the sale price of a product is equal to the regular price of a product the product is not on sale, we are now removing the sale price from feeds when this is happening
305
+ * Changed the default price mapping for Google Shopping and Facebook feeds to the regular price attribute
306
+ * Fixed a PHP Notice for products that are eligable for free shipping as the minimum shipping product price was reached.
307
+ * Fixed a PHP Warning which showed when plugin users had no product attributes at all
308
+
309
+ = 3.8.9 (2018-11-23) =
310
+ * Enabled license check module again. This is just the checking module and page. Licenses are not required yet for the Elite features.
311
+
312
+ = 3.8.8 (2018-11-23) =
313
+ * Fixed a bug: shipping zones that had a cost of 0 were removed from the feed. Those are now being added again as those got disapproved by Google.
314
+ * Fixed a bug: removed the admin-url ajax URL for safety reasons.
315
+
316
+ = 3.8.7 (2018-11-23) =
317
+ * Name change of plugin as we got a trademark complaint from Automattic, the owner of the WooCommerce brand
318
+
319
+ = 3.8.6 (2018-11-21) =
320
+ * New feature: we have added the functionality to copy existing product feed configurations to a new product feed. Just hit the copy project icon on the Manage Feeds page.
321
+
322
+ = 3.8.5 (2018-11-19) =
323
+ * Fixed a bug: shipping zone fix for users who put region, country, postal code or price in the zone name itself
324
+ * Added a correction check for shipping cost formula's that have wrongly been inserted by users
325
+
326
+ = 3.8.4 (2018-11-18) =
327
+ * Fixed a bug: some shipping zones were incomplete in product feeds. Issue has been solved.
328
+
329
+ = 3.8.3 (2018-11-17) =
330
+ * Fixed a bug: text delimiters for custom feed CSV's were missing. Issue has been solved.
331
+
332
+ = 3.8.2 (2018-11-16) =
333
+ * Fixed a bug for United States and Australian Shipping cost settings. There are no longer empty shipping XML nodes in the feed.
334
+
335
+ = 3.8.1 (2018-11-16) =
336
+ * Fixed a color/size/material bug: the plugin was not adding product colors, sizes and materials according to Google's Merchant Center requirements when products had multiple values for this. This has now been fixed
337
+ * Fixed a SimpleXMLElement PHP warning causing PHP warnings in the logs (thanks Simon for your help in this one, appreciated!)
338
+ * Checked compatibility with WooCommerce 3.5.1
339
+
340
+ = 3.8.0 (2018-11-09) =
341
+ * Fixed a delimiter issue for Google's Local Product Inventory feeds on special request from @muranomidwest
342
+
343
+ = 3.7.9 (2018-11-09) =
344
+ * Fixed a minor bug: the g:postal_code field format is, for example, 94002-95460. The default WooCommerce annotation is 94002...95460 so this was resulting in warnings in Google's Merchant Center. We have now fixed this bug so the g:postal_code meets up to Google's requirements.
345
+
346
+ = 3.7.8 (2018-11-09) =
347
+ * Rebuild parts of the category mapping functionality as some users experienced mappings that did not get saved or screens that froze.
348
+ * We have added a plugin systems check tab which shows if the basic requirements for this plugin are met.
349
+
350
+ = 3.7.7 (2018-11-06) =
351
+ * Shipping classes with a 0 shipping cost are no longer added to the product feeds
352
+
353
+ = 3.7.6 (2018-11-06) =
354
+ * Fixed a bug: the plugin was adding prefixes and suffixes to attribute values that were empty. Prefixes and suffixes are no longer added to empty attribute values.
355
+ * Fixed a bug: fputcsv was causing issues with CSV files. Replaced this PHP function with an oldfashioned fopen and fwrite. This has now been solved.
356
+ * Fixed a bug: Eval function was throwing and error for Shipping Class formula's that were not truly a formula. This has now been solved.
357
+
358
+ = 3.7.5 (2018-11-05) =
359
+ * Checked and tested the plugin for WooCommerce 3.5. compatibility
360
+ * Fixed a bug: in some browsers, such as Safari, the attribute enabling/disabling feature was not working due to a JS-error. This has now been solved.
361
+ * Added support for shipping costs formula's. The [qty] field is now supported for all your shipping classes.
362
+
363
+ = 3.7.4 (2018-11-02) =
364
+ * Fixed some cosmetic issues with regards to the blinking status messages
365
+ * Fixed a bug: when a product feed project was disabled one could no longer enable it. This has now been solved
366
+
367
+ = 3.7.3 (2018-11-02) =
368
+ * On popular demand we fixed some Google Local Products Inventory feed issues: the store code attribute was surrounded with non UTF chars, the sale price effective date contained a slash when no sale date was set. Also Google requires it to be a txt file (and not tsv or csv).
369
+ * Fixed a bug: the attribute Category (not used for mapping) was empty for variation products. This has now been fixed. The plugin will use the parent product category for it.
370
+
371
+ = 3.7.2 (2018-11-02) =
372
+ * Fixed a minor bug: variation products that did not have parameters in the URL for which the plugin appended Google Analytics and AdTribes parameters the landingpage URL's contained no questionmark before the parameters
373
+ * Fixed a bug on the get_gallery_image_ids() call
374
+
375
+ = 3.7.1 (2018-10-31) =
376
+ * Bug fixed that was introduced in version 3.7.0, it caused a fatal error upon creation of new feeds
377
+
378
+ = 3.7.0 (2018-10-31) =
379
+ * Added an attributes setting feature so missing custom attributes can be enabled and used for configuration and optimisation of your product feeds.
380
+ * We finally made the progress status message dynamical so you no longer need to refresh your browser to see what the status of your product feed is.
381
+
382
+ = 3.6.9 (2018-10-19) =
383
+ * Fixed a bug: build in stricter UTF8 checks for the description and short_description attributes
384
+
385
+ = 3.6.8 (2018-10-15) =
386
+ * Completed the list of Google Shopping fields available. Also changed the g:adwords_redirect field to g:ads_redirect
387
+
388
+ = 3.6.7 (2018-10-10) =
389
+ * Fixed a bug: When the Yoast SEO plugin was active and products were placed inside a category but no primary category was defined the plugin would not put the category in the product feed. This has now been fixed.
390
+
391
+ = 3.6.6 (2018-10-09) =
392
+ * Added Google's g:cost_of_goods_sold field in the drop-downs so you can add it to your Google Shopping Merchant Center feeds
393
+ * Added Yoast's custom attributes to the drop-downs so you can add those product values to your product feeds
394
+
395
+ = 3.6.5 (2018-10-05) =
396
+ * New feature: When the description of a variation product has been filled it will override the product description and product short description of the simple/mother product.
397
+
398
+ = 3.6.4 (2018-10-05) =
399
+ * Fixed a bug: the plugin was crashing for variation products that had a slash in their product name. This has now been fixed. (Thanks @cargoodrich for reporting this issue to us).
400
+
401
+ = 3.6.3 (2018-10-03) =
402
+ * The optimised title attribute field now also accepts alphanumeric characters
403
+ * Fixed a dynamic attribute bug, it was putting the slug value in the prodicy feed instead of the proper value. This has now been fixed.
404
+
405
+ = 3.6.2 (2018-10-03) =
406
+ * Added the product feed template for Guenstiger.de
407
+
408
+ = 3.6.1 (2018-10-02) =
409
+ * Major custom (product) attribute update: apart from adding individual custom product attributes to the mapping and filtering/rules dropdowns we have also cleaned-up these drop-downs so only the relevant attributes show
410
+ * Fixed a VAT bug that happened for plugin users that also use a caching plugin
411
+
412
+ = 3.6.0 (2018-09-27) =
413
+ * Added support for Facebooks content_type attribute. It is now possible to select the attribute 'Content Type' in the attribute mapping page.
414
+
415
+ = 3.5.9 (2018-09-26) =
416
+ * Fixed another additional image gallery bug, it was showing only two in the feed . Now it shows all.
417
+
418
+ = 3.5.8 (2018-09-24) =
419
+ * Fixed a bug: additional gallery images for variable products can now also be put in product feeds
420
+
421
+ = 3.5.7 (2018-09-23) =
422
+ * Fixed the validation check on MPN
423
+ * Fixed a bug for empty rule sets on values a product doesn't have
424
+
425
+ = 3.5.6 (2018-09-20) =
426
+ * Fixed a bug for include_only and exclude rules and filters that were set on an attribute that were not present for certain products
427
+
428
+ = 3.5.5 (2018-09-17) =
429
+ * Change to the Google Local Products Inventory CSV. Google requires the CSV feed to not contain field enclosures (against official CSV requirements) so we have stripped them off
430
+
431
+ = 3.5.4 (2018-09-15) =
432
+ * Minor changes, fixing PHP log warnings
433
+
434
+ = 3.5.3 (2018-09-10) =
435
+ * Added a plugin setting: you can now override your variation main image with it's mother main image if you do not want your variation images to be your product feeds
436
+
437
+ = 3.5.2 (2018-08-31) =
438
+ * Added product tags support: you can now add product tags to your product feeds and create filters and rules on them
439
+
440
+ = 3.5.1 (2018-08-28) =
441
+ * Added a template for Google Local Products Feed (next to the already existing Local Products Inventory Feed template).
442
+ * Fixed a bug: the field enclosure in Google's Local Products Inventory Feed was wrong. This issue has been fixed now.
443
+
444
+ = 3.5.0 (2018-08-24) =
445
+ * Fixed a bug: multiply rules on numeric values are now both working for European and US annotations.
446
+
447
+ = 3.4.9 (2018-08-22) =
448
+ * Fixed a bug: pieces of product XML or CSV still ended up for products that should have been filtered out. This issue has been fixed now.
449
+
450
+ = 3.4.8 (2018-07-31) =
451
+ * Added the possibility to create replace-rules giving you extra options to manipulate the information that ends up in your product feeds
452
+
453
+ = 3.4.7 (2018-07-30) =
454
+ * Fixed a bug: the optimized title input field did not allow strange characters and uppercases whereas this was allowed for viariant products. This issue has been fixed now.
455
+ * Fixed a bug: there was a double optimized title input field for variant products. This issue has been fixed now.
456
+
457
+ = 3.4.6 (2018-07-30) =
458
+ * Added a template for Google Local Product Inventory
459
+
460
+ = 3.4.5 (2018-07-26) =
461
+ * Fixed a bug: attribute values were no longer appended to product names for variants products. This issue has been fixed now.
462
+
463
+ = 3.4.4 (2018-07-26) =
464
+ * Added a template for Google DSA (Dynamic Search Ads)
465
+
466
+ = 3.4.3 (2018-07-26) =
467
+ * Fixed a bug: plugin was adding the google_product_category tag to the XML for products that were filtered out. This issue has been fixed now.
468
+
469
+ = 3.4.2 (2018-07-20) =
470
+ * Shortcodes added to the description and short description attributes by the visual composer will now be stripped
471
+
472
+ = 3.4.1 (2018-07-19) =
473
+ * Some minor changes to the Miinto templates for the title and description fields
474
+
475
+ = 3.4.0 (2018-07-19) =
476
+ * Fixed a bug: the rightpress plugin support for prices was broken. This issue has been fixed now.
477
+ * Fixed a bug: categories that contained a slash / and for which a category mapping was created caused preg_match PHP warnings in the log. This issue has been fixed now.
478
+
479
+ = 3.3.9 (2018-07-13) =
480
+ * Fixed a bug: when creating a Google Remarketing - DRM feed the delimiter drop-down did not show causing the product feed to have no delimiters. This issue has been fixed now.
481
+
482
+ = 3.3.8 (2018-07-13) =
483
+ * Solved A PHP warning that happened during processing of the product feeds
484
+
485
+ = 3.3.7 (2018-07-06) =
486
+ * Major update to Google category mapping feature: in older versions of the plugin one had to map all categories when a product sat in multiple categories (including the parent category). This no longer is needed, creating just one category mapping for these products is enough, no need to map all categories. Also, when a category mapping is missing for a product the google_product_category field will be empty as of now, whereas previously the plugin put the WooCommerce category name which obviously resulted in disapprovals in Google's Merchant Center as Google did not recognise those categories.
487
+
488
+ = 3.3.6 (2018-07-04) =
489
+ * Fixed a bug: category names that contained a " could not be mapped to Google's categories. This issue now has been fixed.
490
+
491
+ = 3.3.5 (2018-06-30) =
492
+ * Fixed a bug: append to product names was not working in some cases, causing feeds to stall. This issue now has been fixed.
493
+
494
+ = 3.3.4 (2018-06-30) =
495
+ * Fixed a bug: the extra fields our plugin ads somehow did not end up in the feed anymore (GTIN, brand, etc). This issue now has been fixed.
496
+
497
+ = 3.3.3 (2018-06-26) =
498
+ * Removed license check for now. Will launch a seperate version soon.
499
+
500
+ = 3.3.2 (2018-06-26) =
501
+ * New feature: want to retarget your visitors in Google? Simply enable the Google Dynamic Remarketing option of our plugin and Google's remarketing tags will be placed on all pages of your website, including the basket and thank-you page. The Dynamic Remarketing code is perfectly alligned with the product feeds you created.
502
+ * Added a mother product name attribute. Some channels, such as Manomano, need this to be used for variation products.
503
+ * Solved a bug: google categories where added to the XML feed even when product items should have been removed due to filtering. This has now been solved.
504
+ * Solved a bug: removed rightpress support as it was causing prices to be wrong in product feeds.
505
+ * WPML support is deactivated when license is no longer valid
506
+
507
+ = 3.3.1 (2018-06-25) =
508
+ * Added a channel template for Katoni.dk
509
+ * Increased the maximum lenght for custom field from 20 to 50 characters
510
+
511
+ = 3.3.0 (2018-06-24) =
512
+ * Fixed a PHP warning when no attribute could be appended to variant product names
513
+
514
+ = 3.2.9 (2018-06-23) =
515
+ * Fixed a bug: there was a bug in the multiplying rule. This has now been solved.
516
+ * Previous release caused errors to display after the final configuration step. Those have been removed now.
517
+
518
+ = 3.2.8 (2018-06-22) =
519
+ * Fixed a bug: sale prices that were inserted excl. VAT and show incl. VAT on the website did not contain VAT in the product feeds. This has now been solved.
520
+ * Fixed a bug: multiply rules on numeric values containing a comma did not work. This has now been solved.
521
+
522
+ = 3.2.7 (2018-06-22) =
523
+ * Hyphens are now also allowed for XML elements when one adds a custom attribute field
524
+
525
+ = 3.2.6 (2018-06-21) =
526
+ * Made changes to the Miinto templates so they now all support Denmark, Netherlands and Poland localized fields
527
+
528
+ = 3.2.5 (2018-06-20) =
529
+ * We made a change to how category filters are working. Filters are now *always* working on the original category name and no longer need to be changed when you mapped your category to those of Google. We also replaced the input field with a drop-down containing all your categories when you create a new category rule
530
+ * We added an AdTribes widget to your dashboard containing links to our latest blog posts
531
+
532
+ = 3.2.4 (2018-06-18) =
533
+ * Added an option to enable / disable WPML support
534
+
535
+ = 3.2.3 (2018-06-17) =
536
+ * Category rules now both work on your original category name AND the Google category taxonomy
537
+
538
+ = 3.2.2 (2018-06-15) =
539
+ * Minor update: change of plugin name and asset headers
540
+
541
+ = 3.2.1 (2018-06-14) =
542
+ * Multiply, divide, plus and minus are new conditions that can be used when creating rules. These new operators only work on numeric fields such as price, sale price, quantity, etc.
543
+
544
+ = 3.2.0 (2018-06-13) =
545
+ * Added support for WC Fields Factory so the custom attributes created by thus plugin now also can be used
546
+
547
+ = 3.1.9 (2018-06-12) =
548
+ * The extra custom attributes for variations where not saving, this bug has been solved now
549
+
550
+ = 3.1.8 (2018-06-12) =
551
+ * Fixed a bug: in some occasions the attribute value was not appended to the product name for variation products
552
+
553
+ = 3.1.7 (2018-06-10) =
554
+ * Added validation on the input fields added by the plugin (GTIN, EAN, SKU, optimized title, etc)
555
+ * Added sanitizing for POST and GET parameters
556
+
557
+ = 3.1.6 (2018-06-06) =
558
+ * Removed the 'Grant access to support' functionality in the plugin settings section as it was violating the WordPress directory guidelines.
559
+
560
+ = 3.1.5 (2018-06-06) =
561
+ * Added support for WooCommerce Advanced Free Shipping
562
+ * Fixed a bug: inactive shipping methods where still being used to calculate a product shipping price. This has now been solved.
563
+
564
+ = 3.1.4 (2018-06-06) =
565
+ * Added Fruugo.nl template
566
+ * Added Fruugo.es template
567
+ * Added Fruugo United States template
568
+ * Added Fruugo Australia template
569
+
570
+ = 3.1.3 (2018-06-05) =
571
+ * Added Fruugo.co.uk template
572
+ * Added Moebel.de template
573
+
574
+ = 3.1.2 (2018-06-04) =
575
+ * Fixed a bug in the Free Shipping Method
576
+
577
+ = 3.1.1 (2018-06-04) =
578
+ * The size field for Facebook DRM product feeds was missing, added it to the fields drop-downs now.
579
+
580
+ = 3.1.0 (2018-06-03) =
581
+ * WPML: on popular demand our plugin now supports WPML. Create your product feeds in all your active languages.
582
+
583
+ = 3.0.9 (2018-05-31) =
584
+ * Added links to support pages on AdTribes.io
585
+
586
+ = 3.0.8 (2018-05-30) =
587
+ * License notications where not shown when they should, issue has been solved
588
+ * Minor template changes
589
+
590
+ = 3.0.7 (2018-05-30) =
591
+ * Added support for the Google Shopping 'installment' field
592
+
593
+ = 3.0.6 (2018-05-28) =
594
+ * Added the Miinto.pl Poland template
595
+
596
+ = 3.0.5 (2018-05-27) =
597
+ * Fixed a bug: when adding multiple custom attributes in the attribute mapping page it would only save the last created custom attribute mapping. This bug now has been solved.
598
+
599
+ = 3.0.4 (2018-05-27) =
600
+ * Major update of plugin Shipping zones support: The plugin now also supports Australian and United States postal code implementations and respects minimum tresholds for Free Shipping
601
+ * Made compatible with WooCommerce 3.4
602
+ * Changed license check from twice to once a day
603
+
604
+ = 3.0.3 (2018-05-20) =
605
+ * Added template for Miinto Denmark
606
+ * Added template for Miinto Netherlands
607
+ * Fixed a category mapping bug for Google Shopping product feeds
608
+ * Fixed a is_numeric php warning
609
+
610
+ = 3.0.2 (2018-05-17) =
611
+ * Filters are now also working on products that are missing the attribute the filters is set on
612
+
613
+ = 3.0.1 (2018-05-17) =
614
+ * Fixed a batched filter bug
615
+ * Fixed a minor PHP warning
616
+
617
  = 3.0.0 (2018-05-16) =
618
  * Bug fix for include_only filters
619
 
1199
 
1200
  == Upgrade Notice ==
1201
 
1202
+ = 4.0.0 =
1203
+ Fixed another issue with cached prices ending up in product feeds.
1204
+
1205
+ = 3.9.9 =
1206
+ Added support for Cyrillic characters for CSV files.
1207
+
1208
+ = 3.9.8 =
1209
+ Fixed a bug: caching caused product feeds to contain wrong and changing prices in product feeds. This only happened on very rare occaccions but has been fixed now.
1210
+
1211
+ = 3.9.7 =
1212
+ Fixed a bug: when all pre-defined fields for custom feeds where deleted and new fields were added the product feed would break. This has now been fixed.
1213
+ Made improvements to the JSON (structured data fix for the WooCommerce bug)
1214
+
1215
+ = 3.9.6 =
1216
+ Removed the option to create Google Shopping / Merchant Center CSV feeds. The only option left is XML feeds. Current CSV feeds remain working ofcourse.
1217
+ Added support for "fee percentage" Shipping formula's
1218
+
1219
+ = 3.9.5 =
1220
+ Tested for Wordpress 5.0 compatibility, no issues found
1221
+ Added support for diacritics characters in the optimized title field
1222
+
1223
+ = 3.9.4 =
1224
+ Added functionality: one can now create rules saying: if attribute X is empty use the value from attribute Y
1225
+ Added functionality: free shipping zones are now also added to product feeds, even when the price is 0
1226
+
1227
+ = 3.9.3 =
1228
+ Fixed a bug: the last release (3.9.2) broke support for Cyrillic characters. This has now been fixed.
1229
+
1230
+ = 3.9.2 =
1231
+ Fixed a validation bug where spaces where not allowed in the optimized product title field. This has been fixed now.
1232
+
1233
+ = 3.9.1 =
1234
+ Added stricter encoding on the product name, description and short description attributes in order to prevent warnings in Google's Merchant Center
1235
+
1236
+ = 3.9.0 =
1237
+ Product feeds are now only being refreshed when the complete update of a feed has finished. Previously we updated product feeds on the fly which caused issues when for example Google Shopping was retrieving the product feed at the exact same time.
1238
+ You can now create filter and rules on catalogue and search visibility
1239
+ When the sale price of a product is equal to the regular price of a product the product is not on sale, we are now removing the sale price from feeds when this is happening
1240
+ Changed the default price mapping for Google Shopping and Facebook feeds to the regular price attribute
1241
+ Fixed a PHP Notice for products that are eligable for free shipping as the minimum shipping product price was reached.
1242
+ Fixed a PHP Warning which showed when plugin users had no product attributes at all
1243
+
1244
+ = 3.8.9 =
1245
+ Enabled license check module again. This is just the checking module and page. Licenses are not required yet for the Elite features.
1246
+
1247
+ = 3.8.8 =
1248
+ Fixed a bug: shipping zones that had a cost of 0 were removed from the feed. Those are now being added again as those got disapproved by Google.
1249
+ Fixed a bug: removed the admin-url ajax URL for safety reasons.
1250
+
1251
+ = 3.8.7 =
1252
+ Name change of plugin as we got a trademark complaint from Automattic, the owner of the WooCommerce brand
1253
+
1254
+ = 3.8.6 =
1255
+ New feature: we have added the functionality to copy existing product feed configurations to a new product feed. Just hit the copy project icon on the Manage Feeds page.
1256
+
1257
+ = 3.8.5 =
1258
+ Fixed a bug: shipping zone fix for users who put region, country, postal code or price in the zone name itself
1259
+ Added a correction check for shipping cost formula's that have wrongly been inserted by users
1260
+
1261
+ = 3.8.4 =
1262
+ Fixed a bug: some shipping zones were incomplete in product feeds. Issue has been solved.
1263
+
1264
+ = 3.8.3 =
1265
+ Fixed a bug: text delimiters for custom feed CSV's were missing. Issue has been solved.
1266
+
1267
+ = 3.8.2 =
1268
+ Fixed a bug for United States and Australian Shipping cost settings. There are no longer empty shipping XML nodes in the feed.
1269
+
1270
+ = 3.8.1 =
1271
+ Fixed a color/size/material bug: the plugin was not adding product colors, sizes and materials according to Google's Merchant Center requirements when products had multiple values for this. This has now been fixed
1272
+ Fixed a SimpleXMLElement PHP warning causing PHP warnings in the logs (thanks Simon for your help in this one, appreciated!)
1273
+ Checked compatibility with WooCommerce 3.5.1
1274
+
1275
+ = 3.8.0 =
1276
+ Fixed a delimiter issue for Google's Local Product Inventory feeds on special request from @muranomidwest
1277
+
1278
+ = 3.7.9 =
1279
+ Fixed a minor bug: the g:postal_code field format is, for example, 94002-95460. The default WooCommerce annotation is 94002...95460 so this was resulting in warnings in Google's Merchant Center. We have now fixed this bug so the g:postal_code meets up to Google's require
1280
+ ments.
1281
+
1282
+ = 3.7.8 =
1283
+ Rebuild parts of the category mapping functionality as some users experienced mappings that did not get saved or screens that froze.
1284
+ We have added a plugin systems check tab which shows if the basic requirements for this plugin are met.
1285
+
1286
+ = 3.7.7 =
1287
+ Shipping classes with a 0 shipping cost are no longer added to the product feeds
1288
+
1289
+ = 3.7.6 =
1290
+ Fixed a bug: the plugin was adding prefixes and suffixes to attribute values that were empty. Prefixes and suffixes are no longer added to empty attribute values.
1291
+ Fixed a bug: fputcsv was causing issues with CSV files. Replaced this PHP function with an oldfashioned fopen and fwrite. This has now been solved.
1292
+ Fixed a bug: Eval function was throwing and error for Shipping Class formula's that were not truly a formula. This has now been solved.
1293
+
1294
+ = 3.7.5 =
1295
+ Checked and tested the plugin for WooCommerce 3.5. compatibility
1296
+ Fixed a bug: in some browsers, such as Safari, the attribute enabling/disabling feature was not working due to a JS-error. This has now been solved.
1297
+ Added support for shipping costs formula's. The [qty] field is now supported for all your shipping classes.
1298
+
1299
+ = 3.7.4 =
1300
+ Fixed some cosmetic issues with regards to the blinking status messages
1301
+ Fixed a bug: when a product feed project was disabled one could no longer enable it. This has now been solved
1302
+
1303
+ = 3.7.3 =
1304
+ On popular demand we fixed some Google Local Products Inventory feed issues: the store code attribute was surrounded with non UTF chars, the sale price effective date contained a slash when no sale date was set. Also Google requires it to be a txt file (and not tsv or csv).
1305
+ Fixed a bug: the attribute Category (not used for mapping) was empty for variation products. This has now been fixed. The plugin will use the parent product category for it.
1306
+
1307
+ = 3.7.2 =
1308
+ Fixed a minor bug: variation products that did not have parameters in the URL for which the plugin appended Google Analytics and AdTribes parameters the landingpage URL's contained no questionmark before the parameters
1309
+ Fixed a bug on the get_gallery_image_ids() call
1310
+
1311
+ = 3.7.1 =
1312
+ The 3.7.0 version caused a fatal error upon creation of new feeds. This has been solved now.
1313
+
1314
+ = 3.7.0 =
1315
+ Added an attributes setting feature so missing custom attributes can be enabled and used for configuration and optimisation of your product feeds.
1316
+ We finally made the progress status message dynamical so you no longer need to refresh your browser to see what the status of your product feed is.
1317
+
1318
+ = 3.6.9 =
1319
+ Fixed a bug: build in stricter UTF8 checks for the description and short_description attributes
1320
+
1321
+ = 3.6.8 =
1322
+ Completed the list of Google Shopping fields available. Also changed the g:adwords_redirect field to g:ads_redirect
1323
+
1324
+ = 3.6.7 =
1325
+ Fixed a bug: When the Yoast SEO plugin was active and products were placed inside a category but no primary category was defined the plugin would not put the category in the product feed. This has now been fixed.
1326
+
1327
+ = 3.6.6 =
1328
+ Added Google's g:cost_of_goods_sold field in the drop-downs so you can add it to your Google Shopping Merchant Center feeds
1329
+ Added Yoast's custom attributes to the drop-downs so you can add those product values to your product feeds
1330
+
1331
+ = 3.6.5 =
1332
+ New feature: When the description of a variation product has been filled it will override the product description and product short description of the simple/mother product.
1333
+
1334
+ = 3.6.4 =
1335
+ Fixed a bug: the plugin was crashing for variation products that had a slash in their product name. This has now been fixed. (Thanks @cargoodrich for reporting this issue to us).
1336
+
1337
+ = 3.6.3 =
1338
+ The optimised title attribute field now also accepts alphanumeric characters
1339
+ Fixed a dynamic attribute bug, it was putting the slug value in the prodicy feed instead of the proper value. This has now been fixed.
1340
+
1341
+ = 3.6.2 =
1342
+ Added the product feed template for Guenstiger.de
1343
+
1344
+ = 3.6.1 =
1345
+ Major custom (product) attribute update: apart from adding individual custom product attributes to the mapping and filtering/rules dropdowns we have also cleaned-up these drop-downs so only the relevant attributes show
1346
+ Fixed a VAT bug that happened for plugin users that also use a caching plugin
1347
+
1348
+ = 3.6.0 =
1349
+ Added support for Facebooks content_type attribute. It is now possible to select the attribute 'Content Type' in the attribute mapping page.
1350
+
1351
+ = 3.5.9 =
1352
+ Fixed another additional image gallery bug, it was showing only two in the feed . Now it shows all.
1353
+
1354
+ = 3.5.8 =
1355
+ Fixed a bug: additional gallery images for variable products can now also be put in product feeds
1356
+
1357
+ = 3.5.7 =
1358
+ Fixed the validation check on MPN
1359
+ Fixed a bug for empty rule sets on values a product doesn't have
1360
+
1361
+ = 3.5.6 =
1362
+ Fixed a bug for include_only and exclude rules and filters that were set on an attribute that were not present for certain products
1363
+
1364
+ = 3.5.5 =
1365
+ Change to the Google Local Products Inventory CSV. Google requires the CSV feed to not contain field enclosures (against official CSV requirements) so we have stripped them off
1366
+
1367
+ = 3.5.4 =
1368
+ Minor changes, fixing PHP log warnings
1369
+
1370
+ = 3.5.3 =
1371
+ Added a plugin setting: you can now override your variation main image with it's mother main image if you do not want your variation images to be your product feeds
1372
+
1373
+ = 3.5.2 =
1374
+ Added product tags support: you can now add product tags to your product feeds and create filters and rules on them
1375
+
1376
+ = 3.5.1 =
1377
+ Added a template for Google Local Products Feed (next to the already existing Local Products Inventory Feed template).
1378
+ Fixed a bug: the field enclosure in Google's Local Products Inventory Feed was wrong. This issue has been fixed now.
1379
+
1380
+ = 3.5.0 =
1381
+ Fixed a bug: multiply rules on numeric values are now both working for European and US annotations.
1382
+
1383
+ = 3.4.9 =
1384
+ Fixed a bug: pieces of product XML or CSV still ended up for products that should have been filtered out. This issue has been fixed now.
1385
+
1386
+ = 3.4.8 =
1387
+ Added the possibility to create replace-rules giving you extra options to manipulate the information that ends up in your product feeds
1388
+
1389
+ = 3.4.7 =
1390
+ Fixed a bug: the optimized title input field did not allow strange characters and uppercases whereas this was allowed for viariant products. This issue has been fixed now.
1391
+ Fixed a bug: there was a double optimized title input field for variant products. This issue has been fixed now.
1392
+
1393
+ = 3.4.6 =
1394
+ Added a template for Google Local Product Inventory
1395
+
1396
+ = 3.4.5 =
1397
+ Fixed a bug: attribute values were no longer appended to product names for variants products. This issue has been fixed now.
1398
+
1399
+ = 3.4.4 =
1400
+ Added a template for Google DSA (Dynamic Search Ads)
1401
+
1402
+ = 3.4.3 =
1403
+ Fixed a bug: plugin was adding the google_product_category tag to the XML for products that were filtered out. This issue has been fixed now.
1404
+
1405
+ = 3.4.2 =
1406
+ Shortcodes added to the description and short description attributes by the visual composer will now be stripped
1407
+
1408
+ = 3.4.1 =
1409
+ Some minor changes to the Miinto templates for the title and description fields
1410
+
1411
+ = 3.4.0 =
1412
+ Fixed a bug: the rightpress plugin support for prices was broken. This issue has been fixed now.
1413
+ Fixed a bug: categories that contained a slash / and for which a category mapping was created caused preg_match PHP warnings in the log. This issue has been fixed now.
1414
+
1415
+ = 3.3.9 =
1416
+ Fixed a bug: when creating a Google Remarketing - DRM feed the delimiter drop-down did not show causing the product feed to have no delimiters. This issue has been fixed now.
1417
+
1418
+ = 3.3.8 =
1419
+ Solved A PHP warning that happened during processing of the product feeds
1420
+
1421
+ = 3.3.7 =
1422
+ Major update to Google category mapping feature: in older versions of the plugin one had to map all categories when a product sat in multiple categories (including the parent category). This no longer is needed, creating just one category mapping for these products is enough, no need to map all categories. Also, when a category mapping is missing for a product the google_product_category field will be empty as of now, whereas previously the plugin put the WooCommerce category name which obviously resulted in disapprovals in Google's Merchant Ce
1423
+ nter as Google did not recognise those categories.
1424
+
1425
+ = 3.3.6 =
1426
+ Fixed a bug: category names that contained a " could not be mapped to Google's categories. This issue now has been fixed.
1427
+
1428
+ = 3.3.5 =
1429
+ Fixed a bug: append to product names was not working in some cases, causing feeds to stall. This issue now has been fixed.
1430
+
1431
+ = 3.3.4 =
1432
+ Fixed a bug: the extra fields our plugin ads somehow did not end up in the feed anymore (GTIN, brand, etc). This issue now has been fixed.
1433
+
1434
+ = 3.3.3 =
1435
+ Removed license check for now. Will launch a seperate version soon.
1436
+
1437
+ = 3.3.2 =
1438
+ New feature: want to retarget your visitors in Google? Simply enable the Google Dynamic Remarketing option of our plugin and Google's remarketing tags will be placed on all pages of your website, including the basket and thank-you page. The Dynamic Remarketing code is perfectly alligned with the product feeds you created.
1439
+ Added a mother product name attribute. Some channels, such as Manomano, need this to be used for variation products.
1440
+ Solved a bug: google categories where added to the XML feed even when product items should have been removed due to filtering. This has now been solved.
1441
+ Solved a bug: removed rightpress support as it was causing prices to be wrong in product feeds.
1442
+
1443
+ = 3.3.1 =
1444
+ Added a channel template for Katoni.dk
1445
+ Increased the maximum lenght for custom field from 20 to 50 characters
1446
+
1447
+ = 3.3.0 =
1448
+ Fixed a PHP warning when no attribute could be appended to variant product names
1449
+
1450
+ = 3.2.9 =
1451
+ Fixed a bug: there was a bug in the multiplying rule. This has now been solved.
1452
+ Previous release caused errors to display after the final configuration step. Those have been removed now.
1453
+
1454
+ = 3.2.8 =
1455
+ Fixed a bug: sale prices that were inserted excl. VAT and show incl. VAT on the website did not contain VAT in the product feeds. This has now been solved.
1456
+ Fixed a bug: multiply rules on numeric values containing a comma did not work. This has now been solved.
1457
+
1458
+ = 3.2.7 =
1459
+ Hyphens are now also allowed for XML elements when one adds a custom attribute field
1460
+
1461
+ = 3.2.6 =
1462
+ Made changes to the Miinto templates so they now all support Denmark, Netherlands and Poland localized fields
1463
+
1464
+ = 3.2.5 =
1465
+ We made a change to how category filters are working. Filters are now *always* working on the original category name and no longer need to be changed when you mapped your category to those of Google
1466
+ We added an AdTribes widget to your dashboard containing links to our latest blog posts
1467
+
1468
+ = 3.2.4 =
1469
+ Added an option to enable / disable WPML support
1470
+
1471
+ = 3.2.3 =
1472
+ Category rules now both work on your original category name AND the Google category taxonomy
1473
+
1474
+ = 3.2.2 =
1475
+ Minor update: change of plugin name and asset headers
1476
+
1477
+ = 3.2.1 =
1478
+ Multiply, divide, plus and minus are new conditions that can be used when creating rules. These new operators only work on numeric fields such as price, sale price, quantity, etc.
1479
+
1480
+ = 3.2.0 =
1481
+ Added support for WC Fields Factory
1482
+
1483
+ = 3.1.8 =
1484
+ Fixed a bug: in some occasions the attribute value was not appended to the product name for variation products
1485
+
1486
+ = 3.1.7 =
1487
+ Added validation on the input fields added by the plugin (GTIN, EAN, SKU, optimized title, etc)
1488
+ Added sanitizing for POST and GET parameters
1489
+
1490
+ = 3.1.6 =
1491
+ Removed the 'Grant access to support' functionality in the plugin settings section as it was violating the WordPress directory guidelines.
1492
+
1493
+ = 3.1.5 =
1494
+ Added support for WooCommerce Advanced Free Shipping
1495
+ Fixed a bug: inactive shipping methods where still being used to calculate a product shipping price. This has now been solved.
1496
+
1497
+ = 3.1.4 =
1498
+ Added Fruugo.nl template
1499
+ Added Fruugo.es template
1500
+ Added Fruugo United States template
1501
+ Added Fruugo Australia template
1502
+
1503
+ = 3.1.3 =
1504
+ Added Fruugo.co.uk template
1505
+ Added Moebel.de template
1506
+
1507
+ = 3.1.2 =
1508
+ Fixed a bug in the Free Shipping Method
1509
+
1510
+ = 3.1.1 =
1511
+ The size field for Facebook DRM product feeds was missing, added it to the fields drop-downs now.
1512
+
1513
+ = 3.1.0 =
1514
+ WPML: on popular demand our plugin now supports WPML. Create your product feeds in all your active languages.
1515
+
1516
+ = 3.0.9 =
1517
+ Added links to support pages on AdTribes.io
1518
+
1519
+ = 3.0.8 =
1520
+ License notications where not shown when they should, issue has been solved
1521
+ Minor template changes
1522
+
1523
+ = 3.0.7 =
1524
+ Added support for the Google Shopping 'installment' field
1525
+
1526
+ = 3.0.6 =
1527
+ Added the Miinto.pl Poland template
1528
+
1529
+ = 3.0.5 =
1530
+ Fixed a bug: when adding multiple custom attributes in the attribute mapping page it would only save the last created custom attribute mapping. This bug now has been solved.
1531
+
1532
+ = 3.0.4 =
1533
+ Major update of plugin Shipping zones support: The plugin now also supports Australian and United States postal code implementations and respects minimum tresholds for Free Shipping
1534
+ Made compatible with WooCommerce 3.4
1535
+ Changed license check from twice to once a day
1536
+
1537
+ = 3.0.3 =
1538
+ Added template for Miinto Denmark
1539
+ Added template for Miinto Netherlands
1540
+ Fixed a category mapping bug for Google Shopping product feeds
1541
+ Fixed a is_numeric php warning
1542
+
1543
+ = 3.0.2 =
1544
+ Filters are now also working on products that are missing the attribute the filters is set on
1545
+
1546
+ = 3.0.1 =
1547
+ Fixed a batched filter bug
1548
+ Fixed a minor PHP warning
1549
+
1550
  = 3.0.0 =
1551
  Bug fix for include_only filters
1552
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
- * Plugin Name: WooCommerce Product Feed PRO
4
- * Version: 3.0.0
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
@@ -13,22 +13,22 @@
13
  * Text Domain: wporg
14
  * Domain Path: /languages
15
  * WC requires at least: 3.0
16
- * WC tested up to: 3.3
17
  */
18
 
19
  /**
20
- * WooCommerce Product Feed PRO is free software: you can redistribute it and/or modify
21
  * it under the terms of the GNU General Public License as published by
22
  * the Free Software Foundation, either version 3 of the License, or
23
  * any later version.
24
  *
25
- * WooCommerce Product Feed PRO is distributed in the hope that it will be useful,
26
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
  * GNU General Public License for more details.
29
  *
30
  * You should have received a copy of the GNU General Public License
31
- * along with WooCommerce Product Feed PRO. If not, see <http://www.gnu.org/licenses/>.
32
  */
33
 
34
  /**
@@ -45,7 +45,7 @@ if (!defined('ABSPATH')) {
45
  /**
46
  * Plugin versionnumber, please do not override
47
  */
48
- define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '3.0.0' );
49
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
50
 
51
  if ( ! defined( 'WOOCOMMERCESEA_FILE' ) ) {
@@ -113,9 +113,9 @@ function woosea_scripts($hook) {
113
  wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
114
  wp_enqueue_script( 'woosea_manage-js' );
115
 
116
- // JS for checking license key
117
- wp_register_script( 'woosea_license-js', plugin_dir_url( __FILE__ ) . 'js/woosea_license.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
118
- wp_enqueue_script( 'woosea_license-js' );
119
  }
120
  add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
121
 
@@ -128,6 +128,157 @@ require plugin_dir_path(__FILE__) . 'classes/class-get-products.php';
128
  require plugin_dir_path(__FILE__) . 'classes/class-admin-notifications.php';
129
  require plugin_dir_path(__FILE__) . 'classes/class-update-channel.php';
130
  require plugin_dir_path(__FILE__) . 'classes/class-attributes.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  /**
133
  * Hook and function that will run during plugin uninstall.
@@ -156,6 +307,27 @@ function activate_woosea_feed(){
156
  }
157
  register_activation_hook(__FILE__, 'activate_woosea_feed');
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  /**
160
  * Request our plugin users to write a review
161
  **/
@@ -173,33 +345,12 @@ function woosea_request_review(){
173
  $is_active = $current_time-$first_activation;
174
 
175
  if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
176
- echo '<div class="notice notice-info review-notification is-dismissible"><font color="green" style="font-weight:bold";><p>Hey, I noticed you have been using my plugin, WooCommerce Product Feed PRO, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost my motivation.<br/>~ Joris Verwater<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></div>';
177
  }
178
  }
179
  }
180
  add_action('admin_notices', 'woosea_request_review');
181
 
182
- /**
183
- * Request our plugin users to write a review
184
- **/
185
- function woosea_license_notice(){
186
- $license_information = get_option( 'license_information' );
187
- $license_notification = get_option( 'woosea_license_notification_closed' );
188
- $screen = get_current_screen();
189
-
190
- if($screen->id <> 'product-feed-pro_page_woosea_upgrade_elite'){
191
- if((isset($license_information['notice'])) and ($license_information['notice'] == "true") and ($license_notification <> 'yes')){
192
- ?>
193
- <div class="<?php print "$license_information[message_type]"; ?> license_notification">
194
- <p><?php _e( $license_information['message'], 'sample-text-domain' ); ?></p>
195
- </div>
196
- <?php
197
- }
198
- }
199
- }
200
- add_action('admin_notices', 'woosea_license_notice');
201
-
202
-
203
  /**
204
  * Create a seperate MySql table for saving conversion information
205
  */
@@ -233,18 +384,17 @@ register_activation_hook(__FILE__, 'woosea_create_db_table');
233
  * Add some JS and mark-up code on every front-end page in order to get the conversion tracking to work
234
  */
235
  function woosea_hook_header() {
236
- $marker = sprintf('<!-- This website runs the WooCommerce Product Feed PRO AdTribes.io plugin -->');
237
  echo "\n${marker}\n";
238
 
239
  // Make ajaxurl available on all pages
240
- echo '<script type="text/javascript">
241
- var ajaxurl = "' . admin_url('admin-ajax.php') . '";
242
- </script>';
243
 
244
  // JS for adding the tracking code into the template
245
- wp_register_script( 'woosea_tracking-js', plugin_dir_url( __FILE__ ) . 'js/woosea_tracking.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
246
- wp_enqueue_script( 'woosea_tracking-js' );
247
-
248
  }
249
  add_action('wp_head','woosea_hook_header');
250
 
@@ -260,8 +410,8 @@ function woosea_inject_ajax( $order_id ){
260
 
261
  update_option('last_order_id', $order_id);
262
 
263
- $jscode = sprintf('<script type="text/javascript">var ajaxurl = "' . admin_url('admin-ajax.php') . '";</script>');
264
- echo "\n${jscode}\n\n";
265
  }
266
  add_action( 'woocommerce_thankyou', 'woosea_inject_ajax' );
267
 
@@ -270,7 +420,6 @@ add_action( 'woocommerce_thankyou', 'woosea_inject_ajax' );
270
  */
271
  add_action( 'woosea_cron_hook', 'woosea_create_all_feeds'); // create a cron hook
272
 
273
-
274
  /**
275
  * Check if license for Elite version is valid
276
  */
@@ -280,11 +429,11 @@ add_action( 'woosea_check_license', 'woosea_license_valid'); // check if license
280
  * Add WooCommerce SEA plugin to Menu
281
  */
282
  function woosea_menu_addition(){
283
- add_menu_page(__('WooCommerce Product Feed PRO', 'woosea-feed'), __('Product Feed Pro', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages', 'dashicons-chart-bar',99);
284
  add_submenu_page(__FILE__, __('Feed configuration', 'woosea-feed'), __('Create feed', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages');
285
  add_submenu_page(__FILE__, __('Manage feeds', 'woosea-feed'), __('Manage feeds', 'woosea-feed'), 'manage_options', 'woosea_manage_feed', 'woosea_manage_feed');
286
  add_submenu_page(__FILE__, __('Settings', 'woosea-feed'), __('Settings', 'woosea-feed'), 'manage_options', 'woosea_manage_settings', 'woosea_manage_settings');
287
- add_submenu_page(__FILE__, __('Upgrade to Elite', 'woosea-feed'), __('Upgrade to Elite', 'woosea-feed'), 'manage_options', 'woosea_upgrade_elite', 'woosea_upgrade_elite');
288
  }
289
 
290
  /**
@@ -311,6 +460,58 @@ function woosea_ajax() {
311
  }
312
  add_action( 'wp_ajax_woosea_ajax', 'woosea_ajax' );
313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  /**
315
  * Map categories to the correct Google Shopping category taxonomy
316
  */
@@ -319,9 +520,10 @@ function woosea_add_cat_mapping() {
319
  $className = sanitize_text_field($_POST['className']);
320
  $map_to_category = sanitize_text_field($_POST['map_to_category']);
321
  $project_hash = sanitize_text_field($_POST['project_hash']);
322
- $criteria = sanitize_text_field($_POST['criteria']);
323
- $status_mapping = "false";
324
 
 
 
325
  $project = WooSEA_Update_Project::get_project_data(sanitize_text_field($project_hash));
326
 
327
  // This is during the configuration of a new feed
@@ -361,22 +563,24 @@ add_action( 'wp_ajax_woosea_add_cat_mapping', 'woosea_add_cat_mapping' );
361
  * Function to register a succesfull license activation
362
  */
363
  function woosea_register_license(){
364
- $license_valid = sanitize_text_field($_POST['license_valid']);
365
- $license_created = sanitize_text_field($_POST['license_created']);
366
- $message = sanitize_text_field($_POST['message']);
367
- $message_type = sanitize_text_field($_POST['message_type']);
368
- $license_email = sanitize_text_field($_POST['license_email']);
369
- $license_key = sanitize_text_field($_POST['license_key']);
370
-
371
- $license_information = array (
372
- 'license_valid' => $license_valid,
373
- 'license_created' => $license_created,
374
- 'message' => $message,
375
- 'message_type' => $message_type,
376
- 'license_email' => $license_email,
377
- 'license_key' => $license_key
378
- );
379
- update_option("license_information", $license_information);
 
 
380
 
381
  }
382
  add_action( 'wp_ajax_woosea_register_license', 'woosea_register_license' );
@@ -385,7 +589,7 @@ add_action( 'wp_ajax_woosea_register_license', 'woosea_register_license' );
385
  * Deactivate Elite license
386
  */
387
  function woosea_deactivate_license(){
388
- delete_option( 'license_information' );
389
  }
390
  add_action( 'wp_ajax_woosea_deactivate_license', 'woosea_deactivate_license' );
391
 
@@ -401,10 +605,12 @@ function woosea_find_matching_product_variation( $product, $attributes ) {
401
  unset( $attributes[ $key ] );
402
  $attributes[ sprintf( 'attribute_%s', $key ) ] = $value;
403
  }
404
-
405
  if( class_exists('WC_Data_Store') ) {
406
  $data_store = WC_Data_Store::load( 'product' );
407
- return $data_store->find_matching_product_variation( $product, $attributes );
 
 
408
  } else {
409
  return $product->get_matching_variation( $attributes );
410
  }
@@ -433,9 +639,11 @@ function woosea_product_delete_meta_price( $product = null ) {
433
 
434
  if($structured_data_fix == "yes"){
435
 
436
- if ( '' !== $product->get_price() ) {
 
 
437
  $product_id = get_the_id();
438
-
439
  // Get product condition
440
  $condition = ucfirst( get_post_meta( $product_id, '_woosea_condition', true ) );
441
  if(!$condition){
@@ -448,15 +656,27 @@ function woosea_product_delete_meta_price( $product = null ) {
448
  // We should first check if there are any _GET parameters available
449
  // When there are not we are on a variable product page but not on a specific variable one
450
  // In that case we need to put in the AggregateOffer structured data
451
- $variation_id = woosea_find_matching_product_variation( $product, $_GET );
452
  $nr_get = count($_GET);
453
-
454
  if($nr_get > 0){
 
 
 
 
 
 
 
 
 
 
 
 
 
455
  $variable_product = wc_get_product($variation_id);
456
-
457
  if(is_object( $variable_product ) ) {
458
-
459
- $product_price = $variable_product->get_price();
460
 
461
  // Get product condition
462
  $condition = ucfirst( get_post_meta( $variation_id, '_woosea_condition', true ) );
@@ -531,26 +751,15 @@ function woosea_product_delete_meta_price( $product = null ) {
531
  }
532
  }
533
  } else {
 
 
534
  // When there are no parameters in the URL (so for normal users, not coming via Google Shopping URL's) show the old WooCommwerce JSON
535
- $prices = $product->get_variation_prices();
536
- $lowest = reset( $prices['price'] );
537
- $highest = end( $prices['price'] );
538
-
539
- if ( $lowest === $highest ) {
540
- $markup_offer = array(
541
- '@type' => 'Offer',
542
- 'price' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
543
- );
544
- } else {
545
- $markup_offer = array(
546
- '@type' => 'AggregateOffer',
547
- 'lowPrice' => wc_format_decimal( $lowest, wc_get_price_decimals() ),
548
- 'highPrice' => wc_format_decimal( $highest, wc_get_price_decimals() ),
549
- );
550
- }
551
-
552
  $markup_offer += array(
553
- 'priceCurrency' => $shop_currency,
 
 
554
  'availability' => 'https://schema.org/' . ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
555
  'seller' => array(
556
  '@type' => 'Organization',
@@ -563,7 +772,7 @@ function woosea_product_delete_meta_price( $product = null ) {
563
  } else {
564
  $markup_offer = array(
565
  '@type' => 'Offer',
566
- 'price' => wc_format_decimal( $product->get_price(), wc_get_price_decimals() ),
567
  'priceCurrency' => $shop_currency,
568
  'itemCondition' => 'http://schema.org/'.$json_condition.'',
569
  'availability' => 'https://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
@@ -577,7 +786,7 @@ function woosea_product_delete_meta_price( $product = null ) {
577
  ),
578
  );
579
  }
580
- }
581
  } else {
582
  // Just use the old WooCommerce buggy setting
583
  if ( '' !== $product->get_price() ) {
@@ -743,6 +952,95 @@ function woosea_project_cancel(){
743
  }
744
  add_action( 'wp_ajax_woosea_project_cancel', 'woosea_project_cancel' );
745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
  /**
747
  * Refresh a project
748
  */
@@ -764,6 +1062,46 @@ function woosea_project_refresh(){
764
  }
765
  add_action( 'wp_ajax_woosea_project_refresh', 'woosea_project_refresh' );
766
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
767
  /**
768
  * Change status of a project from active to inactive or visa versa
769
  */
@@ -772,15 +1110,20 @@ function woosea_project_status() {
772
  $active = sanitize_text_field($_POST['active']);
773
  $feed_config = get_option( 'cron_projects' );
774
 
775
- foreach ( $feed_config as $key => $val ) {
776
- if ($val['project_hash'] == $project_hash){
777
- $feed_config[$key]['active'] = $active;
778
- $upload_dir = wp_upload_dir();
779
- $base = $upload_dir['basedir'];
780
- $path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
781
- $file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
782
- }
783
- }
 
 
 
 
 
784
 
785
  // When project is put on inactive, delete the product feed
786
  if($active == "false"){
@@ -807,16 +1150,6 @@ function woosea_review_notification() {
807
  }
808
  add_action( 'wp_ajax_woosea_review_notification', 'woosea_review_notification' );
809
 
810
- /**
811
- * Register interaction with the license notification
812
- * We do not want to keep bothering our users with the notification
813
- */
814
- function woosea_license_notification() {
815
- // Update review notification status
816
- update_option( 'woosea_license_notification_closed', 'yes');
817
- }
818
- add_action( 'wp_ajax_woosea_license_notification', 'woosea_license_notification' );
819
-
820
  /**
821
  * This function enables the setting to fix the
822
  * WooCommerce structured data bug
@@ -831,6 +1164,50 @@ function woosea_enable_structured_data (){
831
  }
832
  add_action( 'wp_ajax_woosea_enable_structured_data', 'woosea_enable_structured_data' );
833
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
834
 
835
  /**
836
  * This function enables the setting to add
@@ -959,6 +1336,26 @@ function woosea_custom_general_fields() {
959
  )
960
  );
961
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
  // Exclude product from feed
963
  woocommerce_wp_checkbox(
964
  array(
@@ -979,23 +1376,25 @@ add_action( 'woocommerce_product_options_general_product_data', 'woosea_custom_g
979
  */
980
  function woosea_save_custom_general_fields($post_id){
981
 
982
- $woocommerce_brand = $_POST['_woosea_brand'];
983
- $woocommerce_gtin = $_POST['_woosea_gtin'];
984
- $woocommerce_upc = $_POST['_woosea_upc'];
985
- $woocommerce_mpn = $_POST['_woosea_mpn'];
986
- $woocommerce_ean = $_POST['_woosea_ean'];
987
- $woocommerce_title = $_POST['_woosea_optimized_title'];
988
- $woocommerce_unit_pricing_measure = $_POST['_woosea_unit_pricing_measure'];
989
- $woocommerce_unit_pricing_base_measure = $_POST['_woosea_unit_pricing_base_measure'];
990
- $woocommerce_condition = $_POST['_woosea_condition'];
 
 
991
  if(!empty($_POST['_woosea_exclude_product'])){
992
- $woocommerce_exclude_product = $_POST['_woosea_exclude_product'];
993
  } else {
994
  $woocommerce_exclude_product = "no";;
995
  }
996
 
997
  if(isset($woocommerce_brand))
998
- update_post_meta( $post_id, '_woosea_brand', esc_attr($woocommerce_brand));
999
 
1000
  if(isset($woocommerce_mpn))
1001
  update_post_meta( $post_id, '_woosea_mpn', esc_attr($woocommerce_mpn));
@@ -1010,16 +1409,22 @@ function woosea_save_custom_general_fields($post_id){
1010
  update_post_meta( $post_id, '_woosea_gtin', esc_attr($woocommerce_gtin));
1011
 
1012
  if(isset($woocommerce_title))
1013
- update_post_meta( $post_id, '_woosea_optimized_title', esc_attr($woocommerce_title));
1014
 
1015
  if(isset($woocommerce_unit_pricing_measure))
1016
- update_post_meta( $post_id, '_woosea_unit_pricing_measure', esc_attr($woocommerce_unit_pricing_measure));
1017
 
1018
  if(isset($woocommerce_unit_pricing_base_measure))
1019
- update_post_meta( $post_id, '_woosea_unit_pricing_base_measure', esc_attr($woocommerce_unit_pricing_base_measure));
1020
 
1021
  if(isset($woocommerce_condition))
1022
- update_post_meta( $post_id, '_woosea_condition', esc_attr($woocommerce_condition));
 
 
 
 
 
 
1023
 
1024
  if(isset($woocommerce_exclude_product))
1025
  update_post_meta( $post_id, '_woosea_exclude_product', esc_attr($woocommerce_exclude_product));
@@ -1138,6 +1543,32 @@ function woosea_custom_variable_fields( $loop, $variation_id, $variation ) {
1138
  )
1139
  );
1140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
  // Add product condition drop-down
1142
  woocommerce_wp_select(
1143
  array(
@@ -1195,7 +1626,7 @@ function woosea_save_custom_variable_fields( $post_id ) {
1195
  $_brand = $_POST['_woosea_variable_brand'];
1196
  $variation_id = (int) $variable_post_id[$i];
1197
  if ( isset( $_brand[$i] ) ) {
1198
- update_post_meta( $variation_id, '_woosea_brand', stripslashes( $_brand[$i]));
1199
  }
1200
 
1201
 
@@ -1203,56 +1634,70 @@ function woosea_save_custom_variable_fields( $post_id ) {
1203
  $_mpn = $_POST['_woosea_variable_mpn'];
1204
  $variation_id = (int) $variable_post_id[$i];
1205
  if ( isset( $_mpn[$i] ) ) {
1206
- update_post_meta( $variation_id, '_woosea_mpn', stripslashes( $_mpn[$i]));
1207
  }
1208
 
1209
  // UPC Field
1210
  $_upc = $_POST['_woosea_variable_upc'];
1211
  $variation_id = (int) $variable_post_id[$i];
1212
  if ( isset( $_upc[$i] ) ) {
1213
- update_post_meta( $variation_id, '_woosea_upc', stripslashes( $_upc[$i]));
1214
  }
1215
 
1216
  // EAN Field
1217
  $_ean = $_POST['_woosea_variable_ean'];
1218
  $variation_id = (int) $variable_post_id[$i];
1219
  if ( isset( $_ean[$i] ) ) {
1220
- update_post_meta( $variation_id, '_woosea_ean', stripslashes( $_ean[$i]));
1221
  }
1222
 
1223
  // GTIN Field
1224
  $_gtin = $_POST['_woosea_variable_gtin'];
1225
  $variation_id = (int) $variable_post_id[$i];
1226
  if ( isset( $_gtin[$i] ) ) {
1227
- update_post_meta( $variation_id, '_woosea_gtin', stripslashes( $_gtin[$i]));
1228
  }
1229
 
1230
  // Unit pricing measure Field
1231
  $_pricing_measure = $_POST['_woosea_variable_unit_pricing_measure'];
1232
  $variation_id = (int) $variable_post_id[$i];
1233
  if ( isset( $_pricing_measure[$i] ) ) {
1234
- update_post_meta( $variation_id, '_woosea_unit_pricing_measure', stripslashes( $_pricing_measure[$i]));
1235
  }
1236
 
1237
  // Unit pricing base measure Field
1238
  $_pricing_base = $_POST['_woosea_variable_unit_pricing_base_measure'];
1239
  $variation_id = (int) $variable_post_id[$i];
1240
  if ( isset( $_pricing_base[$i] ) ) {
1241
- update_post_meta( $variation_id, '_woosea_unit_pricing_base_measure', stripslashes( $_pricing_base[$i]));
1242
  }
1243
 
1244
  // Optimized title Field
1245
  $_opttitle = $_POST['_woosea_optimized_title'];
1246
  $variation_id = (int) $variable_post_id[$i];
1247
  if ( isset( $_opttitle[$i] ) ) {
1248
- update_post_meta( $variation_id, '_woosea_optimized_title', stripslashes( $_opttitle[$i]));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1249
  }
1250
 
1251
  // Product condition Field
1252
  $_condition = $_POST['_woosea_condition'];
1253
  $variation_id = (int) $variable_post_id[$i];
1254
  if ( isset( $_condition[$i] ) ) {
1255
- update_post_meta( $variation_id, '_woosea_condition', stripslashes( $_condition[$i]));
1256
  }
1257
 
1258
  // Exclude product from feed
@@ -1270,74 +1715,6 @@ function woosea_save_custom_variable_fields( $post_id ) {
1270
  }
1271
  add_action( 'woocommerce_save_product_variation', 'woosea_save_custom_variable_fields', 10, 1 );
1272
 
1273
- /**
1274
- * Returns the user ID of the user which is used as the
1275
- * login for AdTribes support. The user is created here if it doesn't
1276
- * exist yet, with role Shop Manager.
1277
- *
1278
- * @return int adtribes-support user ID
1279
- */
1280
- function woosea_create_support_user() {
1281
- $status = sanitize_text_field($_POST['status']);
1282
- $user_id = get_current_user_id();
1283
- $user = get_user_by( 'login', 'adtribes-support' );
1284
-
1285
- if ( $user instanceof WP_User ) {
1286
- // user exists already
1287
- if($status == "off"){
1288
- $user_id = $user->ID;
1289
- $del_user = wp_delete_user($user_id);
1290
- update_option('woosea_support_user', 'no', 'yes');
1291
- } else {
1292
- $user_id = $user->ID;
1293
- update_option('woosea_support_user', 'yes', 'yes');
1294
- }
1295
- } else {
1296
- $user_pass = wp_generate_password( 12 );
1297
- $maybe_user_id = wp_insert_user( array(
1298
- 'user_login' => 'adtribes-support',
1299
- 'role' => 'administrator',
1300
- 'user_pass' => $user_pass,
1301
- 'user_email' => 'support@adtribes.io',
1302
- 'display_name' => 'AdTribes.io Support',
1303
- 'description' => 'AdTribes.io Support user created to help with configuration of product feeds',
1304
- ) );
1305
- if ( !( $maybe_user_id instanceof WP_Error ) ) {
1306
- $user_id = $maybe_user_id;
1307
-
1308
- update_option('woosea_support_user', 'yes', 'yes');
1309
-
1310
- // notify admin
1311
- $user = get_userdata( $user_id );
1312
- $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
1313
-
1314
- $message = sprintf( __( 'AdTribes.io support user created on %s:', WOOCOMMERCESEA_PLUGIN_NAME ), $blogname ) . "\r\n\r\n";
1315
- $message .= sprintf( __( 'Username: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $user->user_login ) . "\r\n\r\n";
1316
- $message .= sprintf( __( 'Password: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $user_pass ) . "\r\n\r\n";
1317
- $message .= __( 'The user has the role of an Admin.', WOOCOMMERCESEA_PLUGIN_NAME ) . "\r\n";
1318
-
1319
- @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] AdTribes.io Support User', WOOCOMMERCESEA_PLUGIN_NAME ), $blogname ), $message);
1320
-
1321
- // notify AdTribes.io support
1322
- $websitehome = wp_specialchars_decode( get_option( 'home' ), ENT_QUOTES );
1323
- $admin_login = wp_login_url( get_permalink() );
1324
- $websiteadmin = $admin_login;
1325
-
1326
- $message = sprintf( __( 'AdTribes.io support user created on %s:', WOOCOMMERCESEA_PLUGIN_NAME ), $blogname ) . "\r\n\r\n";
1327
- $message .= sprintf( __( 'Website: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $websitehome ) . "\r\n\r\n";
1328
- $message .= sprintf( __( 'WP Admin: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $websiteadmin ) . "\r\n\r\n";
1329
- $message .= sprintf( __( 'Username: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $user->user_login ) . "\r\n\r\n";
1330
- $message .= sprintf( __( 'Password: %s', WOOCOMMERCESEA_PLUGIN_NAME ), $user_pass ) . "\r\n\r\n";
1331
-
1332
- $message .= __( 'The user has the role of a Admin.', WOOCOMMERCESEA_PLUGIN_NAME ) . "\r\n";
1333
-
1334
- @wp_mail( 'support@adtribes.io', sprintf( __( '[%s] AdTribes.io Support User', WOOCOMMERCESEA_PLUGIN_NAME ), $blogname ), $message);
1335
- }
1336
- }
1337
- return $user_id;
1338
- }
1339
- add_action( 'wp_ajax_woosea_create_support_user', 'woosea_create_support_user' );
1340
-
1341
  /**
1342
  * Set project history: amount of products in the feed
1343
  **/
@@ -1446,9 +1823,6 @@ function woosea_fieldmapping_dialog_helptext(){
1446
  case "g:shipping";
1447
  $helptext = "(Required when you need to override the shipping settings that you set up in Merchant Center) Google recommends that you set up shipping costs through your Merchant center. However, when you need to override these settings you can map the g:shipping field to the 'Shipping price' attribute.";
1448
  break;
1449
- case "Grant access";
1450
- $helptext = "Grant access to our support employees so we can help you out with creating your product feed.";
1451
- break;
1452
  case "Structured data fix";
1453
  $helptext = "Because of a bug in WooCommerce variable products will get disapproved in Google's Merchant Center. WooCommerce adds the price of the cheapest variable product in the structured data for all variations of a product. Because of this there will be a mismatch between the product price you provide to Google in your Google Shopping product feed and the structured data price on the product landingpage. Google will therefor disapprove the product in its merchant center. You won't be able to advertise on that product in your Google Shopping campaign. Enable this option will fix the structured data on variable product pages by adding the correct variable product price in the JSON-LD structured data so Google will approve the variable products you submitted.";
1454
  break;
@@ -1715,8 +2089,8 @@ function woosea_generate_pages(){
1715
  * needs to be done once and not continuesly so it gets removed.
1716
  */
1717
  function woosea_de_register_license(){
1718
- wp_dequeue_script( 'woosea_adtribes-js' );
1719
- wp_deregister_script( 'woosea_adtribes-js' );
1720
  }
1721
  add_action( 'woosea_deregister_hook', 'woosea_de_register_license', 99999); // deregister the paid version check after 60 seconds
1722
 
@@ -1725,46 +2099,48 @@ add_action( 'woosea_deregister_hook', 'woosea_de_register_license', 99999); // d
1725
  * key is invalid or expired the advanced options of this plugin will be disabled
1726
  */
1727
  function woosea_license_valid(){
1728
- $domain = $_SERVER['HTTP_HOST'];
1729
- $license_information = get_option('license_information');
1730
 
1731
  $curl = curl_init();
1732
- $url = "https://www.adtribes.io/check/license.php?key=$license_information[license_key]&email=$license_information[license_email]&domain=$domain&version=3.0.0";
1733
 
1734
- curl_setopt_array($curl, array(
1735
- CURLOPT_RETURNTRANSFER => 1,
1736
  CURLOPT_URL => $url,
1737
  CURLOPT_USERAGENT => 'AdTribes license cURL Request'
1738
  ));
1739
  $response = curl_exec( $curl );
1740
  curl_close($curl);
1741
  $json_return = json_decode($response, true);
1742
-
1743
- $license_start_time = strtotime($json_return['created']);
1744
  $license_end_time = strtotime('+1 years', $license_start_time);
1745
  $current_time = time();
1746
- $license_information['notice'] = $json_return['notice'];
1747
-
1748
- if($json_return['valid'] == "false"){
1749
- $license_information['message'] = $json_return['message'];
1750
- $license_information['message_type'] = $json_return['message_type'];
1751
- $license_information['license_valid'] = "false";
1752
- $license_information['license_key'] = $json_return['license_key'];
1753
- $license_information['license_email'] = $json_return['license_email'];
1754
-
1755
- update_option ('license_information', $license_information);
1756
- delete_option ('structured_data_fix');
1757
- delete_option ('add_unique_identifiers');
1758
- } else {
1759
- $license_information['message'] = $json_return['message'];
1760
- $license_information['message_type'] = $json_return['message_type'];
1761
- $license_information['license_valid'] = "true";
1762
-
1763
- update_option ('license_information', $license_information);
1764
- }
 
 
 
1765
  }
1766
 
1767
-
1768
  /**
1769
  * Function used by event scheduling to create feeds
1770
  * Feed can automatically be generated every hour, twicedaiy or once a day
@@ -1772,7 +2148,11 @@ function woosea_license_valid(){
1772
  function woosea_create_all_feeds(){
1773
  $feed_config = array();
1774
  $feed_config = get_option( 'cron_projects' );
1775
- $nr_projects = count($feed_config);
 
 
 
 
1776
  $cron_start_date = date("d M Y H:i");
1777
  $cron_start_time = time();
1778
  $hour = date('H');
@@ -2037,7 +2417,7 @@ function woosea_manage_settings(){
2037
  */
2038
  function woosea_upgrade_elite(){
2039
  $html = new Construct_Admin_Pages();
2040
- $html->set_page("woosea-upgrade-elite");
2041
  echo $html->get_page();
2042
  }
2043
 
@@ -2056,4 +2436,97 @@ function woosea_clear(){
2056
  * Add plugin links to Wordpress menu
2057
  */
2058
  add_action( 'admin_menu' , 'woosea_menu_addition' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2059
  ?>
1
  <?php
2
  /**
3
+ * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 4.0.0
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
13
  * Text Domain: wporg
14
  * Domain Path: /languages
15
  * WC requires at least: 3.0
16
+ * WC tested up to: 3.5
17
  */
18
 
19
  /**
20
+ * Product Feed PRO for WooCommerce is free software: you can redistribute it and/or modify
21
  * it under the terms of the GNU General Public License as published by
22
  * the Free Software Foundation, either version 3 of the License, or
23
  * any later version.
24
  *
25
+ * Product Feed PRO for WooCommerce is distributed in the hope that it will be useful,
26
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
  * GNU General Public License for more details.
29
  *
30
  * You should have received a copy of the GNU General Public License
31
+ * along with Product Feed PRO for WooCommerce. If not, see <http://www.gnu.org/licenses/>.
32
  */
33
 
34
  /**
45
  /**
46
  * Plugin versionnumber, please do not override
47
  */
48
+ define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '4.0.0' );
49
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
50
 
51
  if ( ! defined( 'WOOCOMMERCESEA_FILE' ) ) {
113
  wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
114
  wp_enqueue_script( 'woosea_manage-js' );
115
 
116
+ // JS for managing keys
117
+ wp_register_script( 'woosea_key-js', plugin_dir_url( __FILE__ ) . 'js/woosea_key.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
118
+ wp_enqueue_script( 'woosea_key-js' );
119
  }
120
  add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
121
 
128
  require plugin_dir_path(__FILE__) . 'classes/class-admin-notifications.php';
129
  require plugin_dir_path(__FILE__) . 'classes/class-update-channel.php';
130
  require plugin_dir_path(__FILE__) . 'classes/class-attributes.php';
131
+ require plugin_dir_path(__FILE__) . 'classes/class-google-remarketing.php';
132
+
133
+ /**
134
+ * Add links to the plugin page
135
+ */
136
+ function woosea_plugin_action_links($links, $file) {
137
+ static $this_plugin;
138
+
139
+ if (!$this_plugin) {
140
+ $this_plugin = plugin_basename(__FILE__);
141
+ }
142
+
143
+ // check to make sure we are on the correct plugin
144
+ if ($file == $this_plugin) {
145
+
146
+ // link to what ever you want
147
+ $plugin_links[] = '<a href="https://adtribes.io/support/" target="_blank">Support</a>';
148
+ $plugin_links[] = '<a href="https://adtribes.io/blog/" target="_blank">Blog</a>';
149
+ //$plugin_links[] = '<a href="https://adtribes.io/pro-vs-elite/?utm_source=adminpage&utm_medium=pluginpage&utm_campaign=upgrade-elite&utm_term=upgrade to elite" target="_blank">Upgrade to Elite</a>';
150
+ //$plugin_links[] = '<a href="https://adtribes.io/pro-vs-elite/?utm_source=adminpage&utm_medium=pluginpage&utm_campaign=upgrade-elite&utm_term=premium support" target="_blank">Premium Support</a>';
151
+
152
+ // add the links to the list of links already there
153
+ foreach($plugin_links as $link) {
154
+ array_unshift($links, $link);
155
+ }
156
+ }
157
+ return $links;
158
+ }
159
+ add_filter('plugin_action_links', 'woosea_plugin_action_links', 10, 2);
160
+
161
+ /**
162
+ * Add Google Adwords Remarketing code to footer
163
+ */
164
+ function woosea_add_remarketing_tags( $product = null ){
165
+ if ( ! is_object( $product ) ) {
166
+ global $product;
167
+ }
168
+ $ecomm_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
169
+ $add_remarketing = get_option ('add_remarketing');
170
+
171
+ if($add_remarketing == "yes"){
172
+ $adwords_conversion_id = get_option("woosea_adwords_conversion_id");
173
+
174
+ if($adwords_conversion_id > 0){
175
+ if ($ecomm_pagetype == "product"){
176
+ if ( '' !== $product->get_price()) {
177
+ $ecomm_prodid = get_the_id();
178
+
179
+ if(!empty($ecomm_prodid)){
180
+ if ( $product->is_type( 'variable' ) ) {
181
+ // We should first check if there are any _GET parameters available
182
+ // When there are not we are on a variable product page but not on a specific variable one
183
+ // In that case we need to put in the AggregateOffer structured data
184
+
185
+ $variation_id = woosea_find_matching_product_variation( $product, $_GET );
186
+ $nr_get = count($_GET);
187
+
188
+ if($nr_get > 0){
189
+ $variable_product = wc_get_product($variation_id);
190
+
191
+ if(is_object( $variable_product ) ) {
192
+ $product_price = $variable_product->get_price_html();
193
+ $ecomm_price = $product_price;
194
+ } else {
195
+ // AggregateOffer
196
+ $prices = $product->get_variation_prices();
197
+ $lowest = reset( $prices['price'] );
198
+ $highest = end( $prices['price'] );
199
+
200
+ if ( $lowest === $highest ) {
201
+ $ecomm_price = wc_format_decimal( $lowest, wc_get_price_decimals() );
202
+ } else {
203
+ $ecomm_lowprice = wc_format_decimal( $lowest, wc_get_price_decimals() );
204
+ $ecomm_highprice = wc_format_decimal( $highest, wc_get_price_decimals() );
205
+ }
206
+ }
207
+ } else {
208
+ // When there are no parameters in the URL (so for normal users, not coming via Google Shopping URL's) show the old WooCommwerce JSON
209
+ $prices = $product->get_variation_prices();
210
+ $lowest = reset( $prices['price'] );
211
+ $highest = end( $prices['price'] );
212
+
213
+ if ( $lowest === $highest ) {
214
+ $ecomm_price = wc_format_decimal( $lowest, wc_get_price_decimals());
215
+ } else {
216
+ $ecomm_lowprice = wc_format_decimal( $lowest, wc_get_price_decimals() );
217
+ $ecomm_highprice = wc_format_decimal( $highest, wc_get_price_decimals() );
218
+ }
219
+ }
220
+ } else {
221
+ $ecomm_price = wc_format_decimal( $product->get_price(), wc_get_price_decimals() );
222
+ }
223
+ }
224
+
225
+ ?>
226
+ <script type="text/javascript">
227
+ var google_tag_params = {
228
+ ecomm_prodid: '<?php print "$ecomm_prodid";?>',
229
+ ecomm_pagetype: '<?php print "$ecomm_pagetype";?>',
230
+ ecomm_totalvalue: <?php print "$ecomm_price";?>,
231
+ };
232
+ </script>
233
+
234
+ <?php
235
+ }
236
+ } elseif ($ecomm_pagetype == "cart"){
237
+ $ecomm_prodid = get_the_id();
238
+
239
+ ?>
240
+ <script type="text/javascript">
241
+ var google_tag_params = {
242
+ ecomm_prodid: '<?php print "$ecomm_prodid";?>',
243
+ ecomm_pagetype: '<?php print "$ecomm_pagetype";?>',
244
+ };
245
+ </script>
246
+ <?php
247
+ } else {
248
+ // This is another page than a product page
249
+ ?>
250
+ <script type="text/javascript">
251
+ var google_tag_params = {
252
+ ecomm_pagetype: '<?php print "$ecomm_pagetype";?>',
253
+ };
254
+ </script>
255
+ <?php
256
+ }
257
+ ?>
258
+ <!-- Google-code – remarketing tag added by AdTribes.io -->
259
+ <!--------------------------------------------------
260
+ You need to make sure that the ecomm_prodid parameter, which we fill with your
261
+ WooCommerce product Id matches the g:id field for your Google Merchant Center feed.
262
+ --------------------------------------------------->
263
+ <script type="text/javascript">
264
+ /* <![CDATA[ */
265
+ var google_conversion_id = <?php print "$adwords_conversion_id";?>;
266
+ var google_custom_params = window.google_tag_params;
267
+ var google_remarketing_only = true;
268
+ /* ]]> */
269
+ </script>
270
+ <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
271
+ </script>
272
+ <noscript>
273
+ <div style="display:inline;">
274
+ <img height="1" width="1" style="border-style:none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/<?php print "$adwords_conversion_id";?>/?guid=ON&amp;script=0"/>
275
+ </div>
276
+ </noscript>
277
+ <?php
278
+ }
279
+ }
280
+ }
281
+ add_action('wp_footer', 'woosea_add_remarketing_tags');
282
 
283
  /**
284
  * Hook and function that will run during plugin uninstall.
307
  }
308
  register_activation_hook(__FILE__, 'activate_woosea_feed');
309
 
310
+ /**
311
+ * Request our plugin users to write a review
312
+ **/
313
+ function woosea_license_notice(){
314
+ $license_information = get_option( 'license_information' );
315
+ $license_notification = get_option( 'woosea_license_notification_closed' );
316
+ $screen = get_current_screen();
317
+
318
+ if($screen->id <> 'product-feed-elite_page_woosea_upgrade_elite'){
319
+ if((isset($license_information['notice'])) and ($license_information['notice'] == "true") and ($license_notification <> 'yes')){
320
+ ?>
321
+ <div class="<?php print "$license_information[message_type]"; ?> license_notification">
322
+ <p><?php _e( $license_information['message'], 'sample-text-domain' ); ?></p>
323
+ </div>
324
+ <?php
325
+ }
326
+ }
327
+ }
328
+ add_action('admin_notices', 'woosea_license_notice');
329
+
330
+
331
  /**
332
  * Request our plugin users to write a review
333
  **/
345
  $is_active = $current_time-$first_activation;
346
 
347
  if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
348
+ echo '<div class="notice notice-info review-notification is-dismissible"><font color="green" style="font-weight:bold";><p>Hey, I noticed you have been using my plugin, Product Feed PRO for WooCommerce, for over a week now and have created product feed projects with it - that\'s awesome! Could you please do me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost my motivation.<br/>~ Joris Verwater<br><ul><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="https://wordpress.org/support/plugin/woo-product-feed-pro/reviews?rate=5#new-post" target="_blank" class="dismiss-review-notification">Ok, you deserve it</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">Nope, maybe later</a></li><li><span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span><a href="#" class="dismiss-review-notification">I already did</a></li></ul></p></font></div>';
349
  }
350
  }
351
  }
352
  add_action('admin_notices', 'woosea_request_review');
353
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
354
  /**
355
  * Create a seperate MySql table for saving conversion information
356
  */
384
  * Add some JS and mark-up code on every front-end page in order to get the conversion tracking to work
385
  */
386
  function woosea_hook_header() {
387
+ $marker = sprintf('<!-- This website runs the Product Feed PRO for WooCommerce by AdTribes.io plugin -->');
388
  echo "\n${marker}\n";
389
 
390
  // Make ajaxurl available on all pages
391
+ // echo '<script type="text/javascript">
392
+ // var ajaxurl = "' . admin_url('admin-ajax.php') . '";
393
+ // </script>';
394
 
395
  // JS for adding the tracking code into the template
396
+ // wp_register_script( 'woosea_tracking-js', plugin_dir_url( __FILE__ ) . 'js/woosea_tracking.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
397
+ // wp_enqueue_script( 'woosea_tracking-js' );
 
398
  }
399
  add_action('wp_head','woosea_hook_header');
400
 
410
 
411
  update_option('last_order_id', $order_id);
412
 
413
+ // $jscode = sprintf('<script type="text/javascript">var ajaxurl = "' . admin_url('admin-ajax.php') . '";</script>');
414
+ // echo "\n${jscode}\n\n";
415
  }
416
  add_action( 'woocommerce_thankyou', 'woosea_inject_ajax' );
417
 
420
  */
421
  add_action( 'woosea_cron_hook', 'woosea_create_all_feeds'); // create a cron hook
422
 
 
423
  /**
424
  * Check if license for Elite version is valid
425
  */
429
  * Add WooCommerce SEA plugin to Menu
430
  */
431
  function woosea_menu_addition(){
432
+ add_menu_page(__('Product Feed PRO for WooCommerce', 'woosea-feed'), __('Product Feed Pro', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages', 'dashicons-chart-bar',99);
433
  add_submenu_page(__FILE__, __('Feed configuration', 'woosea-feed'), __('Create feed', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages');
434
  add_submenu_page(__FILE__, __('Manage feeds', 'woosea-feed'), __('Manage feeds', 'woosea-feed'), 'manage_options', 'woosea_manage_feed', 'woosea_manage_feed');
435
  add_submenu_page(__FILE__, __('Settings', 'woosea-feed'), __('Settings', 'woosea-feed'), 'manage_options', 'woosea_manage_settings', 'woosea_manage_settings');
436
+ // add_submenu_page(__FILE__, __('Upgrade to Elite', 'woosea-elite-feed'), __('Upgrade to Elite', 'woosea-elite-feed'), 'manage_options', 'woosea_key', 'woosea_upgrade_elite');
437
  }
438
 
439
  /**
460
  }
461
  add_action( 'wp_ajax_woosea_ajax', 'woosea_ajax' );
462
 
463
+ /**
464
+ * Get a list of categories for the drop-down
465
+ */
466
+ function woosea_categories_dropdown() {
467
+ $rowCount = sanitize_text_field($_POST['rowCount']);
468
+
469
+ // Check if WPML is active, switch language?
470
+ // if(isset($project['WPML'])){
471
+ // if ( function_exists('icl_object_id') ) {
472
+ // // Get WPML language
473
+ // global $sitepress;
474
+ // $lang = $project['WPML'];
475
+ // $sitepress->switch_lang($lang);
476
+ // }
477
+ // }
478
+
479
+ $orderby = 'name';
480
+ $order = 'asc';
481
+ $hide_empty = false ;
482
+ $cat_args = array(
483
+ 'orderby' => $orderby,
484
+ 'order' => $order,
485
+ 'hide_empty' => $hide_empty,
486
+ );
487
+
488
+ $categories_dropdown = "<select name=\"rules[$rowCount][criteria]\">";
489
+ $product_categories = get_terms( 'product_cat', $cat_args );
490
+ foreach ($product_categories as $key => $category) {
491
+ $categories_dropdown .= "<option value=\"$category->name\">$category->name</option>";
492
+
493
+ }
494
+ $categories_dropdown .= "</select>";
495
+
496
+ $data = array (
497
+ 'rowCount' => $rowCount,
498
+ 'dropdown' => $categories_dropdown
499
+ );
500
+ echo json_encode($data);
501
+ wp_die();
502
+ }
503
+ add_action( 'wp_ajax_woosea_categories_dropdown', 'woosea_categories_dropdown' );
504
+
505
+ /**
506
+ * Save Google Dynamic Remarketing Conversion Tracking ID
507
+ */
508
+ function woosea_save_adwords_conversion_id() {
509
+ $adwords_conversion_id = sanitize_text_field($_POST['adwords_conversion_id']);
510
+ update_option("woosea_adwords_conversion_id", $adwords_conversion_id);
511
+ }
512
+ add_action( 'wp_ajax_woosea_save_adwords_conversion_id', 'woosea_save_adwords_conversion_id' );
513
+
514
+
515
  /**
516
  * Map categories to the correct Google Shopping category taxonomy
517
  */
520
  $className = sanitize_text_field($_POST['className']);
521
  $map_to_category = sanitize_text_field($_POST['map_to_category']);
522
  $project_hash = sanitize_text_field($_POST['project_hash']);
523
+ //$criteria = sanitize_text_field($_POST['criteria']);
 
524
 
525
+ $criteria = $_POST['criteria'];
526
+ $status_mapping = "false";
527
  $project = WooSEA_Update_Project::get_project_data(sanitize_text_field($project_hash));
528
 
529
  // This is during the configuration of a new feed
563
  * Function to register a succesfull license activation
564
  */
565
  function woosea_register_license(){
566
+ $license_valid = sanitize_text_field($_POST['license_valid']);
567
+ $license_created = sanitize_text_field($_POST['license_created']);
568
+ $message = sanitize_text_field($_POST['message']);
569
+ $message_type = sanitize_text_field($_POST['message_type']);
570
+ $license_email = sanitize_text_field($_POST['license_email']);
571
+ $license_key = sanitize_text_field($_POST['license_key']);
572
+ $notice = sanitize_text_field($_POST['notice']);
573
+
574
+ $license_information = array (
575
+ 'license_valid' => $license_valid,
576
+ 'license_created' => $license_created,
577
+ 'message' => $message,
578
+ 'message_type' => $message_type,
579
+ 'license_email' => $license_email,
580
+ 'license_key' => $license_key,
581
+ 'notice' => $notice,
582
+ );
583
+ update_option("license_information", $license_information);
584
 
585
  }
586
  add_action( 'wp_ajax_woosea_register_license', 'woosea_register_license' );
589
  * Deactivate Elite license
590
  */
591
  function woosea_deactivate_license(){
592
+ delete_option( 'license_information' );
593
  }
594
  add_action( 'wp_ajax_woosea_deactivate_license', 'woosea_deactivate_license' );
595
 
605
  unset( $attributes[ $key ] );
606
  $attributes[ sprintf( 'attribute_%s', $key ) ] = $value;
607
  }
608
+
609
  if( class_exists('WC_Data_Store') ) {
610
  $data_store = WC_Data_Store::load( 'product' );
611
+
612
+ // return ( new \WC_Product_Data_Store_CPT() )->find_matching_product_variation(new \WC_Product( $product ),$attributes);
613
+ return $data_store->find_matching_product_variation( $product, $attributes );
614
  } else {
615
  return $product->get_matching_variation( $attributes );
616
  }
639
 
640
  if($structured_data_fix == "yes"){
641
 
642
+ $pr_woo = wc_get_price_to_display($product);
643
+
644
+ // if ( '' !== $product->get_regular_price() ) {
645
  $product_id = get_the_id();
646
+
647
  // Get product condition
648
  $condition = ucfirst( get_post_meta( $product_id, '_woosea_condition', true ) );
649
  if(!$condition){
656
  // We should first check if there are any _GET parameters available
657
  // When there are not we are on a variable product page but not on a specific variable one
658
  // In that case we need to put in the AggregateOffer structured data
 
659
  $nr_get = count($_GET);
660
+
661
  if($nr_get > 0){
662
+ //$variation_id = woosea_find_matching_product_variation( $product, $_GET );
663
+ $mother_id = wc_get_product()->get_id();
664
+ $children_ids = $product->get_children();
665
+
666
+ foreach ($children_ids as &$child_val) {
667
+ $product_variations = new WC_Product_Variation( $child_val );
668
+ $variations = array_filter($product_variations->get_variation_attributes());
669
+ $intersect = array_intersect($_GET, $variations);
670
+
671
+ if($variations == $intersect){
672
+ $variation_id = $child_val;
673
+ }
674
+ }
675
  $variable_product = wc_get_product($variation_id);
676
+
677
  if(is_object( $variable_product ) ) {
678
+ // Structured data error here, it ignores VAT when prices has been entered without VAT
679
+ $product_price = wc_get_price_to_display($variable_product);
680
 
681
  // Get product condition
682
  $condition = ucfirst( get_post_meta( $variation_id, '_woosea_condition', true ) );
751
  }
752
  }
753
  } else {
754
+ // This is a variation product page but no variation has been selected. WooCommerce always shows the price of the lowest priced
755
+ // variation product. That is why we also put this in the JSON
756
  // When there are no parameters in the URL (so for normal users, not coming via Google Shopping URL's) show the old WooCommwerce JSON
757
+ $product_price = wc_get_price_to_display($product);
758
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  $markup_offer += array(
760
+ '@type' => 'Offer',
761
+ 'price' => $product_price,
762
+ 'priceCurrency' => $shop_currency,
763
  'availability' => 'https://schema.org/' . ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
764
  'seller' => array(
765
  '@type' => 'Organization',
772
  } else {
773
  $markup_offer = array(
774
  '@type' => 'Offer',
775
+ 'price' => wc_format_decimal( wc_get_price_to_display($product), wc_get_price_decimals() ),
776
  'priceCurrency' => $shop_currency,
777
  'itemCondition' => 'http://schema.org/'.$json_condition.'',
778
  'availability' => 'https://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
786
  ),
787
  );
788
  }
789
+ // }
790
  } else {
791
  // Just use the old WooCommerce buggy setting
792
  if ( '' !== $product->get_price() ) {
952
  }
953
  add_action( 'wp_ajax_woosea_project_cancel', 'woosea_project_cancel' );
954
 
955
+ /**
956
+ * Get the processing status of a project feed
957
+ */
958
+ function woosea_project_processing_status(){
959
+ $project_hash = sanitize_text_field($_POST['project_hash']);
960
+ $feed_config = get_option( 'cron_projects' );
961
+ $proc_perc = 0;
962
+
963
+ foreach ( $feed_config as $key => $val ) {
964
+ if ($val['project_hash'] == $project_hash){
965
+ if($val['running'] == "ready"){
966
+ $proc_perc = 100;
967
+ } elseif($val['running'] == "not run yet"){
968
+ $proc_perc = 999; // Fake, otherwise the copied feed will be generated immediatly
969
+ } else {
970
+ $proc_perc = round(($val['nr_products_processed']/$val['nr_products'])*100);
971
+ }
972
+ }
973
+ }
974
+
975
+ $data = array (
976
+ 'proc_perc' => $proc_perc,
977
+ );
978
+
979
+ echo json_encode($data);
980
+ wp_die();
981
+
982
+ }
983
+ add_action( 'wp_ajax_woosea_project_processing_status', 'woosea_project_processing_status' );
984
+
985
+ /**
986
+ * Copy a project
987
+ */
988
+ function woosea_project_copy(){
989
+ $project_hash = sanitize_text_field($_POST['project_hash']);
990
+ $feed_config = get_option( 'cron_projects' );
991
+
992
+ $max_key = max(array_keys($feed_config));
993
+ $add_project = array();
994
+ $upload_dir = wp_upload_dir();
995
+ $external_base = $upload_dir['baseurl'];
996
+
997
+ foreach ( $feed_config as $key => $val ) {
998
+ if ($val['project_hash'] == $project_hash){
999
+ $val['projectname'] = "Copy ". $val['projectname'];
1000
+ $val['project_hash'] = bin2hex(openssl_random_pseudo_bytes(16));
1001
+ $val['filename'] = $val['project_hash'];
1002
+ $val['utm_campaign'] = "Copy ". $val['utm_campaign'];
1003
+ $val['last_updated'] = "";
1004
+ $val['running'] = "not run yet";
1005
+
1006
+ // Construct product feed URL
1007
+ $external_path = $external_base . "/woo-product-feed-pro/" . $val['fileformat'];
1008
+ $val['external_file'] = $external_path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
1009
+
1010
+ // To build the new project row on the manage feed page
1011
+ $projecthash = $val['project_hash'];
1012
+ $projectname = $val['projectname'];
1013
+ $channel = $val['name'];
1014
+ $fileformat = $val['fileformat'];
1015
+ $interval = $val['cron'];
1016
+ $external_file = $val['external_file'];
1017
+
1018
+ // Save the copied project
1019
+ $new_key = $max_key+1;
1020
+ $add_project[$new_key] = $val;
1021
+ array_push($feed_config, $add_project[$new_key]);
1022
+ update_option( 'cron_projects', $feed_config, '', 'yes');
1023
+
1024
+ // Do not start processing, user wants to make changes to the copied project
1025
+ $copy_status = "true";
1026
+ }
1027
+ }
1028
+
1029
+ $data = array (
1030
+ 'project_hash' => $projecthash,
1031
+ 'channel' => $channel,
1032
+ 'projectname' => $projectname,
1033
+ 'fileformat' => $fileformat,
1034
+ 'interval' => $interval,
1035
+ 'external_file' => $external_file,
1036
+ 'copy_status' => $copy_status
1037
+ );
1038
+
1039
+ echo json_encode($data);
1040
+ wp_die();
1041
+ }
1042
+ add_action( 'wp_ajax_woosea_project_copy', 'woosea_project_copy' );
1043
+
1044
  /**
1045
  * Refresh a project
1046
  */
1062
  }
1063
  add_action( 'wp_ajax_woosea_project_refresh', 'woosea_project_refresh' );
1064
 
1065
+ /**
1066
+ * Add or remove custom attributes to the feed configuration drop-downs
1067
+ */
1068
+ function woosea_add_attributes() {
1069
+ $attribute_name = sanitize_text_field($_POST['attribute_name']);
1070
+ $attribute_value = sanitize_text_field($_POST['attribute_value']);
1071
+ $active = sanitize_text_field($_POST['active']);
1072
+
1073
+ // unset($extra_attributes);
1074
+ // delete_option('woosea_extra_attributes');
1075
+
1076
+ if(!get_option( 'woosea_extra_attributes' )){
1077
+ if($active == "true"){
1078
+ $extra_attributes = array(
1079
+ $attribute_value => $attribute_name
1080
+ );
1081
+ update_option ( 'woosea_extra_attributes', $extra_attributes, 'yes');
1082
+ }
1083
+ } else {
1084
+ $extra_attributes = get_option( 'woosea_extra_attributes' );
1085
+ if(!in_array($attribute_name, $extra_attributes)){
1086
+ if($active == "true"){
1087
+ $add_attribute = array (
1088
+ $attribute_value => $attribute_name
1089
+ );
1090
+ $extra_attributes = array_merge ($extra_attributes, $add_attribute);
1091
+ update_option ( 'woosea_extra_attributes', $extra_attributes, 'yes');
1092
+ }
1093
+ } else {
1094
+ if($active == "false"){
1095
+ // remove from extra attributes array
1096
+ $extra_attributes = array_diff($extra_attributes, array($attribute_value => $attribute_name));
1097
+ update_option ( 'woosea_extra_attributes', $extra_attributes, 'yes');
1098
+ }
1099
+ }
1100
+ }
1101
+ $extra_attributes = get_option( 'woosea_extra_attributes' );
1102
+ }
1103
+ add_action( 'wp_ajax_woosea_add_attributes', 'woosea_add_attributes' );
1104
+
1105
  /**
1106
  * Change status of a project from active to inactive or visa versa
1107
  */
1110
  $active = sanitize_text_field($_POST['active']);
1111
  $feed_config = get_option( 'cron_projects' );
1112
 
1113
+ $number_feeds = count($feed_config);
1114
+
1115
+ if ($number_feeds > 0){
1116
+
1117
+ foreach ( $feed_config as $key => $val ) {
1118
+ if ($val['project_hash'] == $project_hash){
1119
+ $feed_config[$key]['active'] = $active;
1120
+ $upload_dir = wp_upload_dir();
1121
+ $base = $upload_dir['basedir'];
1122
+ $path = $base . "/woo-product-feed-pro/" . $val['fileformat'];
1123
+ $file = $path . "/" . sanitize_file_name($val['filename']) . "." . $val['fileformat'];
1124
+ }
1125
+ }
1126
+ }
1127
 
1128
  // When project is put on inactive, delete the product feed
1129
  if($active == "false"){
1150
  }
1151
  add_action( 'wp_ajax_woosea_review_notification', 'woosea_review_notification' );
1152
 
 
 
 
 
 
 
 
 
 
 
1153
  /**
1154
  * This function enables the setting to fix the
1155
  * WooCommerce structured data bug
1164
  }
1165
  add_action( 'wp_ajax_woosea_enable_structured_data', 'woosea_enable_structured_data' );
1166
 
1167
+ /**
1168
+ * This function enables the setting to add
1169
+ * WPML support
1170
+ */
1171
+ function woosea_add_wpml (){
1172
+ $status = sanitize_text_field($_POST['status']);
1173
+
1174
+ if ($status == "off"){
1175
+ update_option( 'add_wpml_support', 'no', 'yes');
1176
+ } else {
1177
+ update_option( 'add_wpml_support', 'yes', 'yes');
1178
+ }
1179
+ }
1180
+ add_action( 'wp_ajax_woosea_add_wpml', 'woosea_add_wpml' );
1181
+
1182
+ /**
1183
+ * This function enables the setting to use
1184
+ * Mother main image for all product variations
1185
+ */
1186
+ function woosea_add_mother_image (){
1187
+ $status = sanitize_text_field($_POST['status']);
1188
+
1189
+ if ($status == "off"){
1190
+ update_option( 'add_mother_image', 'no', 'yes');
1191
+ } else {
1192
+ update_option( 'add_mother_image', 'yes', 'yes');
1193
+ }
1194
+ }
1195
+ add_action( 'wp_ajax_woosea_add_mother_image', 'woosea_add_mother_image' );
1196
+
1197
+ /**
1198
+ * This function enables the setting to add
1199
+ * Google's Dynamic Remarketing
1200
+ */
1201
+ function woosea_add_remarketing (){
1202
+ $status = sanitize_text_field($_POST['status']);
1203
+
1204
+ if ($status == "off"){
1205
+ update_option( 'add_remarketing', 'no', 'yes');
1206
+ } else {
1207
+ update_option( 'add_remarketing', 'yes', 'yes');
1208
+ }
1209
+ }
1210
+ add_action( 'wp_ajax_woosea_add_remarketing', 'woosea_add_remarketing' );
1211
 
1212
  /**
1213
  * This function enables the setting to add
1336
  )
1337
  );
1338
 
1339
+ // Installment months
1340
+ woocommerce_wp_text_input(
1341
+ array(
1342
+ 'id' => '_woosea_installment_months',
1343
+ 'label' => __( 'Installment months', 'woocommerce' ),
1344
+ 'desc_tip' => 'true',
1345
+ 'description' => __( 'Enter the number of monthly installments the buyer has to pay.', 'woocommerce' ),
1346
+ )
1347
+ );
1348
+
1349
+ // Installment amount
1350
+ woocommerce_wp_text_input(
1351
+ array(
1352
+ 'id' => '_woosea_installment_amount',
1353
+ 'label' => __( 'Installment amount', 'woocommerce' ),
1354
+ 'desc_tip' => 'true',
1355
+ 'description' => __( 'Enter the amount the nuyer has to pay per month.', 'woocommerce' ),
1356
+ )
1357
+ );
1358
+
1359
  // Exclude product from feed
1360
  woocommerce_wp_checkbox(
1361
  array(
1376
  */
1377
  function woosea_save_custom_general_fields($post_id){
1378
 
1379
+ $woocommerce_brand = sanitize_text_field($_POST['_woosea_brand']);
1380
+ $woocommerce_gtin = sanitize_text_field($_POST['_woosea_gtin']);
1381
+ $woocommerce_upc = sanitize_text_field($_POST['_woosea_upc']);
1382
+ $woocommerce_mpn = sanitize_text_field($_POST['_woosea_mpn']);
1383
+ $woocommerce_ean = sanitize_text_field($_POST['_woosea_ean']);
1384
+ $woocommerce_title = sanitize_text_field($_POST['_woosea_optimized_title']);
1385
+ $woocommerce_unit_pricing_measure = sanitize_text_field($_POST['_woosea_unit_pricing_measure']);
1386
+ $woocommerce_unit_pricing_base_measure = sanitize_text_field($_POST['_woosea_unit_pricing_base_measure']);
1387
+ $woocommerce_installment_months = sanitize_text_field($_POST['_woosea_installment_months']);
1388
+ $woocommerce_installment_amount = sanitize_text_field($_POST['_woosea_installment_amount']);
1389
+ $woocommerce_condition = sanitize_text_field($_POST['_woosea_condition']);
1390
  if(!empty($_POST['_woosea_exclude_product'])){
1391
+ $woocommerce_exclude_product = sanitize_text_field($_POST['_woosea_exclude_product']);
1392
  } else {
1393
  $woocommerce_exclude_product = "no";;
1394
  }
1395
 
1396
  if(isset($woocommerce_brand))
1397
+ update_post_meta( $post_id, '_woosea_brand', $woocommerce_brand);
1398
 
1399
  if(isset($woocommerce_mpn))
1400
  update_post_meta( $post_id, '_woosea_mpn', esc_attr($woocommerce_mpn));
1409
  update_post_meta( $post_id, '_woosea_gtin', esc_attr($woocommerce_gtin));
1410
 
1411
  if(isset($woocommerce_title))
1412
+ update_post_meta( $post_id, '_woosea_optimized_title', $woocommerce_title);
1413
 
1414
  if(isset($woocommerce_unit_pricing_measure))
1415
+ update_post_meta( $post_id, '_woosea_unit_pricing_measure', $woocommerce_unit_pricing_measure);
1416
 
1417
  if(isset($woocommerce_unit_pricing_base_measure))
1418
+ update_post_meta( $post_id, '_woosea_unit_pricing_base_measure', $woocommerce_unit_pricing_base_measure);
1419
 
1420
  if(isset($woocommerce_condition))
1421
+ update_post_meta( $post_id, '_woosea_condition', $woocommerce_condition);
1422
+
1423
+ if(isset($woocommerce_installment_months))
1424
+ update_post_meta( $post_id, '_woosea_installment_months', esc_attr($woocommerce_installment_months));
1425
+
1426
+ if(isset($woocommerce_installment_amount))
1427
+ update_post_meta( $post_id, '_woosea_installment_amount', esc_attr($woocommerce_installment_amount));
1428
 
1429
  if(isset($woocommerce_exclude_product))
1430
  update_post_meta( $post_id, '_woosea_exclude_product', esc_attr($woocommerce_exclude_product));
1543
  )
1544
  );
1545
 
1546
+ // Installment month field
1547
+ woocommerce_wp_text_input(
1548
+ array(
1549
+ 'id' => '_woosea_installment_months['.$loop.']',
1550
+ 'label' => __( '<br>Installment months', 'woocommerce' ),
1551
+ 'placeholder' => 'Installment months',
1552
+ 'desc_tip' => 'true',
1553
+ 'description' => __( 'Enter the number of montly installments for the buyer here.', 'woocommerce' ),
1554
+ 'value' => get_post_meta($variation->ID, '_woosea_installment_months', true),
1555
+ 'wrapper_class' => 'form-row-last',
1556
+ )
1557
+ );
1558
+
1559
+ // Installment amount field
1560
+ woocommerce_wp_text_input(
1561
+ array(
1562
+ 'id' => '_woosea_installment_amount['.$loop.']',
1563
+ 'label' => __( '<br>Installment amount', 'woocommerce' ),
1564
+ 'placeholder' => 'Installment amount',
1565
+ 'desc_tip' => 'true',
1566
+ 'description' => __( 'Enter the installment amount here.', 'woocommerce' ),
1567
+ 'value' => get_post_meta($variation->ID, '_woosea_installment_amount', true),
1568
+ 'wrapper_class' => 'form-row-last',
1569
+ )
1570
+ );
1571
+
1572
  // Add product condition drop-down
1573
  woocommerce_wp_select(
1574
  array(
1626
  $_brand = $_POST['_woosea_variable_brand'];
1627
  $variation_id = (int) $variable_post_id[$i];
1628
  if ( isset( $_brand[$i] ) ) {
1629
+ update_post_meta( $variation_id, '_woosea_brand', stripslashes( sanitize_text_field( $_brand[$i] )));
1630
  }
1631
 
1632
 
1634
  $_mpn = $_POST['_woosea_variable_mpn'];
1635
  $variation_id = (int) $variable_post_id[$i];
1636
  if ( isset( $_mpn[$i] ) ) {
1637
+ update_post_meta( $variation_id, '_woosea_mpn', stripslashes( sanitize_text_field( $_mpn[$i] )));
1638
  }
1639
 
1640
  // UPC Field
1641
  $_upc = $_POST['_woosea_variable_upc'];
1642
  $variation_id = (int) $variable_post_id[$i];
1643
  if ( isset( $_upc[$i] ) ) {
1644
+ update_post_meta( $variation_id, '_woosea_upc', stripslashes( sanitize_text_field( $_upc[$i] )));
1645
  }
1646
 
1647
  // EAN Field
1648
  $_ean = $_POST['_woosea_variable_ean'];
1649
  $variation_id = (int) $variable_post_id[$i];
1650
  if ( isset( $_ean[$i] ) ) {
1651
+ update_post_meta( $variation_id, '_woosea_ean', stripslashes( sanitize_text_field( $_ean[$i] )));
1652
  }
1653
 
1654
  // GTIN Field
1655
  $_gtin = $_POST['_woosea_variable_gtin'];
1656
  $variation_id = (int) $variable_post_id[$i];
1657
  if ( isset( $_gtin[$i] ) ) {
1658
+ update_post_meta( $variation_id, '_woosea_gtin', stripslashes( sanitize_text_field( $_gtin[$i] )));
1659
  }
1660
 
1661
  // Unit pricing measure Field
1662
  $_pricing_measure = $_POST['_woosea_variable_unit_pricing_measure'];
1663
  $variation_id = (int) $variable_post_id[$i];
1664
  if ( isset( $_pricing_measure[$i] ) ) {
1665
+ update_post_meta( $variation_id, '_woosea_unit_pricing_measure', stripslashes( sanitize_text_field( $_pricing_measure[$i] )));
1666
  }
1667
 
1668
  // Unit pricing base measure Field
1669
  $_pricing_base = $_POST['_woosea_variable_unit_pricing_base_measure'];
1670
  $variation_id = (int) $variable_post_id[$i];
1671
  if ( isset( $_pricing_base[$i] ) ) {
1672
+ update_post_meta( $variation_id, '_woosea_unit_pricing_base_measure', stripslashes( sanitize_text_field( $_pricing_base[$i] )));
1673
  }
1674
 
1675
  // Optimized title Field
1676
  $_opttitle = $_POST['_woosea_optimized_title'];
1677
  $variation_id = (int) $variable_post_id[$i];
1678
  if ( isset( $_opttitle[$i] ) ) {
1679
+ update_post_meta( $variation_id, '_woosea_optimized_title', stripslashes( sanitize_text_field( $_opttitle[$i] )));
1680
+ }
1681
+
1682
+ // Installment months Field
1683
+ $_installment_months = $_POST['_woosea_installment_months'];
1684
+ $variation_id = (int) $variable_post_id[$i];
1685
+ if ( isset( $_installment_months[$i] ) ) {
1686
+ update_post_meta( $variation_id, '_woosea_installment_months', stripslashes( sanitize_text_field( $_installment_months[$i] )));
1687
+ }
1688
+
1689
+ // Installment amount Field
1690
+ $_installment_amount = $_POST['_woosea_installment_amount'];
1691
+ $variation_id = (int) $variable_post_id[$i];
1692
+ if ( isset( $_installment_amount[$i] ) ) {
1693
+ update_post_meta( $variation_id, '_woosea_installment_amount', stripslashes( sanitize_text_field( $_installment_amount[$i] )));
1694
  }
1695
 
1696
  // Product condition Field
1697
  $_condition = $_POST['_woosea_condition'];
1698
  $variation_id = (int) $variable_post_id[$i];
1699
  if ( isset( $_condition[$i] ) ) {
1700
+ update_post_meta( $variation_id, '_woosea_condition', stripslashes( sanitize_text_field( $_condition[$i] )));
1701
  }
1702
 
1703
  // Exclude product from feed
1715
  }
1716
  add_action( 'woocommerce_save_product_variation', 'woosea_save_custom_variable_fields', 10, 1 );
1717
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1718
  /**
1719
  * Set project history: amount of products in the feed
1720
  **/
1823
  case "g:shipping";
1824
  $helptext = "(Required when you need to override the shipping settings that you set up in Merchant Center) Google recommends that you set up shipping costs through your Merchant center. However, when you need to override these settings you can map the g:shipping field to the 'Shipping price' attribute.";
1825
  break;
 
 
 
1826
  case "Structured data fix";
1827
  $helptext = "Because of a bug in WooCommerce variable products will get disapproved in Google's Merchant Center. WooCommerce adds the price of the cheapest variable product in the structured data for all variations of a product. Because of this there will be a mismatch between the product price you provide to Google in your Google Shopping product feed and the structured data price on the product landingpage. Google will therefor disapprove the product in its merchant center. You won't be able to advertise on that product in your Google Shopping campaign. Enable this option will fix the structured data on variable product pages by adding the correct variable product price in the JSON-LD structured data so Google will approve the variable products you submitted.";
1828
  break;
2089
  * needs to be done once and not continuesly so it gets removed.
2090
  */
2091
  function woosea_de_register_license(){
2092
+ wp_dequeue_script( 'woosea_adtribes-js' );
2093
+ wp_deregister_script( 'woosea_adtribes-js' );
2094
  }
2095
  add_action( 'woosea_deregister_hook', 'woosea_de_register_license', 99999); // deregister the paid version check after 60 seconds
2096
 
2099
  * key is invalid or expired the advanced options of this plugin will be disabled
2100
  */
2101
  function woosea_license_valid(){
2102
+ $domain = $_SERVER['HTTP_HOST'];
2103
+ $license_information = get_option('license_information');
2104
 
2105
  $curl = curl_init();
2106
+ $url = "https://www.adtribes.io/check/license.php?key=$license_information[license_key]&email=$license_information[license_email]&domain=$domain&version=1.0.0";
2107
 
2108
+ curl_setopt_array($curl, array(
2109
+ CURLOPT_RETURNTRANSFER => 1,
2110
  CURLOPT_URL => $url,
2111
  CURLOPT_USERAGENT => 'AdTribes license cURL Request'
2112
  ));
2113
  $response = curl_exec( $curl );
2114
  curl_close($curl);
2115
  $json_return = json_decode($response, true);
2116
+
2117
+ $license_start_time = strtotime($json_return['created']);
2118
  $license_end_time = strtotime('+1 years', $license_start_time);
2119
  $current_time = time();
2120
+ $license_information['notice'] = $json_return['notice'];
2121
+
2122
+ if($json_return['valid'] == "false"){
2123
+ $license_information['message'] = $json_return['message'];
2124
+ $license_information['message_type'] = $json_return['message_type'];
2125
+ $license_information['license_valid'] = "false";
2126
+ $license_information['license_key'] = $json_return['license_key'];
2127
+ $license_information['license_email'] = $json_return['license_email'];
2128
+ $license_information['notice'] = $json_return['notice'];
2129
+
2130
+ update_option ('license_information', $license_information);
2131
+ // delete_option ('structured_data_fix');
2132
+ // delete_option ('add_unique_identifiers');
2133
+ // delete_option ('add_wpml_support');
2134
+ } else {
2135
+ $license_information['message'] = $json_return['message'];
2136
+ $license_information['message_type'] = $json_return['message_type'];
2137
+ $license_information['license_valid'] = "true";
2138
+ $license_information['notice'] = $json_return['notice'];
2139
+
2140
+ update_option ('license_information', $license_information);
2141
+ }
2142
  }
2143
 
 
2144
  /**
2145
  * Function used by event scheduling to create feeds
2146
  * Feed can automatically be generated every hour, twicedaiy or once a day
2148
  function woosea_create_all_feeds(){
2149
  $feed_config = array();
2150
  $feed_config = get_option( 'cron_projects' );
2151
+ if(empty($feed_config)){
2152
+ $nr_projects = 0;
2153
+ } else {
2154
+ $nr_projects = count($feed_config);
2155
+ }
2156
  $cron_start_date = date("d M Y H:i");
2157
  $cron_start_time = time();
2158
  $hour = date('H');
2417
  */
2418
  function woosea_upgrade_elite(){
2419
  $html = new Construct_Admin_Pages();
2420
+ $html->set_page("woosea-key");
2421
  echo $html->get_page();
2422
  }
2423
 
2436
  * Add plugin links to Wordpress menu
2437
  */
2438
  add_action( 'admin_menu' , 'woosea_menu_addition' );
2439
+
2440
+ /**
2441
+ * Register all dashboard metaboxes
2442
+ */
2443
+
2444
+ function woosea_blog_widgets() {
2445
+ global $wp_meta_boxes;
2446
+
2447
+ add_meta_box('woosea_rss_dashboard_widget', __('Latest Product Feed Pro blog posts', 'rc_mdm'), 'woosea_my_rss_box','dashboard','side','high');
2448
+ //wp_add_dashboard_widget('woosea_rss_dashboard_widget', __('Latest Product Feed Pro blog posts', 'rc_mdm'), 'woosea_my_rss_box');
2449
+ }
2450
+ add_action('wp_dashboard_setup', 'woosea_blog_widgets');
2451
+
2452
+ /**
2453
+ * Creates the RSS metabox
2454
+ */
2455
+ function woosea_my_rss_box() {
2456
+
2457
+ // Get RSS Feed(s)
2458
+ include_once(ABSPATH . WPINC . '/feed.php');
2459
+ $domain = $_SERVER['HTTP_HOST'];
2460
+
2461
+ // My feeds list (add your own RSS feeds urls)
2462
+ $my_feeds = array(
2463
+ 'https://www.adtribes.io/feed/'
2464
+ );
2465
+
2466
+ // Loop through Feeds
2467
+ foreach ( $my_feeds as $feed) :
2468
+
2469
+ // Get a SimplePie feed object from the specified feed source.
2470
+ $rss = fetch_feed( $feed );
2471
+ if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
2472
+ // Figure out how many total items there are, and choose a limit
2473
+ $maxitems = $rss->get_item_quantity( 5 );
2474
+
2475
+ // Build an array of all the items, starting with element 0 (first element).
2476
+ $rss_items = $rss->get_items( 0, $maxitems );
2477
+
2478
+ // Get RSS title
2479
+ $rss_title = '<a href="'.$rss->get_permalink().'" target="_blank">'.strtoupper( $rss->get_title() ).'</a>';
2480
+ endif;
2481
+
2482
+ // Display the container
2483
+ echo '<div class="rss-widget">';
2484
+ echo '<strong>'.$rss_title.'</strong>';
2485
+ echo '<hr style="border: 0; background-color: #DFDFDF; height: 1px;">';
2486
+
2487
+ // Starts items listing within <ul> tag
2488
+ echo '<ul>';
2489
+
2490
+ // Check items
2491
+ if ( $maxitems == 0 ) {
2492
+ echo '<li>'.__( 'No item', 'rc_mdm').'.</li>';
2493
+ } else {
2494
+ // Loop through each feed item and display each item as a hyperlink.
2495
+ foreach ( $rss_items as $item ) :
2496
+ // Uncomment line below to display non human date
2497
+ //$item_date = $item->get_date( get_option('date_format').' @ '.get_option('time_format') );
2498
+
2499
+ // Get human date (comment if you want to use non human date)
2500
+ $item_date = human_time_diff( $item->get_date('U'), current_time('timestamp')).' '.__( 'ago', 'rc_mdm' );
2501
+
2502
+ // Start displaying item content within a <li> tag
2503
+ echo '<li>';
2504
+ // create item link
2505
+ echo '<a href="'.esc_url( $item->get_permalink() ).'?utm_source='.$domain.'&utm_medium=plugin&utm_campaign=dashboard-rss" title="'.$item_date.'" target="_blank">';
2506
+ // Get item title
2507
+ echo esc_html( $item->get_title() );
2508
+ echo '</a>';
2509
+ // Display date
2510
+ echo ' <span class="rss-date">'.$item_date.'</span><br />';
2511
+ // Get item content
2512
+ $content = $item->get_content();
2513
+ // Shorten content
2514
+ $content = wp_html_excerpt($content, 120) . ' [...]';
2515
+ // Display content
2516
+ echo $content;
2517
+ // End <li> tag
2518
+ echo '</li>';
2519
+ endforeach;
2520
+ }
2521
+ // End <ul> tag
2522
+ echo '</ul>';
2523
+ echo '<hr style="border: 0; background-color: #DFDFDF; height: 1px;">';
2524
+ echo '<a href="https://adtribes.io/blog/?utm_source='.$domain.'&utm_medium=plugin&utm_campaign=dashboard-rss" target="_blank">Read more like this on our blog</a>';
2525
+
2526
+ echo '</div>';
2527
+
2528
+ endforeach; // End foreach feed
2529
+ }
2530
+
2531
+
2532
  ?>