Product Feed PRO for WooCommerce - Version 5.0.0

Version Description

Fixed a PHP undefined variable warning

Download this release

Release Info

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

Code changes from version 4.0.0 to 5.0.0

TODO.txt CHANGED
@@ -1,43 +1,32 @@
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
 
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
+ Urgent issues:
5
+ - Add product title manipulation feature
6
+ - Zbozi / Heureka category taxonomy
7
+ - Zbozi / Heureka add same named attributes: https://wordpress.org/support/topic/multiple-attributes-with-the-same-name/#post-11287592
8
 
9
  Plugin functionalities:
10
+ - Add support for Google Product Review feeds
11
+ - Add support for Google Actions: https://support.google.com/merchants/answer/7378924
12
+ - Add possibility to create OR rules
13
+ - Change root XML node for custom feeds
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
 
16
  OTHER ISSUES:
17
+ - Add a CSV upload feature (or UI) for filling the woosea attributes, both for simple and variation products
18
+ - Add hierarchy category dropdown in filters/rules (exclude on identical subcategory names removes all)
19
+ - Build a better WP Cron check, current one is not good enough
20
+ - Add support for Google Shopping product review feeds - https://developers.google.com/product-review-feeds/
21
  - Remarketing tags not yet on thank-you purchase page
22
  - Incomplete remarketing tag on cart-page
23
  - Tracking & conversion
24
  - dynamic dropdowns in GA / tracking page for values
25
+ - Add support for Composite products: https://woocommerce.com/products/composite-products/ & https://yithemes.com/themes/plugins/yith-woocommerce-composite-products/
26
  - Add support for Bundled products: https://woocommerce.com/products/product-bundles/
27
  - Add more complex rules based on more than just 1 condition (AND)
28
  - Add localisation (at least for nl_NL and nl_BE / fr_BE) - https://codex.wordpress.org/I18n_for_WordPress_Developers#Translating_Plugins_and_Themes
29
  - AMAZON integration:
30
  - requires a professional seller account, 39 dollar a month, before being able to create a developer account
31
  - only than we can use their AWS service needed to connect our plugin
32
+ - eBay integration
classes/channels/class-daisyconhuisentuin.php ADDED
@@ -0,0 +1,248 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Daisycon huis & tuin feeds
4
+ */
5
+ class WooSEA_daisyconhuisentuin {
6
+ public $daisyconhuisentuin;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $daisyconhuisentuin = array(
13
+ "Feed fields" => array(
14
+ "description" => array(
15
+ "name" => "description",
16
+ "feed_name" => "description",
17
+ "format" => "required",
18
+ "woo_suggest" => "description",
19
+ ),
20
+ "link" => array(
21
+ "name" => "link",
22
+ "feed_name" => "link",
23
+ "format" => "required",
24
+ "woo_suggest" => "link",
25
+ ),
26
+ "price" => array(
27
+ "name" => "price",
28
+ "feed_name" => "price",
29
+ "format" => "required",
30
+ "woo_suggest" => "price",
31
+ ),
32
+ "sku" => array(
33
+ "name" => "sku",
34
+ "feed_name" => "sku",
35
+ "format" => "required",
36
+ "woo_suggest" => "sku",
37
+ ),
38
+ "title" => array(
39
+ "name" => "title",
40
+ "feed_name" => "title",
41
+ "format" => "required",
42
+ "woo_suggest" => "title",
43
+ ),
44
+ "additional_costs" => array(
45
+ "name" => "additional_costs",
46
+ "feed_name" => "additional_costs",
47
+ "format" => "optional",
48
+ ),
49
+ "brand" => array(
50
+ "name" => "brand",
51
+ "feed_name" => "brand",
52
+ "format" => "optional",
53
+ ),
54
+ "brand_logo" => array(
55
+ "name" => "brand_logo",
56
+ "feed_name" => "brand_log",
57
+ "format" => "optional",
58
+ ),
59
+ "category" => array(
60
+ "name" => "category",
61
+ "feed_name" => "category",
62
+ "format" => "optional",
63
+ ),
64
+ "category_path" => array(
65
+ "name" => "category_path",
66
+ "feed_name" => "category_path",
67
+ "format" => "optional",
68
+ "woo_suggest" => "category_path",
69
+ ),
70
+ "color_primary" => array(
71
+ "name" => "color_primary",
72
+ "feed_name" => "color_primary",
73
+ "format" => "optional",
74
+ ),
75
+ "condition" => array(
76
+ "name" => "condition",
77
+ "feed_name" => "condition",
78
+ "format" => "optional",
79
+ "woo_suggest" => "condition",
80
+ ),
81
+ "delivery_description" => array(
82
+ "name" => "delivery_description",
83
+ "feed_name" => "delivery_description",
84
+ "format" => "optional",
85
+ ),
86
+ "delivery_time" => array(
87
+ "name" => "delivery_time",
88
+ "feed_name" => "delivery_time",
89
+ "format" => "optional",
90
+ ),
91
+ "designer" => array(
92
+ "name" => "designer",
93
+ "feed_name" => "designer",
94
+ "format" => "optional",
95
+ ),
96
+ "ean" => array(
97
+ "name" => "ean",
98
+ "feed_name" => "ean",
99
+ "format" => "optional",
100
+ ),
101
+ "gender_target" => array(
102
+ "name" => "gender_target",
103
+ "feed_name" => "gender_target",
104
+ "format" => "optional",
105
+ ),
106
+ "google_category_id" => array(
107
+ "name" => "google_category_id",
108
+ "feed_name" => "google_category_id",
109
+ "format" => "optional",
110
+ "woo_suggest" => "category",
111
+ ),
112
+ "in_stock" => array(
113
+ "name" => "in_stock",
114
+ "feed_name" => "in_stock",
115
+ "format" => "optional",
116
+ "woo_suggest" => "stock",
117
+ ),
118
+ "in_stock_amount" => array(
119
+ "name" => "in_stock_amount",
120
+ "feed_name" => "in_stock_amount",
121
+ "format" => "optional",
122
+ ),
123
+ "keywords" => array(
124
+ "name" => "keywords",
125
+ "feed_name" => "keywords",
126
+ "format" => "optional",
127
+ ),
128
+ "made_in_country" => array(
129
+ "name" => "made_in_country",
130
+ "feed_name" => "made_in_country",
131
+ "format" => "optional",
132
+ ),
133
+ "material_1" => array(
134
+ "name" => "material_1",
135
+ "feed_name" => "material_1",
136
+ "format" => "optional",
137
+ ),
138
+ "material_2" => array(
139
+ "name" => "material_2",
140
+ "feed_name" => "material_2",
141
+ "format" => "optional",
142
+ ),
143
+ "material_3" => array(
144
+ "name" => "material_3",
145
+ "feed_name" => "material_3",
146
+ "format" => "optional",
147
+ ),
148
+ "model" => array(
149
+ "name" => "model",
150
+ "feed_name" => "model",
151
+ "format" => "optional",
152
+ ),
153
+ "price_old" => array(
154
+ "name" => "price_old",
155
+ "feed_name" => "price_old",
156
+ "format" => "optional",
157
+ ),
158
+ "price_shipping" => array(
159
+ "name" => "price_shipping",
160
+ "feed_name" => "price_shipping",
161
+ "format" => "optional",
162
+ ),
163
+ "priority" => array(
164
+ "name" => "priority",
165
+ "feed_name" => "priority",
166
+ "format" => "optional",
167
+ ),
168
+ "size" => array(
169
+ "name" => "size",
170
+ "feed_name" => "size",
171
+ "format" => "optional",
172
+ ),
173
+ "size_description" => array(
174
+ "name" => "size_description",
175
+ "feed_name" => "size_description",
176
+ "format" => "optional",
177
+ ),
178
+ "size_length" => array(
179
+ "name" => "size_length",
180
+ "feed_name" => "size_length",
181
+ "format" => "optional",
182
+ ),
183
+ "size_width" => array(
184
+ "name" => "size_width",
185
+ "feed_name" => "size_width",
186
+ "format" => "optional",
187
+ ),
188
+ "terms_condition" => array(
189
+ "name" => "terms_condition",
190
+ "feed_name" => "terms_condition",
191
+ "format" => "optional",
192
+ ),
193
+ "weight" => array(
194
+ "name" => "weight",
195
+ "feed_name" => "weight",
196
+ "format" => "optional",
197
+ ),
198
+ "image_link_1" => array(
199
+ "name" => "image_link_1",
200
+ "feed_name" => "image_link_1",
201
+ "format" => "optional",
202
+ ),
203
+ "image_link_2" => array(
204
+ "name" => "image_link_2",
205
+ "feed_name" => "image_link_2",
206
+ "format" => "optional",
207
+ ),
208
+ "image_link_3" => array(
209
+ "name" => "image_link_3",
210
+ "feed_name" => "image_link_3",
211
+ "format" => "optional",
212
+ ),
213
+ "image_link_4" => array(
214
+ "name" => "image_link_4",
215
+ "feed_name" => "image_link_4",
216
+ "format" => "optional",
217
+ ),
218
+ "image_link_5" => array(
219
+ "name" => "image_link_5",
220
+ "feed_name" => "image_link_5",
221
+ "format" => "optional",
222
+ ),
223
+ "image_link_6" => array(
224
+ "name" => "image_link_6",
225
+ "feed_name" => "image_link_6",
226
+ "format" => "optional",
227
+ ),
228
+ "image_link_7" => array(
229
+ "name" => "image_link_7",
230
+ "feed_name" => "image_link_7",
231
+ "format" => "optional",
232
+ ),
233
+ "image_link_8" => array(
234
+ "name" => "image_link_8",
235
+ "feed_name" => "image_link_8",
236
+ "format" => "optional",
237
+ ),
238
+ "image_link_9" => array(
239
+ "name" => "image_link_9",
240
+ "feed_name" => "image_link_9",
241
+ "format" => "optional",
242
+ ),
243
+ ),
244
+ );
245
+ return $daisyconhuisentuin;
246
+ }
247
+ }
248
+ ?>
classes/channels/class-facebook_drm.php CHANGED
@@ -17,6 +17,11 @@ class WooSEA_facebook_drm {
17
  "format" => "required",
18
  "woo_suggest" => "id",
19
  ),
 
 
 
 
 
20
  "availability" => array(
21
  "name" => "availability",
22
  "feed_name" => "g:availability",
17
  "format" => "required",
18
  "woo_suggest" => "id",
19
  ),
20
+ "override" => array(
21
+ "name" => "override",
22
+ "feed_name" => "g:override",
23
+ "format" => "optional",
24
+ ),
25
  "availability" => array(
26
  "name" => "availability",
27
  "feed_name" => "g:availability",
classes/channels/class-google_product_review.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Google Product Review feeds
4
+ */
5
+ class WooSEA_google_product_review {
6
+ public $google_product_review;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $google_product_review = 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_product_review;
73
+ }
74
+ }
75
+ ?>
classes/channels/class-salidzini.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Salidzini.lv Latvia feeds
4
+ */
5
+ class WooSEA_salidzini {
6
+ public $salidzini;
7
+
8
+ public static function get_channel_attributes() {
9
+
10
+ $sitename = get_option('blogname');
11
+
12
+ $salidzini = array(
13
+ "Feed fields" => array(
14
+ "Manufacturer" => array(
15
+ "name" => "Manufacturer",
16
+ "feed_name" => "manufacturer",
17
+ "format" => "required",
18
+ ),
19
+ "Model" => array(
20
+ "name" => "Model",
21
+ "feed_name" => "model",
22
+ "format" => "required",
23
+ ),
24
+ "Color" => array(
25
+ "name" => "Color",
26
+ "feed_name" => "color",
27
+ "format" => "required",
28
+ ),
29
+ "Name" => array(
30
+ "name" => "Name",
31
+ "feed_name" => "name",
32
+ "format" => "required",
33
+ "woo_suggest" => "title",
34
+ ),
35
+ "Link" => array(
36
+ "name" => "Link",
37
+ "feed_name" => "link",
38
+ "format" => "required",
39
+ "woo_suggest" => "link",
40
+ ),
41
+ "Price" => array(
42
+ "name" => "Price",
43
+ "feed_name" => "price",
44
+ "format" => "required",
45
+ "woo_suggest" => "price",
46
+ ),
47
+ "Image" => array(
48
+ "name" => "Image",
49
+ "feed_name" => "image",
50
+ "format" => "required",
51
+ "woo_suggest" => "image",
52
+ ),
53
+ "Category full" => array(
54
+ "name" => "Category full",
55
+ "feed_name" => "category_full",
56
+ "format" => "required",
57
+ "woo_suggest" => "categories",
58
+ ),
59
+ "Category link" => array(
60
+ "name" => "Category link",
61
+ "feed_name" => "category_link",
62
+ "format" => "required",
63
+ "woo_suggest" => "category_link",
64
+ ),
65
+ "In Stock" => array(
66
+ "name" => "In Stock",
67
+ "feed_name" => "in_stock",
68
+ "format" => "required",
69
+ ),
70
+ "Delivery cost Riga" => array(
71
+ "name" => "Delivery cost Riga",
72
+ "feed_name" => "delivery_cost_riga",
73
+ "format" => "required",
74
+ ),
75
+ "Delivery latvija" => array(
76
+ "name" => "Delivery latvija",
77
+ "feed_name" => "delivery_latvija",
78
+ "format" => "required",
79
+ ),
80
+ "Delivery latvijas pasts" => array(
81
+ "name" => "Delivery latvijas pasts",
82
+ "feed_name" => "delivery_latvijas_pasts",
83
+ "format" => "required",
84
+ ),
85
+ "Delivery dpd paku bode" => array(
86
+ "name" => "Delivery dpd paku bode",
87
+ "feed_name" => "delivery_dpd_paku_bode",
88
+ "format" => "required",
89
+ ),
90
+ "Delivery pasta stacija" => array(
91
+ "name" => "Delivery pasta stacija",
92
+ "feed_name" => "delivery_pasta_stacija",
93
+ "format" => "required",
94
+ ),
95
+ "Delivery omniva" => array(
96
+ "name" => "Delivery omniva",
97
+ "feed_name" => "delivery_omniva",
98
+ "format" => "required",
99
+ ),
100
+ "Delivery circlek" => array(
101
+ "name" => "Delivery circlek",
102
+ "feed_name" => "delivery_circlek",
103
+ "format" => "required",
104
+ ),
105
+ "Delivery venipak" => array(
106
+ "name" => "Delivery venipak",
107
+ "feed_name" => "delivery_venipak",
108
+ "format" => "required",
109
+ ),
110
+ "Delivery days riga" => array(
111
+ "name" => "Delivery days riga",
112
+ "feed_name" => "delivery_days_riga",
113
+ "format" => "required",
114
+ ),
115
+ "Delivery days latvija" => array(
116
+ "name" => "Delivery days latvija",
117
+ "feed_name" => "delivery_days_latvija",
118
+ "format" => "required",
119
+ ),
120
+ "Used" => array(
121
+ "name" => "Used",
122
+ "feed_name" => "used",
123
+ "format" => "required",
124
+ ),
125
+ ),
126
+ );
127
+ return $salidzini;
128
+ }
129
+ }
130
+ ?>
classes/channels/class-trovaprezzi.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Trovaprezzi feeds
4
+ */
5
+ class WooSEA_trovaprezzi {
6
+ public $trovaprezzi;
7
+
8
+ public static function get_channel_attributes() {
9
+ $sitename = get_option('blogname');
10
+
11
+ $trovaprezzi = array(
12
+ "Feed fields" => array(
13
+ "Product ID" => array(
14
+ "name" => "Code",
15
+ "feed_name" => "Code",
16
+ "format" => "required",
17
+ "woo_suggest" => "id",
18
+ ),
19
+ "Product SKU" => array(
20
+ "name" => "SKU",
21
+ "feed_name" => "SKU",
22
+ "format" => "optional",
23
+ ),
24
+ "Product name" => array(
25
+ "name" => "Name",
26
+ "feed_name" => "Name",
27
+ "format" => "required",
28
+ "woo_suggest" => "title",
29
+ ),
30
+ "Product brand" => array(
31
+ "name" => "Brand",
32
+ "feed_name" => "Brand",
33
+ "format" => "optional",
34
+ ),
35
+ "Product URL" => array(
36
+ "name" => "Link",
37
+ "feed_name" => "Link",
38
+ "format" => "required",
39
+ "woo_suggest" => "link",
40
+ ),
41
+ "Product price" => array(
42
+ "name" => "Price",
43
+ "feed_name" => "Price",
44
+ "format" => "required",
45
+ "woo_suggest" => "price",
46
+ ),
47
+ "Product category" => array(
48
+ "name" => "Categories",
49
+ "feed_name" => "Categories",
50
+ "format" => "required",
51
+ "woo_suggest" => "categories",
52
+ ),
53
+ "Product description" => array(
54
+ "name" => "Product description",
55
+ "feed_name" => "Description",
56
+ "format" => "optional",
57
+ "woo_suggest" => "description",
58
+ ),
59
+ "Product image 1" => array(
60
+ "name" => "Image1",
61
+ "feed_name" => "Image",
62
+ "format" => "required",
63
+ "woo_suggest" => "image"
64
+ ),
65
+ "Product image 2" => array(
66
+ "name" => "Image2",
67
+ "feed_name" => "Image2",
68
+ "format" => "optional",
69
+ ),
70
+ "Product image 3" => array(
71
+ "name" => "Image3",
72
+ "feed_name" => "Image3",
73
+ "format" => "optional",
74
+ ),
75
+ "Product image 4" => array(
76
+ "name" => "Image4",
77
+ "feed_name" => "Image4",
78
+ "format" => "optional",
79
+ ),
80
+ "Product image 5" => array(
81
+ "name" => "Image5",
82
+ "feed_name" => "Image5",
83
+ "format" => "optional",
84
+ ),
85
+ "Stock" => array(
86
+ "name" => "Stock",
87
+ "feed_name" => "Stock",
88
+ "format" => "optional",
89
+ ),
90
+ "EAN" => array(
91
+ "name" => "EanCode",
92
+ "feed_name" => "EanCode",
93
+ "format" => "optional",
94
+ ),
95
+ "MPN" => array(
96
+ "name" => "MpnCode",
97
+ "feed_name" => "MpnCode",
98
+ "format" => "optional",
99
+ ),
100
+ "Shipping Cost" => array(
101
+ "name" => "ShippingCost",
102
+ "feed_name" => "ShippingCost",
103
+ "format" => "required",
104
+ ),
105
+ ),
106
+ );
107
+ return $trovaprezzi;
108
+ }
109
+ }
110
+ ?>
classes/channels/class-zap.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for ZAP israel feeds
4
+ */
5
+ class WooSEA_zap {
6
+ public $zap;
7
+
8
+ public static function get_channel_attributes() {
9
+ $sitename = get_option('blogname');
10
+
11
+ $zap = array(
12
+ "Feed fields" => array(
13
+ "Product URL" => array(
14
+ "name" => "PRODUCT_URL",
15
+ "feed_name" => "PRODUCT_URL",
16
+ "format" => "required",
17
+ "woo_suggest" => "link",
18
+ ),
19
+ "Product Name" => array(
20
+ "name" => "PRODUCT_NAME",
21
+ "feed_name" => "PRODUCT_NAME",
22
+ "format" => "required",
23
+ "woo_suggest" => "title",
24
+ ),
25
+ "Product Type" => array(
26
+ "name" => "PRODUCT_TYPE",
27
+ "feed_name" => "PRODUCT_TYPE",
28
+ "format" => "optional",
29
+ ),
30
+ "Model" => array(
31
+ "name" => "MODEL",
32
+ "feed_name" => "MODEL",
33
+ "format" => "optional",
34
+ ),
35
+ "Details" => array(
36
+ "name" => "DETAILS",
37
+ "feed_name" => "DETAILS",
38
+ "format" => "required",
39
+ "woo_suggest" => "description",
40
+ ),
41
+ "Catalog Number" => array(
42
+ "name" => "CATALOG_NUMBER",
43
+ "feed_name" => "CATALOG_NUMBER",
44
+ "format" => "optional",
45
+ ),
46
+ "Productcode" => array(
47
+ "name" => "PRODUCTCODE",
48
+ "feed_name" => "PRODUCTCODE",
49
+ "format" => "required",
50
+ "woo_suggest" => "id",
51
+ ),
52
+ "Currency" => array(
53
+ "name" => "CURRENCY",
54
+ "feed_name" => "CURRENCY",
55
+ "format" => "required",
56
+ ),
57
+ "Price" => array(
58
+ "name" => "PRICE",
59
+ "feed_name" => "PRICE",
60
+ "format" => "required",
61
+ "woo_suggest" => "price",
62
+ ),
63
+ "Open Price" => array(
64
+ "name" => "OPEN_PRICE",
65
+ "feed_name" => "OPEN_PRICE",
66
+ "format" => "optional",
67
+ ),
68
+ "Shipment Cost" => array(
69
+ "name" => "SHIPMENT_COST",
70
+ "feed_name" => "SHIPMENT_COST",
71
+ "format" => "required",
72
+ ),
73
+ "Delivery Time" => array(
74
+ "name" => "DELIVERY_TIME",
75
+ "feed_name" => "DELIVERY_TIME",
76
+ "format" => "required",
77
+ ),
78
+ "Manufacturer" => array(
79
+ "name" => "MANUFACTURER",
80
+ "feed_name" => "MANUFACTURER",
81
+ "format" => "optional",
82
+ ),
83
+ "Warrenty" => array(
84
+ "name" => "WARRENTY",
85
+ "feed_name" => "WARRENTY",
86
+ "format" => "optional",
87
+ ),
88
+ "Image" => array(
89
+ "name" => "IMAGE",
90
+ "feed_name" => "IMAGE",
91
+ "format" => "required",
92
+ "woo_suggest" => "image",
93
+ ),
94
+ "Tax" => array(
95
+ "name" => "TAX",
96
+ "feed_name" => "TAX",
97
+ "format" => "optional",
98
+ ),
99
+ ),
100
+ );
101
+ return $zap;
102
+ }
103
+ }
104
+ ?>
classes/channels/class-zbozi.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Settings for Zbozi feeds
4
+ */
5
+ class WooSEA_zbozi {
6
+ public $zbozi;
7
+
8
+ public static function get_channel_attributes() {
9
+ $sitename = get_option('blogname');
10
+
11
+ $zbozi = array(
12
+ "Feed fields" => array(
13
+ "ITEM_ID" => array(
14
+ "name" => "ITEM_ID",
15
+ "feed_name" => "ITEM_ID",
16
+ "format" => "required",
17
+ "woo_suggest" => "id",
18
+ ),
19
+ "PRODUCTNAME" => array(
20
+ "name" => "PRODUCTNAME",
21
+ "feed_name" => "PRODUCTNAME",
22
+ "format" => "required",
23
+ "woo_suggest" => "title",
24
+ ),
25
+ "PRODUCT" => array(
26
+ "name" => "PRODUCT",
27
+ "feed_name" => "PRODUCT",
28
+ "format" => "optional",
29
+ ),
30
+ "DESCRIPTION" => array(
31
+ "name" => "DESCRIPTION",
32
+ "feed_name" => "DESCRIPTION",
33
+ "format" => "required",
34
+ "woo_suggest" => "description",
35
+ ),
36
+ "CATEGORYTEXT" => array(
37
+ "name" => "CATEGORYTEXT",
38
+ "feed_name" => "CATEGORYTEXT",
39
+ "format" => "required",
40
+ "woo_suggest" => "description",
41
+ ),
42
+ "EAN" => array(
43
+ "name" => "EAN",
44
+ "feed_name" => "EAN",
45
+ "format" => "optional",
46
+ ),
47
+ "ISBN" => array(
48
+ "name" => "ISBN",
49
+ "feed_name" => "ISBN",
50
+ "format" => "optional",
51
+ ),
52
+ "PRODUCTNO" => array(
53
+ "name" => "PRODUCTNO",
54
+ "feed_name" => "PRODUCTNO",
55
+ "format" => "optional",
56
+ ),
57
+ "MANUFACTURER" => array(
58
+ "name" => "MANUFACTURER",
59
+ "feed_name" => "MANUFACTURER",
60
+ "format" => "optional",
61
+ ),
62
+ "BRAND" => array(
63
+ "name" => "BRAND",
64
+ "feed_name" => "BRAND",
65
+ "format" => "optional",
66
+ ),
67
+ "URL" => array(
68
+ "name" => "URL",
69
+ "feed_name" => "URL",
70
+ "format" => "required",
71
+ "woo_suggest" => "link",
72
+ ),
73
+ "PRICE_VAT" => array(
74
+ "name" => "PRICE_VAT",
75
+ "feed_name" => "PRICE_VAT",
76
+ "format" => "required",
77
+ "woo_suggest" => "price",
78
+ ),
79
+ "DELIVERY_DATE" => array(
80
+ "name" => "DELIVERY_DATE",
81
+ "feed_name" => "DELIVERY_DATE",
82
+ "format" => "required",
83
+ ),
84
+ "DELIVERY" => array(
85
+ "name" => "DELIVERY",
86
+ "feed_name" => "DELIVERY",
87
+ "format" => "required",
88
+ "woo_suggest" => "shipping",
89
+ ),
90
+ "SHOP_DEPOTS" => array(
91
+ "name" => "SHOP_DEPOTS",
92
+ "feed_name" => "SHOP_DEPOTS",
93
+ "format" => "optional",
94
+ ),
95
+ "CATEGORYTEXT" => array(
96
+ "name" => "CATEGORYTEXT",
97
+ "feed_name" => "CATEGORYTEXT",
98
+ "format" => "optional",
99
+ "woo_suggest" => "categories",
100
+ ),
101
+ "IMGURL" => array(
102
+ "name" => "IMGURL",
103
+ "feed_name" => "IMGURL",
104
+ "format" => "optional",
105
+ "woo_suggest" => "image",
106
+ ),
107
+ "EXTRA_MESSAGE" => array(
108
+ "name" => "EXTRA_MESSAGE",
109
+ "feed_name" => "EXTRA_MESSAGE",
110
+ "format" => "optional",
111
+ ),
112
+ "FREE_GIFT_TEXT" => array(
113
+ "name" => "FREE_GIFT_TEXT",
114
+ "feed_name" => "FREE_GIFT_TEXT",
115
+ "format" => "optional",
116
+ ),
117
+ "MAX_CPC" => array(
118
+ "name" => "MAX_CPC",
119
+ "feed_name" => "MAX_CPC",
120
+ "format" => "optional",
121
+ ),
122
+ "MAX_CPC_SEARCH" => array(
123
+ "name" => "MAX_CPC_SEARCH",
124
+ "feed_name" => "MAX_CPC_SEARCH",
125
+ "format" => "optional",
126
+ ),
127
+ "EROTIC" => array(
128
+ "name" => "EROTIC",
129
+ "feed_name" => "EROTIC",
130
+ "format" => "optional",
131
+ ),
132
+ "ITEMGROUP_ID" => array(
133
+ "name" => "ITEMGROUP_ID",
134
+ "feed_name" => "ITEMGROUP_ID",
135
+ "format" => "optional",
136
+ "woo_suggest" => "item_group_id",
137
+ ),
138
+ "VISIBILITY" => array(
139
+ "name" => "VISIBILITY",
140
+ "feed_name" => "VISIBILITY",
141
+ "format" => "optional",
142
+ ),
143
+ "CUSTOM_LABEL_0" => array(
144
+ "name" => "CUSTOM_LABEL_0",
145
+ "feed_name" => "CUSTOM_LABEL_0",
146
+ "format" => "optional",
147
+ ),
148
+ "CUSTOM_LABEL_1" => array(
149
+ "name" => "CUSTOM_LABEL_1",
150
+ "feed_name" => "CUSTOM_LABEL_1",
151
+ "format" => "optional",
152
+ ),
153
+ "CUSTOM_LABEL_2" => array(
154
+ "name" => "CUSTOM_LABEL_2",
155
+ "feed_name" => "CUSTOM_LABEL_2",
156
+ "format" => "optional",
157
+ ),
158
+ "CUSTOM_LABEL_3" => array(
159
+ "name" => "CUSTOM_LABEL_3",
160
+ "feed_name" => "CUSTOM_LABEL_3",
161
+ "format" => "optional",
162
+ ),
163
+ "CUSTOM_LABEL_4" => array(
164
+ "name" => "CUSTOM_LABEL_4",
165
+ "feed_name" => "CUSTOM_LABEL_4",
166
+ "format" => "optional",
167
+ ),
168
+ "PRODUCT_LINE" => array(
169
+ "name" => "PRODUCT_LINE",
170
+ "feed_name" => "PRODUCT_LINE",
171
+ "format" => "optional",
172
+ ),
173
+ "LIST_PRICE" => array(
174
+ "name" => "LIST_PRICE",
175
+ "feed_name" => "LIST_PRICE",
176
+ "format" => "optional",
177
+ ),
178
+ "RELEASE_DATE" => array(
179
+ "name" => "RELEASE_DATE",
180
+ "feed_name" => "RELEASE_DATE",
181
+ "format" => "optional",
182
+ ),
183
+ ),
184
+ );
185
+ return $zbozi;
186
+ }
187
+ }
188
+ ?>
classes/class-activate.php CHANGED
@@ -276,7 +276,7 @@ class WooSEA_Activation {
276
  "Zbozi.cz" => array (
277
  "channel_hash" => md5("Zbozi.cz"),
278
  "name" => "Zbozi.cz",
279
- "fields" => "heureka",
280
  "taxonomy" => "none",
281
  "utm_source" => "Zbozi.cz",
282
  "type" => "Comparison shopping engine" ),
@@ -912,7 +912,15 @@ class WooSEA_Activation {
912
  "utm_source" => "Stylight.ie",
913
  "type" => "Comparison shopping engine" ),
914
  ),
915
- "Israel" => array (),
 
 
 
 
 
 
 
 
916
  "Italy" => array (
917
  "ShopAlike" => array (
918
  "channel_hash" => md5("ShopAlike.it"),
@@ -938,7 +946,7 @@ class WooSEA_Activation {
938
  "Trovaprezzi" => array (
939
  "channel_hash" => md5("Trovaprezzi.it"),
940
  "name" => "Trovaprezzi.it",
941
- "fields" => "customfeed",
942
  "taxonomy" => "none",
943
  "utm_source" => "Trovaprezzi.it",
944
  "type" => "Comparison shopping engine" ),
@@ -985,7 +993,15 @@ class WooSEA_Activation {
985
  "Kuwait" => array (),
986
  "Kyrgyzstan" => array (),
987
  "Laos" => array (),
988
- "Latvia" => array (),
 
 
 
 
 
 
 
 
989
  "Lebanon" => array (),
990
  "Lesotho" => array (),
991
  "Liberia" => array (),
@@ -1158,6 +1174,13 @@ class WooSEA_Activation {
1158
  "taxonomy" => "none",
1159
  "utm_source" => "TheNextAd",
1160
  "type" => "Advertising" ),
 
 
 
 
 
 
 
1161
  ),
1162
  "New Zealand" => array (),
1163
  "Nicaragua" => array (),
@@ -1736,6 +1759,31 @@ class WooSEA_Activation {
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
 
276
  "Zbozi.cz" => array (
277
  "channel_hash" => md5("Zbozi.cz"),
278
  "name" => "Zbozi.cz",
279
+ "fields" => "zbozi",
280
  "taxonomy" => "none",
281
  "utm_source" => "Zbozi.cz",
282
  "type" => "Comparison shopping engine" ),
912
  "utm_source" => "Stylight.ie",
913
  "type" => "Comparison shopping engine" ),
914
  ),
915
+ "Israel" => array (
916
+ "Zap.co.il" => array (
917
+ "channel_hash" => md5("Zap.co.il"),
918
+ "name" => "Zap.co.il",
919
+ "fields" => "zap",
920
+ "taxonomy" => "none",
921
+ "utm_source" => "Zap.co.il",
922
+ "type" => "Comparison shopping engine" ),
923
+ ),
924
  "Italy" => array (
925
  "ShopAlike" => array (
926
  "channel_hash" => md5("ShopAlike.it"),
946
  "Trovaprezzi" => array (
947
  "channel_hash" => md5("Trovaprezzi.it"),
948
  "name" => "Trovaprezzi.it",
949
+ "fields" => "trovaprezzi",
950
  "taxonomy" => "none",
951
  "utm_source" => "Trovaprezzi.it",
952
  "type" => "Comparison shopping engine" ),
993
  "Kuwait" => array (),
994
  "Kyrgyzstan" => array (),
995
  "Laos" => array (),
996
+ "Latvia" => array (
997
+ "Salidzini.lv" => array (
998
+ "channel_hash" => md5("Salidzini.lv"),
999
+ "name" => "Salidzini.lv",
1000
+ "fields" => "salidzini",
1001
+ "taxonomy" => "none",
1002
+ "utm_source" => "Salidzini.lv",
1003
+ "type" => "Comparison shopping engine" ),
1004
+ ),
1005
  "Lebanon" => array (),
1006
  "Lesotho" => array (),
1007
  "Liberia" => array (),
1174
  "taxonomy" => "none",
1175
  "utm_source" => "TheNextAd",
1176
  "type" => "Advertising" ),
1177
+ "Daisycon huis & tuin" => array (
1178
+ "channel_hash" => md5("Daisyconhuisentuin"),
1179
+ "name" => "Daisycon huis & tuin",
1180
+ "fields" => "daisyconhuisentuin",
1181
+ "taxonomy" => "google_shopping",
1182
+ "utm_source" => "Daisycon",
1183
+ "type" => "Advertising" ),
1184
  ),
1185
  "New Zealand" => array (),
1186
  "Nicaragua" => array (),
1759
  * Function for checking if license is valid
1760
  */
1761
  if (!wp_next_scheduled( 'woosea_check_license' ) ) {
1762
+
1763
+ if(!get_option("license_information")){
1764
+ $license_valid = "false";
1765
+ $message = "Thank you for becoming a user of our product feed pro plugin, much appreciated! Some of the features of this plugin have been locked as you are using the free version of this plugin. The added extra fields such as Brand and GTIN, WPML support, Aelia currency switcher support and the WooCommerce structured data bug fix are Elite features of this plugin. You can get <a href=\"https://adtribes.io/pro-vs-elite/?utm_source=$domain&utm_medium=plugin&utm_campaign=upgrade-elite\" target=\"_blank\">your license key here</a>.";
1766
+ $message_type = "notice notice-info is-dismissible";
1767
+ $notice = "true";
1768
+
1769
+ $license_information = array (
1770
+ 'license_valid' => $license_valid,
1771
+ 'license_created' => $license_created,
1772
+ 'message' => $message,
1773
+ 'message_type' => $message_type,
1774
+ 'license_email' => "",
1775
+ 'license_key' => "",
1776
+ 'notice' => $notice,
1777
+ );
1778
+ update_option ('license_information', $license_information);
1779
+
1780
+ update_option ('structured_data_fix', 'no', 'yes');
1781
+ update_option ('structured_vat', 'no', 'yes');
1782
+ update_option ('add_unique_identifiers', 'no', 'yes');
1783
+ update_option ('add_wpml_support', 'no', 'yes');
1784
+ update_option ('add_aelia_support', 'no', 'yes');
1785
+ }
1786
+
1787
  wp_schedule_event ( time(), 'daily', 'woosea_check_license');
1788
  }
1789
 
classes/class-admin-notifications.php CHANGED
@@ -70,7 +70,7 @@ class WooSEA_Get_Admin_Notifications {
70
  $message_type = "notice notice-info is-dismissible";
71
  break;
72
  case 4:
73
- $message = "Create filter and rules so exactly the right products end up in your product feed. These filters and rules are only eligable for the current product feed you are configuring and will not be used for other feeds.<br/><br/><strong>Filters:</strong> Exclude or include products that meet certain conditions. [<strong><i><a href=\"https://adtribes.io/how-to-create-filters-for-your-product-feed/\" target=\"_blank\">Detailed information and filter examples</a></i></strong>]<br/><strong>Rules:</strong> Change attribute values based on other attribute values or conditions.<br/><br/>Order of execution: the filters and rules will be executed in the order of creation.";
74
  $message_type = "notice notice-info";
75
  break;
76
  case 5:
@@ -82,7 +82,7 @@ class WooSEA_Get_Admin_Notifications {
82
  $message_type = "notice notice-info is-dismissible";
83
  break;
84
  case 7:
85
- $message = "For the selected channel the attributes shown below are mandatory, please map them to your product attributes. We've already pre-filled a lot of mappings so all you have to do is check those and map the ones that are left blank or add new ones by hitting the 'Add field mapping' button.";
86
  $message_type = "notice notice-info";
87
  break;
88
  case 8:
70
  $message_type = "notice notice-info is-dismissible";
71
  break;
72
  case 4:
73
+ $message = "Create filter and rules so exactly the right products end up in your product feed. These filters and rules are only eligable for the current product feed you are configuring and will not be used for other feeds.<br/><br/><strong>Filters:</strong> Exclude or include products that meet certain conditions. [<strong><i><a href=\"https://adtribes.io/how-to-create-filters-for-your-product-feed/\" target=\"_blank\">Detailed information and filter examples</a></i></strong>] or [<strong><i><a href=\"https://adtribes.io/create-a-product-feed-for-one-specific-category/\">Create a product feed for just 1 category</a></i></strong>]<br/><strong>Rules:</strong> Change attribute values based on other attribute values or conditions.[<strong><i><a href=\"https://adtribes.io/how-to-create-rules/\" target=\"_blank\">Detailed information about rules and some examples</a></i></strong>]<br/><br/>Order of execution: the filters and rules will be executed in the order of creation.";
74
  $message_type = "notice notice-info";
75
  break;
76
  case 5:
82
  $message_type = "notice notice-info is-dismissible";
83
  break;
84
  case 7:
85
+ $message = "For the selected channel the attributes shown below are mandatory, please map them to your product attributes. We've already pre-filled a lot of mappings so all you have to do is check those and map the ones that are left blank or add new ones by hitting the 'Add field mapping' button.<br/><br/>[<strong><i><a href=\"https://adtribes.io/how-to-use-static-values-and-create-fake-content-for-your-product-feed/\" target=\"_blank\">Learn how to use static values</a></i></strong>]";
86
  $message_type = "notice notice-info";
87
  break;
88
  case 8:
classes/class-attributes.php CHANGED
@@ -184,7 +184,8 @@ public function get_mapping_attributes_dropdown() {
184
  $attributes = array(
185
  "id" => "Product Id",
186
  "sku" => "SKU",
187
- "sku_id" => "SKU_ID",
 
188
  "title" => "Product name",
189
  "mother_title" => "Product name mother product",
190
  "description" => "Product description",
@@ -309,8 +310,24 @@ public function get_mapping_attributes_dropdown() {
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
 
@@ -320,7 +337,8 @@ public function get_mapping_attributes_dropdown() {
320
  $attributes = array(
321
  "id" => "Product Id",
322
  "sku" => "SKU",
323
- "sku_id" => "SKU_ID",
 
324
  "title" => "Product name",
325
  "mother_title" => "Product name mother product",
326
  "description" => "Product description",
@@ -401,6 +419,7 @@ public function get_mapping_attributes_dropdown() {
401
  "static_value" => "Static value",
402
  "calculated" => "Plugin calculation",
403
  "product_tag" => "Product tags",
 
404
  );
405
 
406
  $attributes = array_merge($attributes, $static);
184
  $attributes = array(
185
  "id" => "Product Id",
186
  "sku" => "SKU",
187
+ "sku_id" => "SKU_ID (Facebook)",
188
+ "sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
189
  "title" => "Product name",
190
  "mother_title" => "Product name mother product",
191
  "description" => "Product description",
310
  */
311
  $dropdown .= "<optgroup label='Other fields'><strong>Other fields</strong>";
312
  $dropdown .= "<option value='product_tag'>Product tags</option>";
313
+ $dropdown .= "<option value='menu_order'>Menu order</option>";
314
  $dropdown .= "</optgroup>";
315
 
316
+ // Did the user checked extra attributes
317
+ if(get_option( 'woosea_extra_attributes' )){
318
+ $extra_attributes = get_option( 'woosea_extra_attributes' );
319
+ if($extra_attributes){
320
+ array_walk($extra_attributes, function(&$value, $key) { $value .= ' (Added Custom attribute)';});
321
+ $dropdown .= "<optgroup label='Added Custom Attributes'><strong>Added Custom Attributes</strong>";
322
+
323
+ foreach ($extra_attributes as $key => $value) {
324
+ if (strpos($value, 0, 1) !== "_") {
325
+ $dropdown .= "<option value='$key'>" . ucfirst($value) . "</option>";
326
+ }
327
+ }
328
+ $dropdown .="</optgroup>";
329
+ }
330
+ }
331
  return $dropdown;
332
  }
333
 
337
  $attributes = array(
338
  "id" => "Product Id",
339
  "sku" => "SKU",
340
+ "sku_id" => "SKU_ID (Facebook)",
341
+ "sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
342
  "title" => "Product name",
343
  "mother_title" => "Product name mother product",
344
  "description" => "Product description",
419
  "static_value" => "Static value",
420
  "calculated" => "Plugin calculation",
421
  "product_tag" => "Product tags",
422
+ "menu_order" => "Menu order",
423
  );
424
 
425
  $attributes = array_merge($attributes, $static);
classes/class-deactivate-cleanup.php CHANGED
@@ -8,7 +8,5 @@ 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
  }
8
  public static function deactivate_cleanup() {
9
  wp_clear_scheduled_hook('woosea_cron_hook');
10
  wp_clear_scheduled_hook('woosea_check_license');
 
 
11
  }
12
  }
classes/class-get-products.php CHANGED
@@ -44,6 +44,68 @@ class WooSEA_Get_Products {
44
  // return "<![CDATA[ $string ]]>";
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Strip unwanted UTF chars from string
49
  */
@@ -208,7 +270,7 @@ class WooSEA_Get_Products {
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
  }
@@ -239,7 +301,9 @@ class WooSEA_Get_Products {
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
 
@@ -260,6 +324,7 @@ class WooSEA_Get_Products {
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;
@@ -292,114 +357,177 @@ class WooSEA_Get_Products {
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])){
@@ -408,15 +536,15 @@ class WooSEA_Get_Products {
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
 
@@ -473,7 +601,7 @@ class WooSEA_Get_Products {
473
  }
474
 
475
  // Check if file exists, if it does: delete it first so we can create a new updated one
476
- if ( (file_exists( $file )) AND ($header == "true") AND ($feed_config['nr_products_processed'] == 0) ) {
477
  unlink ( $file );
478
  }
479
 
@@ -504,79 +632,79 @@ class WooSEA_Get_Products {
504
  $xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);
505
  $aantal = count($products);
506
 
507
- if ($xml === FALSE){
508
- // Something went wrong reading the XML file
509
- } else {
510
- if ($aantal > 0){
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
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
  }
569
  }
570
- }
571
- }
572
  }
573
  }
574
- $xml->asXML($file);
 
 
 
575
  unset($products);
576
  }
577
  unset($xml);
578
  } else {
579
- if ( ($header == "true") AND ($feed_config['nr_products_processed'] == 0) ) {
 
580
  if ($feed_config['name'] == "Yandex") {
581
  $main_currency = get_woocommerce_currency();
582
 
@@ -613,9 +741,38 @@ class WooSEA_Get_Products {
613
  $shop->addChild('agency', 'AdTribes.io');
614
  $shop->addChild('email', 'support@adtribes.io');
615
  $xml->asXML($file);
616
- } elseif ($feed_config['name'] == "Heureka.cz") {
617
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><SHOP></SHOP>');
618
- $xml->addAttribute('xmlns', 'https://www.zbozi.cz/ns/offer/1.0');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
619
  $xml->asXML($file);
620
  } else {
621
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
@@ -624,7 +781,7 @@ class WooSEA_Get_Products {
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);
629
  }
630
  } else {
@@ -636,17 +793,37 @@ class WooSEA_Get_Products {
636
  $offers = $xml->shop[0]->addChild('offers');
637
  }
638
 
 
 
 
 
 
 
 
 
 
 
639
  foreach ($products as $key => $value){
 
640
  if (is_array ( $value ) ) {
641
  if ($feed_config['name'] == "Yandex") {
642
  $product = $offers->addChild('offer');
643
- } elseif ($feed_config['name'] == "Heureka.cz") {
644
  $product = $xml->addChild('SHOPITEM');
 
 
 
 
 
 
 
 
645
  } else {
646
  $product = $xml->addChild('product');
647
  }
 
648
  foreach ($value as $k => $v){
649
-
650
  $v = trim($v);
651
  $k = trim($k);
652
 
@@ -677,28 +854,33 @@ class WooSEA_Get_Products {
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');
@@ -762,6 +944,7 @@ class WooSEA_Get_Products {
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'];
@@ -796,6 +979,11 @@ class WooSEA_Get_Products {
796
 
797
  // Append or write to file
798
  $fp = fopen($file, 'a+');
 
 
 
 
 
799
 
800
  // Write each row of the products array
801
  foreach ($products as $row) {
@@ -827,15 +1015,48 @@ class WooSEA_Get_Products {
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
 
@@ -998,6 +1219,15 @@ class WooSEA_Get_Products {
998
  if($status != "publish") { continue; }
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();
@@ -1025,17 +1255,45 @@ class WooSEA_Get_Products {
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
  }
1032
 
1033
- $product_data['item_group_id'] = $this->parentID;
1034
  $categories = array_unique(wc_get_product_cat_ids( $product_data['id'] ));
1035
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1036
  // Check if the Yoast plugin is installed and active
1037
  if ( class_exists('WPSEO_Primary_Term') ){
1038
-
1039
  $product_id = $product_data['id'];
1040
  $primary_cat_id=get_post_meta($product_id ,'_yoast_wpseo_primary_product_cat',true);
1041
  $category_path = $this->woosea_get_term_parents( $primary_cat_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
@@ -1092,7 +1350,6 @@ class WooSEA_Get_Products {
1092
  }
1093
  } else {
1094
  foreach ($categories as $key => $value){
1095
-
1096
  if (!$catname){
1097
  $product_cat = get_term($value, 'product_cat');
1098
 
@@ -1146,8 +1403,8 @@ class WooSEA_Get_Products {
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'] );
@@ -1191,7 +1448,11 @@ class WooSEA_Get_Products {
1191
 
1192
  $product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
1193
  $product_data['visibility'] = $this->get_attribute_value( $this->childID,"_visibility" );
 
1194
  $product_data['currency'] = get_woocommerce_currency();
 
 
 
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'];
@@ -1234,17 +1495,19 @@ class WooSEA_Get_Products {
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){
@@ -1256,22 +1519,145 @@ class WooSEA_Get_Products {
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;
@@ -1329,8 +1715,10 @@ class WooSEA_Get_Products {
1329
  array_push ($product_data["product_tag"], $term->name);
1330
  }
1331
  }
 
 
1332
  }
1333
-
1334
  /**
1335
  * Get Custom Attributes for Single products
1336
  */
@@ -1391,7 +1779,10 @@ class WooSEA_Get_Products {
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
@@ -1400,6 +1791,17 @@ class WooSEA_Get_Products {
1400
 
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 );
@@ -1412,8 +1814,8 @@ class WooSEA_Get_Products {
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'] );
@@ -1500,24 +1902,23 @@ class WooSEA_Get_Products {
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
  }
@@ -1602,9 +2003,33 @@ class WooSEA_Get_Products {
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
 
@@ -1688,7 +2113,7 @@ class WooSEA_Get_Products {
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
  }
@@ -1741,14 +2166,18 @@ class WooSEA_Get_Products {
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
  /**
@@ -1763,6 +2192,7 @@ class WooSEA_Get_Products {
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
  */
@@ -1771,6 +2201,21 @@ class WooSEA_Get_Products {
1771
  $product_data = null;
1772
  }
1773
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1774
  /**
1775
  * When product has passed the filter rules it can continue with the rest
1776
  */
@@ -1841,7 +2286,8 @@ class WooSEA_Get_Products {
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
  }
@@ -1855,9 +2301,8 @@ class WooSEA_Get_Products {
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
  }
@@ -1872,25 +2317,26 @@ class WooSEA_Get_Products {
1872
  $pieces_row = explode ("','", $attr_line);
1873
  $pieces_row = array_map('trim', $pieces_row);
1874
 
1875
- foreach($identifier_positions as $id_key => $id_value){
1876
- if($id_key != "g:identifier_exists"){
1877
- if ($pieces_row[$id_value]){
1878
- $identifier_exists = "Yes";
 
 
 
 
1879
  }
1880
- } else {
1881
- $identifier_position = $id_value;
1882
  }
1883
- }
1884
 
1885
- if((isset($identifier_exists)) AND ($identifier_exists == "Yes")){
1886
- $pieces_row[$id_value] = $identifier_exists;
1887
- } else {
1888
- if(isset($id_value)){
1889
- $pieces_row[$id_value] = "No";
 
1890
  }
1891
  }
1892
  $attr_line = implode("','", $pieces_row);
1893
-
1894
  $products[] = array ( $attr_line );
1895
  } else {
1896
  foreach( array_keys($project_config['attributes']) as $attribute_key ){
@@ -1910,85 +2356,96 @@ class WooSEA_Get_Products {
1910
  * Build an array needed for the adding Childs in the XML productfeed
1911
  */
1912
  foreach( array_keys($project_config['attributes']) as $attribute_key ){
1913
- if(!isset($old_attributes_config)){
1914
- if(!$xml_product){
1915
- $xml_product = array (
1916
- $attribute_key => $product_data[$attribute_key]
1917
- );
1918
- } else {
1919
- if(isset($product_data[$attribute_key])){
1920
- $xml_product = array_merge($xml_product, array($attribute_key => $product_data[$attribute_key]));
1921
- }
1922
- }
1923
- } else {
1924
- foreach($old_attributes_config as $attr_key => $attr_value){
1925
 
1926
- $ca = 0;
1927
- // Static attribute value was set by user
1928
- if(array_key_exists('static_value', $attr_value)){
1929
- if(!isset($xml_product)){
1930
- $xml_product = array (
1931
- $attr_value['attribute'] => "$attr_value[prefix] ". $attr_value['mapfrom'] ." $attr_value[suffix]"
1932
- );
1933
- } else {
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]"
1941
- );
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, "||");
1979
- $shipping_str = rtrim($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
  }
@@ -2021,8 +2478,6 @@ class WooSEA_Get_Products {
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;
@@ -2374,14 +2829,14 @@ class WooSEA_Get_Products {
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";
2379
  $category_id = explode("-", $pr_array['newvalue']);
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
 
@@ -2392,7 +2847,8 @@ class WooSEA_Get_Products {
2392
  switch ($pr_array['condition']) {
2393
  case($pr_array['condition'] = "contains"):
2394
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
2395
- $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
 
2396
  }
2397
  break;
2398
  case($pr_array['condition'] = "containsnot"):
@@ -2459,7 +2915,6 @@ class WooSEA_Get_Products {
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){
@@ -2468,7 +2923,7 @@ class WooSEA_Get_Products {
2468
  switch ($pr_array['condition']) {
2469
  case($pr_array['condition'] = "contains"):
2470
  if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
2471
- $pd_value[$k]['price'] = $pr_array['newvalue'];
2472
  $product_data[$pr_array['than_attribute']] = $pd_value;
2473
  }
2474
  break;
@@ -2520,6 +2975,25 @@ class WooSEA_Get_Products {
2520
  $product_data[$pr_array['than_attribute']] = $pd_value;
2521
  }
2522
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2523
  default:
2524
  break;
2525
  }
@@ -2619,7 +3093,7 @@ class WooSEA_Get_Products {
2619
  // Use a lexical order on relational string operators
2620
  if (($pd_value < $pr_array['criteria'])){
2621
  // Specifically for shipping price rules
2622
- if(is_array($product_data[$pr_array['than_attribute']])){
2623
  $arr_size = (count($product_data[$pr_array['than_attribute']])-1);
2624
  for ($x = 0; $x <= $arr_size; $x++) {
2625
  $product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
@@ -2646,7 +3120,7 @@ class WooSEA_Get_Products {
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"):
@@ -2705,11 +3179,13 @@ class WooSEA_Get_Products {
2705
  }
2706
 
2707
  foreach ($project_rules as $pr_key => $pr_array){
 
2708
  if(array_key_exists($pr_array['attribute'], $product_data)){
2709
 
2710
  foreach ($product_data as $pd_key => $pd_value){
2711
  // Check is there is a rule on specific attributes
2712
- if(in_array($pd_key, $pr_array)){
 
2713
 
2714
  if($pd_key == "price"){
2715
  $pd_value = @number_format($pd_value,2);
@@ -2784,52 +3260,166 @@ class WooSEA_Get_Products {
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;
@@ -2973,10 +3563,11 @@ class WooSEA_Get_Products {
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")){
 
 
2980
  $allowed = 0;
2981
  }
2982
  break;
@@ -2989,9 +3580,17 @@ class WooSEA_Get_Products {
2989
  } else {
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;
@@ -2999,7 +3598,6 @@ class WooSEA_Get_Products {
2999
  $allowed = 0;
3000
  }
3001
  } else {
3002
-
3003
  if($pr_array['than'] == "exclude"){
3004
  $allowed = 0;
3005
  } else {
44
  // return "<![CDATA[ $string ]]>";
45
  }
46
 
47
+ /**
48
+ * An improved function for the strip_tags
49
+ * Removing tags but replacing them with spaces instead of just removing them
50
+ */
51
+ public function rip_tags( $string ) {
52
+ // ----- remove HTML TAGs -----
53
+ $string = preg_replace ('/<[^>]*>/', ' ', $string);
54
+
55
+ // ----- remove control characters -----
56
+ $string = str_replace("\r", '', $string); // --- replace with empty space
57
+ $string = str_replace("\n", ' ', $string); // --- replace with space
58
+ $string = str_replace("\t", ' ', $string); // --- replace with space
59
+
60
+ // ----- remove multiple spaces -----
61
+ $string = trim(preg_replace('/ {2,}/', ' ', $string));
62
+
63
+ return $string;
64
+ }
65
+
66
+ /**
67
+ * Get all approved product review comments for Google's Product Review Feeds
68
+ */
69
+ public function woosea_get_reviews ( $product_data, $product ) {
70
+ $approved_reviews = array();
71
+
72
+ $reviews = get_comments(array(
73
+ 'post_id' => $product_data['id'],
74
+ 'comment_type' => 'review',
75
+ 'comment_approved' => 1,
76
+ ));
77
+
78
+ // Loop through all product reviews for this specific products (ternary operators)
79
+ foreach($reviews as $review_raw){
80
+ $review = array();
81
+ $review['review_product_id'] = $product_data['id'];
82
+ $review['review_product_ids'] = array(
83
+ "gtins" => empty($product_data['gtins']) ? '' : $product_data['gtins'],
84
+ "mpns" => empty($product_data['mpns']) ? '' : $product_data['mpns'],
85
+ "skus" => empty($product_data['skus']) ? '' : $product_data['skus'],
86
+ "brand" => empty($product_data['brands']) ? '' : $product_data['brands'],
87
+ );
88
+ $review['review_reviewer_image'] = empty($product_data['reviewer_image']) ? '' : $product_data['reviewer_image'];
89
+ $review['review_ratings'] = get_comment_meta( $review_raw->comment_ID, 'rating', true);
90
+ $review['review_review_id'] = $review_raw->comment_ID;
91
+ $review['review_reviewer_name'] = $review_raw->comment_author;
92
+ $review['review_reviewer_id'] = $review_raw->user_id;
93
+ $review['review_timestamp'] = $review_raw->comment_date;
94
+ $review['review_title'] = empty($product_data['review_title']) ? '' : $product_data['review_title'];
95
+ $review['review_content'] = $review_raw->comment_content;
96
+ $review['review_pros'] = empty($product_data['review_pros']) ? '' : $product_data['review_pros'];
97
+ $review['review_cons'] = empty($product_data['review_coms']) ? '' : $product_data['review_cons'];
98
+ $review['review_product_name'] = $product_data['title'];
99
+ $review['review_url'] = $product_data['link'];
100
+ $review['review_product_url'] = $product_data['link'];
101
+ array_push($approved_reviews, $review);
102
+ }
103
+ $review_count = $product->get_review_count();
104
+ $review_average = $product->get_average_rating();
105
+ return $approved_reviews;
106
+ }
107
+
108
+
109
  /**
110
  * Strip unwanted UTF chars from string
111
  */
270
  $name = $parent->name;
271
  }
272
 
273
+ if ($parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited, TRUE )){
274
  $visited[] = $parent->parent;
275
  $chain .= $this->woosea_get_term_parents( $parent->parent, $taxonomy, $link, $separator, $nicename, $visited );
276
  }
301
  public function woosea_get_installment ($project_config, $productId){
302
  $installment = "";
303
  $currency = get_woocommerce_currency();
304
+ if(isset($project_config['WCML'])){
305
+ $currency = $project_config['WCML'];
306
+ }
307
  $installment_months = get_post_meta($productId, '_woosea_installment_months', true);
308
  $installment_amount = get_post_meta($productId, '_woosea_installment_amount', true);
309
 
324
  $zone_details = array();
325
  $base_location = wc_get_base_location();
326
  $base_country = $base_location['country'];
327
+ $from_currency = get_woocommerce_currency();
328
 
329
  // Normal shipping set-up
330
  $zone_count = count($shipping_arr)+1;
357
  } else {
358
  // Unknown shipping zone type
359
  }
360
+
361
+ // Get the g:services and g:prices, because there could be multiple services the $shipping_arr could multiply again
362
+ // g:service = "Method title - Shipping class costs"
363
+ // for example, g:service = "Estimated Shipping - Heavy shipping". g:price would be 180
364
+ $shipping_methods = $zone['shipping_methods'];
365
 
366
+ foreach ($shipping_methods as $k => $v){
 
 
 
 
 
367
 
368
+ if($v->enabled == "yes"){
369
+ if(empty($zone_details['country'])){
370
+ $zone_details['service'] = $zone['zone_name'] ." ". $v->title;
371
+ } else {
372
+ $zone_details['service'] = $zone['zone_name'] ." ". $v->title ." ".$zone_details['country'];
 
 
 
 
 
 
 
373
  }
374
+ $taxable = $v->tax_status;
375
 
376
+ if(isset($v->instance_settings['cost'])){
377
+ $shipping_cost = $v->instance_settings['cost'];
378
+ if(!$shipping_cost){
379
+ $shipping_cost = 0;
380
+ }
381
+
382
+ // Do we need to convert the shipping costswith the Aelia Currency Switcher
383
+ if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
384
+ if(!array_key_exists('base_currency', $project_config)){
385
+ $from_currency = get_woocommerce_currency();
386
+ } else {
387
+ $from_currency = $project_config['base_currency'];
388
+ }
389
+
390
+ // Get Aelia currency conversion prices
391
+ $shipping_cost = apply_filters('wc_aelia_cs_convert', $shipping_cost, $from_currency, $project_config['AELIA']);
392
  }
 
 
393
 
 
 
 
 
 
 
394
  if($taxable == "taxable"){
395
  foreach ($tax_rates as $k => $w){
 
396
  if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
397
  $rate = (($w['rate']+100)/100);
398
+ $shipping_cost = str_replace(",", ".", $shipping_cost);
399
  $shipping_cost = $shipping_cost*$rate;
400
  $shipping_cost = round($shipping_cost, 2);
401
  }
402
  }
403
  }
404
+ }
 
 
 
 
 
 
 
405
 
406
+ // CLASS SHIPPING COSTS
407
+ if(isset($v->instance_settings[$class_cost_id])){
408
+ if (is_numeric($v->instance_settings[$class_cost_id])){
409
+ $shipping_cost = $v->instance_settings[$class_cost_id];
410
 
411
+ // Do we need to convert the shipping costswith the Aelia Currency Switcher
412
+ if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
413
+ if(!array_key_exists('base_currency', $project_config)){
414
+ $from_currency = get_woocommerce_currency();
415
+ } else {
416
+ $from_currency = $project_config['base_currency'];
417
+ }
418
+
419
+ // Get Aelia currency conversion prices
420
+ $shipping_cost = apply_filters('wc_aelia_cs_convert', $shipping_cost, $from_currency, $project_config['AELIA']);
421
+ }
422
+
423
  if($taxable == "taxable"){
424
  foreach ($tax_rates as $k => $w){
425
 
426
  if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
427
  $rate = (($w['rate']+100)/100);
428
+ $shipping_cost = $shipping_cost*$rate;
429
+ $shipping_cost = round($shipping_cost, 2);
430
+ }
431
+ }
432
+ }
433
+ } else {
434
+ $shipping_cost = $v->instance_settings[$class_cost_id];
435
+ $shipping_cost = str_replace("[qty]", "1", $shipping_cost);
436
+ $mathString = trim($shipping_cost); // trim white spaces
437
+ if (preg_match("/fee percent/", $mathString)){
438
+ $shipcost_piece = explode("+", $mathString);
439
+ $mathString = trim($shipcost_piece[0]);
440
+ }
441
+
442
+ $mathString = str_replace ('..', '.', $mathString); // remove input mistakes from users using shipping formula's
443
+ $mathString = preg_replace ('[^0-9\+-\*\/\(\)]', '', $mathString); // remove any non-numbers chars; exception for math operators
444
+ $mathString = str_replace(array('\'', '"', ','), '', $mathString);
445
+
446
+ if(!empty($mathString)){
447
+ eval("\$mathString = $mathString;");
448
+ $shipping_cost = $mathString;
449
+
450
+ if($taxable == "taxable"){
451
+ foreach ($tax_rates as $k => $w){
452
+
453
+ if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
454
+ $rate = (($w['rate']+100)/100);
455
+ if(is_numeric($shipping_cost)){
456
+ $shipping_cost = $shipping_cost*$rate;
457
+ $shipping_cost = round($shipping_cost, 2);
458
+ }
459
  }
460
  }
461
  }
462
  }
463
+
464
+ // Do we need to convert the shipping costswith the Aelia Currency Switcher
465
+ if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
466
+ if(!array_key_exists('base_currency', $project_config)){
467
+ $from_currency = get_woocommerce_currency();
468
+ } else {
469
+ $from_currency = $project_config['base_currency'];
470
+ }
471
+ // Get Aelia currency conversion prices
472
+ $shipping_cost = apply_filters('wc_aelia_cs_convert', $shipping_cost, $from_currency, $project_config['AELIA']);
473
+ }
474
+ }
475
+ }
476
+
477
+ // FREE SHIPPING COSTS IF MINIMUM FEE REACHED
478
+ if($v->id == "free_shipping"){
479
+ $minimum_fee = $v->min_amount;
480
+ if(!array_key_exists('base_currency', $project_config)){
481
+ $currency = get_woocommerce_currency();
482
+ } else {
483
+ $currency = $project_config['base_currency'];
484
+ }
485
+
486
+ if(isset($project_config['WCML'])){
487
+ $currency = $project_config['WCML'];
488
+ }
489
+ if(isset($project_config['AELIA'])){
490
+ $currency = $project_config['AELIA'];
491
+ }
492
+
493
+ // Only Free Shipping when prodict price is over or equal to minimum order fee
494
+ if ($price >= $minimum_fee){
495
+ $shipping_cost = 0;
496
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
497
+ } else {
498
+ // There are no free shipping requirements
499
+ if($v->requires == ""){
500
+ $shipping_cost = 0;
501
+ $zone_details['price'] = trim($currency." ".$shipping_cost);
502
+ } else {
503
+ // No need to add the free shipping zone as it is not eligable
504
+ break;
505
+ }
506
  }
507
  }
508
+
509
+ if($shipping_cost >= 0){
510
+ $currency = get_woocommerce_currency();
511
+ if(isset($project_config['WCML'])){
512
+ $currency = $project_config['WCML'];
513
+ } else {
514
+ if(isset($project_config['AELIA'])){
515
+ $currency = $project_config['AELIA'];
516
+ } else {
517
+ if(!array_key_exists('base_currency', $project_config)){
518
+ $currency = get_woocommerce_currency();
519
+ } else {
520
+ $currency = $project_config['base_currency'];
521
+ }
522
+ }
523
+ }
524
  $zone_details['price'] = trim($currency." ".$shipping_cost);
 
 
 
525
  }
 
 
 
 
 
 
526
 
527
+ // This shipping zone has postal codes so multiply the zone details
528
+ $nr_postals = count($postal_code);
529
+ if ($nr_postals > 0){
530
+ //if(!empty($shipping_cost)){
531
  for ($x = 0; $x <= count($postal_code); ) {
532
  $zone_count++;
533
  if(!empty($postal_code[$x])){
536
  }
537
  $x++;
538
  }
539
+ //}
540
+ } else {
541
+ $zone_count++;
542
+ $shipping_arr[$zone_count] = $zone_details;
543
+ }
544
+ }
545
+ }
546
  }
547
  }
 
548
  return $shipping_arr;
549
  }
550
 
601
  }
602
 
603
  // Check if file exists, if it does: delete it first so we can create a new updated one
604
+ if ( (file_exists( $file )) AND ($header == "true") AND ($feed_config['nr_products_processed'] == 0) || !file_exists( $file ) ) {
605
  unlink ( $file );
606
  }
607
 
632
  $xml = simplexml_load_file($file, 'SimpleXMLElement', LIBXML_NOCDATA);
633
  $aantal = count($products);
634
 
635
+ if (($xml !== FALSE) AND ($aantal > 0)){
636
+ foreach ($products as $key => $value){
637
+
638
+ if (is_array ( $value ) ) {
639
+ if(!empty( $value )){
640
+ $product = $xml->channel->addChild('item');
641
+ foreach ($value as $k => $v){
642
+ if ($k == "g:shipping"){
643
+ $ship = explode("||", $v);
644
+ foreach ($ship as $kk => $vv){
645
+ $sub_count = substr_count($vv, '##');
646
+ $shipping = $product->addChild($k, '',htmlspecialchars($namespace['g']));
647
+ $ship_split = explode(":", $vv);
 
 
 
648
 
649
+ foreach($ship_split as $ship_piece){
650
+
651
+ $piece_value = explode("##", $ship_piece);
652
+ if (preg_match("/WOOSEA_COUNTRY/", $ship_piece)){
653
+ $shipping_country = $shipping->addChild('g:country', $piece_value[1], $namespace['g']);
654
+ } elseif (preg_match("/WOOSEA_REGION/", $ship_piece)){
655
+ $shipping_region = $shipping->addChild('g:region', $piece_value[1], $namespace['g']);
656
+ } elseif (preg_match("/WOOSEA_POSTAL_CODE/", $ship_piece)){
657
+ $shipping_price = $shipping->addChild('g:postal_code', $piece_value[1], $namespace['g']);
658
+ } elseif (preg_match("/WOOSEA_SERVICE/", $ship_piece)){
659
+ $shipping_service = $shipping->addChild('g:service', $piece_value[1], $namespace['g']);
660
+ } elseif (preg_match("/WOOSEA_PRICE/", $ship_piece)){
661
+ $shipping_price = $shipping->addChild('g:price',trim($piece_value[1]),$namespace['g']);
662
+ } else {
663
+ // DO NOT ADD ANYTHING
 
664
  }
665
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
666
  }
667
+ // Fix issue with additional images for Google Shopping
668
+ } elseif (preg_match("/g:additional_image_link/i",$k)){
669
+ $link = $product->addChild('g:additional_image_link', $v, $namespace['g']);
670
+ //$product->$k = $v;
671
+ } elseif ($k == "g:installment"){
672
+ if(!empty($v)){
673
+ $installment_split = explode(":", $v);
674
+ $installment = $product->addChild($k, '', $namespace['g']);
675
+ $installment_months = $installment->addChild('g:months', $installment_split[0], $namespace['g']);
676
+ $installment_amount = $installment->addChild('g:amount', $installment_split[1], $namespace['g']);
677
+ }
678
+ } elseif ($k == "g:color" || $k == "g:size" || $k == "g:material"){
679
+ if(!empty($v)){
680
+ $attr_split = explode(",", $v);
681
+ $nr_attr = count($attr_split)-1;
682
+ $attr_value = "";
683
+
684
+ for ($x = 0; $x <= $nr_attr; $x++){
685
+ $attr_value .= trim($attr_split[$x])."/";
686
+ }
687
+ $attr_value = rtrim($attr_value,"/");
688
+ $product->$k = $attr_value;
689
+ }
690
+ } else {
691
+ $product->$k = $v;
692
  }
693
  }
694
+ }
695
+ }
696
  }
697
  }
698
+
699
+ if(is_object($xml)){
700
+ $xml->asXML($file);
701
+ }
702
  unset($products);
703
  }
704
  unset($xml);
705
  } else {
706
+ if ( ($header == "true") AND ($feed_config['nr_products_processed'] == 0) || !file_exists( $file ) ) {
707
+
708
  if ($feed_config['name'] == "Yandex") {
709
  $main_currency = get_woocommerce_currency();
710
 
741
  $shop->addChild('agency', 'AdTribes.io');
742
  $shop->addChild('email', 'support@adtribes.io');
743
  $xml->asXML($file);
744
+ } elseif ($feed_config['name'] == "Heureka.cz" || $feed_config['name'] == "Zbozi.cz") {
745
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><SHOP></SHOP>');
746
+ $xml->addAttribute('xmlns', 'http://www.zbozi.cz/ns/offer/1.0');
747
+ $xml->asXML($file);
748
+ } elseif ($feed_config['name'] == "Zap.co.il") {
749
+ $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><STORE></STORE>');
750
+ $xml->addChild('datetime', date('Y-m-d H:i:s'));
751
+ $xml->addChild('title', htmlspecialchars($feed_config['projectname']));
752
+ $xml->addChild('link', site_url());
753
+ $xml->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced Product Feed PRO for WooCommerce 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 ');
754
+ $xml->addChild('agency', 'AdTribes.io');
755
+ $xml->addChild('email', 'support@adtribes.io');
756
+ $xml->asXML($file);
757
+ } elseif ($feed_config['name'] == "Salidzini.lv") {
758
+ $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><root></root>');
759
+ $xml->addChild('datetime', date('Y-m-d H:i:s'));
760
+ $xml->addChild('title', htmlspecialchars($feed_config['projectname']));
761
+ $xml->addChild('link', site_url());
762
+ $xml->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced Product Feed PRO for WooCommerce 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 ');
763
+ $xml->addChild('agency', 'AdTribes.io');
764
+ $xml->addChild('email', 'support@adtribes.io');
765
+ $xml->asXML($file);
766
+ } elseif ($feed_config['name'] == "Google Product Review") {
767
+ $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><feed></feed>');
768
+ $xml->addAttribute('xmlns:vc', 'http://www.w3.org/2007/XMLSchema-versioning');
769
+ $xml->addAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
770
+ $xml->addAttribute('xsi:noNamespaceSchemaLocation', 'http://www.google.com/shopping/reviews/schema/product/2.2/product_reviews.xsd');
771
+ $xml->addChild('version', '2.2');
772
+ $aggregator = $xml->addChild('aggregator');
773
+ $aggregator->addChild('name', 'je weet toch');
774
+ $publisher = $xml->addChild('publisher');
775
+ $publisher->addChild('name', 'even wat invullen nog');
776
  $xml->asXML($file);
777
  } else {
778
  $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
781
  $xml->addChild('datetime', date('Y-m-d H:i:s'));
782
  $xml->addChild('title', htmlspecialchars($feed_config['projectname']));
783
  $xml->addChild('link', site_url());
784
+ $xml->addChild('description', 'WooCommerce Product Feed PRO - This product feed is created with the free Advanced Product Feed PRO for WooCommerce 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 ');
785
  $xml->asXML($file);
786
  }
787
  } else {
793
  $offers = $xml->shop[0]->addChild('offers');
794
  }
795
 
796
+ // For ZAP template
797
+ if ($feed_config['name'] == "Zap.co.il") {
798
+ $productz = $xml->addChild('PRODUCTS');
799
+ }
800
+
801
+ // For Google Product review template
802
+ if($feed_config['name'] == "Google Product Review"){
803
+ $reviewz = $xml->addChild('reviews');
804
+ }
805
+
806
  foreach ($products as $key => $value){
807
+
808
  if (is_array ( $value ) ) {
809
  if ($feed_config['name'] == "Yandex") {
810
  $product = $offers->addChild('offer');
811
+ } elseif ($feed_config['name'] == "Heureka.cz" || $feed_config['name'] == "Zbozi.cz") {
812
  $product = $xml->addChild('SHOPITEM');
813
+ } elseif ($feed_config['name'] == "Zap.co.il") {
814
+ $product = $productz->addChild('PRODUCT');
815
+ } elseif ($feed_config['name'] == "Salidzini.lv") {
816
+ $product = $xml->addChild('item');
817
+ } elseif ($feed_config['name'] == "Trovaprezzi.it") {
818
+ $product = $xml->addChild('Offer');
819
+ } elseif ($feed_config['name'] == "Google Product Review") {
820
+ $product = $reviewz->addChild('review');
821
  } else {
822
  $product = $xml->addChild('product');
823
  }
824
+
825
  foreach ($value as $k => $v){
826
+
827
  $v = trim($v);
828
  $k = trim($k);
829
 
854
  }
855
  }
856
  } elseif ($k == "shipping"){
857
+ $expl = "||";
858
+ if(strpos($v, $expl)) {
859
+ $ship = explode("||", $v);
860
+ foreach ($ship as $kk => $vv){
861
+ $ship_zone = $product->addChild('shipping');
862
+ $ship_split = explode(":", $vv);
863
 
864
+ foreach($ship_split as $ship_piece){
865
+ $piece_value = explode("##", $ship_piece);
866
+ if (preg_match("/WOOSEA_COUNTRY/", $ship_piece)){
867
+ $shipping_country = $ship_zone->addChild('country', htmlspecialchars($piece_value[1]));
868
+ } elseif (preg_match("/WOOSEA_REGION/", $ship_piece)){
869
+ $shipping_region = $ship_zone->addChild('region', htmlspecialchars($piece_value[1]));
870
+ } elseif (preg_match("/WOOSEA_POSTAL_CODE/", $ship_piece)){
871
+ $postal_code = $ship_zone->addChild('postal_code', htmlspecialchars($piece_value[1]));
872
+ } elseif (preg_match("/WOOSEA_SERVICE/", $ship_piece)){
873
+ $shipping_service = $ship_zone->addChild('service', htmlspecialchars($piece_value[1]));
874
+ } elseif (preg_match("/WOOSEA_PRICE/", $ship_piece)){
875
+ $shipping_price = $ship_zone->addChild('price', htmlspecialchars($piece_value[1]));
876
+ } else {
877
+ // DO NOT ADD ANYTHING
878
+ }
879
+ }
880
+ }
881
+ } else {
882
+ $child = "shipping";
883
+ $product->$k = $v;
884
  }
885
  } elseif ($k == "category_link"){
886
  $category = $product->addChild('category_links');
944
  * Returns relative and absolute file path
945
  */
946
  public function woosea_create_csvtxt_feed ( $products, $feed_config, $header ) {
947
+
948
  $upload_dir = wp_upload_dir();
949
  $base = $upload_dir['basedir'];
950
  $path = $base . "/woo-product-feed-pro/" . $feed_config['fileformat'];
979
 
980
  // Append or write to file
981
  $fp = fopen($file, 'a+');
982
+
983
+ // Set proper UTF encoding BOM for CSV files
984
+ if($header == "true"){
985
+ fputs( $fp, $bom = chr(0xEF) . chr(0xBB) . chr(0xBF) );
986
+ }
987
 
988
  // Write each row of the products array
989
  foreach ($products as $row) {
1015
  if ($feed_config['fields'] == "google_local"){
1016
  $tab_line = "";
1017
 
1018
+ if($header == "false"){
1019
+ // Get the store codes
1020
+ foreach ($feed_config['attributes'] as $k=>$v){
1021
+ if(preg_match('/\|/', $k)){
1022
+ $stores_local = $k;
1023
+ }
1024
+ }
1025
+
1026
+ $store_ids = explode("|", $stores_local);
1027
+ if(is_array($store_ids)){
1028
+
1029
+ foreach ($store_ids as $store_key => $store_value){
1030
+ $pieces[0] = $store_value;
1031
+
1032
+ if(!empty($store_value)){
1033
+ foreach ($pieces as $t_key => $t_value){
1034
+ $tab_line .= $t_value . "$csv_delimiter";
1035
+ }
1036
+ $tab_line = rtrim($tab_line, $csv_delimiter);
1037
+ $tab_line .= PHP_EOL;
1038
+ }
1039
+ }
1040
+ fwrite($fp, $tab_line);
1041
+ } else {
1042
+ // Only one store code entered
1043
+ foreach ($pieces as $t_key => $t_value){
1044
+ $tab_line .= $t_value . "$csv_delimiter";
1045
+ }
1046
+
1047
+ $tab_line = rtrim($tab_line, $csv_delimiter);
1048
+ $tab_line .= PHP_EOL;
1049
+ fwrite($fp, $tab_line);
1050
+ }
1051
+ } else {
1052
+ foreach ($pieces as $t_key => $t_value){
1053
+ $tab_line .= $t_value . "$csv_delimiter";
1054
+ }
1055
+ $tab_line = rtrim($tab_line, $csv_delimiter);
1056
+ $tab_line .= PHP_EOL;
1057
+ fwrite($fp, $tab_line);
1058
  }
 
 
 
1059
  } else {
 
 
1060
  $tofile = fputcsv($fp, $pieces, $csv_delimiter, '"');
1061
  }
1062
 
1219
  if($status != "publish") { continue; }
1220
 
1221
  $product_data['id'] = get_the_ID();
1222
+
1223
+ // Add support for WooCommerce Multilangual - WCML
1224
+ if(isset($project_config['WCML'])){
1225
+ global $woocommerce_wpml;
1226
+ $multi_currency = $woocommerce_wpml->get_multi_currency();
1227
+ $multi_currency->prices->prices_init();
1228
+ $wcml_price = $multi_currency->prices->get_product_price_in_currency( $product_data['id'] , $project_config['WCML']);
1229
+ }
1230
+
1231
  $product_data['title'] = $product->get_title();
1232
  $product_data['title'] = $this->woosea_utf8_for_xml( $product_data['title'] );
1233
  $product_data['mother_title'] = $product->get_title();
1255
  $product_data['exclude_from_all'] = "yes";
1256
  }
1257
  // End product visibility logic
1258
+ $product_data['item_group_id'] = $this->parentID;
1259
+
1260
  if (!empty($product_data['sku'])){
1261
  $product_data['sku_id'] = $product_data['sku']."_".$product_data['id'];
1262
+
1263
+ if ($project_config['fields'] == "facebook_drm"){
1264
+ if($product_data['item_group_id'] > 0){
1265
+ $product_data['sku_item_group_id'] = $product_data['sku']."_".$product_data['item_group_id'];
1266
+ } else {
1267
+ $product_data['sku_item_group_id'] = $product_data['sku']."_".$product_data['id'];
1268
+ }
1269
+ }
1270
  }
1271
 
 
1272
  $categories = array_unique(wc_get_product_cat_ids( $product_data['id'] ));
1273
 
1274
+ // This is a category fix for Yandex, probably needed for all channels
1275
+ // When Yoast is not installed and a product is linked to multiple categories
1276
+ // The ancestor categoryId does not need to be in the feed
1277
+ $double_categories = array(
1278
+ 0 => "Yandex",
1279
+ 1 => "Prisjakt.se",
1280
+ 2 => "Pricerunner.se",
1281
+ 3 => "Pricerunner.dk",
1282
+ );
1283
+
1284
+ if (in_array($project_config['name'], $double_categories, TRUE)){
1285
+ $cat_alt = array();
1286
+ $cat_terms = get_the_terms( $product_data['id'], 'product_cat' );
1287
+ if($cat_terms){
1288
+ foreach($cat_terms as $cat_term){
1289
+ $cat_alt[] = $cat_term->term_id;
1290
+ }
1291
+ }
1292
+ $categories = $cat_alt;
1293
+ }
1294
+
1295
  // Check if the Yoast plugin is installed and active
1296
  if ( class_exists('WPSEO_Primary_Term') ){
 
1297
  $product_id = $product_data['id'];
1298
  $primary_cat_id=get_post_meta($product_id ,'_yoast_wpseo_primary_product_cat',true);
1299
  $category_path = $this->woosea_get_term_parents( $primary_cat_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
1350
  }
1351
  } else {
1352
  foreach ($categories as $key => $value){
 
1353
  if (!$catname){
1354
  $product_cat = get_term($value, 'product_cat');
1355
 
1403
  $product_data['short_description'] = html_entity_decode((str_replace("\r", "", $post->post_excerpt)), ENT_QUOTES | ENT_XML1, 'UTF-8');
1404
 
1405
  // Strip HTML from (short) description
1406
+ $product_data['description'] = $this->rip_tags($product_data['description']);
1407
+ $product_data['short_description'] = $this->rip_tags($product_data['short_description']);
1408
 
1409
  // Strip out Visual Composer short codes
1410
  $product_data['description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['description'] );
1448
 
1449
  $product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
1450
  $product_data['visibility'] = $this->get_attribute_value( $this->childID,"_visibility" );
1451
+ $product_data['menu_order'] = get_post_field( 'menu_order', $product_data['id'] );
1452
  $product_data['currency'] = get_woocommerce_currency();
1453
+ if(isset($project_config['WCML'])){
1454
+ $product_data['currency'] = $project_config['WCML'];
1455
+ }
1456
  $product_data['sale_price_start_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_from");
1457
  $product_data['sale_price_end_date'] = $this->get_sale_date($this->childID, "_sale_price_dates_to");
1458
  $product_data['sale_price_effective_date'] = $product_data['sale_price_start_date'] ."/".$product_data['sale_price_end_date'];
1495
  $shipping_class_id = $product->get_shipping_class_id();
1496
  $shipping_class= $product->get_shipping_class();
1497
  $class_cost_id = "class_cost_".$shipping_class_id;
 
 
 
 
 
1498
 
1499
+ // Get product prices
1500
+ $product_data['price'] = wc_get_price_including_tax($product, array('price'=> $product->get_price()));
1501
+ // Override price when WCML price is different than the non-translated price
1502
+ if((isset($project_config['WCML'])) AND ($product_data['price'] !== $wcml_price)){
1503
+ $product_data['price'] = $wcml_price;
1504
+ }
1505
+ $product_data['sale_price'] = wc_get_price_including_tax($product, array('price'=> $product->get_sale_price()));
1506
+ $product_data['regular_price'] = wc_get_price_including_tax($product, array('price'=> $product->get_regular_price()));
1507
  if($product_data['regular_price'] == $product_data['sale_price']){
1508
  $product_data['sale_price'] = "";
1509
  }
1510
 
 
1511
  if(!empty($tax_rates)){
1512
  foreach ($tax_rates as $tk => $tv){
1513
  if($tv['rate'] > 0){
1519
  } else {
1520
  $tax_rates[1]['rate'] = 0;
1521
  }
 
 
1522
 
1523
+
1524
+ if($product->get_price()){
1525
+ $product_data['price_forced'] = round(wc_get_price_excluding_tax($product,array('price'=> $product->get_price())) * (100+$tax_rates[1]['rate'])/100,2);
1526
+ }
1527
+ if($product->get_regular_price()){
1528
+ $product_data['regular_price_forced'] = round(wc_get_price_excluding_tax($product, array('price'=> $product->get_regular_price())) * (100+$tax_rates[1]['rate'])/100,2);
1529
  }
1530
+ if($product->get_sale_price()){
1531
+ $product_data['sale_price_forced'] = round(wc_get_price_excluding_tax($product, array('price'=> $product->get_sale_price())) * (100+$tax_rates[1]['rate'])/100,2);
1532
+ }
1533
+
1534
+ $product_data['net_price'] = round($product->get_price(),2);
1535
+ $product_data['net_regular_price'] = round($product->get_regular_price(),2);
1536
+ $product_data['net_sale_price'] = round($product->get_sale_price(),2);
1537
+
1538
+ // We do not want to have 0 sale price values in the feed
1539
+ if($product_data['net_sale_price'] == 0){
1540
+ $product_data['net_sale_price'] = "";
1541
+ }
1542
+
1543
+ $price = wc_get_price_including_tax($product,array('price'=> $product->get_price()));
1544
  if($product_data['sale_price'] > 0){
1545
  $price = $product_data['sale_price'];
1546
  }
1547
 
1548
+ // Do we need to convert all of the above prices with the Aelia Currency Switcher
1549
+ if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
1550
+ if(!array_key_exists('base_currency', $project_config)){
1551
+ $from_currency = get_woocommerce_currency();
1552
+ } else {
1553
+ $from_currency = $project_config['base_currency'];
1554
+ }
1555
+
1556
+ // Get Aelia currency conversion prices
1557
+ $product_data['price'] = apply_filters('wc_aelia_cs_convert', $product_data['price'], $from_currency, $project_config['AELIA']);
1558
+ $product_data['regular_price'] = apply_filters('wc_aelia_cs_convert', $product_data['regular_price'], $from_currency, $project_config['AELIA']);
1559
+ $product_data['sale_price'] = apply_filters('wc_aelia_cs_convert', $product_data['sale_price'], $from_currency, $project_config['AELIA']);
1560
+ $product_data['price_forced'] = apply_filters('wc_aelia_cs_convert', $product_data['price_forced'], $from_currency, $project_config['AELIA']);
1561
+ $product_data['regular_price_forced'] = apply_filters('wc_aelia_cs_convert', $product_data['regular_price_forced'], $from_currency, $project_config['AELIA']);
1562
+ if($product->get_sale_price()){
1563
+ $product_data['sale_price_forced'] = apply_filters('wc_aelia_cs_convert', $product_data['sale_price_forced'], $from_currency, $project_config['AELIA']);
1564
+ }
1565
+ $product_data['net_price'] = apply_filters('wc_aelia_cs_convert', $product_data['net_price'], $from_currency, $project_config['AELIA']);
1566
+ $product_data['net_regular_price'] = apply_filters('wc_aelia_cs_convert', $product_data['net_regular_price'], $from_currency, $project_config['AELIA']);
1567
+ $product_data['net_sale_price'] = apply_filters('wc_aelia_cs_convert', $product_data['net_sale_price'], $from_currency, $project_config['AELIA']);
1568
+
1569
+ // Get Aelia manually inserted currency prices
1570
+ if($product->is_type('simple')){
1571
+ $regular_aelia_prices = get_post_meta($product_data['id'], '_regular_currency_prices', true);
1572
+ } else {
1573
+ $regular_aelia_prices = get_post_meta($product_data['id'], 'variable_regular_currency_prices', true);
1574
+ }
1575
+ $regular_aelia_prices = trim($regular_aelia_prices, "}");
1576
+ $regular_aelia_prices = trim($regular_aelia_prices, "{");
1577
+
1578
+ if(strlen($regular_aelia_prices) > 2){
1579
+ $regular_aelia_pieces = explode(",", $regular_aelia_prices);
1580
+ foreach ($regular_aelia_pieces as $rap_k => $rap_v){
1581
+ $regulars = explode(":", $rap_v);
1582
+ $reg_cur = trim($regulars[0], "\"");
1583
+ $reg_val = trim($regulars[1], "\"");
1584
+ if($reg_cur == $project_config['AELIA']){
1585
+ $product_data['regular_price'] = $reg_val;
1586
+ }
1587
+ }
1588
+ }
1589
+
1590
+ if($product->is_type('simple')){
1591
+ $sale_aelia_prices = get_post_meta($product_data['id'], '_sale_currency_prices', true);
1592
+ } else {
1593
+ $sale_aelia_prices = get_post_meta($product_data['id'], 'variable_sale_currency_prices', true);
1594
+ }
1595
+ $sale_aelia_prices = trim($sale_aelia_prices, "}");
1596
+ $sale_aelia_prices = trim($sale_aelia_prices, "{");
1597
+
1598
+ if(strlen($sale_aelia_prices) > 2){
1599
+ $sale_aelia_pieces = explode(",", $sale_aelia_prices);
1600
+ foreach ($sale_aelia_pieces as $sap_k => $sap_v){
1601
+ $sales = explode(":", $sap_v);
1602
+ $sale_cur = trim($sales[0], "\"");
1603
+ $sale_val = trim($sales[1], "\"");
1604
+ if($sale_cur == $project_config['AELIA']){
1605
+ $product_data['sale_price'] = $sale_val;
1606
+ }
1607
+ }
1608
+ }
1609
+
1610
+ }
1611
+
1612
+ // Localize the price attributes
1613
+ $product_data['price'] = wc_format_localized_price($product_data['price']);
1614
+ $product_data['regular_price'] = wc_format_localized_price($product_data['regular_price']);
1615
+ $product_data['sale_price'] = wc_format_localized_price($product_data['sale_price']);
1616
+ if($product->get_price()){
1617
+ $product_data['price_forced'] = wc_format_localized_price($product_data['price_forced']);
1618
+ }
1619
+ if($product->get_regular_price()){
1620
+ $product_data['regular_price_forced'] = wc_format_localized_price($product_data['regular_price_forced']);
1621
+ }
1622
+ if($product->get_sale_price()){
1623
+ $product_data['sale_price_forced'] = wc_format_localized_price($product_data['sale_price_forced']);
1624
+ }
1625
+ $product_data['net_price'] = wc_format_localized_price($product_data['net_price']);
1626
+ $product_data['net_regular_price'] = wc_format_localized_price($product_data['net_regular_price']);
1627
+ $product_data['net_sale_price'] = wc_format_localized_price($product_data['net_sale_price']);
1628
+
1629
+ foreach($project_config['attributes'] as $attr_key => $attr_arr){
1630
+ if(is_array($attr_arr)){
1631
+ if($attr_arr['attribute'] == "g:shipping"){
1632
+ $product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $price, $tax_rates, $shipping_zones);
1633
+ $shipping_str = $product_data['shipping'];
1634
+ }
1635
+ }
1636
+ }
1637
+
1638
+ if (array_key_exists('shipping', $project_config['attributes'])){
1639
+ $product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $price, $tax_rates, $shipping_zones);
1640
+ $shipping_str = $product_data['shipping'];
1641
+ }
1642
+
1643
+ // Google Dynamic Remarketing feeds require the English price notation
1644
+ if ($project_config['name'] == "Google Remarketing - DRM"){
1645
+ $thousand_separator = wc_get_price_thousand_separator();
1646
+
1647
+ if($thousand_separator != ','){
1648
+ $product_data['price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['price'])));
1649
+ $product_data['regular_price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['regular_price'])));
1650
+ $product_data['sale_price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['sale_price'])));
1651
+ $product_data['regular_price_forced'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['regular_price_forced'])));
1652
+ if($product->get_sale_price()){
1653
+ $product_data['sale_price_forced'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['sale_price_forced'])));
1654
+ }
1655
+ $product_data['net_price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['net_price'])));
1656
+ $product_data['net_regular_price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['net_regular_price'])));
1657
+ $product_data['net_sale_price'] = floatval(str_replace(',', '.', str_replace('.', '', $product_data['net_sale_price'])));
1658
+ }
1659
+ }
1660
+
1661
  $product_data['installment'] = $this->woosea_get_installment($project_config, $product_data['id']);
1662
  $product_data['weight'] = ($product->get_weight()) ? $product->get_weight() : false;
1663
  $product_data['height'] = ($product->get_height()) ? $product->get_height() : false;
1715
  array_push ($product_data["product_tag"], $term->name);
1716
  }
1717
  }
1718
+ } else {
1719
+ $product_data["product_tag"] = array();
1720
  }
1721
+
1722
  /**
1723
  * Get Custom Attributes for Single products
1724
  */
1779
  $mother_image = wp_get_attachment_image_src( get_post_thumbnail_id( $product_data['item_group_id'] ), 'full' );
1780
  $product_data['image'] = $mother_image[0];
1781
  }
1782
+
1783
+ // Get product reviews for Google Product Review Feeds
1784
+ // $product_data['reviews'] = $this->woosea_get_reviews( $product_data, $product );
1785
+
1786
  /**
1787
  * Versioned products need a seperate approach
1788
  * Get data for these products based on the mother products item group id
1791
 
1792
  $product_variations = new WC_Product_Variation( $product_data['id'] );
1793
  $variations = $product_variations->get_variation_attributes();
1794
+
1795
+ // Determine the default variation product
1796
+ $variation_pass = "true";
1797
+ $mother_product = new WC_Product( $product_data['item_group_id'] );
1798
+ $def_attributes = $mother_product->get_default_attributes();
1799
+ $diff_result = array_diff($variations, $def_attributes);
1800
+
1801
+ if(isset($project_config['default_variations']) AND (!empty($diff_result))){
1802
+ $variation_pass = "false";
1803
+ }
1804
+
1805
  $append = "";
1806
 
1807
  $variable_description = get_post_meta( $product_data['id'], '_variation_description', true );
1814
  $product_data['short_description'] = html_entity_decode((str_replace("\r", "", $variable_description)), ENT_QUOTES | ENT_XML1, 'UTF-8');
1815
 
1816
  // Strip HTML from (short) description
1817
+ $product_data['description'] = $this->rip_tags($product_data['description']);
1818
+ $product_data['short_description'] = $this->rip_tags($product_data['short_description']);
1819
  // Strip out Visual Composer short codes
1820
  $product_data['description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['description'] );
1821
  $product_data['short_description'] = preg_replace( '/\[(.*?)\]/', ' ', $product_data['short_description'] );
1902
  }
1903
  }
1904
 
1905
+ // Add attribute values to the variation product names to make them unique
1906
  foreach($variations as $kk => $vv){
1907
  $custom_key = $kk;
1908
 
1909
  if (isset($project_config['product_variations']) AND ($project_config['product_variations'] == "on")){
 
1910
  $taxonomy = str_replace("attribute_","",$kk);
1911
  $term = get_term_by('slug', $vv, $taxonomy);
1912
+
1913
+ if($term && $term->name){
1914
+ $vv = $term->name;
1915
+ }
1916
 
1917
+ if($vv){
1918
+ $append = ucfirst($vv);
1919
+ // Prevent duplicate attribute values from being added to the product name
1920
+ if(!preg_match("/" . preg_quote($product_data['title'], '/') . "/", $append)){
1921
+ $product_data['title'] = $product_data['title']." ".$append;
1922
  }
1923
  }
1924
  }
2003
 
2004
  // Get versioned product categories
2005
  $categories = wc_get_product_cat_ids( $product_data['item_group_id'] );
2006
+
2007
+ // This is a category fix for Yandex, probably needed for all channels
2008
+ // When Yoast is not installed and a product is linked to multiple categories
2009
+ // The ancestor categoryId does not need to be in the feed
2010
+ $double_categories = array(
2011
+ 0 => "Yandex",
2012
+ 1 => "Prisjakt.se",
2013
+ 2 => "Pricerunner.se",
2014
+ 3 => "Pricerunner.dk",
2015
+ );
2016
+
2017
+ if (in_array($project_config['name'], $double_categories, TRUE)){
2018
+ $cat_alt = array();
2019
+ $cat_terms = get_the_terms( $product_data['item_group_id'], 'product_cat' );
2020
+ if($cat_terms){
2021
+ foreach($cat_terms as $cat_term){
2022
+ $cat_alt[] = $cat_term->term_id;
2023
+ }
2024
+ }
2025
+ $categories = $cat_alt;
2026
+ }
2027
+
2028
+
2029
+
2030
  // Check if the Yoast plugin is installed and active
2031
  if ( class_exists('WPSEO_Primary_Term') ){
2032
+
2033
  $product_id = $product_data['item_group_id'];
2034
  $primary_cat_id=get_post_meta($product_id ,'_yoast_wpseo_primary_product_cat',true);
2035
 
2113
  foreach ($categories as $key => $value){
2114
  if (!$catname){
2115
  $product_cat = get_term($value, 'product_cat');
2116
+
2117
  if($product_cat->parent > 0){
2118
  $set_parent = $product_cat->parent;
2119
  }
2166
  * Rules execution
2167
  */
2168
  if (array_key_exists('rules2', $project_config)){
2169
+ if(is_array($product_data)){
2170
+ $product_data = $this->woocommerce_sea_rules( $project_config['rules2'], $product_data );
2171
+ }
2172
  }
2173
 
2174
  /**
2175
  * Filter execution
2176
  */
2177
  if (array_key_exists('rules', $project_config)){
2178
+ if(is_array($product_data)){
2179
+ $product_data = $this->woocommerce_sea_filters( $project_config['rules'], $product_data );
2180
+ }
2181
  }
2182
 
2183
  /**
2192
  $product_data['categories'] = "";
2193
  }
2194
  }
2195
+
2196
  /**
2197
  * When a product is a variable product we need to delete the original product from the feed, only the originals are allowed
2198
  */
2201
  $product_data = null;
2202
  }
2203
 
2204
+ /**
2205
+ * Remove variation products that are not THE default variation product
2206
+ */
2207
+ if((isset($variation_pass)) AND ($variation_pass == "false")){
2208
+ $product_data = array();
2209
+ $product_data = null;
2210
+ }
2211
+
2212
+ /**
2213
+ * And item_group_id is not allowed for simple products, prevent users from adding this to the feedd
2214
+ */
2215
+ if($product->is_type('simple')){
2216
+ unset($product_data['item_group_id']);
2217
+ }
2218
+
2219
  /**
2220
  * When product has passed the filter rules it can continue with the rest
2221
  */
2286
  $shipping_str .= "||";
2287
  foreach($value as $k => $v){
2288
  if(preg_match('/[0-9]/', $v)){
2289
+ $shipping_str .= ":$attr_value[prefix]".$v."$attr_value[suffix]";
2290
+ // $shipping_str .= ":$attr_value[prefix]".$v."$attr_value[suffix]";
2291
  } else {
2292
  $shipping_str .= ":$v";
2293
  }
2301
  $attr_line .= ",'".$shipping_str."'";
2302
  }
2303
  } else {
 
2304
  if(strlen($product_data[$attr_value['mapfrom']])){
2305
+ $attr_line .= ",'".$attr_value['prefix']. " ".$product_data[$attr_value['mapfrom']]." " .$attr_value['suffix']."'";
2306
  } else {
2307
  $attr_line .= ",''";
2308
  }
2317
  $pieces_row = explode ("','", $attr_line);
2318
  $pieces_row = array_map('trim', $pieces_row);
2319
 
2320
+ if($project_config['fields'] == "google_shopping"){
2321
+ foreach($identifier_positions as $id_key => $id_value){
2322
+ if($id_key != "g:identifier_exists"){
2323
+ if ($pieces_row[$id_value]){
2324
+ $identifier_exists = "yes";
2325
+ }
2326
+ } else {
2327
+ $identifier_position = $id_value;
2328
  }
 
 
2329
  }
 
2330
 
2331
+ if((isset($identifier_exists)) AND ($identifier_exists == "yes")){
2332
+ $pieces_row[$id_value] = $identifier_exists;
2333
+ } else {
2334
+ if(isset($id_value)){
2335
+ $pieces_row[$id_value] = "no";
2336
+ }
2337
  }
2338
  }
2339
  $attr_line = implode("','", $pieces_row);
 
2340
  $products[] = array ( $attr_line );
2341
  } else {
2342
  foreach( array_keys($project_config['attributes']) as $attribute_key ){
2356
  * Build an array needed for the adding Childs in the XML productfeed
2357
  */
2358
  foreach( array_keys($project_config['attributes']) as $attribute_key ){
2359
+
2360
+ if(!is_numeric($attribute_key)){
 
 
 
 
 
 
 
 
 
 
2361
 
2362
+ if(!isset($old_attributes_config)){
2363
+ if(!$xml_product){
2364
+ $xml_product = array (
2365
+ $attribute_key => $product_data[$attribute_key]
2366
+ );
2367
+ } else {
2368
+ if(isset($product_data[$attribute_key])){
2369
+ $xml_product = array_merge($xml_product, array($attribute_key => $product_data[$attribute_key]));
 
2370
  }
2371
+ }
2372
+ } else {
2373
+ foreach($old_attributes_config as $attr_key => $attr_value){
2374
+
2375
+ $ca = 0;
2376
+ // Static attribute value was set by user
2377
+ if(array_key_exists('static_value', $attr_value)){
2378
+ if(!isset($xml_product)){
2379
+ $xml_product = array (
2380
+ $attr_value['attribute'] => "$attr_value[prefix] ". $attr_value['mapfrom'] ." $attr_value[suffix]"
2381
+ );
2382
+ } else {
2383
+ $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $attr_value['mapfrom'] ." $attr_value[suffix]";
2384
+ }
2385
+ } elseif ($attr_value['mapfrom'] == $attribute_key){
2386
+ if(!isset($xml_product)){
2387
+ $xml_product = array (
2388
+ $attr_value['attribute'] => "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]"
2389
+ );
2390
+ } else {
2391
+ if(key_exists($attr_value['mapfrom'],$product_data)){
2392
+
2393
+ if(is_array($product_data[$attr_value['mapfrom']])){
2394
+ if($attr_value['mapfrom'] == "product_tag"){
2395
+ $product_tag_str = "";
2396
+
2397
+ foreach ($product_data['product_tag'] as $key => $value){
2398
+ $product_tag_str .= ",";
2399
+ $product_tag_str .= "$value";
2400
+ }
2401
+ $product_tag_str = ltrim($product_tag_str, ",");
2402
+ $product_tag_str = rtrim($product_tag_str, ",");
2403
+
2404
+ $xml_product[$attr_value['attribute']] = "$product_tag_str";
2405
+ } else {
2406
+ $shipping_str = "";
2407
+ foreach ($product_data[$attr_value['mapfrom']] as $key => $value){
2408
+ $shipping_str .= "||";
2409
 
2410
+ foreach($value as $k => $v){
2411
+
2412
+ if($k == "country"){
2413
+ $shipping_str .= ":WOOSEA_COUNTRY##$v";
2414
+ } elseif ($k == "region"){
2415
+ $shipping_str .= ":WOOSEA_REGION##$v";
2416
+ } elseif ($k == "service"){
2417
+ $shipping_str .= ":WOOSEA_SERVICE##$v";
2418
+ } elseif ($k == "postal_code"){
2419
+ $shipping_str .= ":WOOSEA_POSTAL_CODE##$v";
2420
+ } elseif ($k == "price"){
2421
+ $shipping_str .= ":WOOSEA_PRICE##$attr_value[prefix] $v $attr_value[suffix]";
2422
+ } else {
2423
+ // UNKNOWN, DO NOT ADD
2424
+ }
2425
  }
2426
+ }
2427
+ $shipping_str = ltrim($shipping_str, "||");
2428
+ $shipping_str = rtrim($shipping_str, ":");
2429
+ $shipping_str = ltrim($shipping_str, ":");
2430
+ $shipping_str = str_replace("||:", "||", $shipping_str);
 
2431
 
2432
+ $xml_product[$attr_value['attribute']] = "$shipping_str";
2433
+ }
 
 
 
 
2434
  } else {
2435
+ if(array_key_exists($attr_value['attribute'], $xml_product)){
2436
+ $ca = explode("_", $attr_value['mapfrom']);
2437
+ $xml_product[$attr_value['attribute']."_$ca[1]"] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
2438
+ } else {
2439
+ if(strlen($product_data[$attr_value['mapfrom']])){
2440
+
2441
+ if(($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "link")){
2442
+ $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ."$attr_value[suffix]";
2443
+ } elseif(($attr_value['attribute'] == "g:id") OR ($attr_value['attribute'] == "id") OR ($attr_value['attribute'] == "g:item_group_id")){
2444
+ $xml_product[$attr_value['attribute']] = "$attr_value[prefix]". $product_data[$attr_value['mapfrom']] ."$attr_value[suffix]";
2445
+ } else {
2446
+ $xml_product[$attr_value['attribute']] = "$attr_value[prefix] ". $product_data[$attr_value['mapfrom']] ." $attr_value[suffix]";
2447
+ }
2448
+ }
2449
  }
2450
  }
2451
  }
2478
  array_push ($xml_piece, $xml_product);
2479
  unset($xml_product);
2480
  }
 
 
2481
  unset($product_data);
2482
  }
2483
  endwhile;
2829
  }
2830
 
2831
  // Check if a rule has been set for Google categories
2832
+ if (!empty($product_data[$pr_array['than_attribute']]) AND ($product_data[$pr_array['than_attribute']] == "google_category")){
2833
  $pr_array['than_attribute'] = "categories";
2834
  $category_id = explode("-", $pr_array['newvalue']);
2835
  $pr_array['newvalue'] = $category_id[0];
2836
  }
2837
 
2838
  // Make sure that rules on numerics are on true numerics
2839
+ if (!is_array($pd_value) AND (!preg_match('/[A-Za-z]/', $pd_value))){
2840
  $pd_value = strtr($pd_value, ',', '.');
2841
  }
2842
 
2847
  switch ($pr_array['condition']) {
2848
  case($pr_array['condition'] = "contains"):
2849
  if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
2850
+ // $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
2851
+ $product_data[$pr_array['than_attribute']] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $pd_value);
2852
  }
2853
  break;
2854
  case($pr_array['condition'] = "containsnot"):
2915
  break;
2916
  }
2917
  } elseif (is_array($pd_value)) {
 
2918
  // For now only shipping details are in an array
2919
  foreach ($pd_value as $k => $v){
2920
  foreach ($v as $kk => $vv){
2923
  switch ($pr_array['condition']) {
2924
  case($pr_array['condition'] = "contains"):
2925
  if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
2926
+ $pd_value[$k]['price'] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $vv);
2927
  $product_data[$pr_array['than_attribute']] = $pd_value;
2928
  }
2929
  break;
2975
  $product_data[$pr_array['than_attribute']] = $pd_value;
2976
  }
2977
  break;
2978
+ case($pr_array['condition'] = "multiply"):
2979
+ // Only shipping array
2980
+ if(is_array($pd_value)){
2981
+ $pr_array['criteria'] = strtr($pr_array['criteria'], ',', '.');
2982
+ foreach ($pd_value as $ship_a_key => $shipping_arr){
2983
+ foreach($shipping_arr as $ship_key => $ship_value){
2984
+ if($ship_key == "price"){
2985
+ $ship_pieces = explode(" ", $ship_value);
2986
+ $pd_value = strtr($ship_pieces[1], ',', '.');
2987
+ $newvalue = $pd_value*$pr_array['criteria'];
2988
+ $newvalue = round($newvalue, 2);
2989
+ $newvalue = strtr($newvalue, '.',',');
2990
+ $newvalue = $ship_pieces[0]." ".$newvalue;
2991
+ $product_data[$pr_array['than_attribute']][$ship_a_key]['price'] = $newvalue;
2992
+ }
2993
+ }
2994
+ }
2995
+ }
2996
+ break;
2997
  default:
2998
  break;
2999
  }
3093
  // Use a lexical order on relational string operators
3094
  if (($pd_value < $pr_array['criteria'])){
3095
  // Specifically for shipping price rules
3096
+ if(isset($product_data[$pr_array['than_attribute']]) AND (is_array($product_data[$pr_array['than_attribute']]))){
3097
  $arr_size = (count($product_data[$pr_array['than_attribute']])-1);
3098
  for ($x = 0; $x <= $arr_size; $x++) {
3099
  $product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
3120
 
3121
  case($pr_array['condition'] = "empty"):
3122
  if(empty($product_data[$pr_array['attribute']])){
3123
+ $product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
3124
  }
3125
  break;
3126
  case($pr_array['condition'] = "replace"):
3179
  }
3180
 
3181
  foreach ($project_rules as $pr_key => $pr_array){
3182
+
3183
  if(array_key_exists($pr_array['attribute'], $product_data)){
3184
 
3185
  foreach ($product_data as $pd_key => $pd_value){
3186
  // Check is there is a rule on specific attributes
3187
+
3188
+ if(in_array($pd_key, $pr_array, TRUE)){
3189
 
3190
  if($pd_key == "price"){
3191
  $pd_value = @number_format($pd_value,2);
3260
  break;
3261
  }
3262
  } elseif (is_array($pd_value)){
3263
+
3264
  // Tis can either be a shipping or product_tag array
3265
  if($pr_array['attribute'] == "product_tag"){
3266
+
3267
+ if(in_array($pr_array['criteria'], $pd_value, TRUE)) {
3268
+ $v = $pr_array['criteria'];
3269
+
3270
  switch ($pr_array['condition']) {
3271
  case($pr_array['condition'] = "contains"):
3272
  if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
3273
+ if($pr_array['than'] == "include_only"){
3274
+ $allowed = 1;
3275
+ } else {
3276
+ $allowed = 0;
3277
+ }
3278
+ } else {
3279
+ $allowed = 0;
3280
  }
3281
  break;
3282
  case($pr_array['condition'] = "containsnot"):
3283
  if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
3284
+ if($pr_array['than'] == "include_only"){
3285
+ $allowed = 1;
3286
+ } else {
3287
+ $allowed = 0;
3288
+ }
3289
+ } else {
3290
  $allowed = 0;
3291
  }
3292
  break;
3293
  case($pr_array['condition'] = "="):
3294
  if (($v == $pr_array['criteria'])){
3295
+ if($pr_array['than'] == "include_only"){
3296
+ $allowed = 1;
3297
+ } else {
3298
+ $allowed = 0;
3299
+ }
3300
+ } else {
3301
  $allowed = 0;
3302
  }
3303
  break;
3304
  case($pr_array['condition'] = "!="):
3305
  if (($v != $pr_array['criteria'])){
3306
+ if($pr_array['than'] == "include_only"){
3307
+ $allowed = 1;
3308
+ } else {
3309
+ $allowed = 0;
3310
+ }
3311
  }
3312
  break;
3313
  case($pr_array['condition'] = ">"):
3314
  if (($v > $pr_array['criteria'])){
3315
+ if($pr_array['than'] == "include_only"){
3316
+ $allowed = 1;
3317
+ } else {
3318
+ $allowed = 0;
3319
+ }
3320
  }
3321
  break;
3322
  case($pr_array['condition'] = ">="):
3323
  if (($v >= $pr_array['criteria'])){
3324
+ if($pr_array['than'] == "include_only"){
3325
+ $allowed = 1;
3326
+ } else {
3327
+ $allowed = 0;
3328
+ }
3329
  }
3330
  break;
3331
  case($pr_array['condition'] = "<"):
3332
  if (($v < $pr_array['criteria'])){
3333
+ if($pr_array['than'] == "include_only"){
3334
+ $allowed = 1;
3335
+ } else {
3336
+ $allowed = 0;
3337
+ }
3338
  }
3339
  break;
3340
  case($pr_array['condition'] = "=<"):
3341
  if (($v <= $pr_array['criteria'])){
3342
+ if($pr_array['than'] == "include_only"){
3343
+ $allowed = 1;
3344
+ } else {
3345
+ $allowed = 0;
3346
+ }
3347
  }
3348
  break;
3349
  case($pr_array['condition'] = "empty"):
3350
  if (strlen($v) < 1){
3351
+ if($pr_array['than'] == "include_only"){
3352
+ $allowed = 1;
3353
+ } else {
3354
+ $allowed = 0;
3355
+ }
3356
+ }
3357
+ break;
3358
+ default:
3359
+ break;
3360
+ }
3361
+ } else {
3362
+ switch ($pr_array['condition']) {
3363
+ case($pr_array['condition'] = "contains"):
3364
+ if($pr_array['than'] == "include_only"){
3365
+ $allowed = 0;
3366
+ } else {
3367
+ $allowed = 0;
3368
+ }
3369
+ break;
3370
+ case($pr_array['condition'] = "containsnot"):
3371
+ if($pr_array['than'] == "include_only"){
3372
+ $allowed = 1;
3373
+ } else {
3374
+ $allowed = 0;
3375
+ }
3376
+ break;
3377
+ case($pr_array['condition'] = "="):
3378
+ if($pr_array['than'] == "include_only"){
3379
+ $allowed = 0;
3380
+ } else {
3381
+ $allowed = 0;
3382
+ }
3383
+ break;
3384
+ case($pr_array['condition'] = "!="):
3385
+ if($pr_array['than'] == "include_only"){
3386
+ $allowed = 1;
3387
+ } else {
3388
+ $allowed = 0;
3389
+ }
3390
+ break;
3391
+ case($pr_array['condition'] = ">"):
3392
+ if($pr_array['than'] == "include_only"){
3393
+ $allowed = 0;
3394
+ } else {
3395
+ $allowed = 0;
3396
+ }
3397
+ break;
3398
+ case($pr_array['condition'] = ">="):
3399
+ if($pr_array['than'] == "include_only"){
3400
+ $allowed = 0;
3401
+ } else {
3402
+ $allowed = 0;
3403
+ }
3404
+ break;
3405
+ case($pr_array['condition'] = "<"):
3406
+ if($pr_array['than'] == "include_only"){
3407
+ $allowed = 0;
3408
+ } else {
3409
+ $allowed = 0;
3410
+ }
3411
+ break;
3412
+ case($pr_array['condition'] = "=<"):
3413
+ if($pr_array['than'] == "include_only"){
3414
+ $allowed = 0;
3415
+ } else {
3416
+ $allowed = 0;
3417
+ }
3418
+ break;
3419
+ case($pr_array['condition'] = "empty"):
3420
+ if($pr_array['than'] == "include_only"){
3421
+ $allowed = 1;
3422
+ } else {
3423
  $allowed = 0;
3424
  }
3425
  break;
3563
  }
3564
  break;
3565
  case($pr_array['condition'] = "empty"):
 
3566
  if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
3567
  $allowed = 0;
3568
+ } elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "exclude")){
3569
+ $allowed = 1;
3570
+ } elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "include_only")){
3571
  $allowed = 0;
3572
  }
3573
  break;
3580
  } else {
3581
  // A empty rule has been set on an attribute that is not in a product anyhow. Still, remove this product from the feed
3582
  if($pr_array['condition'] == "empty"){
3583
+ if($pr_array['than'] == "exclude"){
3584
+ $allowed = 0;
3585
+ } else {
3586
+ $allowed = 1;
3587
+ }
3588
  } elseif($pr_array['condition'] == "="){
3589
+ if($pr_array['than'] == "exclude"){
3590
+ $allowed = 1;
3591
+ } else {
3592
+ $allowed = 0;
3593
+ }
3594
  } elseif($pr_array['condition'] == "contains"){
3595
  if($pr_array['than'] == "exclude"){
3596
  $allowed = 1;
3598
  $allowed = 0;
3599
  }
3600
  } else {
 
3601
  if($pr_array['than'] == "exclude"){
3602
  $allowed = 0;
3603
  } else {
classes/class-google-remarketing.php CHANGED
@@ -6,23 +6,24 @@ 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
  }
6
 
7
  public static function woosea_google_remarketing_pagetype ( ) {
8
  $ecomm_pagetype = "other"; // set a default
9
+
10
+ if (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
11
+ if(is_product()){
12
+ $ecomm_pagetype = "product";
13
+ } elseif (is_cart()){
14
+ $ecomm_pagetype = "cart";
15
+ } elseif (is_checkout()){
16
+ $ecomm_pagetype = "cart";
17
+ } elseif (is_product_category()){
18
+ $ecomm_pagetype = "category";
19
+ } elseif (is_front_page()){
20
+ $ecomm_pagetype = "home";
21
+ } elseif (is_search()){
22
+ $ecomm_pagetype = "searchresults";
23
+ } else {
24
+ $ecomm_pagetype = "other";
25
+ }
26
+ }
27
  return $ecomm_pagetype;
28
  }
29
  }
classes/class-update-channel.php CHANGED
@@ -21,7 +21,7 @@ class WooSEA_Update_Project {
21
  foreach ($channel_statics as $key=>$val){
22
 
23
  foreach ($val as $k=>$v){
24
- if ($channel_hash == $v['channel_hash']){
25
  $channel_data = $v;
26
  }
27
  }
@@ -39,7 +39,7 @@ class WooSEA_Update_Project {
39
 
40
  foreach ($cron_projects as $key=>$val){
41
  if(!empty($val)){
42
- if($val['project_hash'] == $project_hash){
43
  $project_config = $val;
44
  }
45
  }
@@ -52,12 +52,13 @@ class WooSEA_Update_Project {
52
  * Update individual project configuration
53
  */
54
  public static function update_project_data($project) {
 
55
  if(get_option( 'cron_projects' )){
56
  $cron_projects = get_option( 'cron_projects' );
57
-
58
  foreach ($cron_projects as $key=>$val){
59
  if(!empty($val)){
60
- if($val['project_hash'] == $project['project_hash']){
61
  $cron_projects[$key] = $project;
62
  update_option('cron_projects', $cron_projects);
63
  }
@@ -67,6 +68,7 @@ class WooSEA_Update_Project {
67
  }
68
 
69
  public static function update_project($project_data){
 
70
  if(!array_key_exists('project_hash', $project_data)){
71
  $upload_dir = wp_upload_dir();
72
  $external_base = $upload_dir['baseurl'];
@@ -77,7 +79,7 @@ class WooSEA_Update_Project {
77
  foreach ($channel_statics as $key=>$val){
78
 
79
  foreach ($val as $k=>$v){
80
- if ($project_data['channel_hash'] == $v['channel_hash']){
81
  $project_fill = array_merge($v, $project_data);
82
  $project_fill['project_hash'] = bin2hex(openssl_random_pseudo_bytes(16));
83
 
@@ -111,7 +113,7 @@ class WooSEA_Update_Project {
111
  if(!empty($val)){
112
  foreach ($val as $k=>$v){
113
  if(!is_array($v)){
114
- if (($v == $project_hash) AND ($k == "project_hash")){
115
  $project_config = $val;
116
  $remove_key = $key;
117
  }
@@ -120,7 +122,7 @@ class WooSEA_Update_Project {
120
  }
121
  }
122
  }
123
-
124
  /**
125
  * Update project hash with new values
126
  */
@@ -149,9 +151,7 @@ class WooSEA_Update_Project {
149
  $external_path = $external_base . "/woo-product-feed-pro/" . $project_config['fileformat'];
150
  $project_config['external_file'] = $external_path . "/" . sanitize_file_name($project_config['filename']) . "." . $project_config['fileformat'];
151
 
152
-
153
-
154
- if((array_key_exists('page', $project_data)) AND ($project_data['page'] == "analytics")){
155
  /**
156
  * Did the Google Analytics UTM code part got disabled?
157
  */
@@ -164,10 +164,6 @@ class WooSEA_Update_Project {
164
  if(!array_key_exists('adtribes_conversion', $project_data)) {
165
  unset($project_config['adtribes_conversion']);
166
  }
167
-
168
-
169
-
170
-
171
  }
172
 
173
  /**
@@ -180,21 +176,32 @@ class WooSEA_Update_Project {
180
  }
181
  }
182
 
183
- if((array_key_exists('page', $project_data)) AND ($project_data['page'] == "filters")){
184
- /**
185
- * Did all the filters got removed
186
- */
 
 
 
 
 
 
 
 
 
187
  if(!array_key_exists('rules', $project_data)) {
188
  unset($project_config['rules']);
189
  }
 
190
 
191
- /**
192
- * Did all the rules got removed
193
- */
 
194
  if(!array_key_exists('rules2', $project_data)) {
195
  unset($project_config['rules2']);
196
  }
197
- }
198
 
199
  /**
200
  * Update cron with new project settings
21
  foreach ($channel_statics as $key=>$val){
22
 
23
  foreach ($val as $k=>$v){
24
+ if ($channel_hash === $v['channel_hash']){
25
  $channel_data = $v;
26
  }
27
  }
39
 
40
  foreach ($cron_projects as $key=>$val){
41
  if(!empty($val)){
42
+ if($val['project_hash'] === $project_hash){
43
  $project_config = $val;
44
  }
45
  }
52
  * Update individual project configuration
53
  */
54
  public static function update_project_data($project) {
55
+
56
  if(get_option( 'cron_projects' )){
57
  $cron_projects = get_option( 'cron_projects' );
58
+
59
  foreach ($cron_projects as $key=>$val){
60
  if(!empty($val)){
61
+ if($val['project_hash'] === $project['project_hash']){
62
  $cron_projects[$key] = $project;
63
  update_option('cron_projects', $cron_projects);
64
  }
68
  }
69
 
70
  public static function update_project($project_data){
71
+
72
  if(!array_key_exists('project_hash', $project_data)){
73
  $upload_dir = wp_upload_dir();
74
  $external_base = $upload_dir['baseurl'];
79
  foreach ($channel_statics as $key=>$val){
80
 
81
  foreach ($val as $k=>$v){
82
+ if ($project_data['channel_hash'] === $v['channel_hash']){
83
  $project_fill = array_merge($v, $project_data);
84
  $project_fill['project_hash'] = bin2hex(openssl_random_pseudo_bytes(16));
85
 
113
  if(!empty($val)){
114
  foreach ($val as $k=>$v){
115
  if(!is_array($v)){
116
+ if (($v === $project_hash) AND ($k === "project_hash")){
117
  $project_config = $val;
118
  $remove_key = $key;
119
  }
122
  }
123
  }
124
  }
125
+
126
  /**
127
  * Update project hash with new values
128
  */
151
  $external_path = $external_base . "/woo-product-feed-pro/" . $project_config['fileformat'];
152
  $project_config['external_file'] = $external_path . "/" . sanitize_file_name($project_config['filename']) . "." . $project_config['fileformat'];
153
 
154
+ if((array_key_exists('woosea_page', $project_data)) AND ($project_data['woosea_page'] == "analytics")){
 
 
155
  /**
156
  * Did the Google Analytics UTM code part got disabled?
157
  */
164
  if(!array_key_exists('adtribes_conversion', $project_data)) {
165
  unset($project_config['adtribes_conversion']);
166
  }
 
 
 
 
167
  }
168
 
169
  /**
176
  }
177
  }
178
 
179
+ /**
180
+ * Did the default product variations got disabled?
181
+ */
182
+ if(array_key_exists('fileformat', $project_data)){
183
+ if(!array_key_exists('default_variations', $project_data)) {
184
+ unset($project_config['default_variations']);
185
+ }
186
+ }
187
+
188
+ /**
189
+ * Did all the filters got removed
190
+ */
191
+ if((array_key_exists('woosea_page', $project_data)) AND ($project_data['woosea_page'] == "filters_rules")){
192
  if(!array_key_exists('rules', $project_data)) {
193
  unset($project_config['rules']);
194
  }
195
+ }
196
 
197
+ /**
198
+ * Did all the rules got removed
199
+ */
200
+ if((array_key_exists('woosea_page', $project_data)) AND ($project_data['woosea_page'] == "filters_rules")){
201
  if(!array_key_exists('rules2', $project_data)) {
202
  unset($project_config['rules2']);
203
  }
204
+ }
205
 
206
  /**
207
  * Update cron with new project settings
images/icon-16x16.png ADDED
Binary file
js/woosea_autocomplete.js CHANGED
@@ -5430,6 +5430,114 @@ jQuery(document).ready(function($) {
5430
  "5644 - Vehicles & Parts > Vehicles > Watercraft > Yachts",
5431
  ];
5432
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5433
  jQuery(".js-autosuggest").click(function(){
5434
  var className = $(this).attr("class").split(' ')[3];
5435
  var rowCount = className.split("_")[1]
@@ -5454,6 +5562,8 @@ jQuery(document).ready(function($) {
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
 
@@ -5473,8 +5583,6 @@ jQuery(document).ready(function($) {
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 = "";
@@ -5498,6 +5606,5 @@ jQuery(document).ready(function($) {
5498
  });
5499
  }
5500
  });
5501
-
5502
  });
5503
  });
5430
  "5644 - Vehicles & Parts > Vehicles > Watercraft > Yachts",
5431
  ];
5432
 
5433
+
5434
+ jQuery(".dashicons-arrow-down").click(function(){
5435
+ var className = $(this).attr("class").split(' ')[2];
5436
+ var rowCount = className.split("_")[2]
5437
+ var map_to_category = $(".autocomplete_" + rowCount).val();
5438
+ var project_hash = $("#project_hash").val();
5439
+ var minimum = 1;
5440
+ var len = map_to_category.length;
5441
+ var copied_criteria = $("#" + rowCount).val();
5442
+ var rows = $('#woosea-ajax-mapping-table tbody tr.catmapping').length;
5443
+ var $tr = $(this).closest('tr');
5444
+ var fromRow = $('#woosea-ajax-mapping-table tr').index($tr)-1;
5445
+ var toAjax = new Array();
5446
+
5447
+ var mainCriteria = $("#" + rowCount).val();
5448
+ var mainMapping = mainCriteria + "||" + rowCount + "||" + map_to_category;
5449
+ $('.autocomplete_' + rowCount).addClass("input-field-large-active");
5450
+ toAjax.push(mainMapping);
5451
+
5452
+ $('.mother_' + rowCount).each(function( index, obj ) {
5453
+
5454
+ var classes = $(this).attr("class");
5455
+ var classNameLoop = $(this).attr("class").split(' ')[3];
5456
+ var rowCountLoop = classNameLoop.split("_")[1]
5457
+ var criteria = $("#" + rowCountLoop).val();
5458
+
5459
+ var catMappings = criteria + "||" + rowCountLoop + "||" + map_to_category;
5460
+ toAjax.push(catMappings); // filling the array
5461
+
5462
+ $('.mother_' + rowCount).attr('value', map_to_category);
5463
+ $('.autocomplete_' + rowCountLoop).addClass("input-field-large-active");
5464
+ });
5465
+
5466
+
5467
+ jQuery.ajax({
5468
+ method: "POST",
5469
+ url: ajaxurl,
5470
+ data: { 'action': 'woosea_add_mass_cat_mapping', 'project_hash': project_hash, 'catMappings': toAjax }
5471
+ })
5472
+
5473
+ .done(function( data ) {
5474
+ data = JSON.parse( data );
5475
+ jQuery(data.className).removeClass("input-field-large");
5476
+ jQuery(data.className).addClass("input-field-large-active");
5477
+ })
5478
+
5479
+ .fail(function( data ) {
5480
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
5481
+ console.log('Category mapping failed!');
5482
+ });
5483
+ });
5484
+
5485
+
5486
+ jQuery(".dashicons-arrow-down-alt").click(function(){
5487
+ var className = $(this).attr("class").split(' ')[2];
5488
+ var rowCount = className.split("_")[2]
5489
+ var map_to_category = $(".autocomplete_" + rowCount).val();
5490
+ var project_hash = $("#project_hash").val();
5491
+ var minimum = 1;
5492
+ var len = map_to_category.length;
5493
+ var copied_criteria = $("#" + rowCount).val();
5494
+ var rows = $('#woosea-ajax-mapping-table tbody tr.catmapping').length;
5495
+ var $tr = $(this).closest('tr');
5496
+ var fromRow = $('#woosea-ajax-mapping-table tr').index($tr)-1;
5497
+
5498
+ if (len >= minimum){
5499
+ if ( !isNaN(parseInt(map_to_category)) ) {
5500
+
5501
+ var i = 0;
5502
+ var toAjax = new Array();
5503
+
5504
+ // Update the mappings
5505
+ $('.js-autosuggest').each(function( index, obj ) {
5506
+ i++;
5507
+ var classNameLoop = $(this).attr("class").split(' ')[3];
5508
+ var rowCountLoop = classNameLoop.split("_")[1]
5509
+ var criteria = $("#" + rowCountLoop).val();
5510
+
5511
+ // Only start copying when copied category mapping is found
5512
+ if(i > fromRow){
5513
+ var catMappings = criteria + "||" + rowCountLoop + "||" + map_to_category;
5514
+ toAjax.push(catMappings); // filling the array
5515
+ $('.autocomplete_' + rowCountLoop).attr('value', map_to_category);
5516
+ $('.autocomplete_' + rowCountLoop).addClass("input-field-large-active");
5517
+ }
5518
+ });
5519
+
5520
+ jQuery.ajax({
5521
+ method: "POST",
5522
+ url: ajaxurl,
5523
+ data: { 'action': 'woosea_add_mass_cat_mapping', 'project_hash': project_hash, 'catMappings': toAjax }
5524
+ })
5525
+
5526
+ .done(function( data ) {
5527
+ data = JSON.parse( data );
5528
+ jQuery(data.className).removeClass("input-field-large");
5529
+ jQuery(data.className).addClass("input-field-large-active");
5530
+ })
5531
+
5532
+ .fail(function( data ) {
5533
+ console.log('Failed AJAX Call :( /// Return Data: ' + data);
5534
+ console.log('Category mapping failed!');
5535
+ });
5536
+ }
5537
+ }
5538
+ });
5539
+
5540
+
5541
  jQuery(".js-autosuggest").click(function(){
5542
  var className = $(this).attr("class").split(' ')[3];
5543
  var rowCount = className.split("_")[1]
5562
  var criteria = $("#" + rowCount).val();
5563
  var map_to_category = jQuery(this).val();
5564
 
5565
+ jQuery(".autocomplete_" + rowCount).addClass("input-field-large-active");
5566
+
5567
  if (len >= minimum){
5568
  if ( !isNaN(parseInt(map_to_category)) ) {
5569
 
5583
  console.log('Failed AJAX Call :( /// Return Data: ' + data);
5584
  console.log('Category mapping failed!');
5585
  });
 
 
5586
  }
5587
  } else {
5588
  var map_to_category = "";
5606
  });
5607
  }
5608
  });
 
5609
  });
5610
  });
js/woosea_channel.js CHANGED
@@ -61,6 +61,12 @@ jQuery(document).ready(function($) {
61
  }
62
  });
63
 
 
 
 
 
 
 
64
  jQuery("#countries").on("change", function(){
65
  var country = this.value;
66
 
61
  }
62
  });
63
 
64
+ // The Aelia currency has changed, make sure to warn the user to also change the currency prefix and/or suffix
65
+ $('.aelia_switch').change(function(){
66
+ var popup_dialog = alert("You have changed the Aelia currency, this will change pricing in your product feed. Make sure the currency prefix and/or suffix on the field mapping page is correct.");
67
+ });
68
+
69
+
70
  jQuery("#countries").on("change", function(){
71
  var country = this.value;
72
 
js/woosea_field_mapping.js CHANGED
@@ -144,7 +144,8 @@ jQuery(document).ready(function($) {
144
 
145
  jQuery('.select-field').change(function(){
146
  if ($(this).val() == "static_value") {
147
- var rownr = $(this).closest("tr").prevAll("tr").length;
 
148
  $(this).replaceWith('<input type="text" name="attributes[' + rownr + '][mapfrom]" class="input-field-midsmall"><input type="hidden" name="attributes[' + rownr + '][static_value]" value="true">');
149
  }
150
  });
144
 
145
  jQuery('.select-field').change(function(){
146
  if ($(this).val() == "static_value") {
147
+ // var rownr = $(this).closest("tr").prevAll("tr").length;
148
+ var rownr = $(this).closest('tr').attr("class").split(' ')[1];
149
  $(this).replaceWith('<input type="text" name="attributes[' + rownr + '][mapfrom]" class="input-field-midsmall"><input type="hidden" name="attributes[' + rownr + '][static_value]" value="true">');
150
  }
151
  });
js/woosea_key.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=4.0.0',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
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=5.0.0',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
js/woosea_manage.js CHANGED
@@ -20,13 +20,15 @@ jQuery(document).ready(function($) {
20
  }
21
 
22
  $(".dismiss-review-notification").click(function(){
23
- $(".review-notification").remove();
24
 
25
  jQuery.ajax({
26
  method: "POST",
27
  url: ajaxurl,
28
  data: { 'action': 'woosea_review_notification' }
29
  })
 
 
 
30
  });
31
 
32
  $(".notice-dismiss").click(function(){
@@ -79,6 +81,8 @@ jQuery(document).ready(function($) {
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){
@@ -99,6 +103,26 @@ jQuery(document).ready(function($) {
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){
@@ -195,8 +219,48 @@ jQuery(document).ready(function($) {
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({
@@ -214,6 +278,27 @@ jQuery(document).ready(function($) {
214
  }
215
  })
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  $(".actions").delegate("span", "click", function() {
218
  var id=$(this).attr('id');
219
  var idsplit = id.split('_');
20
  }
21
 
22
  $(".dismiss-review-notification").click(function(){
 
23
 
24
  jQuery.ajax({
25
  method: "POST",
26
  url: ajaxurl,
27
  data: { 'action': 'woosea_review_notification' }
28
  })
29
+
30
+ $(".review-notification").remove();
31
+
32
  });
33
 
34
  $(".notice-dismiss").click(function(){
81
  }
82
  });
83
 
84
+
85
+
86
  // Check if user would like to enable WPML support
87
  $('#add_wpml_support').on('change', function(){ // on change of state
88
  if(this.checked){
103
  }
104
  })
105
 
106
+ // Check if user would like to enable Aelia Currency Switcher support
107
+ $('#add_aelia_support').on('change', function(){ // on change of state
108
+ if(this.checked){
109
+
110
+ // Checkbox is on
111
+ jQuery.ajax({
112
+ method: "POST",
113
+ url: ajaxurl,
114
+ data: { 'action': 'woosea_add_aelia', 'status': "on" }
115
+ })
116
+ } else {
117
+ // Checkbox is off
118
+ jQuery.ajax({
119
+ method: "POST",
120
+ url: ajaxurl,
121
+ data: { 'action': 'woosea_add_aelia', 'status': "off" }
122
+ })
123
+ }
124
+ })
125
+
126
  // Check if user would like to use mother image for variations
127
  $('#add_mother_image').on('change', function(){ // on change of state
128
  if(this.checked){
219
  }
220
  })
221
 
222
+
223
+ // When an Elite feature is clicked and the license is not valid show a pop-up
224
+ $('#json_option').on('click', function(){ // on change of state
225
+ var license_active = $(this).closest('tr').attr("class");
226
+ console.log(license_active);
227
+ if(license_active == "disabled"){
228
+ var popup_dialog = alert("We are sorry, The JSON LD WooCommerce bug fix is an Elite feature of this plugin. Please visit AdTribes.io to acquire a license and enable this option.");
229
+ }
230
+ })
231
+
232
+ $('#structured_vat_option').on('click', function(){ // on change of state
233
+ var license_active = $(this).closest('tr').attr("class");
234
+ console.log(license_active);
235
+ if(license_active == "disabled"){
236
+ var popup_dialog = alert("We are sorry, removing the VAT from the structured data prices is an Elite feature of this plugin. Please visit AdTribes.io to acquire a license and enable this option.");
237
+ }
238
+ })
239
+
240
+ $('#wpml_option').on('click', function(){ // on change of state
241
+ var license_active = $(this).closest('tr').attr("class");
242
+ if(license_active == "disabled"){
243
+ var popup_dialog = alert("We are sorry, this featue is locked. WPML support is an Elite feature of this plugin. Please visit AdTribes.io to acquire a license and enable this option.");
244
+ }
245
+ })
246
+
247
+ $('#aelia_option').on('click', function(){ // on change of state
248
+ var license_active = $(this).closest('tr').attr("class");
249
+ if(license_active == "disabled"){
250
+ var popup_dialog = alert("We are sorry, this feature is locked. The Aelia currency support is an Elite feature of this plugin. Please visit AdTribes.io to acquire a license and enable this option.");
251
+ }
252
+ })
253
+
254
+ $('#identifier_option').on('click', function(){ // on change of state
255
+ var license_active = $(this).closest('tr').attr("class");
256
+ if(license_active == "disabled"){
257
+ var popup_dialog = alert("We are sorry, adding the extra fields (such as brand, GTIN, MPN etc) is an Elite feature of this plugin. Please visit AdTribes.io to acquire a license and enable this option.");
258
+ }
259
+ })
260
+
261
  // Check if user would like to fix the WooCommerce structured data bug
262
  $('#fix_json_ld').on('change', function(){ // on change of state
263
+
264
  if(this.checked){
265
  // Checkbox is on
266
  jQuery.ajax({
278
  }
279
  })
280
 
281
+ // Check if user wants to display structured data prices excluding VAT
282
+ $('#no_structured_vat').on('change', function(){ // on change of state
283
+
284
+ if(this.checked){
285
+ // Checkbox is on
286
+ jQuery.ajax({
287
+ method: "POST",
288
+ url: ajaxurl,
289
+ data: { 'action': 'woosea_structured_vat', 'status': "on" }
290
+ })
291
+ } else {
292
+ // Checkbox is off
293
+ jQuery.ajax({
294
+ method: "POST",
295
+ url: ajaxurl,
296
+ data: { 'action': 'woosea_structured_vat', 'status': "off" }
297
+ })
298
+ }
299
+ })
300
+
301
+
302
  $(".actions").delegate("span", "click", function() {
303
  var id=$(this).attr('id');
304
  var idsplit = id.split('_');
js/woosea_rules.js CHANGED
@@ -3,8 +3,7 @@ jQuery(document).ready(function($) {
3
  // Add standard filters
4
  jQuery(".add-filter").click(function(){
5
  // Count amount of rows, used to create the form array field and values
6
- // var rowCount = $('#woosea-ajax-table >tbody >tr').length-1;
7
-
8
  var rowCount = Math.round(new Date().getTime() + (Math.random() * 100));
9
 
10
  jQuery.ajax({
@@ -14,7 +13,12 @@ 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]" 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(){
@@ -41,8 +45,8 @@ jQuery(document).ready(function($) {
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));
46
 
47
  jQuery.ajax({
48
  method: "POST",
@@ -51,7 +55,12 @@ jQuery(document).ready(function($) {
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(){
@@ -128,10 +137,11 @@ jQuery(document).ready(function($) {
128
 
129
  // Find and remove selected table rows
130
  jQuery(".delete-row").click(function(){
131
- $("table tbody").find('input[name="record"]').each(function(){
132
- if($(this).is(":checked")){
133
- $(this).parents("tr").remove();
134
- }
135
- });
 
136
  });
137
  });
3
  // Add standard filters
4
  jQuery(".add-filter").click(function(){
5
  // Count amount of rows, used to create the form array field and values
6
+ var TrueRowCount = $('#woosea-ajax-table >tbody >tr').length-1;
 
7
  var rowCount = Math.round(new Date().getTime() + (Math.random() * 100));
8
 
9
  jQuery.ajax({
13
  })
14
  .done(function( data ) {
15
  data = JSON.parse( data );
16
+
17
+ if(TrueRowCount == 0){
18
+ $( '#woosea-ajax-table' ).find('tbody:first').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>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>');
19
+ } else {
20
+ $('<tr><td><input type="hidden" name="rules[' + data.rowCount + '][rowCount]" value="' + data.rowCount + '"><input type="checkbox" name="record" class="checkbox-field"></td><td><i>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>').insertBefore( ".rules-buttons");
21
+ }
22
 
23
  // Check if user selected a data manipulation condition
24
  jQuery("#rules_" + rowCount).on("change", function(){
45
  jQuery(".add-rule").click(function(){
46
 
47
  // Count amount of rows, used to create the form array field and values
48
+ var TrueRowCount = $('#woosea-ajax-table >tbody >tr').length-1;
49
+ var rowCount = Math.round(new Date().getTime() + (Math.random() * 100));
50
 
51
  jQuery.ajax({
52
  method: "POST",
55
  })
56
  .done(function( data ) {
57
  data = JSON.parse( data );
58
+
59
+ if(TrueRowCount == 0){
60
+ $( '#woosea-ajax-table' ).find('tbody:first').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>');
61
+ } else {
62
+ $('<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>').insertBefore( ".rules-buttons");
63
+ }
64
 
65
  // Check if user selected a data manipulation condition
66
  jQuery("#condition_" + rowCount).on("change", function(){
137
 
138
  // Find and remove selected table rows
139
  jQuery(".delete-row").click(function(){
140
+ //$("table tbody").find('input[name="record"]').each(function(){
141
+ $(".woo-product-feed-pro-body").find('input[name="record"]').each(function(){
142
+ if($(this).is(":checked")){
143
+ $(this).parents("tr").remove();
144
+ }
145
+ });
146
  });
147
  });
js/woosea_validation.js CHANGED
@@ -22,7 +22,7 @@ jQuery(document).ready(function($) {
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){
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){
pages/admin/old-woosea-generate-feed-step-7.php CHANGED
@@ -61,12 +61,12 @@ if(isset($_POST['product_variations'])){
61
 
62
  $channels_with_item_id = array('google_shopping','facebook_drm');
63
 
64
- if (in_array($project['fields'],$channels_with_item_id)){
65
 
66
  $attributes["Detailed product description"]["Item group ID"]["format"] = "required";
67
  $attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
68
 
69
- if (in_array($project['fields'],$channels_with_item_id)){
70
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
71
  } else {
72
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "item_group_id";
61
 
62
  $channels_with_item_id = array('google_shopping','facebook_drm');
63
 
64
+ if (in_array($project['fields'],$channels_with_item_id,TRUE)){
65
 
66
  $attributes["Detailed product description"]["Item group ID"]["format"] = "required";
67
  $attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
68
 
69
+ if (in_array($project['fields'],$channels_with_item_id,TRUE)){
70
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
71
  } else {
72
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "item_group_id";
pages/admin/woosea-generate-feed-step-0.php CHANGED
@@ -1,4 +1,8 @@
1
  <?php
 
 
 
 
2
  /**
3
  * Change default footer text, asking to review our plugin
4
  **/
@@ -73,8 +77,26 @@ if (array_key_exists('project_hash', $_GET)){
73
 
74
  <div class="wrap">
75
  <div class="woo-product-feed-pro-form-style-2">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
@@ -99,6 +121,45 @@ if (array_key_exists('project_hash', $_GET)){
99
  </td>
100
  </tr>
101
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  if ( function_exists('icl_object_id') ) {
104
 
@@ -111,6 +172,17 @@ if (array_key_exists('project_hash', $_GET)){
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>";
@@ -127,6 +199,23 @@ if (array_key_exists('project_hash', $_GET)){
127
  print "</select>";
128
  print "</td>";
129
  print "</tr>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  } else {
131
  print "<tr>";
132
  print "<td><span>WPML Language:</span></td>";
@@ -142,6 +231,24 @@ if (array_key_exists('project_hash', $_GET)){
142
  print "</select>";
143
  print "</td>";
144
  print "</tr>";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  }
146
  }
147
  }
@@ -287,6 +394,21 @@ if (array_key_exists('project_hash', $_GET)){
287
  </label>
288
  </td>
289
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  <tr id="file">
291
  <td><span>File format:</span></td>
292
  <td>
@@ -362,68 +484,73 @@ if (array_key_exists('project_hash', $_GET)){
362
  </div>
363
  <div class="woo-product-feed-pro-table-right">
364
 
365
-
 
 
366
  <table class="woo-product-feed-pro-table">
367
- <tr>
368
- <td><strong>We’ve got you covered!</strong></td>
369
  </tr>
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>
404
  </tr>
405
  <tr>
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
-
425
-
426
-
427
  </form>
428
  </div>
429
  </div>
1
  <?php
2
+ $my_currency = get_woocommerce_currency();
3
+ $aelia_currencies = apply_filters('wc_aelia_cs_enabled_currencies', $my_currency);
4
+ $host = $_SERVER['HTTP_HOST'];
5
+
6
  /**
7
  * Change default footer text, asking to review our plugin
8
  **/
77
 
78
  <div class="wrap">
79
  <div class="woo-product-feed-pro-form-style-2">
80
+ <?php
81
+ if($license_information['license_valid'] <> "true"){
82
+ ?>
83
+ <div class="notice notice-info is-dismissible">
84
+ <p>
85
+ <strong>Would you like to get more out of your product feeds? Upgrade to the Elite version of the plugin and you will get:</strong><br/></br/>
86
+ <span class="dashicons dashicons-yes"></span>GTIN, Brand, MPN, EAN, Condition and more fields for your product feeds [<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=adding%20fields" target="_blank">read more</a>];<br/>
87
+ <span class="dashicons dashicons-yes"></span>Enhanched structured data on your product pages: more products approved in your Google Merchant Center [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank">read more</a>];<br/>
88
+ <span class="dashicons dashicons-yes"></span>WPML support - including their currency switcher [<a href="https://adtribes.io/wpml-support/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=wpml%20support" target="_blank">read more</a>];<br/>
89
+ <span class="dashicons dashicons-yes"></span>Aelia currency switcher support [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank">read more</a>];<br/>
90
+ <span class="dashicons dashicons-yes"></span>Priority support;<br/><br/>
91
+ Than upgrade to the <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_content=notification" target="_blank">Elite version of our plugin</a> to unlock these features.
92
+ </p>
93
+ </div>
94
+ <?php
95
+ }
96
+ ?>
97
 
98
+
99
+ <div class="woo-product-feed-pro-form-style-2-heading">General feed settings</div>
100
 
101
  <form action="" id="myForm" method="post" name="myForm">
102
 
121
  </td>
122
  </tr>
123
  <?php
124
+ $add_aelia_support = get_option ('add_aelia_support');
125
+ if($add_aelia_support == "yes"){
126
+ if ((is_array($aelia_currencies)) AND (count($aelia_currencies) > 0)){
127
+ if (isset($manage_project)){
128
+ print "<tr>";
129
+ print " <td><span>Aelia Currency:</span></td>";
130
+ print " <td>";
131
+ print " <select name=\"AELIA\" class=\"aelia_switch\">";
132
+ foreach ($aelia_currencies as $key => $value){
133
+ if($value == $project['AELIA']){
134
+ print "<option value=\"$value\" selected>$value</option>";
135
+ } else {
136
+ print "<option value=\"$value\">$value</option>";
137
+ }
138
+ }
139
+ print "</select>";
140
+ print "<input type=\"hidden\" name=\"base_currency\" value=\"$my_currency\">";
141
+ print "</td>";
142
+ print "</tr>";
143
+ } else {
144
+ print "<tr>";
145
+ print " <td><span>Aelia Currency:</span></td>";
146
+ print " <td>";
147
+ print " <select name=\"AELIA\">";
148
+ foreach ($aelia_currencies as $key => $value){
149
+ if($value == $my_currency){
150
+ print "<option value=\"$value\" selected>$value</option>";
151
+ } else {
152
+ print "<option value=\"$value\">$value</option>";
153
+ }
154
+ }
155
+ print "</select>";
156
+ print "<input type=\"hidden\" name=\"base_currency\" value=\"$my_currency\">";
157
+ print "</td>";
158
+ print "</tr>";
159
+ }
160
+ }
161
+ }
162
+
163
 
164
  if ( function_exists('icl_object_id') ) {
165
 
172
  $list_lang = $sitepress->get_active_languages();
173
  $nr_lang = count($list_lang);
174
 
175
+ $wcml_currencies = array();
176
+ // Check if WCML plugin is active
177
+ if ( function_exists('wcml_loader') ) {
178
+ $wcml_settings = get_option('_wcml_settings');
179
+ $currencies = $wcml_settings['currency_options'];
180
+
181
+ foreach ($currencies as $cur_key => $cur_val){
182
+ array_push($wcml_currencies, $cur_key);
183
+ }
184
+ }
185
+
186
  if($nr_lang > 0){
187
  if (isset($manage_project)){
188
  print "<tr>";
199
  print "</select>";
200
  print "</td>";
201
  print "</tr>";
202
+
203
+ if(count($wcml_currencies) > 0){
204
+ print "<tr>";
205
+ print "<td><span>WCML Currency:</span></td>";
206
+ print "<td>";
207
+ print "<select name=\"WPML\" disabled>";
208
+ foreach ($wcml_currencies as $key => $value){
209
+ if($value == $project['WCML']){
210
+ print "<option value=\"$value\" selected>$value</option>";
211
+ } else {
212
+ print "<option value=\"$value\">$value</option>";
213
+ }
214
+ }
215
+ print "</select>";
216
+ print "</td>";
217
+ print "</tr>";
218
+ }
219
  } else {
220
  print "<tr>";
221
  print "<td><span>WPML Language:</span></td>";
231
  print "</select>";
232
  print "</td>";
233
  print "</tr>";
234
+
235
+ if(count($wcml_currencies) > 0){
236
+ $my_currency = get_woocommerce_currency();
237
+ print "<tr>";
238
+ print "<td><span>WCML Currency:</span></td>";
239
+ print "<td>";
240
+ print "<select name=\"WCML\">";
241
+ foreach ($wcml_currencies as $key => $value){
242
+ if($value == $my_currency){
243
+ print "<option value=\"$value\" selected>$value</option>";
244
+ } else {
245
+ print "<option value=\"$value\">$value</option>";
246
+ }
247
+ }
248
+ print "</select>";
249
+ print "</td>";
250
+ print "</tr>";
251
+ }
252
  }
253
  }
254
  }
394
  </label>
395
  </td>
396
  </tr>
397
+ <tr id="default_variation">
398
+ <td><span>Only include default product variation:</span></td>
399
+ <td>
400
+ <label class="woo-product-feed-pro-switch">
401
+ <?php
402
+ if(isset($project['default_variations'])){
403
+ print "<input type=\"checkbox\" id=\"default_variations\" name=\"default_variations\" class=\"checkbox-field\" checked>";
404
+ } else {
405
+ print "<input type=\"checkbox\" id=\"default_variations\" name=\"default_variations\" class=\"checkbox-field\">";
406
+ }
407
+ ?>
408
+ <div class="woo-product-feed-pro-slider round"></div>
409
+ </label>
410
+ </td>
411
+ </tr>
412
  <tr id="file">
413
  <td><span>File format:</span></td>
414
  <td>
484
  </div>
485
  <div class="woo-product-feed-pro-table-right">
486
 
487
+ <?php
488
+ if($license_information['license_valid'] <> "true"){
489
+ ?>
490
  <table class="woo-product-feed-pro-table">
491
+ <tr>
492
+ <td><strong>Why upgrade to Elite?</strong></td>
493
  </tr>
494
  <tr>
495
  <td>
496
+ Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
497
  <ul>
498
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
499
+ <li><strong>2.</strong> More products approved by Google</li>
500
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
501
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
502
+ <li><strong>5.</strong> WPML support</li>
503
+ <li><strong>6.</strong> Aelia currency switcher support</li>
504
+ </ul>
505
+ <strong>
506
+ <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=page-0&utm_campaign=why-upgrade-box" target="_blank">Upgrade to Elite here!</a>
507
+ </strong>
508
  </td>
509
  </tr>
510
  </table><br/>
511
+ <?php
512
+ }
513
+ ?>
514
 
515
  <table class="woo-product-feed-pro-table">
516
+ <tr>
517
+ <td><strong>We’ve got you covered!</strong></td>
518
  </tr>
519
  <tr>
520
  <td>
521
+ Need assistance? Check out our:
522
  <ul>
523
+ <li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=page-0&utm_campaign=faq" target="_blank">Frequently Asked Questions</a></strong></li>
524
+ <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
525
+ <li><strong><a href="https://adtribes.io/blog/?utm_source=<?php print "$host";?>&utm_medium=page-0&utm_campaign=blog" target="_blank">Blog</a></strong></li>
 
 
 
526
  </ul>
527
+ 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.
528
  </td>
529
  </tr>
530
  </table><br/>
531
 
 
532
  <table class="woo-product-feed-pro-table">
533
  <tr>
534
+ <td><strong>Our latest blog articles</strong></td>
535
  </tr>
536
  <tr>
537
  <td>
 
538
  <ul>
539
+ <li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=first shopping feed" target="_blank">Create a Google Shopping feed</a></strong></li>
540
+ <li><strong>2. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=how to create filters" target="_blank">How to create filters for your product feed</a></strong></li>
541
+ <li><strong>3. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=how to create rules" target="_blank">How to set rules for your product feed</a></strong></li>
542
+ <li><strong>4. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=adding fields" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
543
+ <li><strong>5. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=structured data bug" target="_blank">WooCommerce structured data markup bug</a></strong></li>
544
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=wpml support" target="_blank">Enable WPML support</a></strong></li>
545
+
546
+ <li><strong>7. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=page0&utm_campaign=aelia support" target="_blank">Enable Aelia currency switcher support</a></strong></li>
547
+
548
+ </ul>
549
+ </td>
550
  </tr>
551
  </table><br/>
 
552
  </div>
553
  </div>
 
 
 
554
  </form>
555
  </div>
556
  </div>
pages/admin/woosea-generate-feed-step-1.php CHANGED
@@ -6,6 +6,9 @@ function my_footer_text($default) {
6
  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!';
7
  }
8
  add_filter('admin_footer_text', 'my_footer_text');
 
 
 
9
 
10
  /**
11
  * Create notification object
@@ -53,9 +56,12 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
53
  );
54
 
55
  $next = get_terms('product_cat', $args);
 
 
56
 
57
  if ($next) {
58
  foreach ($next as $sub_category) {
 
59
  $x = $sub_category->term_id;
60
  $woo_category = $sub_category->name;
61
  $woo_category_id = $sub_category->term_id;
@@ -68,15 +74,36 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
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
  }
82
  $r .= $sub_category->term_id !== 0 ? woosea_hierarchical_term_tree($sub_category->term_id, $prev_mapped) : null;
@@ -102,6 +129,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
102
  <tr>
103
  <th>Your category <i>(Number of products)</i></th>
104
  <th><?php print "$channel_data[name]";?> category</th>
 
105
  </tr>
106
  </thead>
107
 
@@ -125,7 +153,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
125
  <form action="" method="post">
126
 
127
  <tr>
128
- <td colspan="2">
129
  <input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
130
  <?php
131
  if(isset($manage_project)){
@@ -152,60 +180,71 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
152
  </div>
153
 
154
  <div class="woo-product-feed-pro-table-right">
155
-
156
- <table class="woo-product-feed-pro-table">
 
 
157
  <tr>
158
- <td><strong>We’ve got you covered!</strong></td>
159
  </tr>
160
  <tr>
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>
194
  </tr>
195
  <tr>
196
  <td>
197
- Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
198
  <ul>
199
- <li><strong>1.</strong> More products approved by Google </li>
200
- <li><strong>2.</strong> Add GTIN, brand and more fields to your store</li>
201
- <li><strong>3.</strong> Exclude individual products from your product feeds</li>
202
- <li><strong>4.</strong> Priority support</li>
 
 
 
 
 
203
  </ul>
204
- <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>
205
  </td>
206
  </tr>
207
  </table><br/>
208
- -->
209
  </div>
210
  </div>
211
  </div>
6
  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!';
7
  }
8
  add_filter('admin_footer_text', 'my_footer_text');
9
+ delete_option( 'woosea_cat_mapping' );
10
+ $license_information = get_option( 'license_information' );
11
+ $host = $_SERVER['HTTP_HOST'];
12
 
13
  /**
14
  * Create notification object
56
  );
57
 
58
  $next = get_terms('product_cat', $args);
59
+ $nr_categories = count($next);
60
+ $yo = 0;
61
 
62
  if ($next) {
63
  foreach ($next as $sub_category) {
64
+ $yo++;
65
  $x = $sub_category->term_id;
66
  $woo_category = $sub_category->name;
67
  $woo_category_id = $sub_category->term_id;
74
  $mapped_active_class = "input-field-large-active";
75
  }
76
 
77
+ // These are main categories
78
  if($sub_category->parent == 0){
79
+
80
+ $args = array(
81
+ 'parent' => $sub_category->term_id,
82
+ 'hide_empty' => false,
83
+ 'no_found_rows' => true,
84
+ );
85
+
86
+ $subcat = get_terms('product_cat', $args);
87
+ $nr_subcats = count($subcat);
88
+
89
+ $r .= "<tr class=\"catmapping\">";
90
  $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>";
91
  $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>";
92
+ if(($yo == $nr_categories) AND ($nr_subcats == 0)){
93
+ $r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
94
+ } else {
95
+ if($nr_subcats > 0){
96
+ $r .= "<td><span class=\"dashicons dashicons-arrow-down copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to subcategories\"></span><span class=\"dashicons dashicons-arrow-down-alt copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
97
+ } else {
98
+ $r .= "<td><span class=\"dashicons dashicons-arrow-down-alt copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
99
+ }
100
+ }
101
  $r .= "</tr>";
102
  } else {
103
+ $r .= "<tr class=\"catmapping\">";
104
  $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>";
105
+ $r .= "<td><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x mother_$sub_category->parent\" value=\"$mapped_category\"></td>";
106
+ $r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
107
  $r .= "</tr>";
108
  }
109
  $r .= $sub_category->term_id !== 0 ? woosea_hierarchical_term_tree($sub_category->term_id, $prev_mapped) : null;
129
  <tr>
130
  <th>Your category <i>(Number of products)</i></th>
131
  <th><?php print "$channel_data[name]";?> category</th>
132
+ <th></th>
133
  </tr>
134
  </thead>
135
 
153
  <form action="" method="post">
154
 
155
  <tr>
156
+ <td colspan="3">
157
  <input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
158
  <?php
159
  if(isset($manage_project)){
180
  </div>
181
 
182
  <div class="woo-product-feed-pro-table-right">
183
+ <?php
184
+ if($license_information['license_valid'] <> "true"){
185
+ ?>
186
+ <table class="woo-product-feed-pro-table">
187
  <tr>
188
+ <td><strong>Why upgrade to Elite?</strong></td>
189
  </tr>
190
  <tr>
191
  <td>
192
+ Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
193
  <ul>
194
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
195
+ <li><strong>2.</strong> More products approved by Google</li>
196
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
197
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
198
+ <li><strong>5.</strong> WPML support</li>
199
+ <li><strong>6.</strong> Aelia currency switcher support</li>
200
+ </ul>
201
+ <strong>
202
+ <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=page1&utm_campaign=why-upgrade-box" target="_blank">Upgrade to Elite here!</a>
203
+ </strong>
204
  </td>
205
  </tr>
206
  </table><br/>
207
+ <?php
208
+ }
209
+ ?>
210
 
211
  <table class="woo-product-feed-pro-table">
212
  <tr>
213
+ <td><strong>We’ve got you covered!</strong></td>
214
  </tr>
215
  <tr>
216
  <td>
217
+ Need assistance? Check out our:
218
  <ul>
219
+ <li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=page1&utm_campaign=faq" target="_blank">Frequently Asked Questions</a></strong></li>
220
+ <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
221
+ <li><strong><a href="https://adtribes.io/blog/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=blog" target="_blank">Blog</a></strong></li>
 
 
 
222
  </ul>
223
+ 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.
224
  </td>
225
  </tr>
226
+ </table><br/>
227
 
 
228
  <table class="woo-product-feed-pro-table">
229
  <tr>
230
+ <td><strong>Our latest blog articles</strong></td>
231
  </tr>
232
  <tr>
233
  <td>
 
234
  <ul>
235
+ <li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=first shopping feed" target="_blank">Create a Google Shopping feed</a></strong></li>
236
+ <li><strong>2. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=how to create filters" target="_blank">How to create filters for your product feed</a></strong></li>
237
+ <li><strong>3. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=how to create rules" target="_blank">How to set rules for your product feed</a></strong></li>
238
+ <li><strong>4. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=adding fields" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
239
+ <li><strong>5. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=structured data bug" target="_blank">WooCommerce structured data markup bug</a></strong></li>
240
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=wpml support" target="_blank">Enable WPML support</a></strong></li>
241
+
242
+ <li><strong>7. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=page1&utm_campaign=aelia support" target="_blank">Enable Aelia currency switcher support</a></strong></li>
243
+
244
  </ul>
 
245
  </td>
246
  </tr>
247
  </table><br/>
 
248
  </div>
249
  </div>
250
  </div>
pages/admin/woosea-generate-feed-step-4.php CHANGED
@@ -49,9 +49,8 @@ if (array_key_exists('project_hash', $_GET)){
49
  <div class="<?php _e($notifications_box['message_type']); ?>">
50
  <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
51
  </div>
 
52
 
53
- <form action="" method="post">
54
- <input type="hidden" name="page" value="filters">
55
  <table class="woo-product-feed-pro-table" id="woosea-ajax-table" border="1">
56
  <thead>
57
  <tr>
@@ -65,9 +64,10 @@ if (array_key_exists('project_hash', $_GET)){
65
  <th>IS</th>
66
  </tr>
67
  </thead>
68
-
69
- <tbody class="woo-product-feed-pro-body">
70
- <?php
 
71
  if(isset($project['rules'])){
72
  foreach ($project['rules'] as $rule_key => $rule_array){
73
 
@@ -193,8 +193,11 @@ if (array_key_exists('project_hash', $_GET)){
193
  }
194
 
195
  // RULES SECTION
 
196
  if (isset($project['rules2'])){
 
197
  foreach($project['rules2'] as $rule2_key => $rule2_array){
 
198
  if(isset($project['rules2'][$rule2_key]['criteria'])){
199
  $criteria = $project['rules2'][$rule2_key]['criteria'];
200
  } else {
@@ -311,7 +314,7 @@ if (array_key_exists('project_hash', $_GET)){
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
  ?>
@@ -346,9 +349,11 @@ if (array_key_exists('project_hash', $_GET)){
346
  <?php
347
  }
348
  }
349
- ?>
350
- </tbody>
351
- <tr>
 
 
352
  <td colspan="8">
353
 
354
  <input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
@@ -356,19 +361,21 @@ if (array_key_exists('project_hash', $_GET)){
356
  if(isset($manage_project)){
357
  ?>
358
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
 
359
  <input type="hidden" name="step" value="100">
360
- <input type="button" class="delete-row" value="- Delete">&nbsp;<input type="button" class="add-filter" value="+ Add standard filter">&nbsp;<input type="button" class="add-rule" value="+ Add rule">&nbsp;<input type="submit" value="Save" />
361
  <?php
362
  } else {
363
  ?>
364
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
365
  <input type="hidden" name="step" value="5">
366
- <input type="button" class="delete-row" value="- Delete">&nbsp;<input type="button" class="add-filter" value="+ Add standard filter">&nbsp;<input type="button" class="add-rule" value="+ Add rule">&nbsp;<input type="submit" value="Save / Continue" />
367
  <?php
368
  }
369
  ?>
370
  </td>
371
  </tr>
 
372
  </table>
373
  </form>
374
  </div>
49
  <div class="<?php _e($notifications_box['message_type']); ?>">
50
  <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
51
  </div>
52
+ <form id="rulesandfilters" method="post">
53
 
 
 
54
  <table class="woo-product-feed-pro-table" id="woosea-ajax-table" border="1">
55
  <thead>
56
  <tr>
64
  <th>IS</th>
65
  </tr>
66
  </thead>
67
+
68
+ <?php
69
+ //if(isset($project['rules'])){
70
+ print "<tbody class=\"woo-product-feed-pro-body\">";
71
  if(isset($project['rules'])){
72
  foreach ($project['rules'] as $rule_key => $rule_array){
73
 
193
  }
194
 
195
  // RULES SECTION
196
+
197
  if (isset($project['rules2'])){
198
+
199
  foreach($project['rules2'] as $rule2_key => $rule2_array){
200
+
201
  if(isset($project['rules2'][$rule2_key]['criteria'])){
202
  $criteria = $project['rules2'][$rule2_key]['criteria'];
203
  } else {
314
  </td>
315
  <?php
316
  $manipulators = array('multiply','divide','plus','minus');
317
+ if (in_array($project['rules2'][$rule2_key]['condition'], $manipulators,TRUE)){
318
  print "<td colspan=3></td>";
319
  } else {
320
  ?>
349
  <?php
350
  }
351
  }
352
+ print "</tbody>";
353
+ //}
354
+ ?>
355
+ <tbody>
356
+ <tr class="rules-buttons">
357
  <td colspan="8">
358
 
359
  <input type="hidden" id="channel_hash" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
361
  if(isset($manage_project)){
362
  ?>
363
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
364
+ <input type="hidden" name="woosea_page" value="filters_rules">
365
  <input type="hidden" name="step" value="100">
366
+ <input type="button" class="delete-row" value="- Delete">&nbsp;<input type="button" class="add-filter" value="+ Add filter">&nbsp;<input type="button" class="add-rule" value="+ Add rule">&nbsp;<input type="submit" id="savebutton" value="Save">
367
  <?php
368
  } else {
369
  ?>
370
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
371
  <input type="hidden" name="step" value="5">
372
+ <input type="button" class="delete-row" value="- Delete">&nbsp;<input type="button" class="add-filter" value="+ Add filter">&nbsp;<input type="button" class="add-rule" value="+ Add rule">&nbsp;<input type="submit" id="savebutton" value="Continue">
373
  <?php
374
  }
375
  ?>
376
  </td>
377
  </tr>
378
+ </tbody>
379
  </table>
380
  </form>
381
  </div>
pages/admin/woosea-generate-feed-step-5.php CHANGED
@@ -43,16 +43,16 @@ if (array_key_exists('project_hash', $_GET)){
43
  ?>
44
  <div class="wrap">
45
  <div class="woo-product-feed-pro-form-style-2">
46
- <table class="woo-product-feed-pro-table">
47
  <tbody class="woo-product-feed-pro-body">
48
- <div class="woo-product-feed-pro-form-style-2-heading">Conversion tracking & Google Analytics settings</div>
49
 
50
- <div class="<?php _e($notifications_box['message_type']); ?>">
51
- <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
52
- </div>
53
 
54
- <form action="" method="post">
55
- <input type="hidden" name="page" value="analytics">
 
56
  <tr>
57
  <td><span>Enable conversion tracking: </span></td>
58
  <td>
@@ -109,25 +109,27 @@ if (array_key_exists('project_hash', $_GET)){
109
  if(isset($manage_project)){
110
  ?>
111
  <input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
112
- <input type="hidden" name="project_update" id="project_update" value="yes" />
113
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
114
  <input type="hidden" name="step" value="100">
115
- <input type="submit" value="Save"/>
 
116
  <?php
117
  } else {
118
  ?>
119
  <input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
120
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
121
  <input type="hidden" name="step" value="101">
122
- <input type="submit" value="Generate Product Feed"/>
 
123
  <?php
124
  }
125
  ?>
126
  </td>
127
  </tr>
128
- </form>
 
129
  </tbody>
130
- </table>
131
  </div>
132
  </div>
133
 
43
  ?>
44
  <div class="wrap">
45
  <div class="woo-product-feed-pro-form-style-2">
 
46
  <tbody class="woo-product-feed-pro-body">
47
+ <div class="woo-product-feed-pro-form-style-2-heading">Conversion tracking & Google Analytics settings</div>
48
 
49
+ <div class="<?php _e($notifications_box['message_type']); ?>">
50
+ <p><?php _e($notifications_box['message'], 'sample-text-domain' ); ?></p>
51
+ </div>
52
 
53
+ <form id="googleanalytics" method="post">
54
+
55
+ <table class="woo-product-feed-pro-table">
56
  <tr>
57
  <td><span>Enable conversion tracking: </span></td>
58
  <td>
109
  if(isset($manage_project)){
110
  ?>
111
  <input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
112
+ <input type="hidden" name="project_update" id="project_update" value="yes">
113
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
114
  <input type="hidden" name="step" value="100">
115
+ <input type="hidden" name="woosea_page" value="analytics">
116
+ <input type="submit" id="savebutton" value="Save">
117
  <?php
118
  } else {
119
  ?>
120
  <input type="hidden" name="channel_hash" value="<?php print "$project[channel_hash]";?>">
121
  <input type="hidden" name="project_hash" value="<?php print "$project[project_hash]";?>">
122
  <input type="hidden" name="step" value="101">
123
+ <input type="hidden" name="woosea_page" value="analytics">
124
+ <input type="submit" id="savebutton" value="Generate Product Feed">
125
  <?php
126
  }
127
  ?>
128
  </td>
129
  </tr>
130
+ </table>
131
+ </form>
132
  </tbody>
 
133
  </div>
134
  </div>
135
 
pages/admin/woosea-generate-feed-step-7.php CHANGED
@@ -63,6 +63,13 @@ if($channel_data['taxonomy'] != "none"){
63
  * Get main currency
64
  **/
65
  $currency = get_woocommerce_currency();
 
 
 
 
 
 
 
66
 
67
  /**
68
  * Create channel attribute object
@@ -79,12 +86,12 @@ if(isset($_POST['product_variations'])){
79
 
80
  $channels_with_item_id = array('google_shopping','facebook_drm');
81
 
82
- if (in_array($project['fields'],$channels_with_item_id)){
83
 
84
  $attributes["Detailed product description"]["Item group ID"]["format"] = "required";
85
  $attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
86
 
87
- if (in_array($project['fields'],$channels_with_item_id)){
88
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
89
  } else {
90
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "item_group_id";
@@ -131,7 +138,7 @@ if(isset($_POST['product_variations'])){
131
  foreach($row_value as $row_k => $row_v){
132
  if ($row_v['format'] == "required"){
133
  ?>
134
- <tr class="rowCount">
135
  <td><input type="hidden" name="attributes[<?php print "$c";?>][rowCount]" value="<?php print "$c";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
136
  <td>
137
  <select name="attributes[<?php print"$c"; ?>][attribute]" class="select-field">
@@ -204,7 +211,7 @@ if(isset($_POST['product_variations'])){
204
  $suffix = $project['attributes'][$attribute_key]['suffix'];
205
  }
206
  ?>
207
- <tr class="rowCount">
208
  <td><input type="hidden" name="attributes[<?php print "$attribute_key";?>][rowCount]" value="<?php print "$attribute_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
209
  <td>
210
  <select name="attributes[<?php print"$attribute_key"; ?>][attribute]" class="select-field">
63
  * Get main currency
64
  **/
65
  $currency = get_woocommerce_currency();
66
+ if(isset($project['WCML'])){
67
+ $currency = $project['WCML'];
68
+ }
69
+
70
+ if(isset($project['AELIA'])){
71
+ $currency = $project['AELIA'];
72
+ }
73
 
74
  /**
75
  * Create channel attribute object
86
 
87
  $channels_with_item_id = array('google_shopping','facebook_drm');
88
 
89
+ if (in_array($project['fields'],$channels_with_item_id,TRUE)){
90
 
91
  $attributes["Detailed product description"]["Item group ID"]["format"] = "required";
92
  $attributes["Detailed product description"]["Item group ID"]["woo_suggest"] = "item_group_id";
93
 
94
+ if (in_array($project['fields'],$channels_with_item_id,TRUE)){
95
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "g:item_group_id";
96
  } else {
97
  $attributes["Detailed product description"]["Item group ID"]["feed_name"] = "item_group_id";
138
  foreach($row_value as $row_k => $row_v){
139
  if ($row_v['format'] == "required"){
140
  ?>
141
+ <tr class="rowCount <?php print"$c";?>">
142
  <td><input type="hidden" name="attributes[<?php print "$c";?>][rowCount]" value="<?php print "$c";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
143
  <td>
144
  <select name="attributes[<?php print"$c"; ?>][attribute]" class="select-field">
211
  $suffix = $project['attributes'][$attribute_key]['suffix'];
212
  }
213
  ?>
214
+ <tr class="rowCount <?php print "$attribute_key";?>">
215
  <td><input type="hidden" name="attributes[<?php print "$attribute_key";?>][rowCount]" value="<?php print "$attribute_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
216
  <td>
217
  <select name="attributes[<?php print"$attribute_key"; ?>][attribute]" class="select-field">
pages/admin/woosea-manage-feed.php CHANGED
@@ -6,6 +6,7 @@ $count_single = wp_count_posts('product');
6
  $published_single = $count_single->publish;
7
  $published_variation = $count_variation->publish;
8
  $published_products = $published_single+$published_variation;
 
9
 
10
  $product_numbers = array (
11
  "Single products" => $published_single,
@@ -87,6 +88,22 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
87
  </div><br/>
88
  <?php
89
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
  ?>
92
 
@@ -144,25 +161,26 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
144
  ?>
145
  <td>
146
  <div class="actions">
147
- <span class="gear ui-icon ui-icon-gear" id="gear_<?php print "$val[project_hash]";?>" title="project settings" style="display: inline-block;"></span>
148
  <?php
149
  if ($val['running'] != "processing"){
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>";
164
  }
165
- ?>
166
  </div>
167
  </td>
168
  </tr>
@@ -177,20 +195,20 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
177
  <tr>
178
  <td>
179
  <strong>Change settings</strong><br/>
180
- <span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=0&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">General settings</a><br/>
181
  <?php
182
  if ($val['fields'] == "standard"){
183
- print "<span class=\"u-icon ui-icon-caret-1-e\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=2&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Attribute selection</a></br/>";
184
  } else {
185
- print "<span class=\"ui-icon ui-icon-caret-1-e\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=7&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Attribute mapping</a><br/>";
186
  }
187
 
188
  if ($val['taxonomy'] != "none"){
189
- print "<span class=\"ui-icon ui-icon-caret-1-e\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=1&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Category mapping</a><br/>";
190
  }
191
  ?>
192
- <span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=4&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">Feed filters and rules</a><br/>
193
- <span class="ui-icon ui-icon-caret-1-e" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=5&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">Conversion tracking and Google Analytics settings</a><br/>
194
  </td>
195
  </tr>
196
  <?php
@@ -201,9 +219,9 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
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>
@@ -221,7 +239,7 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
221
  } else {
222
  ?>
223
  <tr>
224
- <td colspan="6"><br/><span class="ui-icon ui-icon-alert"></span> You didn't configured a product feed yet, <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php">please create one first</a>.<br/><br/></td>
225
  </tr>
226
  <?php
227
  }
@@ -229,57 +247,50 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
229
  </table>
230
  </div>
231
  <div class="woo-product-feed-pro-table-right">
232
- <!--
233
- <table class="woo-product-feed-pro-table">
234
- <tr>
235
- <td><strong>Tutorials</strong></td>
236
- </tr>
237
- <tr>
238
- <td><br/><br/><br/><br/></td>
239
- </tr>
240
- </table><br/>
241
- -->
242
-
243
-
244
  <table class="woo-product-feed-pro-table">
245
  <tr>
246
- <td><strong>We’ve got you covered!</strong></td>
247
  </tr>
248
  <tr>
249
  <td>
250
- Need assistance? Check out our:
251
  <ul>
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>
265
  </tr>
266
  <tr>
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,18 +299,20 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
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>
300
  </table><br/>
301
 
302
-
303
  <table class="woo-product-feed-pro-table">
304
  <tr>
305
  <td><strong>WooCommerce product numbers</strong></td>
6
  $published_single = $count_single->publish;
7
  $published_variation = $count_variation->publish;
8
  $published_products = $published_single+$published_variation;
9
+ $host = $_SERVER['HTTP_HOST'];
10
 
11
  $product_numbers = array (
12
  "Single products" => $published_single,
88
  </div><br/>
89
  <?php
90
  }
91
+ } else {
92
+ if($license_information['license_valid'] <> "true"){
93
+ ?>
94
+ <div class="notice notice-info is-dismissible">
95
+ <p>
96
+ <strong>Would you like to get more out of your product feeds? Upgrade to the Elite version of the plugin and you will get:</strong><br/></br/>
97
+ <span class="dashicons dashicons-yes"></span>GTIN, Brand, MPN, EAN, Condition and more fields for your product feeds [<a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=adding%20fields" target="_blank">read more</a>];<br/>
98
+ <span class="dashicons dashicons-yes"></span>Enhanched structured data on your product pages: more products approved in your Google Merchant Center [<a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=structured%20data%20bug" target="_blank">read more</a>];<br/>
99
+ <span class="dashicons dashicons-yes"></span>WPML support - including their currency switcher [<a href="https://adtribes.io/wpml-support/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=wpml%20support" target="_blank">read more</a>];<br/>
100
+ <span class="dashicons dashicons-yes"></span>Aelia currency switcher support [<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=oplader.org&utm_medium=manage-feed&utm_campaign=aelia%20support" target="_blank">read more</a>];<br/>
101
+ <span class="dashicons dashicons-yes"></span>Priority support;<br/><br/>
102
+ Than upgrade to the <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_content=notification" target="_blank">Elite version of our plugin</a> to unlock these features.
103
+ </p>
104
+ </div>
105
+ <?php
106
+ }
107
  }
108
  ?>
109
 
161
  ?>
162
  <td>
163
  <div class="actions">
164
+ <span class="gear dashicons dashicons-admin-generic" id="gear_<?php print "$val[project_hash]";?>" title="project settings" style="display: inline-block;"></span>
165
  <?php
166
  if ($val['running'] != "processing"){
167
  ?>
168
  <?php
169
  if ($val['active'] == "true"){
170
+ print "<span class=\"dashicons dashicons-admin-page\" id=\"copy_$val[project_hash]\" title=\"copy project\" style=\"display: inline-block;\"></span>";
171
+ print "<span class=\"dashicons dashicons-update\" id=\"refresh_$val[project_hash]\" title=\"manually refresh productfeed\" style=\"display: inline-block;\"></span>";
172
 
173
  if($val['running'] != "not run yet"){
174
+ print "<a href=\"$val[external_file]\" target=\"_blank\" class=\"dashicons dashicons-download\" id=\"download\" title=\"download productfeed\" style=\"display: inline-block\"></a>";
175
  }
176
  }?>
177
+ <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=8&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>" class="trash dashicons dashicons-chart-line" id="chart_<?php print "$val[project_hash]";?>" title="amount of products in feed productfeed" style="display: inline-block;" target="_blank"></a>
178
+ <span class="trash dashicons dashicons-trash" id="trash_<?php print "$val[project_hash]";?>" title="delete project and productfeed" style="display: inline-block;"></span>
179
  <?php
180
  } else {
181
+ print "<span class=\"dashicons dashicons-dismiss\" id=\"cancel_$val[project_hash]\" title=\"cancel processing productfeed\" style=\"display: inline-block;\"></span>";
182
  }
183
+ ?>
184
  </div>
185
  </td>
186
  </tr>
195
  <tr>
196
  <td>
197
  <strong>Change settings</strong><br/>
198
+ <span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=0&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">General feed settings</a><br/>
199
  <?php
200
  if ($val['fields'] == "standard"){
201
+ print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=2&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Attribute selection</a></br/>";
202
  } else {
203
+ print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=7&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Field mapping</a><br/>";
204
  }
205
 
206
  if ($val['taxonomy'] != "none"){
207
+ print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> <a href=\"admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=1&project_hash=$val[project_hash]&channel_hash=$val[channel_hash]\">Category mapping</a><br/>";
208
  }
209
  ?>
210
+ <span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=4&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">Feed filters and rules</a><br/>
211
+ <span class="dashicons dashicons-arrow-right" style="display: inline-block;"></span> <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php&action=edit_project&step=5&project_hash=<?php print "$val[project_hash]";?>&channel_hash=<?php print "$val[channel_hash]";?>">Conversion tracking and Google Analytics settings</a><br/>
212
  </td>
213
  </tr>
214
  <?php
219
  <strong>Feed URL</strong><br/>
220
  <?php
221
  if (($val['active'] == "true") AND ($val['running'] != "not run yet")){
222
+ print "<span class=\"dashicons dashicons-arrow-right\" style=\"display: inline-block;\"></span> $val[external_file]";
223
  } else {
224
+ print "<span class=\"dashicons dashicons-warning\"></span> Whoops, there is no active product feed for this project as the project has been disabled or did not run yet.";
225
  }
226
  ?>
227
  </td>
239
  } else {
240
  ?>
241
  <tr>
242
+ <td colspan="6"><br/><span class="dashicons dashicons-warning"></span> You didn't configured a product feed yet, <a href="admin.php?page=woo-product-feed-pro%2Fwoocommerce-sea.php">please create one first</a> or read our tutorial on <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=first shopping feed" target="_blank">how to set up your very first Google Shopping product feed</a>.<br/><br/></td>
243
  </tr>
244
  <?php
245
  }
247
  </table>
248
  </div>
249
  <div class="woo-product-feed-pro-table-right">
250
+ <?php
251
+ if($license_information['license_valid'] <> "true"){
252
+ ?>
 
 
 
 
 
 
 
 
 
253
  <table class="woo-product-feed-pro-table">
254
  <tr>
255
+ <td><strong>Why upgrade to Elite?</strong></td>
256
  </tr>
257
  <tr>
258
  <td>
259
+ Enjoy all priviliges of our Elite features and priority support and upgrade to the Elite version of our plugin now!
260
  <ul>
261
+ <li><strong>1.</strong> Priority support: get your feeds live faster</li>
262
+ <li><strong>2.</strong> More products approved by Google</li>
263
+ <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
264
+ <li><strong>4.</strong> Exclude individual products from your feeds</li>
265
+ <li><strong>5.</strong> WPML support</li>
266
+ <li><strong>6.</strong> Aelia currency switcher support</li>
267
+ </ul>
268
+ <strong>
269
+ <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=why-upgrade-box" target="_blank">Upgrade to Elite here!</a>
270
+ </strong>
271
  </td>
272
  </tr>
273
  </table><br/>
274
+ <?php
275
+ }
276
+ ?>
277
 
 
278
  <table class="woo-product-feed-pro-table">
279
  <tr>
280
+ <td><strong>We’ve got you covered!</strong></td>
281
  </tr>
282
  <tr>
283
  <td>
284
+ Need assistance? Check out our:
285
  <ul>
286
+ <li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=faq" target="_blank">Frequently Asked Questions</a></strong></li>
287
+ <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
288
+ <li><strong><a href="https://adtribes.io/blog/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=blog" target="_blank">Blog</a></strong></li>
289
+ </ul>
290
+ 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.
291
+ </td>
 
 
 
 
292
  </tr>
293
  </table><br/>
 
294
 
295
  <table class="woo-product-feed-pro-table">
296
  <tr>
299
  <tr>
300
  <td>
301
  <ul>
302
+ <li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=first shopping feed" target="_blank">Create a Google Shopping feed</a></strong></li>
303
+ <li><strong>2. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=how to create filters" target="_blank">How to create filters for your product feed</a></strong></li>
304
+ <li><strong>3. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=how to create rules" target="_blank">How to set rules for your product feed</a></strong></li>
305
+ <li><strong>4. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=adding fields" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
306
+ <li><strong>5. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=structured data bug" target="_blank">WooCommerce structured data markup bug</a></strong></li>
307
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=wpml support" target="_blank">Enable WPML support</a></strong></li>
308
+
309
+ <li><strong>7. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-feed&utm_campaign=aelia support" target="_blank">Enable Aelia currency switcher support</a></strong></li>
310
+
311
  </ul>
312
  </td>
313
  </tr>
314
  </table><br/>
315
 
 
316
  <table class="woo-product-feed-pro-table">
317
  <tr>
318
  <td><strong>WooCommerce product numbers</strong></td>
pages/admin/woosea-manage-settings.php CHANGED
@@ -2,7 +2,19 @@
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(),
@@ -76,15 +88,17 @@ if(isset($_GET["tab"])) {
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
  ?>
@@ -112,22 +126,22 @@ if(isset($_GET["tab"])) {
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>
@@ -135,36 +149,56 @@ if(isset($_GET["tab"])) {
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>
@@ -172,6 +206,24 @@ if(isset($_GET["tab"])) {
172
  </td>
173
  </tr>
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  <tr>
176
  <td>
177
  <span>Use mother main image for variations</span>
@@ -243,10 +295,17 @@ if(isset($_GET["tab"])) {
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
 
@@ -309,7 +368,7 @@ GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
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
  }
@@ -321,8 +380,10 @@ GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
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 = "";
@@ -347,26 +408,10 @@ GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
347
  </div>
348
 
349
  <div class="woo-product-feed-pro-table-right">
350
-
351
-
352
- <table class="woo-product-feed-pro-table">
353
- <tr>
354
- <td><strong>We’ve got you covered!</strong></td>
355
- </tr>
356
- <tr>
357
- <td>
358
- Need assistance? Check out our:
359
- <ul>
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>
@@ -380,33 +425,56 @@ GROUP BY meta.meta_key ORDER BY meta.meta_key ASC;";
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>
394
- <td><strong>Our latest blog articles</strong></td>
395
  </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>
2
  $domain = $_SERVER['HTTP_HOST'];
3
  $plugin_settings = get_option( 'plugin_settings' );
4
  $license_information = get_option( 'license_information' );
5
+ $host = $_SERVER['HTTP_HOST'];
6
+
7
+ $elite_disable = "enabled";
8
+ if($license_information['license_valid'] == "false"){
9
+ $elite_disable = "disabled";
10
+ }
11
+
12
+ if(empty($license_information['license_email'])){
13
+ $license_information['license_email'] = "";
14
+ }
15
+ if(empty($license_information['license_key'])){
16
+ $license_information['license_key'] = "";
17
+ }
18
 
19
  $versions = array (
20
  "PHP" => (float)phpversion(),
88
  ?>
89
 
90
  <div class="wrap">
91
+
92
  <div class="woo-product-feed-pro-form-style-2">
93
  <tbody class="woo-product-feed-pro-body">
94
  <div class="woo-product-feed-pro-form-style-2-heading">
95
+ <span>
96
  <?php
97
  print "$header_text";
98
  ?>
99
+ </span>
100
  </div>
101
+
102
  <?php
103
  if(array_key_exists('message', $license_information)){
104
  ?>
126
  ?>
127
 
128
  <table class="woo-product-feed-pro-table">
129
+ <tr><td><strong>Plugin setting</strong></td><td><strong>Off / On</strong></td></tr>
130
 
131
  <form action="" method="post">
132
+ <tr class="<?php print"$elite_disable";?>" id="json_option">
133
  <td>
134
  <span>Increase the number of products that will be approved in Google's Merchant Center:<br/>
135
+ 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/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=structured data bug" target="_blank">Read more about this)</a></span>
136
  </td>
137
  <td>
138
  <label class="woo-product-feed-pro-switch">
139
  <?php
140
  $structured_data_fix = get_option ('structured_data_fix');
141
  if($structured_data_fix == "yes"){
142
+ print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\" checked $elite_disable>";
143
  } else {
144
+ print "<input type=\"checkbox\" id=\"fix_json_ld\" name=\"fix_json_ld\" class=\"checkbox-field\" $elite_disable>";
145
  }
146
  ?>
147
  <div class="woo-product-feed-pro-slider round"></div>
149
  </td>
150
  </tr>
151
 
152
+ <tr class="<?php print"$elite_disable";?>" id="structured_vat_option">
153
+ <td>
154
+ <span>Exclude TAX from structured data prices</span>
155
+ </td>
156
+ <td>
157
+ <label class="woo-product-feed-pro-switch">
158
+ <?php
159
+ $structured_vat = get_option ('structured_vat');
160
+ if($structured_vat == "yes"){
161
+ print "<input type=\"checkbox\" id=\"no_structured_vat\" name=\"no_structured_vat\" class=\"checkbox-field\" checked $elite_disable>";
162
+ } else {
163
+ print "<input type=\"checkbox\" id=\"no_structured_vat\" name=\"no_structured_vat\" class=\"checkbox-field\" $elite_disable>";
164
+ }
165
+ ?>
166
+ <div class="woo-product-feed-pro-slider round"></div>
167
+ </label>
168
+ </td>
169
+ </tr>
170
+
171
+ <tr class="<?php print"$elite_disable";?>" id="identifier_option">
172
  <td>
173
+ <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/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=adding fields" target="_blank">Read more about this)</a></span>
174
  </td>
175
  <td>
176
  <label class="woo-product-feed-pro-switch">
177
  <?php
178
  $add_unique_identifiers = get_option ('add_unique_identifiers');
179
  if($add_unique_identifiers == "yes"){
180
+ print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\" checked $elite_disable>";
181
  } else {
182
+ print "<input type=\"checkbox\" id=\"add_identifiers\" name=\"add_identifiers\" class=\"checkbox-field\" $elite_disable>";
183
  }
184
  ?>
185
  <div class="woo-product-feed-pro-slider round"></div>
186
  </label>
187
  </td>
188
  </tr>
189
+
190
+ <tr class="<?php print"$elite_disable";?>" id="wpml_option">
191
  <td>
192
+ <span>Enable WPML support: (<a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=wpml support" target="_blank">Read more about this)</a></span>
193
  </td>
194
  <td>
195
  <label class="woo-product-feed-pro-switch">
196
  <?php
197
  $add_wpml_support = get_option ('add_wpml_support');
198
  if($add_wpml_support == "yes"){
199
+ print "<input type=\"checkbox\" id=\"add_wpml_support\" name=\"add_wpml_support\" class=\"checkbox-field\" checked $elite_disable>";
200
  } else {
201
+ print "<input type=\"checkbox\" id=\"add_wpml_support\" name=\"add_wpml_support\" class=\"checkbox-field\" $elite_disable>";
202
  }
203
  ?>
204
  <div class="woo-product-feed-pro-slider round"></div>
206
  </td>
207
  </tr>
208
 
209
+ <tr class="<?php print"$elite_disable";?>" id="aelia_option">
210
+ <td>
211
+ <span>Enable Aelia Currency Switcher support: (<a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=aelia support" target="_blank">Read more about this)</a></span>
212
+ </td>
213
+ <td>
214
+ <label class="woo-product-feed-pro-switch">
215
+ <?php
216
+ $add_aelia_support = get_option ('add_aelia_support');
217
+ if($add_aelia_support == "yes"){
218
+ print "<input type=\"checkbox\" id=\"add_aelia_support\" name=\"add_aeli_support\" class=\"checkbox-field\" checked $elite_disable>";
219
+ } else {
220
+ print "<input type=\"checkbox\" id=\"add_aelia_support\" name=\"add_aeli_support\" class=\"checkbox-field\" $elite_disable>";
221
+ }
222
+ ?>
223
+ <div class="woo-product-feed-pro-slider round"></div>
224
+ </label>
225
+ </td>
226
+ </tr>
227
  <tr>
228
  <td>
229
  <span>Use mother main image for variations</span>
295
  </tr>
296
  <tr>
297
  <td colspan="2">
298
+ <?php
299
+ if($license_information['license_valid'] <> "true"){
300
+ ?>
301
  <input type="submit" id="checklicense" value="Activate license">
302
+ <?php
303
+ } else {
304
+ ?>
305
+ <input type="submit" id="checklicense" value="License already active">
306
+ <?php
307
+ }
308
+ ?>
309
  </td>
310
  </tr>
311
 
368
  $product_attr = unserialize($value->type);
369
  if(!empty($product_attr)){
370
  foreach ($product_attr as $key => $arr_value) {
371
+ $value_display = str_replace("_", "",$arr_value['name']);
372
  $list["custom_attributes_" . $key] = ucfirst($value_display);
373
  }
374
  }
380
  print "<tr><td><strong>Attribute name</strong></td><td><strong>On / Off</strong></td></tr>";
381
 
382
  foreach ($list as $key => $value){
383
+ // Trim spaces before and after
384
+ $value = trim($value);
385
+
386
+ if(in_array($value, $extra_attributes,TRUE)){
387
  $checked = "checked";
388
  } else {
389
  $checked = "";
408
  </div>
409
 
410
  <div class="woo-product-feed-pro-table-right">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
411
 
412
+ <?php
413
+ if((empty($license_information['license_valid'])) OR ($license_information['license_valid'] <> "true")){
414
+ ?>
415
  <table class="woo-product-feed-pro-table">
416
  <tr>
417
  <td><strong>Why upgrade to Elite?</strong></td>
425
  <li><strong>3.</strong> Add GTIN, brand and more fields to your store</li>
426
  <li><strong>4.</strong> Exclude individual products from your feeds</li>
427
  <li><strong>5.</strong> WPML support</li>
428
+ <li><strong>6.</strong> Aelia currency switcher support</li>
429
  </ul>
430
  <strong>
431
+ <a href="https://adtribes.io/pro-vs-elite/?utm_source=<?php print"$host";?>&utm_medium=manage-settings&utm_campaign=why-upgrade-box" target="_blank">Upgrade to Elite here!</a>
432
  </strong>
433
  </td>
434
  </tr>
435
  </table><br/>
436
+ <?php
437
+ }
438
+ ?>
439
 
440
  <table class="woo-product-feed-pro-table">
441
  <tr>
442
+ <td><strong>We’ve got you covered!</strong></td>
443
  </tr>
444
  <tr>
445
  <td>
446
+ Need assistance? Check out our:
447
  <ul>
448
+ <li><strong><a href="https://adtribes.io/support/?utm_source=<?php print"$host";?>&utm_medium=manage-settings&utm_campaign=faq" target="_blank">Frequently Asked Questions</a></strong></li>
449
+ <li><strong><a href="https://www.youtube.com/channel/UCXp1NsK-G_w0XzkfHW-NZCw" target="_blank">YouTube tutorials</a></strong></li>
450
+ <li><strong><a href="https://adtribes.io/blog/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=blog" target="_blank">Blog</a></strong></li>
 
 
 
451
  </ul>
452
+ 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.
453
  </td>
454
  </tr>
455
  </table><br/>
456
 
457
+
458
+ <table class="woo-product-feed-pro-table">
459
+ <tr>
460
+ <td><strong>Our latest blog articles</strong></td>
461
+ </tr>
462
+ <tr>
463
+ <td>
464
+ <ul>
465
+ <li><strong>1. <a href="https://adtribes.io/setting-up-your-first-google-shopping-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=first shopping feed" target="_blank">Create a Google Shopping feed</a></strong></li>
466
+ <li><strong>2. <a href="https://adtribes.io/how-to-create-filters-for-your-product-feed/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=how to create filters" target="_blank">How to create filters for your product feed</a></strong></li>
467
+ <li><strong>3. <a href="https://adtribes.io/how-to-create-rules/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=how to create rules" target="_blank">How to set rules for your product feed</a></strong></li>
468
+ <li><strong>4. <a href="https://adtribes.io/add-gtin-mpn-upc-ean-product-condition-optimised-title-and-brand-attributes/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=adding fields" target="_blank">Adding GTIN, Brand, MPN and more</a></strong></li>
469
+ <li><strong>5. <a href="https://adtribes.io/woocommerce-structured-data-bug/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=structured data bug" target="_blank">WooCommerce structured data markup bug</a></strong></li>
470
+ <li><strong>6. <a href="https://adtribes.io/wpml-support/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=wpml support" target="_blank">Enable WPML support</a></strong></li>
471
+
472
+ <li><strong>7. <a href="https://adtribes.io/aelia-currency-switcher-feature/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_campaign=aelia support" target="_blank">Enable Aelia currency switcher support</a></strong></li>
473
+ </ul>
474
+ </td>
475
+ </tr>
476
+ </table><br/>
477
+
478
  </div>
479
  </div>
480
  </tbody>
pages/admin/woosea-statistics-feed.php CHANGED
@@ -72,15 +72,15 @@ if (array_key_exists('project_hash', $_GET)){
72
  label: "Number of products in feed",
73
  data: data,
74
  backgroundColor: [
75
- 'rgba(255, 99, 132, 0.2)',
76
- 'rgba(54, 162, 235, 0.2)',
77
- 'rgba(255, 206, 86, 0.2)',
78
- 'rgba(75, 192, 192, 0.2)',
79
- 'rgba(153, 102, 255, 0.2)',
80
- 'rgba(255, 159, 64, 0.2)'
81
  ],
82
  borderColor: [
83
- 'rgba(255,99,132,1)',
84
  'rgba(54, 162, 235, 1)',
85
  'rgba(255, 206, 86, 1)',
86
  'rgba(75, 192, 192, 1)',
72
  label: "Number of products in feed",
73
  data: data,
74
  backgroundColor: [
75
+ 'rgba(144, 91, 137, 0.4)',
76
+ 'rgba(54, 162, 235, 0.4)',
77
+ 'rgba(255, 206, 86, 0.4)',
78
+ 'rgba(75, 192, 192, 0.4)',
79
+ 'rgba(153, 102, 255, 0.4)',
80
+ 'rgba(255, 159, 64, 0.4)'
81
  ],
82
  borderColor: [
83
+ 'rgba(144, 91, 137, 1)',
84
  'rgba(54, 162, 235, 1)',
85
  'rgba(255, 206, 86, 1)',
86
  'rgba(75, 192, 192, 1)',
readme.txt CHANGED
@@ -5,8 +5,8 @@ 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
 
@@ -72,7 +72,13 @@ Use the product tag information for your product feeds or to create filters and
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]
@@ -86,7 +92,8 @@ Our plugin supports WPML (WPML Multilingual CMS)
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;
@@ -163,6 +170,7 @@ Our plugin supports WPML (WPML Multilingual CMS)
163
  * TheNextAd
164
  * Webgains
165
  * Crowdfox
 
166
  * Real.de
167
  * Allyouneed
168
  * Apomio
@@ -177,6 +185,7 @@ Our plugin supports WPML (WPML Multilingual CMS)
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
@@ -264,6 +273,327 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
264
 
265
  === Changelog ===
266
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  = 4.0.0 (2018-12-17) =
268
  * Fixed another issue with cached prices ending up in product feeds.
269
 
@@ -1199,6 +1529,328 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
1199
 
1200
  == Upgrade Notice ==
1201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1202
  = 4.0.0 =
1203
  Fixed another issue with cached prices ending up in product feeds.
1204
 
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.1
9
+ Stable tag: 5.0.0
10
 
11
  == Description ==
12
 
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
76
+
77
+ = WCML - WooCommerce Multilingual =
78
+ Our plugin supports WooCommerce Multilangual, especially the currency switcher
79
+
80
+ = Aelia Currency Switcher =
81
+ Our plugin supports the Aelia Currency Switcher
82
 
83
  = Google Shopping product feed tutorial =
84
  [youtube https://www.youtube.com/watch?v=2XzxwKDufGw]
92
  * > 100 pre-configured product feed channel-templates for ~ 200 countries;
93
  * Create custom product feeds;
94
  * XML, CSV, TSV and TXT formats;
95
+ * Supports WPML (version 4.1 and higher)
96
+ * Supports WCML, WooCommerce Multilingual
97
  * Tracks conversions and sales;
98
  * Intuitive interface;
99
  * Supports product variations / variables;
170
  * TheNextAd
171
  * Webgains
172
  * Crowdfox
173
+ * <a href="https://www.salidzini.lv" target="_blank">Salidzini.lv</a>
174
  * Real.de
175
  * Allyouneed
176
  * Apomio
185
  * Livingo.de
186
  * Medizinfuchs.de
187
  * <a href="https://www.moebel.de" target="_blank">Moebel.de</a>
188
+ * <a href="https://www.zap.co.il" target="_blank">Zap.co.il</a>
189
  * My Best Brands
190
  * Preis.de
191
  * Rakuten
273
 
274
  === Changelog ===
275
 
276
+ = 5.0.0 (2019-03-08) =
277
+ * Fixed a PHP undefined variable warning
278
+
279
+ = 4.9.9 (2019-03-08) =
280
+ * Added a feature: one can select to only include the default product variation in feeds instead of all variations
281
+
282
+ = 4.9.8 (2019-03-07) =
283
+ * Fixed a bug: product tag filters for products that did not have product tags configured did not work. This issue has been fixed.
284
+
285
+ = 4.9.7 (2019-03-07) =
286
+ * Fixed a bug: processing of feeds for which the original feed was deleted did not work. This issue has been fixed.
287
+
288
+ = 4.9.6 (2019-03-05) =
289
+ * Removed the wp_flush_cache option again as it was performing site performance issues
290
+
291
+ = 4.9.5 (2019-03-05) =
292
+ * Solved an PHP object error
293
+
294
+ = 4.9.4 (2019-03-04) =
295
+ * Added the Huis & Tuin template for Daisycon.com
296
+
297
+ = 4.9.3 (2019-03-04) =
298
+ * Fixed a bug: when WooCommerce was deactivated and Google's Remarketing code was activated a PHP error was thrown. This issue has been fixed (thx alx359 for reporting)
299
+
300
+ = 4.9.2 (2019-03-01) =
301
+ * Fixed a bug: rules with an empty condition meant to replace a value did not work. This issue has been fixed now.
302
+
303
+ = 4.9.1 (2019-02-28) =
304
+ * Fixed some PHP bugs: non-strict MD5 comparisons fixed in most places as making most in_array functions strict comparisons (thanks Daniel & Stephan for this, greatly appreciated!)
305
+
306
+ = 4.9.0 (2019-02-28) =
307
+ * Fixed a bug: sale prices excluding VAT that were added to the feed that had no value got added as a sale price of 0 where it should have been empty. Issue has been fixed now.
308
+
309
+ = 4.8.9 (2019-02-27) =
310
+ * Fixed a bug: for variation products the plugin was adding the slug to the product name for dynamic attributes. This needed to be the dynamic attribute name. Issue has been fixed now.
311
+
312
+ = 4.8.8 (2019-02-27) =
313
+ * Added some more cache flushing
314
+
315
+ = 4.8.7 (2019-02-27) =
316
+ * Forcing the prices excluding VAT to be rounded on two decimals
317
+
318
+ = 4.8.6 (2019-02-26) =
319
+ * The filter bug fix of release 4.7.5 changed the behaviour for exclude filters on empty fields. Made changes so it defaults back to the old behaviour for exclude filters.
320
+
321
+ = 4.8.5 (2019-02-26) =
322
+ * Removed ancestor category from all feeds when not selected
323
+
324
+ = 4.8.4 (2019-02-26) =
325
+ * Re-introduced feature: added a chart on the plugin settings page for every individual product feed showing the amount of products per feed after each refresh.
326
+ * Fixed an undifined variables issue for the RSS box (thanks alx359 for spotting this one)
327
+
328
+ = 4.8.3 (2019-02-26) =
329
+ * Fixed a bug for Prisjakt and Pricerunner feeds where the ancestor category was added to the feed even when it was not selected.
330
+
331
+ = 4.8.2 (2019-02-25) =
332
+ * Added a SKU_ITEM_GROUP_ID attribute for Facebook feeds
333
+
334
+ = 4.8.1 (2019-02-24) =
335
+ * Added the product menu order attribute and filter/rule feature
336
+
337
+ = 4.8.0 (2019-02-23) =
338
+ * Fixed a bug: the review notification screen started showing up all over the WP-admin section and could not be dismissed. This issue has been fixed.
339
+ * Added extra custom attributes to the filter drop-downs
340
+
341
+ = 4.7.9 (2019-02-22) =
342
+ * Added support for Cyrillic characters in the variation product name appends
343
+
344
+ = 4.7.8 (2019-02-22) =
345
+ * Checked for WordPress 5.1 compatibility
346
+ * Fixed a Yandex feed bug for missing CategoryIds for variation products
347
+
348
+ = 4.7.7 (2019-02-22) =
349
+ * Fixed an issue where the ancestor categoryId was added to Yandex feeds for variation products only, even though that ancestor category was not activated. This issue has been fixed now.
350
+
351
+ = 4.7.6 (2019-02-21) =
352
+ * Added object caching flushing
353
+ * Changed Zbosi.cz header to http
354
+
355
+ = 4.7.5 (2019-02-21) =
356
+ * Fixed a bug where flters on empty values where not working for include_only filters
357
+
358
+ = 4.7.4 (2019-02-21) =
359
+ * Fixed an issue where the ancestor categoryId was added to Yandex feeds (only when the Yoast SEO plugin was not installed) even though that ancestor category was not activated. This issue has been fixed now.
360
+ * Added a template for Zbosi.cz
361
+
362
+ = 4.7.3 (2019-02-20) =
363
+ * WooCommerce 3.5 compatibility message is not showing. This should fix that as our plugin is compatible.
364
+
365
+ = 4.7.2 (2019-02-20) =
366
+ * Solved some PHP warnings that appeared with one of the information boxes when license was inactive
367
+
368
+ = 4.7.1 (2019-02-19) =
369
+ * Attempting to fix a rounding issue for Facebook feeds
370
+
371
+ = 4.7.0 (2019-02-19) =
372
+ * Fixed a bug for Google DRM feeds. Prices got malformed when the thousand separator was a comma. This issue has been fixed now.
373
+
374
+ = 4.6.9 (2019-02-19) =
375
+ * Fixed a bug where some of the wp_enqueue_script where loaded outside the scope of our plugin. This issue has been fixed now.
376
+
377
+ = 4.6.8 (2019-02-18) =
378
+ * Reverted part of the previous release as it contained untested features of an upcoming release. Mea culpa.
379
+
380
+ = 4.6.7 (2019-02-18) =
381
+ * Added a feature to exclude TAX from structured data price fields on product pages
382
+
383
+ = 4.6.6 (2019-02-18) =
384
+ * Fixed a bug where filters on product tags where only working for products that had one tag attached to them. Filters on products that have multiple product tags are working now aswell.
385
+
386
+ = 4.6.5 (2019-02-16) =
387
+ * Added the category slug in the drop-down when creating a category filter
388
+
389
+ = 4.6.4 (2019-02-15) =
390
+ * As of this release all attribute values making a variation product unique will be added to the product name/title. Previously the plugin only added attribute values of attributes that are also in the product feed itself.
391
+ * Fixed a PHP-warning that happened for variation products that had no regular price.
392
+ * Fixed a PHP-warning that happened for variation products that got saved and did not have the 'extra fields' option of this plugin enabled.
393
+
394
+ = 4.6.3 (2019-02-13) =
395
+ * Fixed another bug where strictly configured PHP instances crashed on using empty on a function.
396
+ * Added notifications
397
+
398
+ = 4.6.2 (2019-02-12) =
399
+ * Fixed a bug where strictly configured PHP instances crashed on using empty on a function.
400
+
401
+ = 4.6.1 (2019-02-11) =
402
+ * Added the product URL to the structured data snippet
403
+
404
+ = 4.6.0 (2019-02-09) =
405
+ * Added the possibility to add wc_post_id_ before the item_group_id without a space between it
406
+ * Added shipping support for local pickup
407
+
408
+ = 4.5.9 (2019-02-08) =
409
+ * Minor fix where the store code for Google's Local Product Inventory Feeds did not make it to the feed when only 1 shop was added
410
+
411
+ = 4.5.8 (2019-02-08) =
412
+ * Prices for Google's Dynamic Remarketing Feeds now always use '.' as the decimal mark as required by Google.
413
+ * Structured data prices are now rounded to two decimals.
414
+
415
+ = 4.5.7 (2019-02-08) =
416
+ * When a suffix was placed behind an attribute on the field mapping page, no space was put between the attribute value and the suffix for CSV feeds only. This has been solved.
417
+
418
+ = 4.5.6 (2019-02-08) =
419
+ * When an user did not add the g:shipping field to their feed there is also no need to calculate the shipping prices per zone per products. So we removed this when this is the case. This results in an perfonce increase, processing the feeds.
420
+
421
+ = 4.5.5 (2019-02-07) =
422
+ * When users add an item_group_id to simple products this causes products to get disapproved in Google's merchant center. Build in a check that always removes the g:item_group_id for simple products.
423
+
424
+ = 4.5.4 (2019-02-07) =
425
+ * Fixed a bug: the attribute price incl. VAT did not always contained the price incl. VAT due to active caching plugins. This has been fixed now.
426
+
427
+ = 4.5.3 (2019-02-06) =
428
+ * Fixed a bug: in the attribute enable/disable settings page some attributes could not be enabled. Changing the settings was not saved. This has been fixed now.
429
+
430
+ = 4.5.2 (2019-02-05) =
431
+ * Added support for adding mutiple store codes to Google Local Product Inventory Feeds
432
+
433
+ = 4.5.1 (2019-02-04) =
434
+ * The Redis Object Caching support was causing issues with some of our users so we removed support for the Redis Object Caching again (temporarly)
435
+
436
+ = 4.5.0 (2019-02-03) =
437
+ * Added the possibility to add prefix and suffixes before and after the id
438
+
439
+ = 4.4.9 (2019-02-03) =
440
+ * Removed upgrade notices for members who bought an Elite license
441
+
442
+ = 4.4.8 (2019-02-03) =
443
+ * Fixed a bug: the Aelia currency switch enable/disable option was broken, it could not be turned off. This issue has been fixed.
444
+
445
+ = 4.4.7 (2019-02-03) =
446
+ * Fixed a bug: include_only filters on tags were not working. This issue has been fixed.
447
+ * Added compatibility for the Redit Object Caching plugin
448
+ * Added some more license checks
449
+
450
+ = 4.4.6 (2019-01-31) =
451
+ * Solved a PHP warning that showed up when creating filters on quantity fields
452
+
453
+ = 4.4.5 (2019-01-31) =
454
+ * Final preparations made for the launch of the Elite features. Added lots of notifications, help texts and utm parameters
455
+
456
+ = 4.4.4 (2019-01-30) =
457
+ * Added notifications to the manage feeds page with regards to the Elite features
458
+
459
+ = 4.4.3 (2019-01-30) =
460
+ * Disabled the chart feature for now as Chart.js seems to conflict with some theme's
461
+
462
+ = 4.4.2 (2019-01-29) =
463
+ * New feature: introduced a chart feature for every individual product feed showing the amount of products per feed after each refresh.
464
+
465
+ = 4.4.1 (2019-01-29) =
466
+ * Fixed a bug: rules to change shipping costs for non Google shopping/Facebook feeds where not working. This issue has been fixed now.
467
+
468
+ = 4.4.0 (2019-01-28) =
469
+ * Fixed a bug: manually entered Aelia prices for variation products did not make it to the product feed. This issue has been fixed now.
470
+
471
+ = 4.3.9 (2019-01-27) =
472
+ * Fixed a bug: when a shipping zone was applicable for multiple countries it only put in the last country in the feed. This issue has been fixed now.
473
+
474
+ = 4.3.8 (2019-01-26) =
475
+ * Removed the template for Google Product Review Feeds as it was not fiished yet
476
+
477
+ = 4.3.7 (2019-01-25) =
478
+ * Fixed a bug: Aelia base currency was always showing as a shipping currency prefix after updating the currency setting of a product feed. This has been fixed now.
479
+
480
+ = 4.3.6 (2019-01-25) =
481
+ * Fixed a bug: there was a double currency prefix with shipping costs. This has been solved.
482
+
483
+ = 4.3.5 (2019-01-25) =
484
+ * Added Aelia exchange rate features for shipping costs
485
+
486
+ = 4.3.4 (2019-01-23) =
487
+ * Further improved support for the Aelia currency switcher
488
+
489
+ = 4.3.3 (2019-01-23) =
490
+ * Improved support for the Aelia currency switcher, the plugin now also accepts manually entered prices (regular and sale price)
491
+
492
+ = 4.3.2 (2019-01-22) =
493
+ * Fixed a bug: exclude rules that were set on product attributes that were empty did not work. Issue has been fixed.
494
+ * Another attempt to fix the variable mismatch issue
495
+
496
+ = 4.3.1 (2019-01-21) =
497
+ * Fixed the variable mismatch error that existed for users who also used WPML
498
+
499
+ = 4.3.0 (2019-01-20) =
500
+ * Added support for the Latvia Comparison Shopping Engine Salidzini.lv
501
+
502
+ = 4.2.9 (2019-01-19) =
503
+ * Added links to relevant tutorials
504
+ * Added some license checks
505
+
506
+ = 4.2.8 (2019-01-17) =
507
+ * Fixed a bug: when a Free Shipping zone was configured and limited to certain postal code's and shipping was restricted to one country the free shipping did not end up in the feed. Issue has been fixed.
508
+
509
+ = 4.2.7 (2019-01-17) =
510
+ * Fixed a bug: adding static values in the attribute field mapping page was not working. Issue has been fixed.
511
+
512
+ = 4.2.6 (2019-01-16) =
513
+ * Added the override column to the Facebook feed template so besided the base Facebook feed one can now also create country and language override feeds for Facebook
514
+
515
+ = 4.2.5 (2019-01-16) =
516
+ * Adding suffixes to the link attribute contained a space. We have now changed this so the space gets removed, allowing you to append (static) paramaters to your URL
517
+
518
+ = 4.2.4 (2019-01-16) =
519
+ * The installment amount field was only accepting numbers and not floating numbers (with a . or ,). We have changed this so the field also accepts decimal values.
520
+
521
+ = 4.2.3 (2019-01-15) =
522
+ * Fixed a bug: The Google Analytics and AdTribes conversion tracking buttons did not save when changed. This issue has been solved.
523
+
524
+ = 4.2.2 (2019-01-15) =
525
+ * Added support for the Aelia Currency Switcher
526
+
527
+ = 4.2.1 (2019-01-11) =
528
+ * Added cascading mother / child category mapping feature
529
+
530
+ = 4.2.0 (2019-01-11) =
531
+ * Category mapping made even easier: as of this release it is possible to, with one go, copy existing category mappings to all other categories. This saves you valuable time when you want to map all your categories to one or just a few Google taxonomy categories.
532
+
533
+ = 4.1.9 (2019-01-08) =
534
+ * Added support (template) for the Italian Comparison website Trovaprezzi.it
535
+
536
+ = 4.1.8 (2019-01-08) =
537
+ * Replaced the jQuery UI icons by the official WP dashicons as some user reported not being able to see the jQuery UI icons as those got removed by there theme's
538
+
539
+ = 4.1.7 (2019-01-07) =
540
+ * Improved license-module of plugin
541
+
542
+ = 4.1.6 (2019-01-03) =
543
+ * Changed the inner workings of the 'contains' rules for the shipping field. Whereas previously this rule replaced the entire string now it does a proper string replace only replacing the exact 'contains' part of the rule.
544
+ * Fixed a bug: previously saved filters and rules on shipping fields got deleted when configuration changes were made to the feed. This issue has been solved now.
545
+ * Changed the plugin's icon in the WP-admin menu to our Adtribes.io logo
546
+
547
+ = 4.1.5 (2019-01-03) =
548
+ * Fixed a bug for Facebook CSV feeds where the identifier_exists field is not needed and caused some columns to contain the value "yes", always. This issue has been solved.
549
+
550
+ = 4.1.4 (2019-01-03) =
551
+ * Added multiply rule feature for shipping prices
552
+ * Added product review information to the plugin, this however cannot be used for feeds yet
553
+ * Prepared the plugin for launch of the paid Elte features
554
+
555
+ = 4.1.3 (2018-12-30) =
556
+ * Fixed a bug for the Zap.co.il template
557
+
558
+ = 4.1.2 (2018-12-29) =
559
+ * Fixed a bug for the Zap.co.il template
560
+
561
+ = 4.1.1 (2018-12-29) =
562
+ * Fixed a bug: rules and filters could not be deleted. This issue has been fixed.
563
+
564
+ = 4.1.0 (2018-12-28) =
565
+ * Fixed another rules and filter display bug
566
+
567
+ = 4.0.9 (2018-12-28) =
568
+ * Added a default feed template for the Israelian price comparison Zap.co.il
569
+
570
+ = 4.0.8 (2018-12-27) =
571
+ * Fixed a rule displaying bug. The rule was actually working fine but it was not showing in the configuration page.
572
+
573
+ = 4.0.7 (2018-12-27) =
574
+ * We have added WooCommerce Multilingual support, especially the currency switcher. WooCommerce Multilangual is an addition onto the popular WPML-plugin
575
+ * We have improved our WPML support (version 4.1 and higher)
576
+
577
+ = 4.0.6 (2018-12-24) =
578
+ * Added a Google Shopping tutorial to the plugin
579
+
580
+ = 4.0.5 (2018-12-22) =
581
+ * Switched On/Off title's of toggle's
582
+ * Cleaned-up HTML of the Google Analytics configuration page so no variable mismatch will show after submitting this page.
583
+
584
+ = 4.0.4 (2018-12-20) =
585
+ * Cleaned-up HTML of the rules and filter pages and made some changes to the jQuery checks for that functionality. Hoping it will take away the variable mismatch detection.
586
+ * Fixed a bug: Byte Order Marks where added to every line for CSV feeds whereas it should only appear only once. This issue has been fixed.
587
+
588
+ = 4.0.3 (2018-12-20) =
589
+ * Improved the way the plugin cleans up the description and short description attributes from HTML. It now replaces some of the HTML with whitespaces instead of just removing it making the description and short description better to read. Thanks Stan B for your suggestion. Much appreciated!
590
+
591
+ = 4.0.2 (2018-12-20) =
592
+ * Another attempt to get rid of the "variable mismatch detection"
593
+
594
+ = 4.0.1 (2018-12-18) =
595
+ * Added form tags to the allowed HTML keys using the wp_kses_allowed_html function as they had been removed in the WP 5.01 release. This solves the "A variable mismatch has been detected" error.
596
+
597
  = 4.0.0 (2018-12-17) =
598
  * Fixed another issue with cached prices ending up in product feeds.
599
 
1529
 
1530
  == Upgrade Notice ==
1531
 
1532
+ = 5.0.0 =
1533
+ Fixed a PHP undefined variable warning
1534
+
1535
+ = 4.9.9 =
1536
+ Added a feature: one can select to only include the default product variation in feeds instead of all variations
1537
+
1538
+ = 4.9.8 =
1539
+ Fixed a bug: product tag filters for products that did not have product tags configured did not work. This issue has been fixed.
1540
+
1541
+ = 4.9.7 =
1542
+ Fixed a bug: processing of feeds for which the original feed was deleted did not work. This issue has been fixed.
1543
+
1544
+ = 4.9.6 =
1545
+ Removed the wp_flush_cache option again as it was performing site performance issues
1546
+
1547
+ = 4.9.5 =
1548
+ Solved an PHP object error
1549
+
1550
+ = 4.9.4 =
1551
+ Added the Huis & Tuin template for Daisycon.com
1552
+
1553
+ = 4.9.3 =
1554
+ Fixed a bug: when WooCommerce was deactivated and Google's Remarketing code was activated a PHP error was thrown. This issue has been fixed (thx alx359 for reporting)
1555
+
1556
+ = 4.9.2 =
1557
+ Fixed a bug: rules with an empty condition meant to replace a value did not work. This issue has been fixed now.
1558
+
1559
+ = 4.9.1 =
1560
+ Fixed some PHP bugs: non-strict MD5 comparisons fixed in most places as making most in_array functions strict comparisons (thanks Daniel & Stephan for this, greatly appreciated!)
1561
+
1562
+ = 4.9.0 =
1563
+ Fixed a bug: sale prices excluding VAT that were added to the feed that had no value got added as a sale price of 0 where it should have been empty. Issue has been fixed now.
1564
+
1565
+ = 4.8.9 =
1566
+ Fixed a bug: for variation products the plugin was adding the slug to the product name for dynamic attributes. This needed to be the dynamic attribute name. Issue has been fixed now.
1567
+
1568
+ = 4.8.8 =
1569
+ Added some more cache flushing
1570
+
1571
+ = 4.8.7 =
1572
+ Forcing the prices excluding VAT to be rounded on two decimals
1573
+
1574
+ = 4.8.6 =
1575
+ The filter bug fix of release 4.7.5 changed the behaviour for exclude filters on empty fields. Made changes so it defaults back to the old behaviour for exclude filters.
1576
+
1577
+ = 4.8.5 =
1578
+ Removed ancestor category from all feeds when not selected
1579
+
1580
+ = 4.8.4 =
1581
+ Re-introduced feature: added a chart on the plugin settings page for every individual product feed showing the amount of products per feed after each refresh.
1582
+ Fixed an undifined variables issue for the RSS box (thanks alx359 for spotting this one)
1583
+
1584
+ = 4.8.3 =
1585
+ Fixed a bug for Prisjakt and Pricerunner feeds where the ancestor category was added to the feed even when it was not selected.
1586
+
1587
+ = 4.8.2 =
1588
+ Added a SKU_ITEM_GROUP_ID attribute for Facebook feeds
1589
+
1590
+ = 4.8.1 =
1591
+ Added the product menu order attribute and filter/rule feature
1592
+
1593
+ = 4.8.0 =
1594
+ Fixed a bug: the review notification screen started showing up all over the WP-admin section and could not be dismissed. This issue has been fixed.
1595
+ Added extra custom attributes to the filter drop-downs
1596
+
1597
+ = 4.7.9 =
1598
+ Added support for Cyrillic characters in the variation product name appends
1599
+
1600
+ = 4.7.8 =
1601
+ Checked for WordPress 5.1 compatibility
1602
+ Fixed a Yandex feed bug for missing CategoryIds for variation products
1603
+
1604
+ = 4.7.7 =
1605
+ Fixed an issue where the ancestor categoryId was added to Yandex feeds for variation products only, even though that ancestor category was not activated. This issue has been fixed now.
1606
+
1607
+ = 4.7.6 =
1608
+ Added object caching flushing
1609
+ Changed Zbosi.cz header to http
1610
+
1611
+ = 4.7.5 =
1612
+ Fixed a bug where flters on empty values where not working for include_only filters
1613
+
1614
+ = 4.7.4 =
1615
+ Fixed an issue where the ancestor categoryId was added to Yandex feeds (only when the Yoast SEO plugin was not installed) even though that ancestor category was not activated. This issue has been fixed now.
1616
+ Added a template for Zbosi.cz
1617
+
1618
+ = 4.7.3 =
1619
+ WooCommerce 3.5 compatibility message is not showing. This should fix that as our plugin is compatible.
1620
+
1621
+ = 4.7.2 =
1622
+ Solved some PHP warnings that appeared with one of the information boxes when license was inactive
1623
+
1624
+ = 4.7.1 =
1625
+ Attempting to fix a rounding issue for Facebook feeds
1626
+
1627
+ = 4.7.0 =
1628
+ Fixed a bug for Google DRM feeds. Prices got malformed when the thousand separator was a comma. This issue has been fixed now.
1629
+
1630
+ = 4.6.9 =
1631
+ Fixed a bug where some of the wp_enqueue_script where loaded outside the scope of our plugin. This issue has been fixed now.
1632
+
1633
+ = 4.6.8 =
1634
+ Reverted part of the previous release as it contained untested features of an upcoming release. Mea culpa.
1635
+
1636
+ = 4.6.7 =
1637
+ Added a feature to exclude TAX from structured data price fields on product pages
1638
+
1639
+ = 4.6.6 =
1640
+ Fixed a bug where filters on product tags where only working for products that had one tag attached to them. Filters on products that have multiple product tags are working now aswell.
1641
+
1642
+ = 4.6.5 =
1643
+ Added the category slug in the drop-down when creating a category filter
1644
+
1645
+ = 4.6.4 =
1646
+ As of this release all attribute values making a variation product unique will be added to the product name/title. Previously the plugin only added attribute values of attributes that are also in the product feed itself.
1647
+ Fixed a PHP-warning that happened for variation products that had no regular price.
1648
+ Fixed a PHP-warning that happened for variation products that got saved and did not have the 'extra fields' option of this plugin enabled.
1649
+
1650
+ = 4.6.3 =
1651
+ Fixed another bug where strictly configured PHP instances crashed on using empty on a function.
1652
+ Added notifications
1653
+
1654
+ = 4.6.2 =
1655
+ Fixed a bug where strictly configured PHP instances crashed on using empty on a function.
1656
+
1657
+ = 4.6.1 =
1658
+ Added the product URL to the structured data snippet
1659
+
1660
+ = 4.6.0 =
1661
+ Added the possibility to add wc_post_id_ before the item_group_id without a space between it
1662
+ Added shipping support for local pickup
1663
+
1664
+ = 4.5.9 =
1665
+ Minor fix where the store code for Google's Local Product Inventory Feeds did not make it to the feed when only 1 shop was added
1666
+
1667
+ = 4.5.8 =
1668
+ Prices for Google's Dynamic Remarketing Feeds now always use '.' as the decimal mark as required by Google.
1669
+ Structured data prices are now rounded to two decimals.
1670
+
1671
+ = 4.5.7 =
1672
+ When a suffix was placed behind an attribute on the field mapping page, no space was put between the attribute value and the suffix for CSV feeds only. This has been solved.
1673
+
1674
+ = 4.5.6 =
1675
+ When an user did not add the g:shipping field to their feed there is also no need to calculate the shipping prices per zone per products. So we removed this when this is the case. This results in an perfonce increase, processing the feeds.
1676
+
1677
+ = 4.5.5 =
1678
+ When users add an item_group_id to simple products this causes products to get disapproved in Google's merchant center. Build in a check that always removes the g:item_group_id for simple products.
1679
+
1680
+ = 4.5.4 =
1681
+ Fixed a bug: the attribute price incl. VAT did not always contained the price incl. VAT due to active caching plugins. This has been fixed now.
1682
+
1683
+ = 4.5.3 =
1684
+ Fixed a bug: in the attribute enable/disable settings page some attributes could not be enabled. Changing the settings was not saved. This has been fixed now.
1685
+
1686
+ = 4.5.2 =
1687
+ Added support for adding mutiple store codes to Google Local Product Inventory Feeds
1688
+
1689
+ = 4.5.1 =
1690
+ Removed Redis Object Caching support as it was causing issues with some of our users
1691
+
1692
+ = 4.5.0 =
1693
+ Added the possibility to add prefix and suffixes before and after the id
1694
+
1695
+ = 4.4.9 =
1696
+ Removed upgrade notices for members who bought an Elite license
1697
+
1698
+ = 4.4.8 =
1699
+ Fixed a bug: the Aelia currency switch enable/disable option was broken, it could not be turned off. This issue has been fixed.
1700
+
1701
+ = 4.4.7 =
1702
+ Fixed a bug: include_only filters on tags were not working. This issue has been fixed.
1703
+ Added compatibility for the Redit Object Caching plugin
1704
+ Added some more license checks
1705
+
1706
+ = 4.4.6 =
1707
+ Solved a PHP warning that showed up when creating filters on quantity fields
1708
+
1709
+ = 4.4.5 =
1710
+ Final preparations made for the launch of the Elite features. Added lots of notifications, help texts and utm parameters
1711
+
1712
+ = 4.4.4 =
1713
+ Added notifications to the manage feeds page with regards to the Elite features
1714
+
1715
+ = 4.4.3 =
1716
+ Disabled the chart feature for now as Chart.js seems to conflict with some theme's
1717
+
1718
+ = 4.4.2 =
1719
+ New feature: introduced a chart feature for every individual product feed showing the amount of products per feed after each refresh.
1720
+
1721
+ = 4.4.1 =
1722
+ Fixed a bug: rules to change shipping costs for non Google shopping/Facebook feeds where not working. This issue has been fixed now.
1723
+
1724
+ = 4.4.0 =
1725
+ Fixed a bug: manually entered Aelia prices for variation products did not make it to the product feed. This issue has been fixed now.
1726
+
1727
+ = 4.3.9 =
1728
+ Fixed a bug: when a shipping zone was applicable for multiple countries it only put in the last country in the feed. This issue has been fixed now.
1729
+
1730
+ = 4.3.8 =
1731
+ Removed the template for Google Product Review Feeds as it was not fiished yet
1732
+
1733
+ = 4.3.7 =
1734
+ Fixed a bug: Aelia base currency was always showing as a shipping currency prefix after updating the currency setting of a product feed. This has been fixed now.
1735
+
1736
+ = 4.3.6 =
1737
+ Fixed a bug: there was a double currency prefix with shipping costs. This has been solved.
1738
+
1739
+ = 4.3.5 =
1740
+ Added Aelia exchange rate features for shipping costs
1741
+
1742
+ = 4.3.4 =
1743
+ Further improved support for the Aelia currency switcher
1744
+
1745
+ = 4.3.3 =
1746
+ Improved support for the Aelia currency switcher, the plugin now also accepts manually entered prices (regular and sale price)
1747
+
1748
+ = 4.3.2 =
1749
+ Fixed a bug: exclude rules that were set on product attributes that were empty did not work. Issue has been fixed.
1750
+ Another attempt to fix the variable mismatch issue
1751
+
1752
+ = 4.3.1 =
1753
+ Fixed the variable mismatch error that existed for users who also used WPML
1754
+
1755
+ = 4.3.0 =
1756
+ Added support for the Latvia Comparison Shopping Engine Salidzini.lv
1757
+
1758
+ = 4.2.9 =
1759
+ Added links to relevant tutorials
1760
+ Added some license checks
1761
+
1762
+ = 4.2.8 =
1763
+ Fixed a bug: when a Free Shipping zone was configured and limited to certain postal code's and shipping was restricted to one country the free shipping did not end up in the feed. Issue has been fixed.
1764
+
1765
+ = 4.2.7 =
1766
+ Fixed a bug: adding static values in the attribute field mapping page was not working. Issue has been fixed.
1767
+
1768
+ = 4.2.6 =
1769
+ Added the override column to the Facebook feed template so besided the base Facebook feed one can now also create country and language override feeds for Facebook
1770
+
1771
+ = 4.2.5 =
1772
+ Adding suffixes to the link attribute contained a space. We have now changed this so the space gets removed, allowing you to append (static) paramaters to your URL
1773
+
1774
+ = 4.2.4 =
1775
+ The installment amount field was only accepting numbers and not floating numbers (with a . or ,). We have changed this so the field also accepts decimal values.
1776
+
1777
+ = 4.2.3 =
1778
+ Fixed a bug: The Google Analytics and AdTribes conversion tracking buttons did not save when changed. This issue has been solved.
1779
+
1780
+ = 4.2.2 =
1781
+ Added support for the Aelia Currency Switcher
1782
+
1783
+ = 4.2.1 =
1784
+ Added cascading mother / child category mapping feature
1785
+
1786
+ = 4.2.0 =
1787
+ Category mapping made even easier: as of this release it is possible to, with one go, copy existing category mappings to all other categories. This saves you valuable time when you want to map all your categories to one or just a few Google taxonomy categories.
1788
+
1789
+ = 4.1.9 =
1790
+ Added support (template) for the Italian Comparison website Trovaprezzi.it
1791
+
1792
+ = 4.1.8 =
1793
+ Replaced the jQuery UI icons by the official WP dashicons as some user reported not being able to see the jQuery UI icons as those got removed by there theme's
1794
+
1795
+ = 4.1.7 =
1796
+ Improved license-module of plugin
1797
+
1798
+ = 4.1.6 =
1799
+ Changed the inner workings of the 'contains' rules for the shipping field. Whereas previously this rule replaced the entire string now it does a proper string replace only replacing the exact 'contains' part of the rule.
1800
+ Fixed a bug: previously saved filters and rules on shipping fields got deleted when configuration changes were made to the feed. This issue has been solved now.
1801
+ Changed the plugin's icon in the WP-admin menu to our Adtribes.io logo
1802
+
1803
+ = 4.1.5 =
1804
+ Fixed a bug for Facebook CSV feeds where the identifier_exists field is not needed and caused some columns to contain the value "yes", always. This issue has been solved.
1805
+
1806
+ = 4.1.4 =
1807
+ Added multiply rule feature for shipping prices
1808
+ Added product review information to the plugin, this however cannot be used for feeds yet
1809
+ Prepared the plugin for launch of the paid Elte features
1810
+
1811
+ = 4.1.3 =
1812
+ Fixed a bug for the Zap.co.il template
1813
+
1814
+ = 4.1.2 =
1815
+ Fixed a bug for the Zap.co.il template
1816
+
1817
+ = 4.1.1 =
1818
+ Fixed a bug: rules and filters could not be deleted. This issue has been fixed.
1819
+
1820
+ = 4.1.0 =
1821
+ Fixed another rules and filter display bug
1822
+
1823
+ = 4.0.9 =
1824
+ Added a default feed template for the Israelian price comparison Zap.co.il
1825
+
1826
+ = 4.0.8 =
1827
+ Fixed a rule displaying bug. The rule was actually working fine but it was not showing in the configuration page.
1828
+
1829
+ = 4.0.7 =
1830
+ We have added WooCommerce Multilingual support, especially the currency switcher. WooCommerce Multilangual is an addition onto the popular WPML-plugin
1831
+ We have improved our WPML support (version 4.1 and higher)
1832
+
1833
+ = 4.0.6 =
1834
+ Added a Google Shopping tutorial to the plugin
1835
+
1836
+ = 4.0.5 =
1837
+ Switched On/Off title's of toggle's
1838
+ Cleaned-up HTML of the Google Analytics configuration page so no variable mismatch will show after submitting this page.
1839
+
1840
+ = 4.0.4 =
1841
+ Cleaned-up HTML of the rules and filter pages and made some changes to the jQuery checks for that functionality. Hoping it will take away the variable mismatch detection.
1842
+ Fixed a bug: Byte Order Marks where added to every line for CSV feeds whereas it should only appear only once. This issue has been fixed.
1843
+
1844
+ = 4.0.3 =
1845
+ Improved the way the plugin cleans up the description and short description attributes from HTML. It now replaces some of the HTML with whitespaces instead of just removing it making the description and short description better to read.
1846
+ Thanks Stan B. for your suggestion. Much appreciated!
1847
+
1848
+ = 4.0.2 =
1849
+ Another attempt to get rid of the "variable mismatch detection"
1850
+
1851
+ = 4.0.1 =
1852
+ Added form tags to the allowed HTML keys using the wp_kses_allowed_html function as they had been removed in the WP 5.01 release. This solves the "A variable mismatch has been detected" error.
1853
+
1854
  = 4.0.0 =
1855
  Fixed another issue with cached prices ending up in product feeds.
1856
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
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
@@ -10,13 +10,15 @@
10
  * Developer: Joris Verwater, Eva van Gelooven
11
  * License: GPL3
12
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
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
@@ -43,10 +45,12 @@ if (!defined('ABSPATH')) {
43
  }
44
 
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' ) ) {
52
  define( 'WOOCOMMERCESEA_FILE', __FILE__ );
@@ -60,6 +64,11 @@ if ( ! defined( 'WOOCOMMERCESEA_BASENAME' ) ) {
60
  define( 'WOOCOMMERCESEA_BASENAME', plugin_basename( WOOCOMMERCESEA_FILE ) );
61
  }
62
 
 
 
 
 
 
63
  /**
64
  * Enqueue css assets
65
  */
@@ -85,37 +94,48 @@ function woosea_scripts($hook) {
85
  wp_enqueue_script('jquery-ui-dialog');
86
  wp_enqueue_script('jquery-ui-calender');
87
 
88
- // Bootstrap typeahead
89
- wp_register_script( 'typeahead-js', plugin_dir_url( __FILE__ ) . 'js/typeahead.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
90
- wp_enqueue_script( 'typeahead-js' );
 
 
 
 
 
 
 
 
 
 
91
 
92
- // JS for adding input field validation
93
- wp_register_script( 'woosea_validation-js', plugin_dir_url( __FILE__ ) . 'js/woosea_validation.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
94
- wp_enqueue_script( 'woosea_validation-js' );
95
 
96
- // JS for autocomplete
97
- wp_register_script( 'woosea_autocomplete-js', plugin_dir_url( __FILE__ ) . 'js/woosea_autocomplete.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
98
- wp_enqueue_script( 'woosea_autocomplete-js' );
99
 
100
- // JS for adding table rows to the rules page
101
- wp_register_script( 'woosea_rules-js', plugin_dir_url( __FILE__ ) . 'js/woosea_rules.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
102
- wp_enqueue_script( 'woosea_rules-js' );
103
 
104
- // JS for adding table rows to the field mappings page
105
- wp_register_script( 'woosea_field_mapping-js', plugin_dir_url( __FILE__ ) . 'js/woosea_field_mapping.js', '', WOOCOMMERCESEA_PLUGIN_VERSION, true );
106
- wp_enqueue_script( 'woosea_field_mapping-js' );
107
 
108
- // JS for getting channels
109
- wp_register_script( 'woosea_channel-js', plugin_dir_url( __FILE__ ) . 'js/woosea_channel.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
110
- wp_enqueue_script( 'woosea_channel-js' );
111
 
112
- // JS for manage projects page
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
 
@@ -144,11 +164,16 @@ function woosea_plugin_action_links($links, $file) {
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);
@@ -343,9 +368,13 @@ function woosea_request_review(){
343
  $current_time = time();
344
  $show_after = 604800; // Show only after one week
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
  }
@@ -429,11 +458,15 @@ add_action( 'woosea_check_license', 'woosea_license_valid'); // check if license
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
  /**
@@ -466,16 +499,6 @@ add_action( 'wp_ajax_woosea_ajax', 'woosea_ajax' );
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 ;
@@ -487,8 +510,9 @@ function woosea_categories_dropdown() {
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>";
@@ -511,6 +535,58 @@ function woosea_save_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
@@ -529,12 +605,13 @@ function woosea_add_cat_mapping() {
529
  // This is during the configuration of a new feed
530
  if(empty($project)){
531
  $project_temp = get_option( 'channel_project' );
532
- $project['mappings'][$rowCount]['rowCount'] = $rowCount;
533
- $project['mappings'][$rowCount]['categoryId'] = $rowCount;
534
- $project['mappings'][$rowCount]['criteria'] = $criteria;
535
- $project['mappings'][$rowCount]['map_to_category'] = $map_to_category;
536
- $project_fill = array_merge($project_temp, $project);
537
- update_option( 'channel_project',$project_fill,'','yes');
 
538
  $status_mapping = "true";
539
  // This is updating an existing product feed
540
  } else {
@@ -580,6 +657,16 @@ function woosea_register_license(){
580
  'license_key' => $license_key,
581
  'notice' => $notice,
582
  );
 
 
 
 
 
 
 
 
 
 
583
  update_option("license_information", $license_information);
584
 
585
  }
@@ -637,6 +724,19 @@ function woosea_product_delete_meta_price( $product = null ) {
637
  $shop_url = home_url();
638
  $shop_currency = get_woocommerce_currency();
639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  if($structured_data_fix == "yes"){
641
 
642
  $pr_woo = wc_get_price_to_display($product);
@@ -646,6 +746,7 @@ function woosea_product_delete_meta_price( $product = null ) {
646
 
647
  // Get product condition
648
  $condition = ucfirst( get_post_meta( $product_id, '_woosea_condition', true ) );
 
649
  if(!$condition){
650
  $json_condition = "NewCondition";
651
  } else {
@@ -676,7 +777,31 @@ function woosea_product_delete_meta_price( $product = null ) {
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 ) );
@@ -708,6 +833,7 @@ function woosea_product_delete_meta_price( $product = null ) {
708
  'name' => $shop_name,
709
  'url' => $shop_url,
710
  ),
 
711
  );
712
  } else {
713
  // AggregateOffer
@@ -730,6 +856,7 @@ function woosea_product_delete_meta_price( $product = null ) {
730
  'name' => $shop_name,
731
  'url' => $shop_url,
732
  ),
 
733
  );
734
  } else {
735
  $markup_offer = array(
@@ -747,6 +874,7 @@ function woosea_product_delete_meta_price( $product = null ) {
747
  'name' => $shop_name,
748
  'url' => $shop_url,
749
  ),
 
750
  );
751
  }
752
  }
@@ -761,18 +889,43 @@ function woosea_product_delete_meta_price( $product = null ) {
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',
766
  'name' => $shop_name,
767
  'url' => $shop_url,
768
  ),
 
769
  );
770
 
771
  }
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' ),
@@ -784,6 +937,7 @@ function woosea_product_delete_meta_price( $product = null ) {
784
  'name' => $shop_name,
785
  'url' => $shop_url,
786
  ),
 
787
  );
788
  }
789
  // }
@@ -945,7 +1099,7 @@ function woosea_project_cancel(){
945
  $feed_config[$key]['last_updated'] = date("d M Y H:i");
946
 
947
  // In 1 minute from now check the amount of products in the feed and update the history count
948
- wp_schedule_single_event( time() + 60, 'woosea_update_project_stats', array($val['project_hash']) );
949
  }
950
  }
951
  update_option( 'cron_projects', $feed_config);
@@ -961,7 +1115,7 @@ function woosea_project_processing_status(){
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"){
@@ -1082,7 +1236,7 @@ function woosea_add_attributes() {
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
@@ -1146,7 +1300,7 @@ add_action( 'wp_ajax_woosea_project_status', 'woosea_project_status' );
1146
  */
1147
  function woosea_review_notification() {
1148
  // Update review notification status
1149
- update_option( 'woosea_review_interaction', 'yes');
1150
  }
1151
  add_action( 'wp_ajax_woosea_review_notification', 'woosea_review_notification' );
1152
 
@@ -1164,6 +1318,20 @@ function woosea_enable_structured_data (){
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
@@ -1179,6 +1347,21 @@ function woosea_add_wpml (){
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
@@ -1223,6 +1406,31 @@ function woosea_add_identifiers (){
1223
  }
1224
  add_action( 'wp_ajax_woosea_add_identifiers', 'woosea_add_identifiers' );
1225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1226
  /**
1227
  * This function add the actual fields to the edit product page for single products
1228
  * identifiers GTIN, MPN, EAN, UPC, Brand and Condition
@@ -1375,18 +1583,17 @@ add_action( 'woocommerce_product_options_general_product_data', 'woosea_custom_g
1375
  * This function saves the input from the extra fields on the single product edit page
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 {
@@ -1968,6 +2175,52 @@ add_action( 'wp_ajax_woosea_autocomplete_mapping', 'woosea_autocomplete_mapping'
1968
  * Some cases are left blank for future steps and pages in the configurations process
1969
  */
1970
  function woosea_generate_pages(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1971
  if (!$_POST){
1972
  $generate_step = 0;
1973
  } else {
@@ -2103,7 +2356,7 @@ function woosea_license_valid(){
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,
@@ -2128,14 +2381,24 @@ function woosea_license_valid(){
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
  }
@@ -2468,6 +2731,11 @@ function woosea_my_rss_box() {
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 );
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 5.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
10
  * Developer: Joris Verwater, Eva van Gelooven
11
  * License: GPL3
12
  * License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
+ * Requires at least: 4.5
14
+ * Tested up to: 5.1
15
+ *
16
+ * Text Domain: woo-product-feed-pro
17
  * Domain Path: /languages
18
+ *
19
  * WC requires at least: 3.0
20
  * WC tested up to: 3.5
21
+ *
 
 
22
  * Product Feed PRO for WooCommerce is free software: you can redistribute it and/or modify
23
  * it under the terms of the GNU General Public License as published by
24
  * the Free Software Foundation, either version 3 of the License, or
45
  }
46
 
47
  /**
48
+ * Plugin versionnumber, please do not override.
49
+ * Define some constants
50
  */
51
+ define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '5.0.0' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
+ define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
55
  if ( ! defined( 'WOOCOMMERCESEA_FILE' ) ) {
56
  define( 'WOOCOMMERCESEA_FILE', __FILE__ );
64
  define( 'WOOCOMMERCESEA_BASENAME', plugin_basename( WOOCOMMERCESEA_FILE ) );
65
  }
66
 
67
+ if ( ! defined( 'WOOCOMMERCESEA_PLUGIN_URL' ) ) {
68
+ define( 'WOOCOMMERCESEA_PLUGIN_URL', plugins_url() . '/' . WOOCOMMERCESEA_PLUGIN_NAME_SHORT );
69
+ }
70
+
71
+
72
  /**
73
  * Enqueue css assets
74
  */
94
  wp_enqueue_script('jquery-ui-dialog');
95
  wp_enqueue_script('jquery-ui-calender');
96
 
97
+ // Only register and enqueue JS scripts from within the plugin itself
98
+ if (preg_match("/product-feed-pro/i",$hook)){
99
+ // JS files for ChartJS
100
+ wp_register_script( 'woosea_chart-bundle-js', plugin_dir_url( __FILE__ ) . 'js/Chart.bundle.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
101
+ wp_enqueue_script( 'woosea_chart-bundle-js' );
102
+
103
+ // Minimized JS files for ChartJS
104
+ wp_register_script( 'woosea_chart-bundle-min-js', plugin_dir_url( __FILE__ ) . 'js/Chart.bundle.min.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
105
+ wp_enqueue_script( 'woosea_chart-bundle-min-js' );
106
+
107
+ // Bootstrap typeahead
108
+ wp_register_script( 'typeahead-js', plugin_dir_url( __FILE__ ) . 'js/typeahead.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
109
+ wp_enqueue_script( 'typeahead-js' );
110
 
111
+ // JS for adding input field validation
112
+ wp_register_script( 'woosea_validation-js', plugin_dir_url( __FILE__ ) . 'js/woosea_validation.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
113
+ wp_enqueue_script( 'woosea_validation-js' );
114
 
115
+ // JS for autocomplete
116
+ wp_register_script( 'woosea_autocomplete-js', plugin_dir_url( __FILE__ ) . 'js/woosea_autocomplete.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
117
+ wp_enqueue_script( 'woosea_autocomplete-js' );
118
 
119
+ // JS for adding table rows to the rules page
120
+ wp_register_script( 'woosea_rules-js', plugin_dir_url( __FILE__ ) . 'js/woosea_rules.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
121
+ wp_enqueue_script( 'woosea_rules-js' );
122
 
123
+ // JS for adding table rows to the field mappings page
124
+ wp_register_script( 'woosea_field_mapping-js', plugin_dir_url( __FILE__ ) . 'js/woosea_field_mapping.js', '', WOOCOMMERCESEA_PLUGIN_VERSION, true );
125
+ wp_enqueue_script( 'woosea_field_mapping-js' );
126
 
127
+ // JS for getting channels
128
+ wp_register_script( 'woosea_channel-js', plugin_dir_url( __FILE__ ) . 'js/woosea_channel.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
129
+ wp_enqueue_script( 'woosea_channel-js' );
130
 
131
+ // JS for manage projects page
132
+ wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
133
+ wp_enqueue_script( 'woosea_manage-js' );
134
 
135
+ // JS for managing keys
136
+ wp_register_script( 'woosea_key-js', plugin_dir_url( __FILE__ ) . 'js/woosea_key.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
137
+ wp_enqueue_script( 'woosea_key-js' );
138
+ }
139
  }
140
  add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
141
 
164
  if ($file == $this_plugin) {
165
 
166
  // link to what ever you want
167
+ $host = $_SERVER['HTTP_HOST'];
168
+ $plugin_links[] = '<a href="https://adtribes.io/support/?utm_source='.$host.'&utm_medium=pluginpage&utm_campaign=support" target="_blank">Support</a>';
169
+ $plugin_links[] = '<a href="https://adtribes.io/blog/?utm_source='.$host.'&utm_medium=pluginpage&utm_campaign=blog" target="_blank">Blog</a>';
170
+
171
+ $license_information = get_option( 'license_information' );
172
+ if($license_information['license_valid'] <> "true"){
173
+ $plugin_links[] = '<a href="https://adtribes.io/pro-vs-elite/?utm_source='.$host.'&utm_medium=pluginpage&utm_campaign=go elite" target="_blank" style="color:green;"><b>Go Elite</b></a>';
174
+ $plugin_links[] = '<a href="https://adtribes.io/pro-vs-elite/?utm_source='.$host.'&utm_medium=pluginpage&utm_campaign=premium support" target="_blank">Premium Support</a>';
175
+ }
176
+
177
  // add the links to the list of links already there
178
  foreach($plugin_links as $link) {
179
  array_unshift($links, $link);
368
  $current_time = time();
369
  $show_after = 604800; // Show only after one week
370
  $is_active = $current_time-$first_activation;
371
+ $page = basename($_SERVER['REQUEST_URI']);
372
 
373
+ if (preg_match("/woo-product-feed-pro|woosea_manage_feed|woosea_manage_settings/i",$page)){
374
+
375
+ if(($nr_projects > 0) AND ($is_active > $show_after) AND ($notification_interaction != "yes")){
376
+ 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 our 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 Eva and me a BIG favor and give it a 5-star rating on WordPress? Just to help us spread the word and boost our motivation.<br/>~ Eva and Joris<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>';
377
+ }
378
  }
379
  }
380
  }
458
  * Add WooCommerce SEA plugin to Menu
459
  */
460
  function woosea_menu_addition(){
461
+ add_menu_page(__('Product Feed PRO for WooCommerce', 'woosea-feed'), __('Product Feed Pro', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages', esc_url( WOOCOMMERCESEA_PLUGIN_URL . '/images/icon-16x16.png'),99);
462
+ add_submenu_page(__FILE__, __('Feed configuration', 'woosea-feed'), __('Create feed', 'woosea-feed'), 'manage_options', __FILE__, 'woosea_generate_pages');
463
+ add_submenu_page(__FILE__, __('Manage feeds', 'woosea-feed'), __('Manage feeds', 'woosea-feed'), 'manage_options', 'woosea_manage_feed', 'woosea_manage_feed');
464
+ add_submenu_page(__FILE__, __('Settings', 'woosea-feed'), __('Settings', 'woosea-feed'), 'manage_options', 'woosea_manage_settings', 'woosea_manage_settings');
465
+
466
+ $license_information = get_option( 'license_information' );
467
+ if($license_information['license_valid'] <> "true"){
468
+ add_submenu_page(__FILE__, __('Upgrade to Elite', 'woosea-elite-feed'), __('Upgrade to Elite', 'woosea-elite-feed'), 'manage_options', 'woosea_manage_settings&tab=woosea_license_check', 'woosea_upgrade_elite');
469
+ }
470
  }
471
 
472
  /**
499
  function woosea_categories_dropdown() {
500
  $rowCount = sanitize_text_field($_POST['rowCount']);
501
 
 
 
 
 
 
 
 
 
 
 
502
  $orderby = 'name';
503
  $order = 'asc';
504
  $hide_empty = false ;
510
 
511
  $categories_dropdown = "<select name=\"rules[$rowCount][criteria]\">";
512
  $product_categories = get_terms( 'product_cat', $cat_args );
513
+
514
  foreach ($product_categories as $key => $category) {
515
+ $categories_dropdown .= "<option value=\"$category->name\">$category->name ($category->slug)</option>";
516
 
517
  }
518
  $categories_dropdown .= "</select>";
535
  }
536
  add_action( 'wp_ajax_woosea_save_adwords_conversion_id', 'woosea_save_adwords_conversion_id' );
537
 
538
+ /**
539
+ * Mass map categories to the correct Google Shopping category taxonomy
540
+ */
541
+ function woosea_add_mass_cat_mapping(){
542
+ $project_hash = sanitize_text_field($_POST['project_hash']);
543
+ $catMappings = $_POST['catMappings'];
544
+
545
+ // I need to sanitize the catMappings Array
546
+ $mappings = array();
547
+ foreach ($catMappings as $mKey => $mVal){
548
+ $mKey = sanitize_text_field($mKey);
549
+ $mVal = sanitize_text_field($mVal);
550
+ $piecesVal = explode("||", $mVal);
551
+ $mappings[$piecesVal[1]] = array(
552
+ "rowCount" => $piecesVal[1],
553
+ "categoryId" => $piecesVal[1],
554
+ "criteria" => $piecesVal[0],
555
+ "map_to_category" => $piecesVal[2],
556
+
557
+ );
558
+ }
559
+
560
+ $project = WooSEA_Update_Project::get_project_data(sanitize_text_field($project_hash));
561
+ // This happens during configuration of a new feed
562
+ if(empty($project)){
563
+ $project_temp = get_option( 'channel_project' );
564
+ if(array_key_exists('mappings', $project_temp)){
565
+ $project_temp['mappings'] = $mappings + $project_temp['mappings'];
566
+ } else {
567
+ $project_temp['mappings'] = $mappings;
568
+ }
569
+ update_option( 'channel_project',$project_temp,'','yes');
570
+ } else {
571
+ // Only update the ones that changed
572
+ foreach ($mappings as $categoryId => $catArray){
573
+ if (array_key_exists($categoryId, $project['mappings'])){
574
+ $project['mappings'][$categoryId] = $catArray;
575
+ } else {
576
+ $project['mappings'][$categoryId] = $catArray;
577
+ }
578
+ }
579
+ $project_updated = WooSEA_Update_Project::update_project_data($project);
580
+ }
581
+ $data = array (
582
+ 'status_mapping' => "true",
583
+ );
584
+
585
+ echo json_encode($data);
586
+ wp_die();
587
+
588
+ }
589
+ add_action( 'wp_ajax_woosea_add_mass_cat_mapping', 'woosea_add_mass_cat_mapping' );
590
 
591
  /**
592
  * Map categories to the correct Google Shopping category taxonomy
605
  // This is during the configuration of a new feed
606
  if(empty($project)){
607
  $project_temp = get_option( 'channel_project' );
608
+
609
+ $project_temp['mappings'][$rowCount]['rowCount'] = $rowCount;
610
+ $project_temp['mappings'][$rowCount]['categoryId'] = $rowCount;
611
+ $project_temp['mappings'][$rowCount]['criteria'] = $criteria;
612
+ $project_temp['mappings'][$rowCount]['map_to_category'] = $map_to_category;
613
+
614
+ update_option( 'channel_project',$project_temp,'','yes');
615
  $status_mapping = "true";
616
  // This is updating an existing product feed
617
  } else {
657
  'license_key' => $license_key,
658
  'notice' => $notice,
659
  );
660
+
661
+ if($license_valid == "false"){
662
+ // The Elite settings get disabled when license is not valid
663
+ delete_option ('structured_data_fix');
664
+ delete_option ('structured_vat');
665
+ delete_option ('add_unique_identifiers');
666
+ delete_option ('add_wpml_support');
667
+ delete_option ('add_aelia_support');
668
+ }
669
+
670
  update_option("license_information", $license_information);
671
 
672
  }
724
  $shop_url = home_url();
725
  $shop_currency = get_woocommerce_currency();
726
 
727
+ // Sisplay URL of current page.
728
+ if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
729
+ $link = "https";
730
+ } else {
731
+ $link = "http";
732
+ }
733
+ // Here append the common URL characters.
734
+ $link .= "://";
735
+ // Append the host(domain name, ip) to the URL.
736
+ $link .= $_SERVER['HTTP_HOST'];
737
+ // Append the requested resource location to the URL
738
+ $link .= $_SERVER['REQUEST_URI'];
739
+
740
  if($structured_data_fix == "yes"){
741
 
742
  $pr_woo = wc_get_price_to_display($product);
746
 
747
  // Get product condition
748
  $condition = ucfirst( get_post_meta( $product_id, '_woosea_condition', true ) );
749
+
750
  if(!$condition){
751
  $json_condition = "NewCondition";
752
  } else {
777
 
778
  if(is_object( $variable_product ) ) {
779
  // Structured data error here, it ignores VAT when prices has been entered without VAT
780
+
781
+ $qty = 1;
782
+ $product_price = wc_get_price_to_display($variable_product, array('qty' => $qty));
783
+ $tax_rates = WC_Tax::get_base_tax_rates( $product->get_tax_class() );
784
+
785
+ // Workaround for price caching issues
786
+ if(!empty($tax_rates)){
787
+ foreach ($tax_rates as $tk => $tv){
788
+ if($tv['rate'] > 0){
789
+
790
+ $structured_vat = get_option ('structured_vat');
791
+ if($structured_vat == "yes"){
792
+ $tax_rates[1]['rate'] = 0;
793
+ } else {
794
+ $tax_rates[1]['rate'] = $tv['rate'];
795
+ }
796
+ } else {
797
+ $tax_rates[1]['rate'] = 0;
798
+ }
799
+ }
800
+ } else {
801
+ $tax_rates[1]['rate'] = 0;
802
+ }
803
+ $product_price = wc_get_price_excluding_tax($variable_product,array('price'=> $variable_product->get_price())) * (100+$tax_rates[1]['rate'])/100;
804
+ $product_price = round($product_price, 2);
805
 
806
  // Get product condition
807
  $condition = ucfirst( get_post_meta( $variation_id, '_woosea_condition', true ) );
833
  'name' => $shop_name,
834
  'url' => $shop_url,
835
  ),
836
+ 'url' => $link
837
  );
838
  } else {
839
  // AggregateOffer
856
  'name' => $shop_name,
857
  'url' => $shop_url,
858
  ),
859
+ 'url' => $link
860
  );
861
  } else {
862
  $markup_offer = array(
874
  'name' => $shop_name,
875
  'url' => $shop_url,
876
  ),
877
+ 'url' => $link
878
  );
879
  }
880
  }
889
  'price' => $product_price,
890
  'priceCurrency' => $shop_currency,
891
  'availability' => 'https://schema.org/' . ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
892
+ 'sku' => $product->get_sku(),
893
+ 'seller' => array(
894
  '@type' => 'Organization',
895
  'name' => $shop_name,
896
  'url' => $shop_url,
897
  ),
898
+ 'url' => $link
899
  );
900
 
901
  }
902
  } else {
903
+ // Workaround for price caching issues
904
+ $tax_rates = WC_Tax::get_base_tax_rates( $product->get_tax_class() );
905
+
906
+ if(!empty($tax_rates)){
907
+ foreach ($tax_rates as $tk => $tv){
908
+ if($tv['rate'] > 0){
909
+
910
+ $structured_vat = get_option ('structured_vat');
911
+ if($structured_vat == "yes"){
912
+ $tax_rates[1]['rate'] = 0;
913
+ } else {
914
+ $tax_rates[1]['rate'] = $tv['rate'];
915
+ }
916
+ } else {
917
+ $tax_rates[1]['rate'] = 0;
918
+ }
919
+ }
920
+ } else {
921
+ $tax_rates[1]['rate'] = 0;
922
+ }
923
+ $product_price = wc_get_price_excluding_tax($product,array('price'=> $product->get_price())) * (100+$tax_rates[1]['rate'])/100;
924
+ $product_price = round($product_price, 2);
925
+
926
  $markup_offer = array(
927
  '@type' => 'Offer',
928
+ 'price' => $product_price,
929
  'priceCurrency' => $shop_currency,
930
  'itemCondition' => 'http://schema.org/'.$json_condition.'',
931
  'availability' => 'https://schema.org/' . $stock = ( $product->is_in_stock() ? 'InStock' : 'OutOfStock' ),
937
  'name' => $shop_name,
938
  'url' => $shop_url,
939
  ),
940
+ 'url' => $link
941
  );
942
  }
943
  // }
1099
  $feed_config[$key]['last_updated'] = date("d M Y H:i");
1100
 
1101
  // In 1 minute from now check the amount of products in the feed and update the history count
1102
+ wp_schedule_single_event( time() + 60, 'woosea_update_project_stats', array($val['project_hash']) );
1103
  }
1104
  }
1105
  update_option( 'cron_projects', $feed_config);
1115
  $proc_perc = 0;
1116
 
1117
  foreach ( $feed_config as $key => $val ) {
1118
+ if ($val['project_hash'] === $project_hash){
1119
  if($val['running'] == "ready"){
1120
  $proc_perc = 100;
1121
  } elseif($val['running'] == "not run yet"){
1236
  }
1237
  } else {
1238
  $extra_attributes = get_option( 'woosea_extra_attributes' );
1239
+ if(!in_array($attribute_name, $extra_attributes,TRUE)){
1240
  if($active == "true"){
1241
  $add_attribute = array (
1242
  $attribute_value => $attribute_name
1300
  */
1301
  function woosea_review_notification() {
1302
  // Update review notification status
1303
+ update_option( 'woosea_review_interaction', 'yes', 'yes');
1304
  }
1305
  add_action( 'wp_ajax_woosea_review_notification', 'woosea_review_notification' );
1306
 
1318
  }
1319
  add_action( 'wp_ajax_woosea_enable_structured_data', 'woosea_enable_structured_data' );
1320
 
1321
+ /**
1322
+ * This function enables the setting to remove VAT from
1323
+ * structured data prices
1324
+ */
1325
+ function woosea_structured_vat (){
1326
+ $status = sanitize_text_field($_POST['status']);
1327
+ if ($status == "off"){
1328
+ update_option( 'structured_vat', 'no', 'yes');
1329
+ } else {
1330
+ update_option( 'structured_vat', 'yes', 'yes');
1331
+ }
1332
+ }
1333
+ add_action( 'wp_ajax_woosea_structured_vat', 'woosea_structured_vat' );
1334
+
1335
  /**
1336
  * This function enables the setting to add
1337
  * WPML support
1347
  }
1348
  add_action( 'wp_ajax_woosea_add_wpml', 'woosea_add_wpml' );
1349
 
1350
+ /**
1351
+ * This function enables the setting to add
1352
+ * Aelia support
1353
+ */
1354
+ function woosea_add_aelia (){
1355
+ $status = sanitize_text_field($_POST['status']);
1356
+
1357
+ if ($status == "off"){
1358
+ update_option( 'add_aelia_support', 'no', 'yes');
1359
+ } else {
1360
+ update_option( 'add_aelia_support', 'yes', 'yes');
1361
+ }
1362
+ }
1363
+ add_action( 'wp_ajax_woosea_add_aelia', 'woosea_add_aelia' );
1364
+
1365
  /**
1366
  * This function enables the setting to use
1367
  * Mother main image for all product variations
1406
  }
1407
  add_action( 'wp_ajax_woosea_add_identifiers', 'woosea_add_identifiers' );
1408
 
1409
+
1410
+ /**
1411
+ * Add a title tab.
1412
+ */
1413
+ //add_filter( 'woocommerce_product_data_tabs', 'woosea_custom_product_tab', 10, 1 );
1414
+
1415
+ function woosea_custom_product_tab( $default_tabs ) {
1416
+ $default_tabs['custom_tab'] = array(
1417
+ 'label' => __( 'AdTribes.io Product Title', 'domain' ),
1418
+ 'target' => 'woosea_title_tab_data',
1419
+ 'priority' => 15,
1420
+ 'class' => array()
1421
+ );
1422
+ return $default_tabs;
1423
+ }
1424
+
1425
+ //add_action( 'woocommerce_product_data_panels', 'woosea_title_tab_data' );
1426
+
1427
+ function woosea_title_tab_data() {
1428
+ echo '<div id="woosea_title_tab_data" class="panel woocommerce_options_panel">';
1429
+ echo 'blat';
1430
+ echo '</div>';
1431
+ }
1432
+
1433
+
1434
  /**
1435
  * This function add the actual fields to the edit product page for single products
1436
  * identifiers GTIN, MPN, EAN, UPC, Brand and Condition
1583
  * This function saves the input from the extra fields on the single product edit page
1584
  */
1585
  function woosea_save_custom_general_fields($post_id){
1586
+ $woocommerce_brand = empty($_POST['_woosea_brand']) ? '' : sanitize_text_field($_POST['_woosea_brand']);
1587
+ $woocommerce_gtin = empty($_POST['_woosea_gtin']) ? '' : sanitize_text_field($_POST['_woosea_gtin']);
1588
+ $woocommerce_upc = empty($_POST['_woosea_upc']) ? '' : sanitize_text_field($_POST['_woosea_upc']);
1589
+ $woocommerce_mpn = empty($_POST['_woosea_mpn']) ? '' : sanitize_text_field($_POST['_woosea_mpn']);
1590
+ $woocommerce_ean = empty($_POST['_woosea_ean']) ? '' : sanitize_text_field($_POST['_woosea_ean']);
1591
+ $woocommerce_title = empty($_POST['_woosea_optimized_title']) ? '' : sanitize_text_field($_POST['_woosea_optimized_title']);
1592
+ $woocommerce_unit_pricing_measure = empty($_POST['_woosea_unit_pricing_measure']) ? '' : sanitize_text_field($_POST['_woosea_unit_pricing_measure']);
1593
+ $woocommerce_unit_pricing_base_measure = empty($_POST['_woosea_unit_pricing_base_measure']) ? '' : sanitize_text_field($_POST['_woosea_unit_pricing_base_measure']);
1594
+ $woocommerce_installment_months = empty($_POST['_woosea_installment_months']) ? '' : sanitize_text_field($_POST['_woosea_installment_months']);
1595
+ $woocommerce_installment_amount = empty($_POST['_woosea_installment_amount']) ? '' : sanitize_text_field($_POST['_woosea_installment_amount']);
1596
+ $woocommerce_condition = empty($_POST['_woosea_condition']) ? '' : sanitize_text_field($_POST['_woosea_condition']);
 
1597
  if(!empty($_POST['_woosea_exclude_product'])){
1598
  $woocommerce_exclude_product = sanitize_text_field($_POST['_woosea_exclude_product']);
1599
  } else {
2175
  * Some cases are left blank for future steps and pages in the configurations process
2176
  */
2177
  function woosea_generate_pages(){
2178
+
2179
+ /**
2180
+ * Since WP 4.99 form elements are no longer allowed tags for non-admin users
2181
+ * With the function below we add the form elements again to the allowed tags
2182
+ **/
2183
+ if(!function_exists('woosea_add_allowed_tags')) {
2184
+ function woosea_add_allowed_tags($tags) {
2185
+ // form
2186
+ $tags['form'] = array(
2187
+ 'action' => true,
2188
+ 'accept' => true,
2189
+ 'accept-charset' => true,
2190
+ 'enctype' => true,
2191
+ 'method' => true,
2192
+ 'name' => true,
2193
+ 'target' => true,
2194
+ 'id' => true,
2195
+ 'class' => true,
2196
+ );
2197
+
2198
+ // input
2199
+ $tags['input'] = array(
2200
+ 'class' => true,
2201
+ 'id' => true,
2202
+ 'name' => true,
2203
+ 'value' => true,
2204
+ 'type' => true,
2205
+ );
2206
+ // select
2207
+ $tags['select'] = array(
2208
+ 'class' => true,
2209
+ 'id' => true,
2210
+ 'name' => true,
2211
+ 'value' => true,
2212
+ 'type' => true,
2213
+ );
2214
+ // select options
2215
+ $tags['option'] = array(
2216
+ 'selected' => true,
2217
+ );
2218
+ return $tags;
2219
+ }
2220
+ add_filter('wp_kses_allowed_html', 'woosea_add_allowed_tags');
2221
+ }
2222
+ $allowed_tags = wp_kses_allowed_html( 'post' );
2223
+
2224
  if (!$_POST){
2225
  $generate_step = 0;
2226
  } else {
2356
  $license_information = get_option('license_information');
2357
 
2358
  $curl = curl_init();
2359
+ $url = "https://www.adtribes.io/check/license.php?key=$license_information[license_key]&email=$license_information[license_email]&domain=$domain&version=5.0.0";
2360
 
2361
  curl_setopt_array($curl, array(
2362
  CURLOPT_RETURNTRANSFER => 1,
2381
  $license_information['notice'] = $json_return['notice'];
2382
 
2383
  update_option ('license_information', $license_information);
2384
+
2385
+ // The Elite settings get disabled when license is not valid
2386
+ delete_option ('structured_data_fix');
2387
+ delete_option ('add_unique_identifiers');
2388
+ delete_option ('add_wpml_support');
2389
+ delete_option ('add_aelia_support');
2390
  } else {
2391
+ if(empty($json_return)){
2392
+ $license_information['message'] = "Could not connect to AdTribes.io to validate your license. We will try again tomorrow.";
2393
+ $license_information['message_type'] = "notice notice-error is-dismissible";
2394
+ $license_information['license_valid'] = "true";
2395
+ $license_information['notice'] = "false";
2396
+ } else {
2397
+ $license_information['message'] = $json_return['message'];
2398
+ $license_information['message_type'] = $json_return['message_type'];
2399
+ $license_information['license_valid'] = "true";
2400
+ $license_information['notice'] = $json_return['notice'];
2401
+ }
2402
 
2403
  update_option ('license_information', $license_information);
2404
  }
2731
 
2732
  // Get a SimplePie feed object from the specified feed source.
2733
  $rss = fetch_feed( $feed );
2734
+
2735
+ $maxitems = 0;
2736
+ $rss_items = array();
2737
+ $rss_title = "";
2738
+
2739
  if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly
2740
  // Figure out how many total items there are, and choose a limit
2741
  $maxitems = $rss->get_item_quantity( 5 );