Version Description
Tested for compatibility with WooCommerce 5.8
Download this release
Release Info
Developer | jorisverwater |
Plugin | Product Feed PRO for WooCommerce |
Version | 10.7.9 |
Comparing to | |
See all releases |
Code changes from version 9.3.7 to 10.7.9
- TODO.txt +10 -3
- classes/channels/class-bing_shopping_promotions.php +105 -0
- classes/channels/class-facebook_drm.php +18 -1
- classes/channels/class-google_local_products.php +2 -2
- classes/channels/class-google_shopping.php +157 -7
- classes/channels/class-idealo.php +446 -0
- classes/channels/class-vivino.php +190 -0
- classes/class-activate.php +40 -13
- classes/class-attributes.php +61 -16
- classes/class-get-products.php +2026 -1395
- css/woosea_admin.css +4 -1
- js/woosea_add_cart.js +93 -0
- js/woosea_autocomplete.js +4 -4
- js/woosea_key.js +1 -2
- js/woosea_manage.js +135 -8
- pages/admin/woosea-generate-feed-step-0.php +3 -3
- pages/admin/woosea-generate-feed-step-1.php +3 -3
- pages/admin/woosea-generate-feed-step-4.php +3 -3
- pages/admin/woosea-manage-feed.php +27 -1
- pages/admin/woosea-manage-settings.php +181 -76
- readme.txt +904 -15
- woocommerce-sea.php +370 -107
TODO.txt
CHANGED
@@ -3,20 +3,27 @@ Missing some features you might like? Drop me a line at support@adtribes.io and
|
|
3 |
|
4 |
Tutorial / Blog posts:
|
5 |
- Explain all the different fields/attributes that can be selected from the drop-downs
|
|
|
6 |
|
7 |
Priority issues:
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
- License key input field needs to be a password field (asterixes)
|
|
|
|
|
9 |
- Add a preview option so only 5-10 products are being generated
|
10 |
- Own hosted plugin updating: https://rudrastyh.com/wordpress/self-hosted-plugin-update.html
|
11 |
- Google local product feed inventory in XML format (not just TXT like it is now)
|
12 |
- Add support for Multisites
|
13 |
- Add a filter on review score (and amount of reviews)
|
14 |
- Make extra woosea fields available for front-end usage
|
15 |
-
- Only update feed when changes to products have been made
|
16 |
- Add header to extra fields on product edit pages
|
17 |
- Add possibility to create OR rules
|
18 |
- Add support for Google My Business product feeds
|
19 |
-
- Build a better WP Cron check, current one is not good enough
|
20 |
- AMAZON integration:
|
21 |
- requires a professional seller account, 39 dollar a month, before being able to create a developer account
|
22 |
-
- only
|
3 |
|
4 |
Tutorial / Blog posts:
|
5 |
- Explain all the different fields/attributes that can be selected from the drop-downs
|
6 |
+
- product highlight / details article
|
7 |
|
8 |
Priority issues:
|
9 |
+
- Add automotive fields for Facebook feed, see: https://developers.facebook.com/docs/marketing-api/dynamic-ads-auto/auto-catalog/
|
10 |
+
- Autosuggest for category mapping broken
|
11 |
+
- Add AddToCart event on buttons again
|
12 |
+
- Add Vivino EXTRA fields, see: https://vivino.slab.com/public/posts/9gq0o3dg
|
13 |
+
- Local product feed - store code should also work with an attribute and not just static values
|
14 |
+
- Add Pinterest Tag; https://help.pinterest.com/nl/business/article/install-the-pinterest-tag
|
15 |
- License key input field needs to be a password field (asterixes)
|
16 |
+
- Allow adding multiple pictures to Yandex feeds, see:https://wordpress.org/support/topic/yandex-yml-support/#post-14344829
|
17 |
+
- A seperate FB pixel per WPML website / language
|
18 |
- Add a preview option so only 5-10 products are being generated
|
19 |
- Own hosted plugin updating: https://rudrastyh.com/wordpress/self-hosted-plugin-update.html
|
20 |
- Google local product feed inventory in XML format (not just TXT like it is now)
|
21 |
- Add support for Multisites
|
22 |
- Add a filter on review score (and amount of reviews)
|
23 |
- Make extra woosea fields available for front-end usage
|
|
|
24 |
- Add header to extra fields on product edit pages
|
25 |
- Add possibility to create OR rules
|
26 |
- Add support for Google My Business product feeds
|
|
|
27 |
- AMAZON integration:
|
28 |
- requires a professional seller account, 39 dollar a month, before being able to create a developer account
|
29 |
+
- only then we can use their MWS service needed to connect our plugin
|
classes/channels/class-bing_shopping_promotions.php
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings for Bing Shopping Promotions feeds
|
4 |
+
*/
|
5 |
+
class WooSEA_bing_shopping_promotions {
|
6 |
+
public $bing_attributes_promotions;
|
7 |
+
|
8 |
+
public static function get_channel_attributes() {
|
9 |
+
$sitename = get_option('blogname');
|
10 |
+
|
11 |
+
$bing_attributes_promotions = array(
|
12 |
+
"Feed fields" => array(
|
13 |
+
"promotion_id" => array(
|
14 |
+
"name" => "promotion_id",
|
15 |
+
"feed_name" => "promotion_id",
|
16 |
+
"format" => "required",
|
17 |
+
),
|
18 |
+
"product_applicability" => array(
|
19 |
+
"name" => "product_applicability",
|
20 |
+
"feed_name" => "product_applicability",
|
21 |
+
"format" => "required",
|
22 |
+
),
|
23 |
+
"offer_type" => array(
|
24 |
+
"name" => "offer_type",
|
25 |
+
"feed_name" => "offer_type",
|
26 |
+
"format" => "required",
|
27 |
+
),
|
28 |
+
"long_title" => array(
|
29 |
+
"name" => "long_title",
|
30 |
+
"feed_name" => "long_title",
|
31 |
+
"format" => "required",
|
32 |
+
),
|
33 |
+
"promotion_effective_dates" => array(
|
34 |
+
"name" => "promotion_effective_dates",
|
35 |
+
"feed_name" => "promotion_effective_dates",
|
36 |
+
"format" => "required",
|
37 |
+
),
|
38 |
+
"redemption_channel" => array(
|
39 |
+
"name" => "redemption_channel",
|
40 |
+
"feed_name" => "redemption_channel",
|
41 |
+
"format" => "required",
|
42 |
+
),
|
43 |
+
"promotional_display_dates" => array(
|
44 |
+
"name" => "promotional_display_dates",
|
45 |
+
"feed_name" => "promotional_display_dates",
|
46 |
+
"format" => "optional",
|
47 |
+
),
|
48 |
+
"minimum_purchase_amount" => array(
|
49 |
+
"name" => "minimum_purchase_amount",
|
50 |
+
"feed_name" => "minimum_purchase_amount",
|
51 |
+
"format" => "optional",
|
52 |
+
),
|
53 |
+
"generic_redemption_code" => array(
|
54 |
+
"name" => "generic_redemption_code",
|
55 |
+
"feed_name" => "generic_redemption_code",
|
56 |
+
"format" => "optional",
|
57 |
+
),
|
58 |
+
),
|
59 |
+
"Structured data attributes" => array(
|
60 |
+
"percent_off" => array(
|
61 |
+
"name" => "percent_off",
|
62 |
+
"feed_name" => "percent_off",
|
63 |
+
"format" => "optional",
|
64 |
+
),
|
65 |
+
"money_off_amount" => array(
|
66 |
+
"name" => "percent_off_amount",
|
67 |
+
"feed_name" => "percent_off_amount",
|
68 |
+
"format" => "optional",
|
69 |
+
),
|
70 |
+
"buy_this_quantity" => array(
|
71 |
+
"name" => "buy_this_quantity",
|
72 |
+
"feed_name" => "buy_this_quantity",
|
73 |
+
"format" => "optional",
|
74 |
+
),
|
75 |
+
"get_this_quantity_discounted" => array(
|
76 |
+
"name" => "get_this_quantity_discounted",
|
77 |
+
"feed_name" => "get_this_quantity_discounted",
|
78 |
+
"format" => "optional",
|
79 |
+
),
|
80 |
+
"free_shipping" => array(
|
81 |
+
"name" => "free_shipping",
|
82 |
+
"feed_name" => "free_shipping",
|
83 |
+
"format" => "optional",
|
84 |
+
),
|
85 |
+
"free_gift_value" => array(
|
86 |
+
"name" => "free_gift_value",
|
87 |
+
"feed_name" => "free_gift_value",
|
88 |
+
"format" => "optional",
|
89 |
+
),
|
90 |
+
"free_gift_description" => array(
|
91 |
+
"name" => "free_gift_description",
|
92 |
+
"feed_name" => "free_gift_description",
|
93 |
+
"format" => "optional",
|
94 |
+
),
|
95 |
+
"free_gift_item_id" => array(
|
96 |
+
"name" => "free_gift_item_id",
|
97 |
+
"feed_name" => "free_gift_item_id",
|
98 |
+
"format" => "optional",
|
99 |
+
),
|
100 |
+
),
|
101 |
+
);
|
102 |
+
return $bing_attributes_promotions;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
?>
|
classes/channels/class-facebook_drm.php
CHANGED
@@ -56,7 +56,7 @@ class WooSEA_facebook_drm {
|
|
56 |
"name" => "title",
|
57 |
"feed_name" => "g:title",
|
58 |
"format" => "required",
|
59 |
-
"woo_suggest" => "
|
60 |
),
|
61 |
"price" => array(
|
62 |
"name" => "price",
|
@@ -79,6 +79,12 @@ class WooSEA_facebook_drm {
|
|
79 |
"feed_name" => "g:brand",
|
80 |
"format" => "required",
|
81 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
"additional_image_link" => array(
|
83 |
"name" => "additional_image_link",
|
84 |
"feed_name" => "g:additional_image_link",
|
@@ -116,6 +122,12 @@ class WooSEA_facebook_drm {
|
|
116 |
"format" => "required",
|
117 |
"woo_suggest" => "categories",
|
118 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
"fb_product_category" => array(
|
120 |
"name" => "fb_product_category",
|
121 |
"feed_name" => "g:fb_product_category",
|
@@ -271,6 +283,11 @@ class WooSEA_facebook_drm {
|
|
271 |
"feed_name" => "g:inventory",
|
272 |
"format" => "optional",
|
273 |
),
|
|
|
|
|
|
|
|
|
|
|
274 |
"ingredients" => array(
|
275 |
"name" => "ingredients",
|
276 |
"feed_name" => "g:ingredients",
|
56 |
"name" => "title",
|
57 |
"feed_name" => "g:title",
|
58 |
"format" => "required",
|
59 |
+
"woo_suggest" => "mother_title",
|
60 |
),
|
61 |
"price" => array(
|
62 |
"name" => "price",
|
79 |
"feed_name" => "g:brand",
|
80 |
"format" => "required",
|
81 |
),
|
82 |
+
"identifier exists" => array(
|
83 |
+
"name" => "identifier_exists",
|
84 |
+
"feed_name" => "g:identifier_exists",
|
85 |
+
"woo_suggest" => "calculated",
|
86 |
+
"format" => "required",
|
87 |
+
),
|
88 |
"additional_image_link" => array(
|
89 |
"name" => "additional_image_link",
|
90 |
"feed_name" => "g:additional_image_link",
|
122 |
"format" => "required",
|
123 |
"woo_suggest" => "categories",
|
124 |
),
|
125 |
+
"product_type" => array(
|
126 |
+
"name" => "product_type",
|
127 |
+
"feed_name" => "g:product_type",
|
128 |
+
"format" => "required",
|
129 |
+
"woo_suggest" => "category_path",
|
130 |
+
),
|
131 |
"fb_product_category" => array(
|
132 |
"name" => "fb_product_category",
|
133 |
"feed_name" => "g:fb_product_category",
|
283 |
"feed_name" => "g:inventory",
|
284 |
"format" => "optional",
|
285 |
),
|
286 |
+
"quantity_to_sell_on_facebook" => array(
|
287 |
+
"name" => "quantity_to_sell_on_facebook",
|
288 |
+
"feed_name" => "g:quantity_to_sell_on_facebook",
|
289 |
+
"format" => "optional",
|
290 |
+
),
|
291 |
"ingredients" => array(
|
292 |
"name" => "ingredients",
|
293 |
"feed_name" => "g:ingredients",
|
classes/channels/class-google_local_products.php
CHANGED
@@ -12,8 +12,8 @@ class WooSEA_google_local_products {
|
|
12 |
$google_local_products = array(
|
13 |
"Local products fields" => array(
|
14 |
"Itemid" => array(
|
15 |
-
"name" => "
|
16 |
-
"feed_name" => "g:
|
17 |
"format" => "required",
|
18 |
"woo_suggest" => "id",
|
19 |
),
|
12 |
$google_local_products = array(
|
13 |
"Local products fields" => array(
|
14 |
"Itemid" => array(
|
15 |
+
"name" => "Id",
|
16 |
+
"feed_name" => "g:id",
|
17 |
"format" => "required",
|
18 |
"woo_suggest" => "id",
|
19 |
),
|
classes/channels/class-google_shopping.php
CHANGED
@@ -132,8 +132,8 @@ class WooSEA_google_shopping {
|
|
132 |
"Product type" => array(
|
133 |
"name" => "product_type",
|
134 |
"feed_name" => "g:product_type",
|
135 |
-
"format" => "
|
136 |
-
"woo_suggest" => "
|
137 |
),
|
138 |
),
|
139 |
"Product identifiers" => array(
|
@@ -244,11 +244,6 @@ class WooSEA_google_shopping {
|
|
244 |
),
|
245 |
),
|
246 |
"Shopping campaigns" => array(
|
247 |
-
"Adwords redirect (old)" => array(
|
248 |
-
"name" => "adwords_redirect",
|
249 |
-
"feed_name" => "g:adwords_redirect",
|
250 |
-
"format" => "optional",
|
251 |
-
),
|
252 |
"Ads redirect (new)" => array(
|
253 |
"name" => "ads_redirect",
|
254 |
"feed_name" => "g:ads_redirect",
|
@@ -309,6 +304,21 @@ class WooSEA_google_shopping {
|
|
309 |
"feed_name" => "g:ads_labels",
|
310 |
"format" => "optional",
|
311 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
),
|
313 |
"Shipping" => array(
|
314 |
"Shipping" => array(
|
@@ -356,6 +366,16 @@ class WooSEA_google_shopping {
|
|
356 |
"feed_name" => "g:max_handling_time",
|
357 |
"format" => "optional",
|
358 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
),
|
360 |
"Tax" => array(
|
361 |
"Tax" => array(
|
@@ -425,6 +445,136 @@ class WooSEA_google_shopping {
|
|
425 |
"feed_name" => "g:google_funded_promotion_eligibility",
|
426 |
"format" => "optional",
|
427 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
),
|
429 |
);
|
430 |
return $google_attributes;
|
132 |
"Product type" => array(
|
133 |
"name" => "product_type",
|
134 |
"feed_name" => "g:product_type",
|
135 |
+
"format" => "required",
|
136 |
+
"woo_suggest" => "raw_categories",
|
137 |
),
|
138 |
),
|
139 |
"Product identifiers" => array(
|
244 |
),
|
245 |
),
|
246 |
"Shopping campaigns" => array(
|
|
|
|
|
|
|
|
|
|
|
247 |
"Ads redirect (new)" => array(
|
248 |
"name" => "ads_redirect",
|
249 |
"feed_name" => "g:ads_redirect",
|
304 |
"feed_name" => "g:ads_labels",
|
305 |
"format" => "optional",
|
306 |
),
|
307 |
+
"Adwords grouping (BING)" => array(
|
308 |
+
"name" => "adwords_grouping",
|
309 |
+
"feed_name" => "g:adwords_grouping",
|
310 |
+
"format" => "optional",
|
311 |
+
),
|
312 |
+
"Adwords labels (BING)" => array(
|
313 |
+
"name" => "adwords_labels",
|
314 |
+
"feed_name" => "g:adwords_labels",
|
315 |
+
"format" => "optional",
|
316 |
+
),
|
317 |
+
"Adwords redirect (BING)" => array(
|
318 |
+
"name" => "adwords_redirect",
|
319 |
+
"feed_name" => "g:adwords_redirect",
|
320 |
+
"format" => "optional",
|
321 |
+
),
|
322 |
),
|
323 |
"Shipping" => array(
|
324 |
"Shipping" => array(
|
366 |
"feed_name" => "g:max_handling_time",
|
367 |
"format" => "optional",
|
368 |
),
|
369 |
+
"Ships from country" => array(
|
370 |
+
"name" => "ships_from_country",
|
371 |
+
"feed_name" => "g:ships_from_country",
|
372 |
+
"format" => "optional",
|
373 |
+
),
|
374 |
+
"Region Id" => array(
|
375 |
+
"name" => "region_id",
|
376 |
+
"feed_name" => "g:region_id",
|
377 |
+
"format" => "optional",
|
378 |
+
),
|
379 |
),
|
380 |
"Tax" => array(
|
381 |
"Tax" => array(
|
445 |
"feed_name" => "g:google_funded_promotion_eligibility",
|
446 |
"format" => "optional",
|
447 |
),
|
448 |
+
"Pickup method" => array(
|
449 |
+
"name" => "pickup_method",
|
450 |
+
"feed_name" => "g:pickup_method",
|
451 |
+
"format" => "optional",
|
452 |
+
),
|
453 |
+
"Pickup SLA" => array(
|
454 |
+
"name" => "pickup_SLA",
|
455 |
+
"feed_name" => "g:pickup_SLA",
|
456 |
+
"format" => "optional",
|
457 |
+
),
|
458 |
+
"Pickup link template" => array(
|
459 |
+
"name" => "pickup_link_template",
|
460 |
+
"feed_name" => "g:pickup_link_template",
|
461 |
+
"format" => "optional",
|
462 |
+
),
|
463 |
+
"Store code" => array(
|
464 |
+
"name" => "store_code",
|
465 |
+
"feed_name" => "g:store_code",
|
466 |
+
"format" => "optional",
|
467 |
+
),
|
468 |
+
"Mobile pickup link template" => array(
|
469 |
+
"name" => "mobile_pickup_link_template",
|
470 |
+
"feed_name" => "g:mobile_pickup_link_template",
|
471 |
+
"format" => "optional",
|
472 |
+
),
|
473 |
+
"Seller name" => array(
|
474 |
+
"name" => "seller_name",
|
475 |
+
"feed_name" => "g:seller_name",
|
476 |
+
"format" => "optional",
|
477 |
+
),
|
478 |
+
"Count" => array(
|
479 |
+
"name" => "count",
|
480 |
+
"feed_name" => "g:count",
|
481 |
+
"format" => "optional",
|
482 |
+
),
|
483 |
+
"Disclosure date" => array(
|
484 |
+
"name" => "disclosure_date",
|
485 |
+
"feed_name" => "g:disclosure_date",
|
486 |
+
"format" => "optional",
|
487 |
+
),
|
488 |
+
"Feature description" => array(
|
489 |
+
"name" => "feature_description",
|
490 |
+
"feed_name" => "g:feature_description",
|
491 |
+
"format" => "optional",
|
492 |
+
),
|
493 |
+
"Flavor" => array(
|
494 |
+
"name" => "flavor",
|
495 |
+
"feed_name" => "g:flavor",
|
496 |
+
"format" => "optional",
|
497 |
+
),
|
498 |
+
"Scent" => array(
|
499 |
+
"name" => "scent",
|
500 |
+
"feed_name" => "g:scent",
|
501 |
+
"format" => "optional",
|
502 |
+
),
|
503 |
+
"Format" => array(
|
504 |
+
"name" => "format",
|
505 |
+
"feed_name" => "g:format",
|
506 |
+
"format" => "optional",
|
507 |
+
),
|
508 |
+
"Product line" => array(
|
509 |
+
"name" => "product_line",
|
510 |
+
"feed_name" => "g:product_line",
|
511 |
+
"format" => "optional",
|
512 |
+
),
|
513 |
+
"Product name" => array(
|
514 |
+
"name" => "product_name",
|
515 |
+
"feed_name" => "g:product_name",
|
516 |
+
"format" => "optional",
|
517 |
+
),
|
518 |
+
"Product page url" => array(
|
519 |
+
"name" => "product_page_url",
|
520 |
+
"feed_name" => "g:product_page_url",
|
521 |
+
"format" => "optional",
|
522 |
+
),
|
523 |
+
"Size system" => array(
|
524 |
+
"name" => "size_system",
|
525 |
+
"feed_name" => "g:size_system",
|
526 |
+
"format" => "optional",
|
527 |
+
),
|
528 |
+
"Size type" => array(
|
529 |
+
"name" => "size_type",
|
530 |
+
"feed_name" => "g:size_type",
|
531 |
+
"format" => "optional",
|
532 |
+
),
|
533 |
+
"Capacity" => array(
|
534 |
+
"name" => "capacity",
|
535 |
+
"feed_name" => "g:capacity",
|
536 |
+
"format" => "optional",
|
537 |
+
),
|
538 |
+
"Suggested retail price" => array(
|
539 |
+
"name" => "suggested_retail_price",
|
540 |
+
"feed_name" => "g:suggested_retail_price",
|
541 |
+
"format" => "optional",
|
542 |
+
),
|
543 |
+
"Theme" => array(
|
544 |
+
"name" => "theme",
|
545 |
+
"feed_name" => "g:theme",
|
546 |
+
"format" => "optional",
|
547 |
+
),
|
548 |
+
"Video link" => array(
|
549 |
+
"name" => "video_link",
|
550 |
+
"feed_name" => "g:video_link",
|
551 |
+
"format" => "optional",
|
552 |
+
),
|
553 |
+
"Display ads ID" => array(
|
554 |
+
"name" => "display_ads_id",
|
555 |
+
"feed_name" => "g:display_ads_id",
|
556 |
+
"format" => "optional",
|
557 |
+
),
|
558 |
+
"Display ads Similar ID" => array(
|
559 |
+
"name" => "display_ads_similar_id",
|
560 |
+
"feed_name" => "g:display_ads_similar_id",
|
561 |
+
"format" => "optional",
|
562 |
+
),
|
563 |
+
"Display ads Title" => array(
|
564 |
+
"name" => "display_ads_title",
|
565 |
+
"feed_name" => "g:display_ads_title",
|
566 |
+
"format" => "optional",
|
567 |
+
),
|
568 |
+
"Display ads Link" => array(
|
569 |
+
"name" => "display_ads_link",
|
570 |
+
"feed_name" => "g:display_ads_link",
|
571 |
+
"format" => "optional",
|
572 |
+
),
|
573 |
+
"Display ads Value" => array(
|
574 |
+
"name" => "display_ads_value",
|
575 |
+
"feed_name" => "g:display_ads_value",
|
576 |
+
"format" => "optional",
|
577 |
+
),
|
578 |
),
|
579 |
);
|
580 |
return $google_attributes;
|
classes/channels/class-idealo.php
ADDED
@@ -0,0 +1,446 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings for Idealo feeds
|
4 |
+
*/
|
5 |
+
class WooSEA_idealo {
|
6 |
+
public $idealo;
|
7 |
+
|
8 |
+
public static function get_channel_attributes() {
|
9 |
+
|
10 |
+
$sitename = get_option('blogname');
|
11 |
+
|
12 |
+
$idealo = array(
|
13 |
+
"Feed fields" => array(
|
14 |
+
"SKU" => array(
|
15 |
+
"name" => "SKU",
|
16 |
+
"feed_name" => "sku",
|
17 |
+
"format" => "required",
|
18 |
+
"woo_suggest" => "sku",
|
19 |
+
),
|
20 |
+
"Brand" => array(
|
21 |
+
"name" => "brand",
|
22 |
+
"feed_name" => "brand",
|
23 |
+
"format" => "required",
|
24 |
+
),
|
25 |
+
"Title" => array(
|
26 |
+
"name" => "title",
|
27 |
+
"feed_name" => "title",
|
28 |
+
"format" => "required",
|
29 |
+
"woo_suggest" => "title",
|
30 |
+
),
|
31 |
+
"CategoryPath" => array(
|
32 |
+
"name" => "categoryPath",
|
33 |
+
"feed_name" => "categoryPath",
|
34 |
+
"format" => "required",
|
35 |
+
"woo_suggest" => "category_path",
|
36 |
+
),
|
37 |
+
"url" => array(
|
38 |
+
"name" => "url",
|
39 |
+
"feed_name" => "url",
|
40 |
+
"format" => "required",
|
41 |
+
"woo_suggest" => "link",
|
42 |
+
),
|
43 |
+
"hans" => array(
|
44 |
+
"name" => "hans",
|
45 |
+
"feed_name" => "hans",
|
46 |
+
"format" => "optional",
|
47 |
+
),
|
48 |
+
"Description" => array(
|
49 |
+
"name" => "description",
|
50 |
+
"feed_name" => "description",
|
51 |
+
"format" => "required",
|
52 |
+
"woo_suggest" => "description",
|
53 |
+
),
|
54 |
+
"ImageUrls" => array(
|
55 |
+
"name" => "imageUrls",
|
56 |
+
"feed_name" => "imageUrls",
|
57 |
+
"format" => "optional",
|
58 |
+
"woo_suggest" => "image",
|
59 |
+
),
|
60 |
+
"eec" => array(
|
61 |
+
"name" => "eec",
|
62 |
+
"feed_name" => "eec",
|
63 |
+
"format" => "optional",
|
64 |
+
),
|
65 |
+
"merchantName" => array(
|
66 |
+
"name" => "merchantName",
|
67 |
+
"feed_name" => "merchantName",
|
68 |
+
"format" => "optional",
|
69 |
+
),
|
70 |
+
"merchantId" => array(
|
71 |
+
"name" => "merchantId",
|
72 |
+
"feed_name" => "merchanId",
|
73 |
+
"format" => "optional",
|
74 |
+
),
|
75 |
+
"price" => array(
|
76 |
+
"name" => "price",
|
77 |
+
"feed_name" => "price",
|
78 |
+
"format" => "required",
|
79 |
+
"woo_suggest" => "price",
|
80 |
+
),
|
81 |
+
"basePrice" => array(
|
82 |
+
"name" => "basePrice",
|
83 |
+
"feed_name" => "basePrice",
|
84 |
+
"format" => "optional",
|
85 |
+
),
|
86 |
+
"formerPrice" => array(
|
87 |
+
"name" => "formerPrice",
|
88 |
+
"feed_name" => "formerPrice",
|
89 |
+
"format" => "optional",
|
90 |
+
),
|
91 |
+
"voucherCode" => array(
|
92 |
+
"name" => "voucherCode",
|
93 |
+
"feed_name" => "voucherCode",
|
94 |
+
"format" => "optional",
|
95 |
+
),
|
96 |
+
"deposit" => array(
|
97 |
+
"name" => "deposit",
|
98 |
+
"feed_name" => "deposit",
|
99 |
+
"format" => "optional",
|
100 |
+
),
|
101 |
+
"deliveryTime" => array(
|
102 |
+
"name" => "deliveryTime",
|
103 |
+
"feed_name" => "deliveryTime",
|
104 |
+
"format" => "optional",
|
105 |
+
),
|
106 |
+
"deliveryComment" => array(
|
107 |
+
"name" => "deliveryComment",
|
108 |
+
"feed_name" => "deliveryComment",
|
109 |
+
"format" => "optional",
|
110 |
+
),
|
111 |
+
"maxOrderProcessingTime" => array(
|
112 |
+
"name" => "maxOrderProcessingTime",
|
113 |
+
"feed_name" => "maxOrderProcessingTime",
|
114 |
+
"format" => "optional",
|
115 |
+
),
|
116 |
+
"freeReturnDays" => array(
|
117 |
+
"name" => "freeReturnDays",
|
118 |
+
"feed_name" => "freeReturnDays",
|
119 |
+
"format" => "optional",
|
120 |
+
),
|
121 |
+
"checkout" => array(
|
122 |
+
"name" => "checkout",
|
123 |
+
"feed_name" => "checkout",
|
124 |
+
"format" => "required",
|
125 |
+
),
|
126 |
+
"minimumPrice" => array(
|
127 |
+
"name" => "minimumPrice",
|
128 |
+
"feed_name" => "minimumPrice",
|
129 |
+
"format" => "required",
|
130 |
+
),
|
131 |
+
"fullfillmentType" => array(
|
132 |
+
"name" => "fulfillmentType",
|
133 |
+
"feed_name" => "fulfillmentType",
|
134 |
+
"format" => "required",
|
135 |
+
),
|
136 |
+
"checkoutLimitPerPeriod" => array(
|
137 |
+
"name" => "checkoutLimitPerPeriod",
|
138 |
+
"feed_name" => "checkoutLimitPerPeriod",
|
139 |
+
"format" => "required",
|
140 |
+
),
|
141 |
+
"quantityPerOrder" => array(
|
142 |
+
"name" => "quantityPerOrder",
|
143 |
+
"feed_name" => "quantityPerOrder",
|
144 |
+
"format" => "optional",
|
145 |
+
),
|
146 |
+
"twoManHandlingFee" => array(
|
147 |
+
"name" => "twoManHandlingFee",
|
148 |
+
"feed_name" => "twoManHandlingFee",
|
149 |
+
"format" => "optional",
|
150 |
+
),
|
151 |
+
"disposalFee" => array(
|
152 |
+
"name" => "disposalFee",
|
153 |
+
"feed_name" => "disposalFee",
|
154 |
+
"format" => "optional",
|
155 |
+
),
|
156 |
+
"eans" => array(
|
157 |
+
"name" => "eans",
|
158 |
+
"feed_name" => "eans",
|
159 |
+
"format" => "required",
|
160 |
+
),
|
161 |
+
"packagingUnit" => array(
|
162 |
+
"name" => "packagingUnit",
|
163 |
+
"feed_name" => "packagingUnit",
|
164 |
+
"format" => "optional",
|
165 |
+
),
|
166 |
+
"deliveryCost_ups" => array(
|
167 |
+
"name" => "deliveryCost_ups",
|
168 |
+
"feed_name" => "deliveryCost_ups",
|
169 |
+
"format" => "optional",
|
170 |
+
),
|
171 |
+
"deliveryCost_fedex" => array(
|
172 |
+
"name" => "deliveryCost_fedex",
|
173 |
+
"feed_name" => "deliveryCost_fedex",
|
174 |
+
"format" => "optional",
|
175 |
+
),
|
176 |
+
"deliveryCost_deutsche_post" => array(
|
177 |
+
"name" => "deliveryCost_deutsche_post",
|
178 |
+
"feed_name" => "deliveryCost_deutsche_post",
|
179 |
+
"format" => "optional",
|
180 |
+
),
|
181 |
+
"deliveryCost_dhl" => array(
|
182 |
+
"name" => "deliveryCost_dhl",
|
183 |
+
"feed_name" => "deliveryCost_dhl",
|
184 |
+
"format" => "optional",
|
185 |
+
),
|
186 |
+
"deliveryCost_dhl_go_green" => array(
|
187 |
+
"name" => "deliveryCost_dhl_go_green",
|
188 |
+
"feed_name" => "deliveryCost_dhl_go_green",
|
189 |
+
"format" => "optional",
|
190 |
+
),
|
191 |
+
"deliveryCost_download" => array(
|
192 |
+
"name" => "deliveryCost_download",
|
193 |
+
"feed_name" => "deliveryCost_download",
|
194 |
+
"format" => "optional",
|
195 |
+
),
|
196 |
+
"deliveryCost_dpd" => array(
|
197 |
+
"name" => "deliveryCost_dpd",
|
198 |
+
"feed_name" => "deliveryCost_dpd",
|
199 |
+
"format" => "optional",
|
200 |
+
),
|
201 |
+
"deliveryCost_german_express_logistics" => array(
|
202 |
+
"name" => "deliveryCost_german_express_logistics",
|
203 |
+
"feed_name" => "deliveryCost_german_express_logistics",
|
204 |
+
"format" => "optional",
|
205 |
+
),
|
206 |
+
"deliveryCost_gls" => array(
|
207 |
+
"name" => "deliveryCost_gls",
|
208 |
+
"feed_name" => "deliveryCost_gls",
|
209 |
+
"format" => "optional",
|
210 |
+
),
|
211 |
+
"deliveryCost_gls_think_green" => array(
|
212 |
+
"name" => "deliveryCost_gls_think_green",
|
213 |
+
"feed_name" => "deliveryCost_gls_think_green",
|
214 |
+
"format" => "optional",
|
215 |
+
),
|
216 |
+
"deliveryCost_hermes" => array(
|
217 |
+
"name" => "deliveryCost_hermes",
|
218 |
+
"feed_name" => "deliveryCost_hermes",
|
219 |
+
"format" => "optional",
|
220 |
+
),
|
221 |
+
"deliveryCost_pick_point" => array(
|
222 |
+
"name" => "deliveryCost_pick_points",
|
223 |
+
"feed_name" => "deliveryCost_pick_point",
|
224 |
+
"format" => "optional",
|
225 |
+
),
|
226 |
+
"deliveryCost_spedition" => array(
|
227 |
+
"name" => "deliveryCost_spedition",
|
228 |
+
"feed_name" => "deliveryCost_spedition",
|
229 |
+
"format" => "optional",
|
230 |
+
),
|
231 |
+
"deliveryCost_tnt" => array(
|
232 |
+
"name" => "deliveryCost_tnt",
|
233 |
+
"feed_name" => "deliveryCost_tnt",
|
234 |
+
"format" => "optional",
|
235 |
+
),
|
236 |
+
"deliveryCost_trans_o_flex" => array(
|
237 |
+
"name" => "deliveryCost_trans_o_flex",
|
238 |
+
"feed_name" => "deliveryCost_trand_o_flex",
|
239 |
+
"format" => "optional",
|
240 |
+
),
|
241 |
+
"paymentCosts_credit_card" => array(
|
242 |
+
"name" => "paymentCosts_credit_card",
|
243 |
+
"feed_name" => "paymentCosts_credit_card",
|
244 |
+
"format" => "optional",
|
245 |
+
),
|
246 |
+
"paymentCosts_cash_in_advance" => array(
|
247 |
+
"name" => "paymentCosts_cash_in_advance",
|
248 |
+
"feed_name" => "paymentCosts_cash_in_advance",
|
249 |
+
"format" => "optional",
|
250 |
+
),
|
251 |
+
"paymentCosts_cash_on_delivery" => array(
|
252 |
+
"name" => "paymentCosts_cash_on_delivery",
|
253 |
+
"feed_name" => "paymentCosts_cash_on_delivery",
|
254 |
+
"format" => "optional",
|
255 |
+
),
|
256 |
+
"paymentCosts_paypal" => array(
|
257 |
+
"name" => "paymentCosts_paypal",
|
258 |
+
"feed_name" => "paymentCosts_paypal",
|
259 |
+
"format" => "optional",
|
260 |
+
),
|
261 |
+
"paymentCosts_giropay" => array(
|
262 |
+
"name" => "paymentCosts_giropay",
|
263 |
+
"feed_name" => "paymentCosts_giropay",
|
264 |
+
"format" => "optional",
|
265 |
+
),
|
266 |
+
"paymentCosts_direct_debit" => array(
|
267 |
+
"name" => "paymentCosts_direct_debit",
|
268 |
+
"feed_name" => "paymentCosts_direct_debit",
|
269 |
+
"format" => "optional",
|
270 |
+
),
|
271 |
+
"paymentCosts_google_checkout" => array(
|
272 |
+
"name" => "paymentCosts_google_checkout",
|
273 |
+
"feed_name" => "paymentCosts_google_checkout",
|
274 |
+
"format" => "optional",
|
275 |
+
),
|
276 |
+
"paymentCosts_invoice" => array(
|
277 |
+
"name" => "paymentCosts_invoice",
|
278 |
+
"feed_name" => "paymentCosts_invoice",
|
279 |
+
"format" => "optional",
|
280 |
+
),
|
281 |
+
"paymentCosts_postal_order" => array(
|
282 |
+
"name" => "paymentCosts_postal_order",
|
283 |
+
"feed_name" => "paymentCosts_postal_order",
|
284 |
+
"format" => "optional",
|
285 |
+
),
|
286 |
+
"paymentCosts_paysafecard" => array(
|
287 |
+
"name" => "paymentCosts_paysafecard",
|
288 |
+
"feed_name" => "paymentCosts_paysafecard",
|
289 |
+
"format" => "optional",
|
290 |
+
),
|
291 |
+
"paymentCosts_sofortueberweisung" => array(
|
292 |
+
"name" => "paymentCosts_sofortueberweisung",
|
293 |
+
"feed_name" => "paymentCosts_sofortueberweisung",
|
294 |
+
"format" => "optional",
|
295 |
+
),
|
296 |
+
"paymentCosts_amazon_payment" => array(
|
297 |
+
"name" => "paymentCosts_amazon_payment",
|
298 |
+
"feed_name" => "paymentCosts_amazon_payment",
|
299 |
+
"format" => "optional",
|
300 |
+
),
|
301 |
+
"paymentCosts_electronical_payment_standard" => array(
|
302 |
+
"name" => "paymentCosts_electronical_payment_standard",
|
303 |
+
"feed_name" => "paymentCosts_electronical_payment_standard",
|
304 |
+
"format" => "optional",
|
305 |
+
),
|
306 |
+
"paymentCosts_ecotax" => array(
|
307 |
+
"name" => "paymentCosts_ecotax",
|
308 |
+
"feed_name" => "paymentCosts_ecotax",
|
309 |
+
"format" => "optional",
|
310 |
+
),
|
311 |
+
"used" => array(
|
312 |
+
"name" => "used",
|
313 |
+
"feed_name" => "used",
|
314 |
+
"format" => "optional",
|
315 |
+
),
|
316 |
+
"download" => array(
|
317 |
+
"name" => "download",
|
318 |
+
"feed_name" => "download",
|
319 |
+
"format" => "optional",
|
320 |
+
),
|
321 |
+
"replica" => array(
|
322 |
+
"name" => "replica",
|
323 |
+
"feed_name" => "replica",
|
324 |
+
"format" => "optional",
|
325 |
+
),
|
326 |
+
"size" => array(
|
327 |
+
"name" => "size",
|
328 |
+
"feed_name" => "size",
|
329 |
+
"format" => "optional",
|
330 |
+
),
|
331 |
+
"colour" => array(
|
332 |
+
"name" => "colour",
|
333 |
+
"feed_name" => "colour",
|
334 |
+
"format" => "optional",
|
335 |
+
),
|
336 |
+
"gender" => array(
|
337 |
+
"name" => "gender",
|
338 |
+
"feed_name" => "gender",
|
339 |
+
"format" => "optional",
|
340 |
+
),
|
341 |
+
"material" => array(
|
342 |
+
"name" => "material",
|
343 |
+
"feed_name" => "material",
|
344 |
+
"format" => "optional",
|
345 |
+
),
|
346 |
+
"oens" => array(
|
347 |
+
"name" => "oens",
|
348 |
+
"feed_name" => "oens",
|
349 |
+
"format" => "optional",
|
350 |
+
),
|
351 |
+
"kbas" => array(
|
352 |
+
"name" => "kbas",
|
353 |
+
"feed_name" => "kbas",
|
354 |
+
"format" => "optional",
|
355 |
+
),
|
356 |
+
"diopter" => array(
|
357 |
+
"name" => "diopter",
|
358 |
+
"feed_name" => "diopter",
|
359 |
+
"format" => "optional",
|
360 |
+
),
|
361 |
+
"baseCurve" => array(
|
362 |
+
"name" => "baseCurve",
|
363 |
+
"feed_name" => "baseCurve",
|
364 |
+
"format" => "optional",
|
365 |
+
),
|
366 |
+
"diameter" => array(
|
367 |
+
"name" => "diameter",
|
368 |
+
"feed_name" => "diameter",
|
369 |
+
"format" => "optional",
|
370 |
+
),
|
371 |
+
"cylinder" => array(
|
372 |
+
"name" => "cylinder",
|
373 |
+
"feed_name" => "cylinder",
|
374 |
+
"format" => "optional",
|
375 |
+
),
|
376 |
+
"axis" => array(
|
377 |
+
"name" => "axis",
|
378 |
+
"feed_name" => "axis",
|
379 |
+
"format" => "optional",
|
380 |
+
),
|
381 |
+
"addition" => array(
|
382 |
+
"name" => "addition",
|
383 |
+
"feed_name" => "addition",
|
384 |
+
"format" => "optional",
|
385 |
+
),
|
386 |
+
"pzns" => array(
|
387 |
+
"name" => "pzns",
|
388 |
+
"feed_name" => "pzns",
|
389 |
+
"format" => "optional",
|
390 |
+
),
|
391 |
+
"quantity" => array(
|
392 |
+
"name" => "quantity",
|
393 |
+
"feed_name" => "quantity",
|
394 |
+
"format" => "optional",
|
395 |
+
),
|
396 |
+
"fuelEfficiency" => array(
|
397 |
+
"name" => "fuelEfficiency",
|
398 |
+
"feed_name" => "fuelEfficiency",
|
399 |
+
"format" => "optional",
|
400 |
+
),
|
401 |
+
"wetGrip" => array(
|
402 |
+
"name" => "wetGrip",
|
403 |
+
"feed_name" => "wetGrip",
|
404 |
+
"format" => "optional",
|
405 |
+
),
|
406 |
+
"externalRollingNoise" => array(
|
407 |
+
"name" => "externalRollingNoise",
|
408 |
+
"feed_name" => "externalRollingNoise",
|
409 |
+
"format" => "optional",
|
410 |
+
),
|
411 |
+
"rollingNoiseClass" => array(
|
412 |
+
"name" => "rollingNoiseClass",
|
413 |
+
"feed_name" => "rollingNoiseClass",
|
414 |
+
"format" => "optional",
|
415 |
+
),
|
416 |
+
"alcoholicContent" => array(
|
417 |
+
"name" => "alcoholicContent",
|
418 |
+
"feed_name" => "alcoholicConent",
|
419 |
+
"format" => "optional",
|
420 |
+
),
|
421 |
+
"allergenInformation" => array(
|
422 |
+
"name" => "allergenInformation",
|
423 |
+
"feed_name" => "allergenInformation",
|
424 |
+
"format" => "optional",
|
425 |
+
),
|
426 |
+
"countryOfOrigin" => array(
|
427 |
+
"name" => "countryOfOrigin",
|
428 |
+
"feed_name" => "countryOfOrigin",
|
429 |
+
"format" => "optional",
|
430 |
+
),
|
431 |
+
"bottler" => array(
|
432 |
+
"name" => "bottler",
|
433 |
+
"feed_name" => "bottler",
|
434 |
+
"format" => "optional",
|
435 |
+
),
|
436 |
+
"importer" => array(
|
437 |
+
"name" => "importer",
|
438 |
+
"feed_name" => "importer",
|
439 |
+
"format" => "optional",
|
440 |
+
),
|
441 |
+
),
|
442 |
+
);
|
443 |
+
return $idealo;
|
444 |
+
}
|
445 |
+
}
|
446 |
+
?>
|
classes/channels/class-vivino.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Settings for Vivino feeds
|
4 |
+
*/
|
5 |
+
class WooSEA_vivino {
|
6 |
+
public $vivino;
|
7 |
+
|
8 |
+
public static function get_channel_attributes() {
|
9 |
+
|
10 |
+
$sitename = get_option('blogname');
|
11 |
+
|
12 |
+
$vivino = array(
|
13 |
+
"Feed fields" => array(
|
14 |
+
"Product ID" => array(
|
15 |
+
"name" => "product-id",
|
16 |
+
"feed_name" => "product-id",
|
17 |
+
"format" => "required",
|
18 |
+
"woo_suggest" => "id"
|
19 |
+
),
|
20 |
+
"Product Name" => array(
|
21 |
+
"name" => "product-name",
|
22 |
+
"feed_name" => "product-name",
|
23 |
+
"format" => "required",
|
24 |
+
"woo_suggest" => "title",
|
25 |
+
),
|
26 |
+
"Price" => array(
|
27 |
+
"name" => "price",
|
28 |
+
"feed_name" => "price",
|
29 |
+
"format" => "required",
|
30 |
+
"woo_suggest" => "vivino_price",
|
31 |
+
),
|
32 |
+
"Bottle Size" => array(
|
33 |
+
"name" => "bottle_size",
|
34 |
+
"feed_name" => "bottle_size",
|
35 |
+
"format" => "required",
|
36 |
+
),
|
37 |
+
"Bottle Quantity" => array(
|
38 |
+
"name" => "bottle_quantity",
|
39 |
+
"feed_name" => "bottle_quantity",
|
40 |
+
"format" => "required",
|
41 |
+
),
|
42 |
+
"Inventory Count" => array(
|
43 |
+
"name" => "inventory_count",
|
44 |
+
"feed_name" => "inventory_count",
|
45 |
+
"format" => "required",
|
46 |
+
"woo_suggest" => "quantity",
|
47 |
+
),
|
48 |
+
"Quantity is minimum" => array(
|
49 |
+
"name" => "quantity-is-minimum",
|
50 |
+
"feed_name" => "quantity-is-minimum",
|
51 |
+
"format" => "required",
|
52 |
+
),
|
53 |
+
"Link" => array(
|
54 |
+
"name" => "link",
|
55 |
+
"feed_name" => "link",
|
56 |
+
"format" => "required",
|
57 |
+
"woo_suggest" => "link",
|
58 |
+
),
|
59 |
+
"Image" => array(
|
60 |
+
"name" => "image",
|
61 |
+
"feed_name" => "image",
|
62 |
+
"format" => "required",
|
63 |
+
"woo_suggest" => "image",
|
64 |
+
),
|
65 |
+
"Producer" => array(
|
66 |
+
"name" => "producer",
|
67 |
+
"feed_name" => "producer",
|
68 |
+
"format" => "optional",
|
69 |
+
),
|
70 |
+
"Wine Name" => array(
|
71 |
+
"name" => "wine-name",
|
72 |
+
"feed_name" => "wine-name",
|
73 |
+
"format" => "optional",
|
74 |
+
),
|
75 |
+
"Appellation" => array(
|
76 |
+
"name" => "appellation",
|
77 |
+
"feed_name" => "appellation",
|
78 |
+
"format" => "optional",
|
79 |
+
),
|
80 |
+
"Vintage" => array(
|
81 |
+
"name" => "vintage",
|
82 |
+
"feed_name" => "vintage",
|
83 |
+
"format" => "optional",
|
84 |
+
),
|
85 |
+
"Country" => array(
|
86 |
+
"name" => "country",
|
87 |
+
"feed_name" => "country",
|
88 |
+
"format" => "optional",
|
89 |
+
),
|
90 |
+
"Color" => array(
|
91 |
+
"name" => "color",
|
92 |
+
"feed_name" => "color",
|
93 |
+
"format" => "optional",
|
94 |
+
),
|
95 |
+
"EAN" => array(
|
96 |
+
"name" => "ean",
|
97 |
+
"feed_name" => "ean",
|
98 |
+
"format" => "optional",
|
99 |
+
),
|
100 |
+
"UPC" => array(
|
101 |
+
"name" => "upc",
|
102 |
+
"feed_name" => "upc",
|
103 |
+
"format" => "optional",
|
104 |
+
),
|
105 |
+
"JAN" => array(
|
106 |
+
"name" => "jan",
|
107 |
+
"feed_name" => "jan",
|
108 |
+
"format" => "optional",
|
109 |
+
),
|
110 |
+
"Description" => array(
|
111 |
+
"name" => "description",
|
112 |
+
"feed_name" => "description",
|
113 |
+
"format" => "optional",
|
114 |
+
),
|
115 |
+
"Alcohol" => array(
|
116 |
+
"name" => "alcohol",
|
117 |
+
"feed_name" => "alcohol",
|
118 |
+
"format" => "optional",
|
119 |
+
),
|
120 |
+
"Producer Address" => array(
|
121 |
+
"name" => "producer-address",
|
122 |
+
"feed_name" => "producer-address",
|
123 |
+
"format" => "optional",
|
124 |
+
),
|
125 |
+
"Importer Address" => array(
|
126 |
+
"name" => "importer-address",
|
127 |
+
"feed_name" => "importer-address",
|
128 |
+
"format" => "optional",
|
129 |
+
),
|
130 |
+
"Varietal" => array(
|
131 |
+
"name" => "varietal",
|
132 |
+
"feed_name" => "varietal",
|
133 |
+
"format" => "optional",
|
134 |
+
),
|
135 |
+
"Ageing" => array(
|
136 |
+
"name" => "ageing",
|
137 |
+
"feed_name" => "ageing",
|
138 |
+
"format" => "optional",
|
139 |
+
),
|
140 |
+
"Closure" => array(
|
141 |
+
"name" => "closure",
|
142 |
+
"feed_name" => "closure",
|
143 |
+
"format" => "optional",
|
144 |
+
),
|
145 |
+
"Production Size Unit" => array(
|
146 |
+
"name" => "production-size",
|
147 |
+
"feed_name" => "production-size",
|
148 |
+
"format" => "optional",
|
149 |
+
),
|
150 |
+
"Residual Sugar Unit" => array(
|
151 |
+
"name" => "residual-sugar",
|
152 |
+
"feed_name" => "residual-sugar",
|
153 |
+
"format" => "optional",
|
154 |
+
),
|
155 |
+
"Acidity Unit" => array(
|
156 |
+
"name" => "acidity",
|
157 |
+
"feed_name" => "acidity",
|
158 |
+
"format" => "optional",
|
159 |
+
),
|
160 |
+
"Ph" => array(
|
161 |
+
"name" => "ph",
|
162 |
+
"feed_name" => "ph",
|
163 |
+
"format" => "optional",
|
164 |
+
),
|
165 |
+
"Winemaker" => array(
|
166 |
+
"name" => "winemaker",
|
167 |
+
"feed_name" => "winemaker",
|
168 |
+
"format" => "optional",
|
169 |
+
),
|
170 |
+
"Contains Milk Allergens" => array(
|
171 |
+
"name" => "contains-milk-allergens",
|
172 |
+
"feed_name" => "contains-milk-allergens",
|
173 |
+
"format" => "optional",
|
174 |
+
),
|
175 |
+
"Contains Egg Allergens" => array(
|
176 |
+
"name" => "contains-egg-allergens",
|
177 |
+
"feed_name" => "contains-egg-allergens",
|
178 |
+
"format" => "optional",
|
179 |
+
),
|
180 |
+
"Non Alcoholic" => array(
|
181 |
+
"name" => "non-alcoholic",
|
182 |
+
"feed_name" => "non-alcoholic",
|
183 |
+
"format" => "optional",
|
184 |
+
),
|
185 |
+
),
|
186 |
+
);
|
187 |
+
return $vivino;
|
188 |
+
}
|
189 |
+
}
|
190 |
+
?>
|
classes/class-activate.php
CHANGED
@@ -64,7 +64,14 @@ class WooSEA_Activation {
|
|
64 |
"fields" => "google_shopping",
|
65 |
"taxonomy" => "google_shopping",
|
66 |
"utm_source" => "Bing Shopping",
|
67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
"Facebook Catalog Feed / Instagram" => array (
|
69 |
"channel_hash" => md5("Facebook Remarketing"),
|
70 |
"name" => "Facebook Catalog Feed / Instagram",
|
@@ -90,9 +97,16 @@ class WooSEA_Activation {
|
|
90 |
"channel_hash" => md5("Snapchat Product Catalog"),
|
91 |
"name" => "Snapchat Product Catalog",
|
92 |
"fields" => "snapchat",
|
93 |
-
"taxonomy" => "
|
94 |
"utm_source" => "snapchat",
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
96 |
),
|
97 |
"Custom Feed" => array (
|
98 |
"Custom Feed" => array (
|
@@ -432,8 +446,8 @@ class WooSEA_Activation {
|
|
432 |
"Prisjakt" => array (
|
433 |
"channel_hash" => md5("Prisjakt"),
|
434 |
"name" => "Prisjakt",
|
435 |
-
"fields" => "
|
436 |
-
"taxonomy" => "
|
437 |
"utm_source" => "Prisjakt",
|
438 |
"type" => "Comparison shopping engine" ),
|
439 |
"Hintaseuranta" => array (
|
@@ -529,7 +543,14 @@ class WooSEA_Activation {
|
|
529 |
"taxonomy" => "none",
|
530 |
"utm_source" => "LeGuide.fr",
|
531 |
"type" => "Comparison shopping engine" ),
|
532 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
533 |
"channel_hash" => md5("Priceminister.fr"),
|
534 |
"name" => "Priceminister.fr",
|
535 |
"fields" => "customfeed",
|
@@ -740,7 +761,7 @@ class WooSEA_Activation {
|
|
740 |
"Idealo.de" => array (
|
741 |
"channel_hash" => md5("Idealo.de"),
|
742 |
"name" => "Idealo.de",
|
743 |
-
"fields" => "
|
744 |
"taxonomy" => "none",
|
745 |
"utm_source" => "Idealo.de",
|
746 |
"type" => "Comparison shopping engine" ),
|
@@ -1112,6 +1133,13 @@ class WooSEA_Activation {
|
|
1112 |
"taxonomy" => "none",
|
1113 |
"utm_source" => "Tweakers.nl",
|
1114 |
"type" => "Comparison shopping engine" ),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1115 |
"Fashionchick.nl" => array (
|
1116 |
"channel_hash" => md5("Fashionchick.nl"),
|
1117 |
"name" => "Fashionchick.nl",
|
@@ -1226,8 +1254,8 @@ class WooSEA_Activation {
|
|
1226 |
"Prisjakt" => array (
|
1227 |
"channel_hash" => md5("Prisjakt.no"),
|
1228 |
"name" => "Prisjakt.no",
|
1229 |
-
"fields" => "
|
1230 |
-
"taxonomy" => "
|
1231 |
"utm_source" => "Prisjakt.no",
|
1232 |
"type" => "Comparison shopping engine" ),
|
1233 |
),
|
@@ -1321,8 +1349,7 @@ class WooSEA_Activation {
|
|
1321 |
"fields" => "compari_ro",
|
1322 |
"taxonomy" => "none",
|
1323 |
"utm_source" => "Compari.ro",
|
1324 |
-
|
1325 |
-
|
1326 |
),
|
1327 |
"Russian Federation" => array (
|
1328 |
"Yandex" => array (
|
@@ -1455,8 +1482,8 @@ class WooSEA_Activation {
|
|
1455 |
"Prisjakt" => array (
|
1456 |
"channel_hash" => md5("Prisjakt.se"),
|
1457 |
"name" => "Prisjakt.se",
|
1458 |
-
"fields" => "
|
1459 |
-
"taxonomy" => "
|
1460 |
"utm_source" => "Pricerunner.se",
|
1461 |
"type" => "Comparison shopping engine" ),
|
1462 |
),
|
64 |
"fields" => "google_shopping",
|
65 |
"taxonomy" => "google_shopping",
|
66 |
"utm_source" => "Bing Shopping",
|
67 |
+
"type" => "Advertising" ),
|
68 |
+
"Bing Shopping Promotions" => array (
|
69 |
+
"channel_hash" => md5("Bing Shopping Promotions"),
|
70 |
+
"name" => "Bing Shopping Promotions",
|
71 |
+
"fields" => "google_shopping_promotions",
|
72 |
+
"taxonomy" => "google_shopping_promotions",
|
73 |
+
"utm_source" => "Bing Shopping Promotions",
|
74 |
+
"type" => "Advertising" ),
|
75 |
"Facebook Catalog Feed / Instagram" => array (
|
76 |
"channel_hash" => md5("Facebook Remarketing"),
|
77 |
"name" => "Facebook Catalog Feed / Instagram",
|
97 |
"channel_hash" => md5("Snapchat Product Catalog"),
|
98 |
"name" => "Snapchat Product Catalog",
|
99 |
"fields" => "snapchat",
|
100 |
+
"taxonomy" => "google_shopping",
|
101 |
"utm_source" => "snapchat",
|
102 |
+
"type" => "Advertising" ),
|
103 |
+
"Vivino" => array (
|
104 |
+
"channel_hash" => md5("Vivino"),
|
105 |
+
"name" => "Vivino",
|
106 |
+
"fields" => "vivino",
|
107 |
+
"taxonomy" => "none",
|
108 |
+
"utm_source" => "Vivino",
|
109 |
+
"type" => "Advertising" ),
|
110 |
),
|
111 |
"Custom Feed" => array (
|
112 |
"Custom Feed" => array (
|
446 |
"Prisjakt" => array (
|
447 |
"channel_hash" => md5("Prisjakt"),
|
448 |
"name" => "Prisjakt",
|
449 |
+
"fields" => "google_shopping",
|
450 |
+
"taxonomy" => "google_shopping",
|
451 |
"utm_source" => "Prisjakt",
|
452 |
"type" => "Comparison shopping engine" ),
|
453 |
"Hintaseuranta" => array (
|
543 |
"taxonomy" => "none",
|
544 |
"utm_source" => "LeGuide.fr",
|
545 |
"type" => "Comparison shopping engine" ),
|
546 |
+
"Miinto" => array (
|
547 |
+
"channel_hash" => md5("Miinto.fr"),
|
548 |
+
"name" => "Miinto.fr",
|
549 |
+
"fields" => "miinto_fr",
|
550 |
+
"taxonomy" => "none",
|
551 |
+
"utm_source" => "Miinto.fr",
|
552 |
+
"type" => "Comparison shopping engine" ),
|
553 |
+
"Priceminister.fr" => array (
|
554 |
"channel_hash" => md5("Priceminister.fr"),
|
555 |
"name" => "Priceminister.fr",
|
556 |
"fields" => "customfeed",
|
761 |
"Idealo.de" => array (
|
762 |
"channel_hash" => md5("Idealo.de"),
|
763 |
"name" => "Idealo.de",
|
764 |
+
"fields" => "idealo",
|
765 |
"taxonomy" => "none",
|
766 |
"utm_source" => "Idealo.de",
|
767 |
"type" => "Comparison shopping engine" ),
|
1133 |
"taxonomy" => "none",
|
1134 |
"utm_source" => "Tweakers.nl",
|
1135 |
"type" => "Comparison shopping engine" ),
|
1136 |
+
"Boetiek.nl" => array (
|
1137 |
+
"channel_hash" => md5("Boetiek.nl"),
|
1138 |
+
"name" => "Boetiek.nl",
|
1139 |
+
"fields" => "boetiek",
|
1140 |
+
"taxonomy" => "none",
|
1141 |
+
"utm_source" => "Boetiek.nl",
|
1142 |
+
"type" => "Comparison shopping engine" ),
|
1143 |
"Fashionchick.nl" => array (
|
1144 |
"channel_hash" => md5("Fashionchick.nl"),
|
1145 |
"name" => "Fashionchick.nl",
|
1254 |
"Prisjakt" => array (
|
1255 |
"channel_hash" => md5("Prisjakt.no"),
|
1256 |
"name" => "Prisjakt.no",
|
1257 |
+
"fields" => "google_shopping",
|
1258 |
+
"taxonomy" => "google_shopping",
|
1259 |
"utm_source" => "Prisjakt.no",
|
1260 |
"type" => "Comparison shopping engine" ),
|
1261 |
),
|
1349 |
"fields" => "compari_ro",
|
1350 |
"taxonomy" => "none",
|
1351 |
"utm_source" => "Compari.ro",
|
1352 |
+
"type" => "Comparison shopping engine" ),
|
|
|
1353 |
),
|
1354 |
"Russian Federation" => array (
|
1355 |
"Yandex" => array (
|
1482 |
"Prisjakt" => array (
|
1483 |
"channel_hash" => md5("Prisjakt.se"),
|
1484 |
"name" => "Prisjakt.se",
|
1485 |
+
"fields" => "google_shopping",
|
1486 |
+
"taxonomy" => "google_shopping",
|
1487 |
"utm_source" => "Pricerunner.se",
|
1488 |
"type" => "Comparison shopping engine" ),
|
1489 |
),
|
classes/class-attributes.php
CHANGED
@@ -48,7 +48,7 @@ private function get_dynamic_attributes(){
|
|
48 |
global $wpdb;
|
49 |
$list = array();
|
50 |
|
51 |
-
$no_taxonomies = array("portfolio_category","portfolio_skills","portfolio_tags","nav_menu","post_format","slide-page","element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","
|
52 |
$taxonomies = get_taxonomies();
|
53 |
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
|
54 |
|
@@ -205,13 +205,17 @@ public function get_mapping_attributes_dropdown() {
|
|
205 |
"sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
|
206 |
"wc_post_id_product_id" => "Wc_post_id_product_id (Facebook)",
|
207 |
"title" => "Product name",
|
208 |
-
"mother_title" => "Product name parent product",
|
209 |
"title_hyphen" => "Product name hyphen",
|
|
|
|
|
210 |
"title_lc" => "Product name lowercase",
|
|
|
211 |
"description" => "Product description",
|
212 |
"short_description" => "Product short description",
|
213 |
"raw_description" => "Unfiltered product description",
|
214 |
"raw_short_description" => "Unfiltered product short description",
|
|
|
|
|
215 |
"price" => "Price",
|
216 |
"regular_price" => "Regular price",
|
217 |
"sale_price" => "Sale price",
|
@@ -235,8 +239,13 @@ public function get_mapping_attributes_dropdown() {
|
|
235 |
"vivino_sale_price" => "Pinterest / Vivino sale price",
|
236 |
"vivino_regular_price" => "Pinterest / Vivino regular price",
|
237 |
"non_geo_wcml_price" => "Non GEO WCML price",
|
|
|
|
|
|
|
|
|
238 |
"discount_percentage" => "Discount percentage",
|
239 |
"link" => "Link",
|
|
|
240 |
"variable_link" => "Product variable link",
|
241 |
"add_to_cart_link" => "Add to cart link",
|
242 |
"product_creation_date" => "Product creation date",
|
@@ -247,9 +256,20 @@ public function get_mapping_attributes_dropdown() {
|
|
247 |
"category_path" => "Category path",
|
248 |
"category_path_short" => "Category path short",
|
249 |
"category_path_skroutz" => "Category path Skroutz",
|
250 |
-
"one_category" => "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
"condition" => "Condition",
|
252 |
-
|
|
|
|
|
|
|
253 |
"quantity" => "Quantity [Stock]",
|
254 |
"product_type" => "Product Type",
|
255 |
"content_type" => "Content Type",
|
@@ -267,7 +287,9 @@ public function get_mapping_attributes_dropdown() {
|
|
267 |
"length" => "Length",
|
268 |
"shipping" => "Shipping",
|
269 |
"shipping_price" => "Shipping cost",
|
270 |
-
|
|
|
|
|
271 |
"visibility" => "Visibility",
|
272 |
"rating_total" => "Total rating",
|
273 |
"rating_average" => "Average rating",
|
@@ -350,9 +372,10 @@ public function get_mapping_attributes_dropdown() {
|
|
350 |
|
351 |
foreach ($custom_attributes as $key => $value) {
|
352 |
if (!preg_match("/pyre|sbg|fusion/i",$value)){
|
353 |
-
|
|
|
354 |
$dropdown .= "<option value='$key'>" . ucfirst($value) . "</option>";
|
355 |
-
|
356 |
}
|
357 |
}
|
358 |
|
@@ -398,15 +421,20 @@ public function get_mapping_attributes_dropdown() {
|
|
398 |
"parent_sku" => "SKU parent variable product",
|
399 |
"sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
|
400 |
"wc_post_id_product_id" => "Wc_post_id_product_id (Facebook)",
|
401 |
-
|
402 |
-
|
403 |
-
|
|
|
404 |
"title_lc" => "Product name lowercase",
|
|
|
405 |
"description" => "Product description",
|
406 |
"short_description" => "Product short description",
|
407 |
"raw_description" => "Unfiltered product description",
|
408 |
"raw_short_description" => "Unfiltered product short description",
|
409 |
-
|
|
|
|
|
|
|
410 |
"variable_link" => "Product variable link",
|
411 |
"add_to_cart_link" => "Add to cart link",
|
412 |
"image" => "Main image",
|
@@ -429,10 +457,21 @@ public function get_mapping_attributes_dropdown() {
|
|
429 |
"category_path" => "Category path",
|
430 |
"category_path_short" => "Category path short",
|
431 |
"category_path_skroutz" => "Category path Skroutz",
|
432 |
-
"one_category" => "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
433 |
"condition" => "Condition",
|
434 |
-
|
435 |
-
|
|
|
|
|
|
|
436 |
"price" => "Price",
|
437 |
"regular_price" => "Regular price",
|
438 |
"sale_price" => "Sale price",
|
@@ -456,7 +495,11 @@ public function get_mapping_attributes_dropdown() {
|
|
456 |
"vivino_sale_price" => "Pinterest / Vivino sale price",
|
457 |
"vivino_regular_price" => "Pinterest / Vivino regular price",
|
458 |
"non_geo_wcml_price" => "Non GEO WCML price",
|
459 |
-
|
|
|
|
|
|
|
|
|
460 |
"item_group_id" => "Item group ID",
|
461 |
"weight" => "Weight",
|
462 |
"width" => "Width",
|
@@ -464,7 +507,9 @@ public function get_mapping_attributes_dropdown() {
|
|
464 |
"length" => "Length",
|
465 |
"shipping" => "Shipping",
|
466 |
"shipping_price" => "Shipping cost",
|
467 |
-
"
|
|
|
|
|
468 |
"visibility" => "Visibility",
|
469 |
"rating_total" => "Total rating",
|
470 |
"rating_average" => "Average rating",
|
48 |
global $wpdb;
|
49 |
$list = array();
|
50 |
|
51 |
+
$no_taxonomies = array("portfolio_category","portfolio_skills","portfolio_tags","nav_menu","post_format","slide-page","element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","category","post_tag","nav_menu","link_category","post_format","product_type","product_visibility","product_cat","product_shipping_class","product_tag");
|
52 |
$taxonomies = get_taxonomies();
|
53 |
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
|
54 |
|
205 |
"sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
|
206 |
"wc_post_id_product_id" => "Wc_post_id_product_id (Facebook)",
|
207 |
"title" => "Product name",
|
|
|
208 |
"title_hyphen" => "Product name hyphen",
|
209 |
+
"mother_title" => "Product name parent product",
|
210 |
+
"mother_title_hyphen" => "Product name parent product hyphen",
|
211 |
"title_lc" => "Product name lowercase",
|
212 |
+
"title_lcw" => "Product name uppercase first characters",
|
213 |
"description" => "Product description",
|
214 |
"short_description" => "Product short description",
|
215 |
"raw_description" => "Unfiltered product description",
|
216 |
"raw_short_description" => "Unfiltered product short description",
|
217 |
+
"mother_description" => "Product description parent product",
|
218 |
+
"mother_short_description" => "Product short description parent product",
|
219 |
"price" => "Price",
|
220 |
"regular_price" => "Regular price",
|
221 |
"sale_price" => "Sale price",
|
239 |
"vivino_sale_price" => "Pinterest / Vivino sale price",
|
240 |
"vivino_regular_price" => "Pinterest / Vivino regular price",
|
241 |
"non_geo_wcml_price" => "Non GEO WCML price",
|
242 |
+
"mm_min_price" => "Mix & Match minimum price",
|
243 |
+
"mm_min_regular_price" => "Mix & Match minimum regular price",
|
244 |
+
"mm_max_price" => "Mix & Match maximum price",
|
245 |
+
"mm_max_regular_price" => "Mix & Match maximum regular price",
|
246 |
"discount_percentage" => "Discount percentage",
|
247 |
"link" => "Link",
|
248 |
+
"link_no_tracking" => "Link without parameters",
|
249 |
"variable_link" => "Product variable link",
|
250 |
"add_to_cart_link" => "Add to cart link",
|
251 |
"product_creation_date" => "Product creation date",
|
256 |
"category_path" => "Category path",
|
257 |
"category_path_short" => "Category path short",
|
258 |
"category_path_skroutz" => "Category path Skroutz",
|
259 |
+
"one_category" => "Yoast / Rankmath primary category",
|
260 |
+
"nr_variations" => "Number of variations",
|
261 |
+
"nr_variations_stock" => "Number of variations on stock",
|
262 |
+
"yoast_gtin8" => "Yoast WooCommerce GTIN8",
|
263 |
+
"yoast_gtin12" => "Yoast WooCommerce GTIN12",
|
264 |
+
"yoast_gtin13" => "Yoast WooCommerce GTIN13",
|
265 |
+
"yoast_gtin14" => "Yoast WooCommerce GTIN14",
|
266 |
+
"yoast_isbn" => "Yoast WooCommerce ISBN",
|
267 |
+
"yoast_mpn" => "Yoast WooCommerce MPN",
|
268 |
"condition" => "Condition",
|
269 |
+
"purchase_note" => "Purchase note",
|
270 |
+
"availability" => "Availability",
|
271 |
+
"region_id" => "Region Id",
|
272 |
+
"stock_status" => "Stock Status WooCommerce",
|
273 |
"quantity" => "Quantity [Stock]",
|
274 |
"product_type" => "Product Type",
|
275 |
"content_type" => "Content Type",
|
287 |
"length" => "Length",
|
288 |
"shipping" => "Shipping",
|
289 |
"shipping_price" => "Shipping cost",
|
290 |
+
"lowest_shipping_costs" => "Lowest shipping costs",
|
291 |
+
"shipping_label" => "Shipping class slug",
|
292 |
+
"shipping_label_name" => "Shipping class name",
|
293 |
"visibility" => "Visibility",
|
294 |
"rating_total" => "Total rating",
|
295 |
"rating_average" => "Average rating",
|
372 |
|
373 |
foreach ($custom_attributes as $key => $value) {
|
374 |
if (!preg_match("/pyre|sbg|fusion/i",$value)){
|
375 |
+
$value = ltrim($value);
|
376 |
+
if (!empty($value)){
|
377 |
$dropdown .= "<option value='$key'>" . ucfirst($value) . "</option>";
|
378 |
+
}
|
379 |
}
|
380 |
}
|
381 |
|
421 |
"parent_sku" => "SKU parent variable product",
|
422 |
"sku_item_group_id" => "SKU_ITEM_GROUP_ID (Facebook)",
|
423 |
"wc_post_id_product_id" => "Wc_post_id_product_id (Facebook)",
|
424 |
+
"title" => "Product name",
|
425 |
+
"title_hyphen" => "Product name hyphen",
|
426 |
+
"mother_title" => "Product name parent product",
|
427 |
+
"mother_title_hyphen" => "Product name parent product hyphen",
|
428 |
"title_lc" => "Product name lowercase",
|
429 |
+
"title_lcw" => "Product name uppercase first characters",
|
430 |
"description" => "Product description",
|
431 |
"short_description" => "Product short description",
|
432 |
"raw_description" => "Unfiltered product description",
|
433 |
"raw_short_description" => "Unfiltered product short description",
|
434 |
+
"mother_description" => "Product description parent product",
|
435 |
+
"mother_short_description" => "Product short description parent product",
|
436 |
+
"link" => "Link",
|
437 |
+
"link_no_tracking" => "Link without parameters",
|
438 |
"variable_link" => "Product variable link",
|
439 |
"add_to_cart_link" => "Add to cart link",
|
440 |
"image" => "Main image",
|
457 |
"category_path" => "Category path",
|
458 |
"category_path_short" => "Category path short",
|
459 |
"category_path_skroutz" => "Category path Skroutz",
|
460 |
+
"one_category" => "Yoast / Rankmath primary category",
|
461 |
+
"nr_variations" => "Number of variations",
|
462 |
+
"nr_variations_stock" => "Number of variations on stock",
|
463 |
+
"yoast_gtin8" => "Yoast WooCommerce GTIN8",
|
464 |
+
"yoast_gtin12" => "Yoast WooCommerce GTIN12",
|
465 |
+
"yoast_gtin13" => "Yoast WooCommerce GTIN13",
|
466 |
+
"yoast_gtin14" => "Yoast WooCommerce GTIN14",
|
467 |
+
"yoast_isbn" => "Yoast WooCommerce ISBN",
|
468 |
+
"yoast_mpn" => "Yoast WooCommerce MPN",
|
469 |
"condition" => "Condition",
|
470 |
+
"purchase_note" => "Purchase note",
|
471 |
+
"availability" => "Availability",
|
472 |
+
"region_id" => "Region Id",
|
473 |
+
"stock_status" => "Stock Status WooCommerce",
|
474 |
+
"quantity" => "Quantity [Stock]",
|
475 |
"price" => "Price",
|
476 |
"regular_price" => "Regular price",
|
477 |
"sale_price" => "Sale price",
|
495 |
"vivino_sale_price" => "Pinterest / Vivino sale price",
|
496 |
"vivino_regular_price" => "Pinterest / Vivino regular price",
|
497 |
"non_geo_wcml_price" => "Non GEO WCML price",
|
498 |
+
"mm_min_price" => "Mix & Match minimum price",
|
499 |
+
"mm_min_regular_price" => "Mix & Match minimum regular price",
|
500 |
+
"mm_max_price" => "Mix & Match maximum price",
|
501 |
+
"mm_max_regular_price" => "Mix & Match maximum regular price",
|
502 |
+
"discount_percentage" => "Discount percentage",
|
503 |
"item_group_id" => "Item group ID",
|
504 |
"weight" => "Weight",
|
505 |
"width" => "Width",
|
507 |
"length" => "Length",
|
508 |
"shipping" => "Shipping",
|
509 |
"shipping_price" => "Shipping cost",
|
510 |
+
"lowest_shipping_costs" => "Lowest shipping costs",
|
511 |
+
"shipping_label" => "Shipping class slug",
|
512 |
+
"shipping_label_name" => "Shipping class name",
|
513 |
"visibility" => "Visibility",
|
514 |
"rating_total" => "Total rating",
|
515 |
"rating_average" => "Average rating",
|
classes/class-get-products.php
CHANGED
@@ -23,10 +23,11 @@ class WooSEA_Get_Products {
|
|
23 |
* Function to add CDATA brackets to title, short_description and description attributes
|
24 |
*/
|
25 |
protected function woosea_append_cdata( $string ){
|
26 |
-
|
|
|
|
|
27 |
}
|
28 |
|
29 |
-
|
30 |
/**
|
31 |
* Check if a plugin is active
|
32 |
*/
|
@@ -57,6 +58,11 @@ class WooSEA_Get_Products {
|
|
57 |
* Get all approved product review comments for Google's Product Review Feeds
|
58 |
*/
|
59 |
public function woosea_get_reviews ( $product_data, $product ) {
|
|
|
|
|
|
|
|
|
|
|
60 |
$approved_reviews = array();
|
61 |
$prod_id = $product_data['id'];
|
62 |
|
@@ -73,54 +79,62 @@ class WooSEA_Get_Products {
|
|
73 |
|
74 |
// Loop through all product reviews for this specific products (ternary operators)
|
75 |
foreach($reviews as $review_raw){
|
76 |
-
$review = array();
|
77 |
-
$review['review_reviewer_image'] = empty($product_data['reviewer_image']) ? '' : $product_data['reviewer_image'];
|
78 |
-
$review['review_ratings'] = get_comment_meta( $review_raw->comment_ID, 'rating', true);
|
79 |
-
$review['review_id'] = $review_raw->comment_ID;
|
80 |
-
|
81 |
-
// Names need to be anonomyzed
|
82 |
-
$name_pieces = explode(" ", $review_raw->comment_author);
|
83 |
-
$nr_name_pieces = count($name_pieces);
|
84 |
-
$cnt = 0;
|
85 |
-
$name = "";
|
86 |
-
foreach($name_pieces as $n_piece){
|
87 |
-
if($cnt > 0){
|
88 |
-
$n_piece = substr($n_piece, 0, 1);
|
89 |
-
}
|
90 |
-
$name .= $n_piece." ";
|
91 |
-
$cnt++;
|
92 |
-
}
|
93 |
|
94 |
-
//
|
95 |
-
$
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
}
|
125 |
$review_count = $product->get_review_count();
|
126 |
$review_average = $product->get_average_rating();
|
@@ -174,7 +188,7 @@ class WooSEA_Get_Products {
|
|
174 |
if($feed_config['fields'] == "google_drm"){
|
175 |
$utm_part .= "&$key=$value";
|
176 |
} else {
|
177 |
-
$utm_part .= "
|
178 |
}
|
179 |
}
|
180 |
|
@@ -200,7 +214,7 @@ class WooSEA_Get_Products {
|
|
200 |
if($parentId > 0){
|
201 |
# Even though variation products always have parameters in the URL we still need to check and make sure they are there
|
202 |
if(strpos($link, '?') !== false){
|
203 |
-
$utm_part = "&
|
204 |
} else {
|
205 |
$utm_part = "?".ltrim($utm_part, '&');
|
206 |
}
|
@@ -248,21 +262,43 @@ class WooSEA_Get_Products {
|
|
248 |
$data = $wpdb->get_results($sql);
|
249 |
|
250 |
if (count($data)) {
|
251 |
-
|
252 |
foreach ($data as $key => $value) {
|
253 |
$value_display = str_replace("_", " ",$value->name);
|
254 |
-
|
255 |
$list[$value->name] = ucfirst($value_display);
|
256 |
-
|
257 |
-
|
258 |
-
if(
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
}
|
264 |
}
|
265 |
-
|
266 |
return $list;
|
267 |
}
|
268 |
return false;
|
@@ -324,7 +360,7 @@ class WooSEA_Get_Products {
|
|
324 |
/**
|
325 |
* Get category path (needed for Prisjakt)
|
326 |
*/
|
327 |
-
public function woosea_get_term_parents( $id, $taxonomy, $link =
|
328 |
// Only add Home to the beginning of the chain when we start buildin the chain
|
329 |
if(empty($visited)){
|
330 |
$chain = 'Home';
|
@@ -363,6 +399,15 @@ class WooSEA_Get_Products {
|
|
363 |
return $chain;
|
364 |
}
|
365 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
/**
|
367 |
* Get all configured shipping zones
|
368 |
*/
|
@@ -652,8 +697,8 @@ class WooSEA_Get_Products {
|
|
652 |
/**
|
653 |
* Get shipping cost for product
|
654 |
*/
|
655 |
-
public function woosea_get_shipping_cost ($class_cost_id, $project_config, $price, $tax_rates, $shipping_zones, $product_id, $item_group_id) {
|
656 |
-
$shipping_cost =
|
657 |
$shipping_arr = array();
|
658 |
$zone_count = 0;
|
659 |
$nr_shipping_zones = count($shipping_zones);
|
@@ -712,6 +757,8 @@ class WooSEA_Get_Products {
|
|
712 |
$shipping_methods = $zone['shipping_methods'];
|
713 |
|
714 |
foreach ($shipping_methods as $k => $v){
|
|
|
|
|
715 |
|
716 |
if($v->enabled == "yes"){
|
717 |
if(empty($zone_details['country'])){
|
@@ -721,55 +768,57 @@ class WooSEA_Get_Products {
|
|
721 |
}
|
722 |
$taxable = $v->tax_status;
|
723 |
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
}
|
729 |
|
730 |
-
|
731 |
-
|
|
|
|
|
732 |
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
|
|
752 |
}
|
753 |
}
|
754 |
}
|
755 |
-
}
|
756 |
-
|
757 |
-
// WooCommerce Table Rate Bolder Elements
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
wc_load_cart();
|
774 |
|
775 |
WC()->customer->set_shipping_country( $code_from_config );
|
@@ -787,17 +836,85 @@ class WooSEA_Get_Products {
|
|
787 |
// Read cart and get schipping costs
|
788 |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
|
789 |
$total_cost = WC()->cart->get_total();
|
790 |
-
|
|
|
|
|
791 |
$shipping_cost = wc_format_localized_price($shipping_cost);
|
792 |
-
|
793 |
-
}
|
794 |
// Make sure to empty the cart again
|
795 |
WC()->cart->empty_cart();
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
801 |
|
802 |
// CLASS SHIPPING COSTS
|
803 |
if((isset($v->instance_settings[$class_cost_id])) AND ($class_cost_id != "no_class_cost")){
|
@@ -931,6 +1048,16 @@ class WooSEA_Get_Products {
|
|
931 |
unset($shipping_cost);
|
932 |
}
|
933 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
934 |
}
|
935 |
|
936 |
if(isset($zone_details)){
|
@@ -948,7 +1075,12 @@ class WooSEA_Get_Products {
|
|
948 |
}
|
949 |
}
|
950 |
}
|
951 |
-
|
|
|
|
|
|
|
|
|
|
|
952 |
if(isset($shipping_cost)){
|
953 |
if(strlen($shipping_cost) > 0){
|
954 |
if($project_config['ship_suffix'] == "false"){
|
@@ -957,12 +1089,9 @@ class WooSEA_Get_Products {
|
|
957 |
$zone_details['price'] = trim($shipping_cost);
|
958 |
}
|
959 |
} else {
|
960 |
-
// $shipping_cost = 0;
|
961 |
if(isset($shipping_cost)){
|
962 |
$zone_details['price'] = trim($currency." ".$shipping_cost);
|
963 |
}
|
964 |
-
//unset($zone_details);
|
965 |
-
//unset($shipping_cost);
|
966 |
}
|
967 |
}
|
968 |
}
|
@@ -992,12 +1121,19 @@ class WooSEA_Get_Products {
|
|
992 |
|
993 |
// Remove other shipping classes when free shipping is relevant
|
994 |
$free_check = "yes";
|
995 |
-
//$free_check = get_option ('free_shipping');
|
996 |
|
997 |
if(in_array($free_check, array_column($shipping_arr, 'free'))) { // search value in the array
|
998 |
foreach($shipping_arr as $k => $v) {
|
999 |
if(!in_array($free_check, $v)){
|
1000 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1001 |
}
|
1002 |
}
|
1003 |
}
|
@@ -1005,8 +1141,6 @@ class WooSEA_Get_Products {
|
|
1005 |
// Fix empty services
|
1006 |
foreach($shipping_arr as $k => $v){
|
1007 |
if(empty($v['service'])){
|
1008 |
-
// $lalala = get_option( 'woocommerce_default_country' );
|
1009 |
-
// $shipping_arr[$k]['country'] = get_option( 'woocommerce_default_country' );
|
1010 |
unset($shipping_arr[$k]);
|
1011 |
}
|
1012 |
}
|
@@ -1141,20 +1275,24 @@ class WooSEA_Get_Products {
|
|
1141 |
$link = $product->addChild('g:additional_image_link', $v, $namespace['g']);
|
1142 |
//$product->$k = $v;
|
1143 |
} elseif (preg_match("/g:product_highlight/i",$k)){
|
|
|
1144 |
$product_highlight = $product->addChild('g:product_highlight', $v, $namespace['g']);
|
1145 |
} elseif (preg_match("/g:product_detail/i",$k)){
|
1146 |
if(!empty($v)){
|
1147 |
$product_detail_split = explode("#", $v);
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
|
|
|
|
|
|
1158 |
}
|
1159 |
} elseif ($k == "g:installment"){
|
1160 |
if(!empty($v)){
|
@@ -1259,6 +1397,9 @@ class WooSEA_Get_Products {
|
|
1259 |
} elseif ($feed_config['name'] == "Glami.gr") {
|
1260 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><SHOP></SHOP>');
|
1261 |
$xml->asXML($file);
|
|
|
|
|
|
|
1262 |
} elseif ($feed_config['name'] == "Pricecheck.co.za") {
|
1263 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><Offers></Offers>');
|
1264 |
$xml->asXML($file);
|
@@ -1267,7 +1408,6 @@ class WooSEA_Get_Products {
|
|
1267 |
$xml->addAttribute('xmlns:content', 'http://purl.org/rss/1.0/modules/content/');
|
1268 |
$xml->addAttribute('xmlns:wfw', 'http://wellformedweb.org/CommentAPI/');
|
1269 |
$xml->addAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
1270 |
-
// $xml->addAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom');
|
1271 |
$xml->addAttribute('xmlns:sy', 'http://purl.org/rss/1.0/modules/syndication/');
|
1272 |
$xml->addAttribute('xmlns:slash', 'http://purl.org/rss/1.0/modules/slash/');
|
1273 |
$xml->addAttribute('version', '2.0');
|
@@ -1317,10 +1457,10 @@ class WooSEA_Get_Products {
|
|
1317 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
|
1318 |
$xml->addAttribute('version', '1.0');
|
1319 |
$xml->addAttribute('standalone', 'yes');
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
$xml->asXML($file);
|
1325 |
}
|
1326 |
} else {
|
@@ -1355,194 +1495,204 @@ class WooSEA_Get_Products {
|
|
1355 |
|
1356 |
// For Google Product review template
|
1357 |
if (($feed_config['name'] == "Google Product Review") AND (empty($xml->channel))) {
|
1358 |
-
|
|
|
|
|
1359 |
|
1360 |
-
|
|
|
|
|
1361 |
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
foreach($review_data as $rk => $rv){
|
1366 |
|
1367 |
-
|
1368 |
-
|
1369 |
|
1370 |
-
|
1371 |
-
|
1372 |
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
|
|
|
|
|
|
1389 |
} else {
|
1390 |
-
$
|
|
|
|
|
1391 |
}
|
1392 |
} else {
|
1393 |
-
$reviewer->addChild('
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
} else {
|
1403 |
-
$
|
|
|
|
|
1404 |
}
|
1405 |
-
} else {
|
1406 |
-
$reviewer->addChild('reviewer_id',$nodes[1]);
|
1407 |
}
|
1408 |
-
}
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
}
|
1415 |
}
|
1416 |
-
}
|
1417 |
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
|
|
1427 |
}
|
1428 |
-
}
|
1429 |
-
|
1430 |
|
1431 |
-
|
1432 |
-
|
1433 |
|
1434 |
-
|
1435 |
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
|
|
1442 |
}
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
$
|
1457 |
-
|
1458 |
-
|
1459 |
-
$
|
1460 |
-
|
1461 |
-
|
1462 |
-
$
|
1463 |
-
|
1464 |
-
|
1465 |
-
$
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1469 |
}
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
$poig = $poi->addChild('gtins');
|
1474 |
-
$poig->$k = $v;
|
1475 |
-
} elseif ($k == "mpn"){
|
1476 |
-
$poim = $poi->addChild('mpns');
|
1477 |
-
$poim->$k = $v;
|
1478 |
-
} elseif ($k == "sku"){
|
1479 |
-
$poix = $poi->addChild('skus');
|
1480 |
-
$poix->$k = $v;
|
1481 |
-
} elseif($k == "brand"){
|
1482 |
-
$poib = $poi->addChild('brands');
|
1483 |
-
$poib->$k = $v;
|
1484 |
-
} else {
|
1485 |
-
// Do nothing
|
1486 |
-
}
|
1487 |
-
}
|
1488 |
-
}
|
1489 |
-
}
|
1490 |
-
}
|
1491 |
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1516 |
}
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
} elseif ($k == "mpn"){
|
1523 |
-
$poim = $poi->addChild('mpns');
|
1524 |
-
$poim->$k = $v;
|
1525 |
-
} elseif ($k == "sku"){
|
1526 |
-
$poix = $poi->addChild('skus');
|
1527 |
-
$poix->$k = $v;
|
1528 |
-
} elseif($k == "brand"){
|
1529 |
-
$poib = $poi->addChild('brands');
|
1530 |
-
$poib->$k = $v;
|
1531 |
-
} else {
|
1532 |
-
// Do nothing
|
1533 |
-
}
|
1534 |
-
}
|
1535 |
-
}
|
1536 |
-
}
|
1537 |
-
}
|
1538 |
-
}
|
1539 |
}
|
1540 |
}
|
1541 |
}
|
1542 |
}
|
1543 |
|
1544 |
foreach ($products as $key => $value){
|
1545 |
-
|
1546 |
if ((is_array ( $value )) and (!empty( $value ))) {
|
1547 |
if ($feed_config['name'] == "Yandex") {
|
1548 |
$product = $xml->shop->offers->addChild('offer');
|
@@ -1566,7 +1716,9 @@ class WooSEA_Get_Products {
|
|
1566 |
|
1567 |
} else {
|
1568 |
if(count($value) > 0){
|
1569 |
-
$
|
|
|
|
|
1570 |
}
|
1571 |
}
|
1572 |
|
@@ -1676,11 +1828,10 @@ class WooSEA_Get_Products {
|
|
1676 |
$product->addChild("$k");
|
1677 |
$product->$k = $v;
|
1678 |
} else {
|
1679 |
-
if ($feed_config['fields'] != 'standard'){
|
1680 |
$k = $this->get_alternative_key ($channel_attributes, $k);
|
1681 |
}
|
1682 |
if(!empty($k)){
|
1683 |
-
|
1684 |
/**
|
1685 |
* Some Zbozi and Heureka attributes need some extra XML nodes
|
1686 |
*/
|
@@ -1715,7 +1866,34 @@ class WooSEA_Get_Products {
|
|
1715 |
$productp = $product->addChild($p,$v);
|
1716 |
$productp->addAttribute('name', $pieces[1]);
|
1717 |
} elseif ($feed_config['name'] == "Google Product Review") {
|
|
|
|
|
|
|
1718 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1719 |
} elseif ($feed_config['name'] == "Fruugo.nl") {
|
1720 |
$desc_arr = array('Language','Title','Description');
|
1721 |
$price_arr = array('Currency','NormalPriceWithoutVAT','NormalPriceWithVAT','VATRate');
|
@@ -1747,6 +1925,7 @@ class WooSEA_Get_Products {
|
|
1747 |
}
|
1748 |
|
1749 |
if(is_object($xml)){
|
|
|
1750 |
$xml->asXML($file);
|
1751 |
}
|
1752 |
unset($product);
|
@@ -1798,7 +1977,7 @@ class WooSEA_Get_Products {
|
|
1798 |
$channel_attributes = get_option('channel_attributes');
|
1799 |
}
|
1800 |
}
|
1801 |
-
|
1802 |
// Append or write to file
|
1803 |
$fp = fopen($file, 'a+');
|
1804 |
|
@@ -1815,7 +1994,7 @@ class WooSEA_Get_Products {
|
|
1815 |
$pieces = str_replace("'", "", $pieces);
|
1816 |
|
1817 |
foreach ($pieces as $k_inner => $v){
|
1818 |
-
|
1819 |
$v = $this->get_alternative_key ($channel_attributes, $v);
|
1820 |
}
|
1821 |
|
@@ -1880,6 +2059,7 @@ class WooSEA_Get_Products {
|
|
1880 |
fwrite($fp, $tab_line);
|
1881 |
}
|
1882 |
} else {
|
|
|
1883 |
$tofile = fputcsv($fp, $pieces, $csv_delimiter, '"');
|
1884 |
}
|
1885 |
|
@@ -1993,7 +2173,7 @@ class WooSEA_Get_Products {
|
|
1993 |
$xml_piece = "";
|
1994 |
|
1995 |
// Get taxonomies
|
1996 |
-
$no_taxonomies = array("element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","
|
1997 |
$taxonomies = get_taxonomies();
|
1998 |
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
|
1999 |
|
@@ -2041,6 +2221,33 @@ class WooSEA_Get_Products {
|
|
2041 |
}
|
2042 |
}
|
2043 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2044 |
// Construct WP query
|
2045 |
$wp_query = array(
|
2046 |
'posts_per_page' => $offset_step_size,
|
@@ -2048,8 +2255,10 @@ class WooSEA_Get_Products {
|
|
2048 |
'post_type' => $post_type,
|
2049 |
'post_status' => 'publish',
|
2050 |
'fields' => 'ids',
|
2051 |
-
|
2052 |
-
|
|
|
|
|
2053 |
$prods = new WP_Query($wp_query);
|
2054 |
$shipping_zones = $this->woosea_get_shipping_zones();
|
2055 |
|
@@ -2086,9 +2295,8 @@ class WooSEA_Get_Products {
|
|
2086 |
if(!in_array($product_data['id'], $allowed_product_orders)){ continue; }
|
2087 |
}
|
2088 |
}
|
2089 |
-
|
2090 |
$product_data['title'] = $product->get_title();
|
2091 |
-
|
2092 |
$product_data['mother_title'] = $product->get_title();
|
2093 |
$product_data['mother_title'] = $this->woosea_utf8_for_xml( $product_data['mother_title'] );
|
2094 |
$product_data['title_hyphen'] = $product_data['title'];
|
@@ -2248,10 +2456,9 @@ class WooSEA_Get_Products {
|
|
2248 |
// Check if there are mother categories
|
2249 |
if(!empty($product_cat)){
|
2250 |
$category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
|
2251 |
-
$category_path_skroutz = preg_replace('/>/', '>', $category_path);
|
2252 |
-
//$category_path_skroutz = str_replace('>','>',$category_path);
|
2253 |
|
2254 |
-
|
|
|
2255 |
$product_data['category_path'] = $category_path;
|
2256 |
$product_data['category_path_skroutz'] = $category_path_skroutz;
|
2257 |
$product_data['category_path_skroutz'] = str_replace("Home >","",$product_data['category_path_skroutz']);
|
@@ -2290,6 +2497,21 @@ class WooSEA_Get_Products {
|
|
2290 |
}
|
2291 |
}
|
2292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2293 |
$product_data['category_path_short'] = str_replace("Home >","",$product_data['category_path']);
|
2294 |
$product_data['category_path_short'] = str_replace(">",">",$product_data['category_path_short']);
|
2295 |
$product_data['category_link'] = $catlink;
|
@@ -2325,6 +2547,10 @@ class WooSEA_Get_Products {
|
|
2325 |
$product_data['raw_description'] = substr($product_data['raw_description'], 0, 5000);
|
2326 |
$product_data['raw_short_description'] = substr($product_data['raw_short_description'], 0, 5000);
|
2327 |
|
|
|
|
|
|
|
|
|
2328 |
/**
|
2329 |
* Check of we need to add Google Analytics UTM parameters
|
2330 |
*/
|
@@ -2335,6 +2561,7 @@ class WooSEA_Get_Products {
|
|
2335 |
}
|
2336 |
|
2337 |
$product_data['link'] = get_permalink( $product_data['id'])."$utm_part";
|
|
|
2338 |
$variable_link = htmlspecialchars(get_permalink( $product_data['id']));
|
2339 |
$vlink_piece = explode("?", $variable_link);
|
2340 |
$qutm_part = ltrim($utm_part, "&");
|
@@ -2342,14 +2569,20 @@ class WooSEA_Get_Products {
|
|
2342 |
$qutm_part = ltrim($qutm_part, "?");
|
2343 |
if($qutm_part){
|
2344 |
$product_data['variable_link'] = $vlink_piece[0]."?".$qutm_part;
|
|
|
2345 |
} else {
|
2346 |
$product_data['variable_link'] = $vlink_piece[0];
|
|
|
2347 |
}
|
2348 |
|
2349 |
$product_data['condition'] = ucfirst( get_post_meta( $product_data['id'], '_woosea_condition', true ) );
|
|
|
|
|
2350 |
if(empty($product_data['condition']) || $product_data['condition'] == "Array"){
|
2351 |
$product_data['condition'] = "New";
|
2352 |
}
|
|
|
|
|
2353 |
$product_data['availability'] = $this->get_stock( $this->childID );
|
2354 |
|
2355 |
/**
|
@@ -2358,17 +2591,28 @@ class WooSEA_Get_Products {
|
|
2358 |
* Therefor, we need to check the stock_status and overwrite te availability value
|
2359 |
*/
|
2360 |
$stock_status = $product->get_stock_status();
|
|
|
|
|
2361 |
if ($stock_status == "outofstock"){
|
2362 |
$product_data['availability'] = "out of stock";
|
|
|
|
|
|
|
2363 |
} elseif ($stock_status == "onbackorder") {
|
2364 |
$product_data['availability'] = "on backorder";
|
|
|
|
|
|
|
2365 |
} else {
|
2366 |
$product_data['availability'] = "in stock";
|
|
|
|
|
|
|
2367 |
}
|
2368 |
|
2369 |
$product_data['author'] = get_the_author();
|
2370 |
$product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
|
2371 |
-
$product_data['visibility'] = $
|
2372 |
$product_data['menu_order'] = get_post_field( 'menu_order', $product_data['id'] );
|
2373 |
$product_data['currency'] = get_woocommerce_currency();
|
2374 |
if(isset($project_config['WCML'])){
|
@@ -2385,10 +2629,38 @@ class WooSEA_Get_Products {
|
|
2385 |
$product_data['image_all'] = $product_data['image'];
|
2386 |
$product_data['all_images'] = $product_data['image'];
|
2387 |
$product_data['all_gallery_images'] = "";
|
2388 |
-
|
2389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2390 |
if($product_data['item_group_id'] > 0){
|
2391 |
$parent_product = wc_get_product( $product_data['item_group_id'] );
|
|
|
2392 |
if(is_object($parent_product)){
|
2393 |
$gallery_ids = $parent_product->get_gallery_image_ids();
|
2394 |
$product_data['image_all'] = wp_get_attachment_url($parent_product->get_image_id());
|
@@ -2414,7 +2686,6 @@ class WooSEA_Get_Products {
|
|
2414 |
$product_data['all_images'] = ltrim($product_data['all_images'],',');
|
2415 |
$product_data['all_images_kogan'] = preg_replace( '/,/', '|', $product_data['all_images'] );
|
2416 |
$product_data['all_gallery_images'] = ltrim($product_data['all_gallery_images'],',');
|
2417 |
-
$product_data['product_type'] = $product->get_type();
|
2418 |
|
2419 |
$product_data['content_type'] = "product";
|
2420 |
if($product_data['product_type'] == "variation"){
|
@@ -2430,6 +2701,8 @@ class WooSEA_Get_Products {
|
|
2430 |
|
2431 |
$product_data['shipping'] = 0;
|
2432 |
$tax_rates = WC_Tax::get_base_tax_rates( $product->get_tax_class() );
|
|
|
|
|
2433 |
$shipping_class_id = $product->get_shipping_class_id();
|
2434 |
$shipping_class= $product->get_shipping_class();
|
2435 |
|
@@ -2439,6 +2712,10 @@ class WooSEA_Get_Products {
|
|
2439 |
}
|
2440 |
|
2441 |
$product_data['shipping_label'] = $product->get_shipping_class();
|
|
|
|
|
|
|
|
|
2442 |
|
2443 |
// Get product prices
|
2444 |
$product_data['price'] = wc_get_price_including_tax($product, array('price'=> $product->get_price()));
|
@@ -2448,32 +2725,57 @@ class WooSEA_Get_Products {
|
|
2448 |
$product_data['regular_price'] = wc_get_price_including_tax($product, array('price'=> $product->get_regular_price()));
|
2449 |
$product_data['regular_price'] = wc_format_decimal($product_data['regular_price'],2);
|
2450 |
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
$product_data['
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
|
|
|
|
|
|
2465 |
|
2466 |
-
|
2467 |
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2473 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2474 |
}
|
2475 |
-
} else {
|
2476 |
-
$tax_rates[1]['rate'] = 0;
|
2477 |
}
|
2478 |
|
2479 |
$fullrate = 100+$tax_rates[1]['rate'];
|
@@ -2485,6 +2787,7 @@ class WooSEA_Get_Products {
|
|
2485 |
if($product->get_type() == "bundle"){
|
2486 |
if ($this->woosea_is_plugin_active('woocommerce-product-bundles/woocommerce-product-bundles.php')){
|
2487 |
$product_data['price'] = get_post_meta($product_data['id'], '_price', true);
|
|
|
2488 |
if(is_numeric($tax_rates[1]['rate'])){
|
2489 |
$product_data['price_forced'] = round(get_post_meta($product_data['id'], '_price', true) * (100+$tax_rates[1]['rate'])/100,2);
|
2490 |
$product_data['regular_price'] = round(get_post_meta($product_data['id'], '_regular_price', true) * (100+$tax_rates[1]['rate'])/100,2);
|
@@ -2525,9 +2828,19 @@ class WooSEA_Get_Products {
|
|
2525 |
|
2526 |
// Make sure the product ID is not NULL either
|
2527 |
global $woocommerce_wpml;
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2531 |
|
2532 |
// When WCML manual prices have been entered
|
2533 |
if(!is_null($product_data['id'])){
|
@@ -2541,9 +2854,17 @@ class WooSEA_Get_Products {
|
|
2541 |
$product_data['regular_price'] = $custom_prices['_regular_price'];
|
2542 |
}
|
2543 |
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2547 |
}
|
2548 |
}
|
2549 |
|
@@ -2557,21 +2878,23 @@ class WooSEA_Get_Products {
|
|
2557 |
}
|
2558 |
if($product->get_regular_price()){
|
2559 |
$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);
|
2560 |
-
$product_data['net_regular_price'] = ($product->get_regular_price()
|
2561 |
-
|
|
|
2562 |
}
|
2563 |
if($product->get_sale_price()){
|
2564 |
$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);
|
2565 |
-
$product_data['net_sale_price'] = ($product->get_sale_price()
|
2566 |
-
|
2567 |
-
|
2568 |
// We do not want to have 0 sale price values in the feed
|
2569 |
if($product_data['net_sale_price'] == 0){
|
2570 |
$product_data['net_sale_price'] = "";
|
2571 |
}
|
2572 |
}
|
2573 |
-
|
2574 |
-
|
|
|
|
|
2575 |
$price = wc_get_price_including_tax($product,array('price'=> $product->get_price()));
|
2576 |
if($product_data['sale_price'] > 0){
|
2577 |
$price = $product_data['sale_price'];
|
@@ -2581,7 +2904,11 @@ class WooSEA_Get_Products {
|
|
2581 |
if ($this->woosea_is_plugin_active('woo-discount-rules/woo-discount-rules.php')){
|
2582 |
$discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', false, $product, 1, $product_data['sale_price'], 'discounted_price', true, true);
|
2583 |
if($discount !== false){
|
|
|
|
|
|
|
2584 |
$product_data['sale_price'] = $discount;
|
|
|
2585 |
$price_incl_tax = get_option( 'woocommerce_prices_include_tax' );
|
2586 |
if($price_incl_tax == "yes"){
|
2587 |
$product_data['price_forced'] = $product_data['price']*($fullrate/100);
|
@@ -2690,6 +3017,24 @@ class WooSEA_Get_Products {
|
|
2690 |
}
|
2691 |
}
|
2692 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2693 |
// Localize the price attributes
|
2694 |
$decimal_separator = wc_get_price_decimal_separator();
|
2695 |
$product_data['price'] = wc_format_localized_price($product_data['price']);
|
@@ -2697,12 +3042,18 @@ class WooSEA_Get_Products {
|
|
2697 |
$product_data['sale_price'] = wc_format_localized_price($product_data['sale_price']);
|
2698 |
if($product->get_price()){
|
2699 |
$product_data['price_forced'] = wc_format_localized_price($product_data['price_forced']);
|
|
|
|
|
2700 |
}
|
2701 |
if($product->get_regular_price()){
|
2702 |
$product_data['regular_price_forced'] = wc_format_localized_price($product_data['regular_price_forced']);
|
|
|
|
|
2703 |
}
|
2704 |
if($product->get_sale_price()){
|
2705 |
$product_data['sale_price_forced'] = wc_format_localized_price($product_data['sale_price_forced']);
|
|
|
|
|
2706 |
}
|
2707 |
$product_data['net_price'] = wc_format_localized_price($product_data['net_price']);
|
2708 |
|
@@ -2716,34 +3067,66 @@ class WooSEA_Get_Products {
|
|
2716 |
$product_data['net_sale_price'] = wc_format_localized_price($product_data['net_sale_price']);
|
2717 |
}
|
2718 |
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2723 |
|
2724 |
// Add rounded price options
|
2725 |
-
|
2726 |
-
|
2727 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2728 |
|
2729 |
// Calculate discount percentage
|
2730 |
-
if($product_data['
|
2731 |
-
$product_data['
|
|
|
|
|
|
|
|
|
2732 |
}
|
2733 |
|
2734 |
foreach($project_config['attributes'] as $attr_key => $attr_arr){
|
2735 |
if(is_array($attr_arr)){
|
2736 |
if($attr_arr['attribute'] == "g:shipping"){
|
2737 |
if($product_data['price'] > 0){
|
2738 |
-
$product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $product_data['price'], $tax_rates, $shipping_zones, $product_data['id'], $product_data['item_group_id']);
|
2739 |
$shipping_str = $product_data['shipping'];
|
2740 |
}
|
2741 |
}
|
2742 |
}
|
2743 |
}
|
2744 |
|
2745 |
-
|
2746 |
-
$product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $product_data['price'], $tax_rates, $shipping_zones, $product_data['id'], $product_data['item_group_id']);
|
2747 |
$shipping_str = $product_data['shipping'];
|
2748 |
}
|
2749 |
|
@@ -2751,7 +3134,8 @@ class WooSEA_Get_Products {
|
|
2751 |
if(!empty($shipping_str)){
|
2752 |
$product_data['shipping_price'] = 0;
|
2753 |
}
|
2754 |
-
$
|
|
|
2755 |
|
2756 |
if(is_array($shipping_arr)){
|
2757 |
foreach($shipping_arr as $akey => $arr){
|
@@ -2759,6 +3143,7 @@ class WooSEA_Get_Products {
|
|
2759 |
$pieces_ship = explode (" ", $arr['price']);
|
2760 |
if(isset($pieces_ship['1'])){
|
2761 |
$product_data['shipping_price'] = $pieces_ship['1'];
|
|
|
2762 |
}
|
2763 |
}
|
2764 |
|
@@ -2773,8 +3158,30 @@ class WooSEA_Get_Products {
|
|
2773 |
}
|
2774 |
}
|
2775 |
|
2776 |
-
//
|
2777 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2778 |
$thousand_separator = wc_get_price_thousand_separator();
|
2779 |
|
2780 |
if($thousand_separator != ','){
|
@@ -2838,7 +3245,7 @@ class WooSEA_Get_Products {
|
|
2838 |
|
2839 |
foreach($diff_taxonomies as $taxo){
|
2840 |
$term_value = get_the_terms($product_data['id'], $taxo);
|
2841 |
-
$product_data[$taxo] = "";
|
2842 |
|
2843 |
if(is_array($term_value)){
|
2844 |
// Do not add variation values to the feed when they are out of stock
|
@@ -2848,7 +3255,7 @@ class WooSEA_Get_Products {
|
|
2848 |
$variations = $product_skroutz->get_available_variations();
|
2849 |
$variations_id = wp_list_pluck( $variations, 'variation_id' );
|
2850 |
$skroutz_att_array = array();
|
2851 |
-
|
2852 |
foreach($variations_id as $var_id){
|
2853 |
$stock_value = get_post_meta( $var_id, "_stock_status", true );
|
2854 |
if($stock_value == "instock"){
|
@@ -2862,12 +3269,13 @@ class WooSEA_Get_Products {
|
|
2862 |
$product_data[$taxo] = rtrim($product_data[$taxo],',');
|
2863 |
}
|
2864 |
}
|
2865 |
-
|
2866 |
foreach($skroutz_att_array as $skrtz_value){
|
2867 |
$product_data[$taxo] .= ",". $skrtz_value;
|
2868 |
}
|
2869 |
$product_data[$taxo] = ltrim($product_data[$taxo],',');
|
2870 |
$product_data[$taxo] = rtrim($product_data[$taxo],',');
|
|
|
2871 |
} else {
|
2872 |
// Simple Skroutz product
|
2873 |
foreach($term_value as $term){
|
@@ -2910,64 +3318,100 @@ class WooSEA_Get_Products {
|
|
2910 |
/**
|
2911 |
* Get Custom Attributes for Single, Bundled and Composite products
|
2912 |
*/
|
2913 |
-
if (($product->is_type('simple')) OR ($product->is_type('mix-and-match')) OR ($product->is_type('external')) OR ($product->is_type('bundle')) OR ($product->is_type('composite')) OR ($product_data['product_type'] == "variable") OR ($product_data['product_type'] == "auction") OR ($product->is_type('subscription'))){
|
2914 |
$custom_attributes = $this->get_custom_attributes( $product_data['id'] );
|
2915 |
|
2916 |
-
if(
|
2917 |
-
$woosea_opt = array (
|
2918 |
-
"_woosea_optimized_title" => "woosea optimized title",
|
2919 |
-
);
|
2920 |
-
$custom_attributes = array_merge($custom_attributes, $woosea_opt);
|
2921 |
-
}
|
2922 |
|
2923 |
-
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
|
2924 |
-
$custom_attributes['_aioseop_title'] = "All in one seo pack title";
|
2925 |
-
$custom_attributes['_aioseop_description'] = "All in one seo pack description";
|
2926 |
-
}
|
2927 |
|
2928 |
-
|
2929 |
-
|
2930 |
-
|
2931 |
-
|
2932 |
-
|
2933 |
-
if(($custom_kk == "_aioseop_title") && ($custom_value == "")){
|
2934 |
-
$custom_value = $product_data['title'];
|
2935 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2936 |
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
|
2963 |
-
|
2964 |
-
|
2965 |
-
|
|
|
2966 |
}
|
2967 |
}
|
|
|
|
|
2968 |
}
|
2969 |
-
|
2970 |
-
}
|
2971 |
|
2972 |
/**
|
2973 |
* We need to check if this product has individual custom product attributes
|
@@ -2977,7 +3421,7 @@ class WooSEA_Get_Products {
|
|
2977 |
$data = $wpdb->get_results($sql);
|
2978 |
if (count($data)) {
|
2979 |
foreach ($data as $key => $value) {
|
2980 |
-
|
2981 |
if (preg_match("/_product_attributes/i",$value->name)){
|
2982 |
$product_attr = unserialize($value->type);
|
2983 |
if(!empty($product_attr)){
|
@@ -2995,14 +3439,14 @@ class WooSEA_Get_Products {
|
|
2995 |
|
2996 |
/**
|
2997 |
* Get Product Attributes for Single products
|
|
|
2998 |
*/
|
2999 |
-
if (($product->is_type('simple')) OR ($product->is_type('external')) OR ($product->is_type('mix-and-match')) OR ($product->is_type('bundle')) OR ($product->is_type('composite')) OR ($product->is_type('auction') OR ($product->is_type('subscription')))){
|
3000 |
$single_attributes = $product->get_attributes();
|
3001 |
-
|
3002 |
foreach ($single_attributes as $attribute){
|
3003 |
-
|
3004 |
-
|
3005 |
-
|
3006 |
}
|
3007 |
}
|
3008 |
|
@@ -3015,9 +3459,6 @@ class WooSEA_Get_Products {
|
|
3015 |
}
|
3016 |
}
|
3017 |
|
3018 |
-
// Get product reviews for Google Product Review Feeds
|
3019 |
-
// $product_data['reviews'] = $this->woosea_get_reviews( $product_data, $product );
|
3020 |
-
|
3021 |
/**
|
3022 |
* Versioned products need a seperate approach
|
3023 |
* Get data for these products based on the mother products item group id
|
@@ -3028,9 +3469,9 @@ class WooSEA_Get_Products {
|
|
3028 |
$product_variations = new WC_Product_Variation( $product_data['id'] );
|
3029 |
$variations = $product_variations->get_variation_attributes();
|
3030 |
|
3031 |
-
// For Skroutz apparal products we can only append colours to the product name
|
3032 |
// When a product has both a size and color attribute we assume its an apparal product
|
3033 |
-
if($project_config['fields'] == "skroutz"){
|
3034 |
$size_found = "no";
|
3035 |
$color_found = "no";
|
3036 |
|
@@ -3064,7 +3505,7 @@ class WooSEA_Get_Products {
|
|
3064 |
if(isset($sz_attribute)){
|
3065 |
$skroutz_size = get_post_meta( $product_data['id'], "attribute_".$sz_attribute, true );
|
3066 |
}
|
3067 |
-
|
3068 |
if((!empty($skroutz_color)) AND (!empty($skroutz_size))){
|
3069 |
|
3070 |
foreach($variations as $kvar => $vvar){
|
@@ -3106,23 +3547,31 @@ class WooSEA_Get_Products {
|
|
3106 |
}
|
3107 |
}
|
3108 |
|
3109 |
-
|
3110 |
-
|
3111 |
if((isset($project_config['lowest_price_variations'])) OR (isset($project_config['default_variations']))){
|
3112 |
-
|
3113 |
// Determine the default variation product
|
3114 |
if( ($product_data['item_group_id'] > 0) AND (is_object(wc_get_product( $product_data['item_group_id']))) AND (($product_data['product_type'] == "variation") OR ($product_data['product_type'] == "subscription_variation"))){
|
3115 |
-
|
3116 |
-
|
|
|
3117 |
|
3118 |
if(isset($project_config['lowest_price_variations'])){
|
3119 |
-
|
3120 |
// Determine lowest priced variation
|
3121 |
$variation_min_price = $mother_product->get_variation_price('min');
|
3122 |
$variation_min_price = wc_format_decimal($variation_min_price,2);
|
3123 |
$variation_min_price = wc_format_localized_price($variation_min_price);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3124 |
|
3125 |
-
if($product_data['system_net_price'] == $variation_min_price){
|
3126 |
$variation_pass = "true";
|
3127 |
} else {
|
3128 |
$variation_pass = "false";
|
@@ -3260,19 +3709,21 @@ class WooSEA_Get_Products {
|
|
3260 |
/**
|
3261 |
* Although this is a product variation we also need to grap the Dynamic attributes belonging to the simple mother prodict
|
3262 |
*/
|
|
|
|
|
3263 |
foreach($diff_taxonomies as $taxo){
|
3264 |
$term_value = get_the_terms($product_data['item_group_id'], $taxo);
|
3265 |
unset($product_data[$taxo]);
|
3266 |
if(is_array($term_value)){
|
3267 |
foreach($term_value as $term){
|
3268 |
if(empty($product_data[$taxo])){
|
3269 |
-
|
3270 |
} else {
|
3271 |
-
|
3272 |
}
|
3273 |
}
|
3274 |
}
|
3275 |
-
|
3276 |
|
3277 |
/**
|
3278 |
* Add product tags to the product data array
|
@@ -3292,6 +3743,7 @@ class WooSEA_Get_Products {
|
|
3292 |
|
3293 |
// Add attribute values to the variation product names to make them unique
|
3294 |
$product_data['title_hyphen'] = $product_data['title']." - ";
|
|
|
3295 |
|
3296 |
foreach($variations as $kk => $vv){
|
3297 |
$custom_key = $kk;
|
@@ -3325,7 +3777,6 @@ class WooSEA_Get_Products {
|
|
3325 |
/**
|
3326 |
* Get Custom Attributes for this variable product
|
3327 |
*/
|
3328 |
-
|
3329 |
$custom_attributes = $this->get_custom_attributes( $product_data['id'] );
|
3330 |
|
3331 |
if(!in_array("woosea optimized title", $custom_attributes)){
|
@@ -3339,7 +3790,28 @@ class WooSEA_Get_Products {
|
|
3339 |
$custom_attributes['_aioseop_title'] = "All in one seo pack title";
|
3340 |
$custom_attributes['_aioseop_description'] = "All in one seo pack description";
|
3341 |
}
|
3342 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3343 |
foreach($custom_attributes as $custom_kk => $custom_vv){
|
3344 |
$custom_value = get_post_meta( $product_data['id'], $custom_kk, true );
|
3345 |
|
@@ -3371,7 +3843,7 @@ class WooSEA_Get_Products {
|
|
3371 |
$new_key = str_replace("var","product",$new_key);
|
3372 |
if(!empty( $custom_value )){
|
3373 |
$product_data[$new_key] = $custom_value;
|
3374 |
-
|
3375 |
}
|
3376 |
}
|
3377 |
|
@@ -3386,7 +3858,7 @@ class WooSEA_Get_Products {
|
|
3386 |
$value_display = str_replace("_", " ",$value->name);
|
3387 |
if (preg_match("/_product_attributes/i",$value->name)){
|
3388 |
$product_attr = unserialize($value->type);
|
3389 |
-
if(!empty($product_attr)){
|
3390 |
foreach ($product_attr as $key => $arr_value) {
|
3391 |
$new_key ="custom_attributes_" . $key;
|
3392 |
$product_data[$new_key] = $arr_value['value'];
|
@@ -3401,6 +3873,27 @@ class WooSEA_Get_Products {
|
|
3401 |
*/
|
3402 |
$custom_attributes_mother = $this->get_custom_attributes( $product_data['item_group_id'] );
|
3403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3404 |
foreach($custom_attributes_mother as $custom_kk_m => $custom_value_m){
|
3405 |
|
3406 |
if(!array_key_exists($custom_kk_m, $product_data)){
|
@@ -3440,14 +3933,61 @@ class WooSEA_Get_Products {
|
|
3440 |
* we will add CDATA brackets to the title and description attributes
|
3441 |
*/
|
3442 |
$product_data['title_lc'] = ucfirst(strtolower($product_data['title']));
|
3443 |
-
|
3444 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3445 |
|
3446 |
/**
|
3447 |
* Get product reviews for Google Product Review Feeds
|
3448 |
*/
|
3449 |
$product_data['reviews'] = $this->woosea_get_reviews( $product_data, $product );
|
3450 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3451 |
/**
|
3452 |
* Check if individual products need to be excluded
|
3453 |
*/
|
@@ -3492,6 +4032,10 @@ class WooSEA_Get_Products {
|
|
3492 |
$product_data = $this->woocommerce_sea_filters( $project_config['rules'], $product_data );
|
3493 |
}
|
3494 |
}
|
|
|
|
|
|
|
|
|
3495 |
|
3496 |
// Check if the sale price is effective
|
3497 |
if(isset($product_data['sale_price_start_date'])){
|
@@ -3513,16 +4057,19 @@ class WooSEA_Get_Products {
|
|
3513 |
// For these channels parent products are allowed
|
3514 |
$allowed_channel_parents = array(
|
3515 |
"skroutz",
|
|
|
3516 |
"google_dsa",
|
3517 |
"google_product_review",
|
3518 |
);
|
3519 |
|
3520 |
-
if
|
3521 |
-
if(($
|
3522 |
-
$product_data
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
|
|
|
|
3526 |
|
3527 |
/**
|
3528 |
* Remove variation products that are not THE default variation product
|
@@ -3535,7 +4082,7 @@ class WooSEA_Get_Products {
|
|
3535 |
/**
|
3536 |
* And item_group_id is not allowed for simple products, prevent users from adding this to the feedd
|
3537 |
*/
|
3538 |
-
if($product->is_type('simple') OR ($product->is_type('auction'))){
|
3539 |
unset($product_data['item_group_id']);
|
3540 |
}
|
3541 |
|
@@ -3549,6 +4096,81 @@ class WooSEA_Get_Products {
|
|
3549 |
}
|
3550 |
}
|
3551 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3552 |
/**
|
3553 |
* When product has passed the filter rules it can continue with the rest
|
3554 |
*/
|
@@ -3582,7 +4204,7 @@ class WooSEA_Get_Products {
|
|
3582 |
}
|
3583 |
} else {
|
3584 |
if((strlen($attr_value['mapfrom'])) AND (array_key_exists($attr_value['mapfrom'], $product_data))){
|
3585 |
-
if(($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "g:link_template") OR ($attr_value['attribute'] == "g:image_link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "Final URL") OR ($attr_value['attribute'] == "SKU")){
|
3586 |
$attr_line = "'".$attr_value['prefix']."".$product_data[$attr_value['mapfrom']]."".$attr_value['suffix']."'";
|
3587 |
} else {
|
3588 |
$attr_line = "'".$attr_value['prefix']. "".$product_data[$attr_value['mapfrom']]."" .$attr_value['suffix']."'";
|
@@ -3654,7 +4276,7 @@ class WooSEA_Get_Products {
|
|
3654 |
}
|
3655 |
} else {
|
3656 |
if(strlen($product_data[$attr_value['mapfrom']])){
|
3657 |
-
if(($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "g:link_template") OR ($attr_value['attribute'] == "g:image_link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "Final URL") OR ($attr_value['attribute'] == "SKU")){
|
3658 |
if(($product_data['product_type'] == "variation") AND (preg_match("/aelia_cs_currency/", $attr_value['suffix']))){
|
3659 |
$attr_value['suffix'] = str_replace("?","&",$attr_value['suffix']);
|
3660 |
$attr_line .= ",'".$attr_value['prefix']."".$product_data[$attr_value['mapfrom']]."".$attr_value['suffix']."'";
|
@@ -3838,6 +4460,7 @@ class WooSEA_Get_Products {
|
|
3838 |
$shipping_str .= ":WOOSEA_POSTAL_CODE##$v";
|
3839 |
} elseif ($k == "price"){
|
3840 |
$shipping_str .= ":WOOSEA_PRICE##$attr_value[prefix] $v $attr_value[suffix]";
|
|
|
3841 |
} else {
|
3842 |
// UNKNOWN, DO NOT ADD
|
3843 |
}
|
@@ -3874,7 +4497,7 @@ class WooSEA_Get_Products {
|
|
3874 |
}
|
3875 |
} else {
|
3876 |
if(strlen($product_data[$attr_value['mapfrom']])){
|
3877 |
-
if(($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "g:link_template")){
|
3878 |
if(($product_data['product_type'] == "variation") AND (preg_match("/aelia_cs_currency/", $attr_value['suffix']))){
|
3879 |
$attr_value['suffix'] = str_replace("?","&",$attr_value['suffix']);
|
3880 |
$xml_product[$attr_value['attribute']] = "$attr_value[prefix]". $product_data[$attr_value['mapfrom']] ."$attr_value[suffix]";
|
@@ -4144,9 +4767,9 @@ class WooSEA_Get_Products {
|
|
4144 |
}
|
4145 |
// New policy of Google, only when the value is yes add it to the feed
|
4146 |
// 28 October 2019
|
4147 |
-
|
4148 |
$xml_product['g:identifier_exists'] = $identifier_exists;
|
4149 |
-
|
4150 |
}
|
4151 |
return $xml_product;
|
4152 |
}
|
@@ -4404,479 +5027,485 @@ class WooSEA_Get_Products {
|
|
4404 |
return $product_data;
|
4405 |
}
|
4406 |
|
4407 |
-
|
4408 |
-
|
4409 |
-
|
4410 |
private function woocommerce_sea_rules( $project_rules2, $product_data ){
|
4411 |
$aantal_prods = count($product_data);
|
4412 |
-
|
4413 |
-
|
4414 |
-
foreach ($project_rules2 as $pr_key => $pr_array){
|
4415 |
|
4416 |
-
|
4417 |
|
4418 |
-
|
4419 |
-
if($pd_key == $pr_array['attribute']){
|
4420 |
|
4421 |
-
|
4422 |
-
|
4423 |
-
|
4424 |
-
|
|
|
|
|
4425 |
|
4426 |
// Check if a rule has been set for Google categories
|
4427 |
if (!empty($product_data['categories']) AND ($pr_array['than_attribute'] == "google_category") AND ($product_data[$pr_array['attribute']] == $pr_array['criteria'])){
|
4428 |
-
|
4429 |
-
|
4430 |
$category_id = explode("-", $pr_array['newvalue']);
|
4431 |
$pr_array['newvalue'] = $category_id[0];
|
4432 |
-
|
4433 |
-
|
4434 |
|
4435 |
-
|
4436 |
-
|
4437 |
-
|
4438 |
-
|
4439 |
|
4440 |
|
4441 |
-
|
4442 |
-
|
4443 |
-
|
4444 |
-
|
4445 |
|
4446 |
-
|
4447 |
|
4448 |
-
|
4449 |
-
|
4450 |
-
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
-
|
4455 |
-
|
4456 |
-
|
4457 |
-
|
4458 |
-
|
4459 |
-
|
4460 |
-
|
4461 |
-
|
4462 |
-
|
4463 |
-
|
4464 |
-
|
4465 |
-
|
4466 |
-
|
4467 |
-
|
4468 |
-
|
4469 |
-
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
4473 |
-
|
4474 |
-
|
4475 |
-
|
4476 |
-
|
4477 |
-
|
4478 |
-
|
4479 |
-
|
4480 |
-
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
4484 |
-
|
4485 |
-
|
4486 |
-
|
4487 |
-
|
4488 |
-
|
4489 |
-
|
4490 |
-
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
|
4498 |
-
|
4499 |
-
|
4500 |
-
|
4501 |
-
|
4502 |
-
|
4503 |
-
|
4504 |
-
|
4505 |
-
|
4506 |
-
|
4507 |
-
|
4508 |
-
|
4509 |
-
|
4510 |
-
|
4511 |
-
|
4512 |
-
|
4513 |
-
|
4514 |
-
|
4515 |
-
|
4516 |
-
|
4517 |
-
|
4518 |
-
|
4519 |
-
|
4520 |
-
|
4521 |
-
|
4522 |
-
|
4523 |
-
|
4524 |
-
|
4525 |
-
|
4526 |
-
|
4527 |
-
|
4528 |
-
|
4529 |
-
|
4530 |
// Make sure that a new value has been set
|
4531 |
-
|
4532 |
-
|
4533 |
if($pr_array['attribute'] == $pr_array['than_attribute']){
|
4534 |
$newvalue = str_replace($pr_array['criteria'],$pr_array['newvalue'], $pd_value);
|
4535 |
$product_data[$pr_array['than_attribute']] = ucfirst($newvalue);
|
4536 |
}
|
4537 |
-
|
4538 |
-
|
4539 |
-
|
4540 |
-
|
4541 |
-
|
4542 |
-
|
4543 |
-
|
4544 |
-
|
4545 |
-
|
4546 |
-
|
4547 |
-
|
4548 |
-
|
4549 |
-
|
4550 |
-
|
4551 |
-
|
4552 |
-
|
4553 |
-
|
4554 |
-
|
4555 |
-
|
4556 |
-
|
4557 |
-
|
4558 |
-
|
4559 |
-
|
4560 |
-
|
4561 |
-
|
4562 |
-
|
4563 |
-
|
4564 |
-
|
4565 |
-
|
4566 |
-
|
4567 |
-
|
4568 |
-
|
4569 |
-
|
4570 |
-
|
4571 |
-
|
4572 |
-
|
4573 |
-
|
4574 |
-
|
4575 |
-
|
4576 |
-
|
4577 |
-
|
4578 |
-
|
4579 |
-
|
4580 |
-
|
4581 |
-
|
4582 |
-
|
4583 |
-
|
4584 |
-
|
4585 |
-
|
4586 |
-
|
4587 |
-
|
4588 |
-
|
4589 |
-
|
4590 |
-
|
4591 |
-
|
4592 |
-
|
4593 |
-
|
4594 |
-
|
4595 |
-
|
4596 |
-
|
4597 |
-
|
4598 |
-
|
4599 |
-
|
4600 |
-
|
4601 |
-
|
4602 |
-
|
4603 |
-
|
4604 |
-
|
4605 |
-
|
4606 |
-
|
4607 |
-
|
4608 |
-
|
4609 |
-
|
4610 |
-
|
4611 |
-
|
4612 |
-
|
4613 |
-
|
4614 |
-
|
4615 |
-
|
4616 |
-
|
4617 |
-
|
4618 |
-
|
4619 |
-
|
4620 |
-
|
4621 |
-
|
4622 |
-
|
4623 |
-
|
4624 |
-
|
4625 |
-
|
4626 |
-
|
4627 |
-
|
4628 |
-
|
4629 |
-
|
4630 |
-
|
4631 |
-
|
4632 |
-
|
4633 |
-
|
4634 |
-
|
4635 |
-
|
4636 |
-
|
4637 |
-
|
4638 |
-
|
4639 |
-
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
-
|
4644 |
-
|
4645 |
-
|
4646 |
-
|
4647 |
-
|
4648 |
-
|
4649 |
-
|
4650 |
-
|
4651 |
-
|
4652 |
-
|
4653 |
-
|
4654 |
-
|
4655 |
-
|
4656 |
-
|
4657 |
-
|
4658 |
-
|
4659 |
-
|
4660 |
-
|
4661 |
-
|
4662 |
-
|
4663 |
-
|
4664 |
-
|
4665 |
-
|
4666 |
-
|
4667 |
-
|
4668 |
-
|
4669 |
-
|
4670 |
-
|
4671 |
-
|
4672 |
-
|
4673 |
-
|
4674 |
-
|
4675 |
-
|
4676 |
-
|
4677 |
-
|
4678 |
-
|
4679 |
-
|
4680 |
-
|
4681 |
-
|
4682 |
-
|
4683 |
-
|
4684 |
-
|
4685 |
-
|
4686 |
-
|
4687 |
-
|
4688 |
-
|
4689 |
-
|
4690 |
-
|
4691 |
-
|
4692 |
-
|
4693 |
-
|
4694 |
-
|
4695 |
-
|
4696 |
-
|
4697 |
-
|
4698 |
-
|
4699 |
-
|
4700 |
-
|
4701 |
-
|
4702 |
-
|
4703 |
-
|
4704 |
-
|
4705 |
-
|
4706 |
-
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
4711 |
-
|
4712 |
-
// Rules for string values
|
4713 |
-
if (!array_key_exists('cs', $pr_array)){
|
4714 |
-
$
|
4715 |
-
|
4716 |
-
|
4717 |
-
|
4718 |
-
|
4719 |
-
case($pr_array['condition'] = "contains"):
|
4720 |
-
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
4721 |
-
// Specifically for shipping price rules
|
4722 |
-
if(!empty($product_data[$pr_array['than_attribute']])){
|
4723 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4724 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4725 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4726 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4727 |
-
}
|
4728 |
-
} else {
|
4729 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4730 |
-
}
|
4731 |
-
} else {
|
4732 |
-
// This attribute value is empty for this product
|
4733 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4734 |
-
}
|
4735 |
-
}
|
4736 |
-
break;
|
4737 |
-
case($pr_array['condition'] = "containsnot"):
|
4738 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
4739 |
-
// Specifically for shipping price rules
|
4740 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4741 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4742 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4743 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4744 |
-
}
|
4745 |
-
} else {
|
4746 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4747 |
-
}
|
4748 |
-
}
|
4749 |
-
break;
|
4750 |
-
case($pr_array['condition'] = "="):
|
4751 |
-
if (($pr_array['criteria'] == "$pd_value")){
|
4752 |
-
// Specifically for shipping price rules
|
4753 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4754 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4755 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4756 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4757 |
-
}
|
4758 |
-
} else {
|
4759 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4760 |
-
}
|
4761 |
-
}
|
4762 |
-
$ship = $product_data['shipping'];
|
4763 |
-
break;
|
4764 |
-
case($pr_array['condition'] = "!="):
|
4765 |
-
if (($pr_array['criteria'] != "$pd_value")){
|
4766 |
-
// Specifically for shipping price rules
|
4767 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4768 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4769 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4770 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4771 |
-
}
|
4772 |
-
} else {
|
4773 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4774 |
-
}
|
4775 |
-
}
|
4776 |
-
break;
|
4777 |
-
case($pr_array['condition'] = ">"):
|
4778 |
-
// Use a lexical order on relational string operators
|
4779 |
-
if (($pd_value > $pr_array['criteria'])){
|
4780 |
-
// Specifically for shipping price rules
|
4781 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4782 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4783 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4784 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4785 |
-
}
|
4786 |
-
} else {
|
4787 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4788 |
-
}
|
4789 |
-
}
|
4790 |
-
break;
|
4791 |
-
case($pr_array['condition'] = ">="):
|
4792 |
-
// Use a lexical order on relational string operators
|
4793 |
-
if (($pd_value >= $pr_array['criteria'])){
|
4794 |
-
// Specifically for shipping price rules
|
4795 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4796 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4797 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4798 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4799 |
-
}
|
4800 |
-
} else {
|
4801 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4802 |
-
}
|
4803 |
-
}
|
4804 |
-
break;
|
4805 |
-
case($pr_array['condition'] = "<"):
|
4806 |
-
// Use a lexical order on relational string operators
|
4807 |
-
if (($pd_value < $pr_array['criteria'])){
|
4808 |
-
// Specifically for shipping price rules
|
4809 |
-
if(isset($product_data[$pr_array['than_attribute']]) AND (is_array($product_data[$pr_array['than_attribute']]))){
|
4810 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4811 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4812 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4813 |
-
}
|
4814 |
-
} else {
|
4815 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4816 |
-
}
|
4817 |
-
}
|
4818 |
-
break;
|
4819 |
-
case($pr_array['condition'] = "=<"):
|
4820 |
-
// Use a lexical order on relational string operators
|
4821 |
-
if (($pd_value <= $pr_array['criteria'])){
|
4822 |
-
// Specifically for shipping price rules
|
4823 |
-
if(is_array($product_data[$pr_array['than_attribute']])){
|
4824 |
-
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
4825 |
-
for ($x = 0; $x <= $arr_size; $x++) {
|
4826 |
-
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
4827 |
-
}
|
4828 |
-
} else {
|
4829 |
-
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
4830 |
-
}
|
4831 |
-
}
|
4832 |
-
break;
|
4833 |
|
4834 |
-
|
4835 |
-
|
4836 |
-
|
4837 |
-
|
4838 |
-
|
4839 |
-
|
4840 |
-
|
4841 |
-
|
4842 |
-
|
4843 |
-
|
4844 |
-
|
4845 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4846 |
case($pr_array['condition'] = "findreplace"):
|
4847 |
if (strpos($pd_value, $pr_array['criteria']) !== false){
|
4848 |
-
|
4849 |
-
|
4850 |
-
|
4851 |
if($pr_array['attribute'] == $pr_array['than_attribute']){
|
4852 |
-
|
4853 |
-
|
4854 |
-
|
4855 |
-
|
4856 |
-
|
|
|
4857 |
break;
|
4858 |
-
|
4859 |
-
|
4860 |
-
|
4861 |
-
|
4862 |
-
|
4863 |
-
|
4864 |
-
|
4865 |
-
|
4866 |
if(!empty($pr_array['newvalue'])){
|
4867 |
-
$
|
|
|
|
|
4868 |
} else {
|
4869 |
-
if(
|
4870 |
-
$
|
|
|
|
|
4871 |
}
|
4872 |
-
|
4873 |
-
|
4874 |
-
|
4875 |
-
|
4876 |
-
|
4877 |
-
|
4878 |
-
|
4879 |
-
|
4880 |
|
4881 |
/**
|
4882 |
* Function to exclude products based on individual product exclusions
|
@@ -4899,525 +5528,527 @@ class WooSEA_Get_Products {
|
|
4899 |
}
|
4900 |
}
|
4901 |
|
4902 |
-
|
4903 |
-
|
4904 |
-
|
|
|
4905 |
private function woocommerce_sea_filters( $project_rules, $product_data ){
|
4906 |
-
|
4907 |
|
4908 |
-
|
4909 |
-
|
4910 |
|
4911 |
-
|
4912 |
-
|
4913 |
-
|
4914 |
|
4915 |
-
|
4916 |
|
4917 |
-
|
4918 |
-
|
4919 |
}
|
4920 |
|
4921 |
-
|
4922 |
-
|
4923 |
-
|
4924 |
-
$product_data[$pr_array['attribute']] = ""; // Sets an empty postmeta value in place of a missing one.
|
4925 |
-
}
|
4926 |
|
4927 |
-
|
4928 |
-
|
|
|
|
|
|
|
|
|
|
|
4929 |
|
4930 |
-
|
|
|
|
|
|
|
|
|
4931 |
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
4941 |
-
|
4942 |
-
|
4943 |
-
|
4944 |
-
|
4945 |
-
|
4946 |
-
|
4947 |
-
|
4948 |
-
} elseif ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
4949 |
-
$allowed = 0;
|
4950 |
-
}
|
4951 |
-
break;
|
4952 |
-
case($pr_array['condition'] = "containsnot"):
|
4953 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
4954 |
-
$allowed = 0;
|
4955 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
4956 |
-
$allowed = 0;
|
4957 |
-
}
|
4958 |
-
break;
|
4959 |
case($pr_array['condition'] = "="):
|
4960 |
-
|
4961 |
-
|
4962 |
-
|
4963 |
-
|
4964 |
}
|
4965 |
-
|
4966 |
-
|
4967 |
-
|
4968 |
-
|
4969 |
-
|
4970 |
-
|
4971 |
-
|
4972 |
-
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
|
4979 |
-
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
|
4987 |
-
|
4988 |
-
|
4989 |
-
|
4990 |
-
|
4991 |
-
|
4992 |
-
|
4993 |
-
|
4994 |
-
|
4995 |
-
|
4996 |
-
|
4997 |
-
|
4998 |
-
|
4999 |
-
|
5000 |
-
|
5001 |
-
|
5002 |
-
|
5003 |
-
|
5004 |
-
|
5005 |
-
|
5006 |
-
|
5007 |
-
|
5008 |
-
|
5009 |
-
|
5010 |
-
|
5011 |
-
|
5012 |
-
|
5013 |
-
|
5014 |
-
|
5015 |
-
if($pr_array['attribute'] == "product_tag"){
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
|
5022 |
-
|
5023 |
-
|
5024 |
-
|
5025 |
-
if(preg_match('/'.$pr_array['criteria'].'/', $pt_value)){
|
5026 |
-
$in_tag_array = "yes";
|
5027 |
-
}
|
5028 |
-
}
|
5029 |
-
|
5030 |
-
if($in_tag_array == "yes"){
|
5031 |
-
//if(in_array($pr_array['criteria'], $pd_value, TRUE)) {
|
5032 |
-
$v = $pr_array['criteria'];
|
5033 |
-
|
5034 |
-
switch ($pr_array['condition']) {
|
5035 |
-
case($pr_array['condition'] = "contains"):
|
5036 |
-
if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5037 |
-
if($pr_array['than'] == "include_only"){
|
5038 |
-
if($allowed <> 0){
|
5039 |
-
$allowed = 1;
|
5040 |
-
}
|
5041 |
-
} else {
|
5042 |
-
$allowed = 0;
|
5043 |
-
}
|
5044 |
-
} else {
|
5045 |
-
$allowed = 0;
|
5046 |
-
}
|
5047 |
-
break;
|
5048 |
-
case($pr_array['condition'] = "containsnot"):
|
5049 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5050 |
-
if($pr_array['than'] == "include_only"){
|
5051 |
-
if($allowed <> 0){
|
5052 |
-
$allowed = 1;
|
5053 |
-
}
|
5054 |
-
} else {
|
5055 |
-
$allowed = 0;
|
5056 |
-
}
|
5057 |
-
} else {
|
5058 |
-
$allowed = 0;
|
5059 |
-
}
|
5060 |
-
break;
|
5061 |
-
case($pr_array['condition'] = "="):
|
5062 |
-
if (($v == $pr_array['criteria'])){
|
5063 |
-
if($pr_array['than'] == "include_only"){
|
5064 |
-
if($allowed <> 0){
|
5065 |
-
$allowed = 1;
|
5066 |
-
}
|
5067 |
-
} else {
|
5068 |
-
$allowed = 0;
|
5069 |
-
}
|
5070 |
-
} else {
|
5071 |
-
$allowed = 0;
|
5072 |
-
}
|
5073 |
-
break;
|
5074 |
-
case($pr_array['condition'] = "!="):
|
5075 |
-
if (($v != $pr_array['criteria'])){
|
5076 |
-
if($pr_array['than'] == "include_only"){
|
5077 |
-
if($allowed <> 0){
|
5078 |
-
$allowed = 1;
|
5079 |
-
}
|
5080 |
-
} else {
|
5081 |
-
$allowed = 0;
|
5082 |
-
}
|
5083 |
-
}
|
5084 |
-
break;
|
5085 |
-
case($pr_array['condition'] = ">"):
|
5086 |
-
if (($v > $pr_array['criteria'])){
|
5087 |
-
if($pr_array['than'] == "include_only"){
|
5088 |
-
if($allowed <> 0){
|
5089 |
-
$allowed = 1;
|
5090 |
-
}
|
5091 |
-
} else {
|
5092 |
-
$allowed = 0;
|
5093 |
-
}
|
5094 |
-
}
|
5095 |
-
break;
|
5096 |
-
case($pr_array['condition'] = ">="):
|
5097 |
-
if (($v >= $pr_array['criteria'])){
|
5098 |
-
if($pr_array['than'] == "include_only"){
|
5099 |
-
if($allowed <> 0){
|
5100 |
-
$allowed = 1;
|
5101 |
-
}
|
5102 |
-
} else {
|
5103 |
-
$allowed = 0;
|
5104 |
-
}
|
5105 |
-
}
|
5106 |
-
break;
|
5107 |
-
case($pr_array['condition'] = "<"):
|
5108 |
-
if (($v < $pr_array['criteria'])){
|
5109 |
-
if($pr_array['than'] == "include_only"){
|
5110 |
-
if($allowed <> 0){
|
5111 |
-
$allowed = 1;
|
5112 |
-
}
|
5113 |
-
} else {
|
5114 |
-
$allowed = 0;
|
5115 |
-
}
|
5116 |
-
}
|
5117 |
-
break;
|
5118 |
-
case($pr_array['condition'] = "=<"):
|
5119 |
-
if (($v <= $pr_array['criteria'])){
|
5120 |
-
if($pr_array['than'] == "include_only"){
|
5121 |
-
if($allowed <> 0){
|
5122 |
-
$allowed = 1;
|
5123 |
-
}
|
5124 |
-
} else {
|
5125 |
-
$allowed = 0;
|
5126 |
-
}
|
5127 |
-
}
|
5128 |
-
break;
|
5129 |
-
case($pr_array['condition'] = "empty"):
|
5130 |
-
if (strlen($v) < 1){
|
5131 |
-
if($pr_array['than'] == "include_only"){
|
5132 |
-
if($allowed <> 0){
|
5133 |
-
$allowed = 1;
|
5134 |
-
}
|
5135 |
-
} else {
|
5136 |
-
$allowed = 0;
|
5137 |
-
}
|
5138 |
-
}
|
5139 |
-
break;
|
5140 |
-
default:
|
5141 |
-
break;
|
5142 |
-
}
|
5143 |
-
} else {
|
5144 |
-
switch ($pr_array['condition']) {
|
5145 |
-
case($pr_array['condition'] = "contains"):
|
5146 |
-
if($pr_array['than'] == "include_only"){
|
5147 |
-
$allowed = 0;
|
5148 |
-
} else {
|
5149 |
-
if($allowed <> 0){
|
5150 |
-
$allowed = 1;
|
5151 |
-
}
|
5152 |
-
}
|
5153 |
-
break;
|
5154 |
-
case($pr_array['condition'] = "containsnot"):
|
5155 |
-
if($pr_array['than'] == "include_only"){
|
5156 |
-
if($allowed <> 0){
|
5157 |
-
$allowed = 1;
|
5158 |
-
}
|
5159 |
-
} else {
|
5160 |
-
$allowed = 0;
|
5161 |
-
}
|
5162 |
-
break;
|
5163 |
-
case($pr_array['condition'] = "="):
|
5164 |
-
if($pr_array['than'] == "include_only"){
|
5165 |
-
$allowed = 0;
|
5166 |
-
} else {
|
5167 |
-
if($allowed <> 0){
|
5168 |
-
$allowed = 1;
|
5169 |
-
}
|
5170 |
-
}
|
5171 |
-
break;
|
5172 |
-
case($pr_array['condition'] = "!="):
|
5173 |
-
if($pr_array['than'] == "include_only"){
|
5174 |
-
if($allowed <> 0){
|
5175 |
-
$allowed = 1;
|
5176 |
-
}
|
5177 |
-
} else {
|
5178 |
-
$allowed = 0;
|
5179 |
-
}
|
5180 |
-
break;
|
5181 |
-
case($pr_array['condition'] = ">"):
|
5182 |
-
if($pr_array['than'] == "include_only"){
|
5183 |
-
$allowed = 0;
|
5184 |
-
} else {
|
5185 |
-
$allowed = 0;
|
5186 |
-
}
|
5187 |
-
break;
|
5188 |
-
case($pr_array['condition'] = ">="):
|
5189 |
-
if($pr_array['than'] == "include_only"){
|
5190 |
-
$allowed = 0;
|
5191 |
-
} else {
|
5192 |
-
$allowed = 0;
|
5193 |
-
}
|
5194 |
-
break;
|
5195 |
-
case($pr_array['condition'] = "<"):
|
5196 |
-
if($pr_array['than'] == "include_only"){
|
5197 |
-
$allowed = 0;
|
5198 |
-
} else {
|
5199 |
-
$allowed = 0;
|
5200 |
-
}
|
5201 |
-
break;
|
5202 |
-
case($pr_array['condition'] = "=<"):
|
5203 |
-
if($pr_array['than'] == "include_only"){
|
5204 |
-
$allowed = 0;
|
5205 |
-
} else {
|
5206 |
-
$allowed = 0;
|
5207 |
-
}
|
5208 |
-
break;
|
5209 |
-
case($pr_array['condition'] = "empty"):
|
5210 |
-
if($pr_array['than'] == "include_only"){
|
5211 |
-
if($allowed <> 0){
|
5212 |
-
$allowed = 1;
|
5213 |
-
}
|
5214 |
-
} else {
|
5215 |
-
$allowed = 0;
|
5216 |
-
}
|
5217 |
-
break;
|
5218 |
-
default:
|
5219 |
-
break;
|
5220 |
-
}
|
5221 |
-
}
|
5222 |
-
} else {
|
5223 |
-
// For now only shipping details are in an array
|
5224 |
-
foreach ($pd_value as $k => $v){
|
5225 |
-
foreach ($v as $kk => $vv){
|
5226 |
-
// Only shipping detail rule can be on price for now
|
5227 |
-
if($kk == "price"){
|
5228 |
-
switch ($pr_array['condition']) {
|
5229 |
-
case($pr_array['condition'] = "contains"):
|
5230 |
-
if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5231 |
-
$allowed = 0;
|
5232 |
-
}
|
5233 |
-
break;
|
5234 |
-
case($pr_array['condition'] = "containsnot"):
|
5235 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5236 |
-
$allowed = 0;
|
5237 |
-
}
|
5238 |
-
break;
|
5239 |
-
case($pr_array['condition'] = "="):
|
5240 |
-
if (($vv == $pr_array['criteria'])){
|
5241 |
-
$allowed = 0;
|
5242 |
-
}
|
5243 |
-
break;
|
5244 |
-
case($pr_array['condition'] = "!="):
|
5245 |
-
if (($vv != $pr_array['criteria'])){
|
5246 |
-
$allowed = 0;
|
5247 |
-
}
|
5248 |
-
break;
|
5249 |
-
case($pr_array['condition'] = ">"):
|
5250 |
-
if (($vv > $pr_array['criteria'])){
|
5251 |
-
$allowed = 0;
|
5252 |
-
}
|
5253 |
-
break;
|
5254 |
-
case($pr_array['condition'] = ">="):
|
5255 |
-
if (($vv >= $pr_array['criteria'])){
|
5256 |
-
$allowed = 0;
|
5257 |
-
}
|
5258 |
-
break;
|
5259 |
-
case($pr_array['condition'] = "<"):
|
5260 |
-
if (($vv < $pr_array['criteria'])){
|
5261 |
-
$allowed = 0;
|
5262 |
-
}
|
5263 |
-
break;
|
5264 |
-
case($pr_array['condition'] = "=<"):
|
5265 |
-
if (($vv <= $pr_array['criteria'])){
|
5266 |
-
$allowed = 0;
|
5267 |
-
}
|
5268 |
-
break;
|
5269 |
-
case($pr_array['condition'] = "empty"):
|
5270 |
-
if (strlen($vv) < 1){
|
5271 |
-
$allowed = 0;
|
5272 |
-
}
|
5273 |
-
break;
|
5274 |
-
default:
|
5275 |
-
break;
|
5276 |
-
}
|
5277 |
-
}
|
5278 |
-
}
|
5279 |
-
}
|
5280 |
-
}
|
5281 |
-
} else {
|
5282 |
-
// Filters for string values
|
5283 |
-
// If case-sensitve is off than lowercase both the criteria and attribute value
|
5284 |
-
if (array_key_exists('cs', $pr_array)){
|
5285 |
-
if ($pr_array['cs'] != "on"){
|
5286 |
-
$pd_value = strtolower($pd_value);
|
5287 |
-
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5288 |
-
}
|
5289 |
-
}
|
5290 |
-
$pos = strpos($pd_value, '&');
|
5291 |
-
$pos_slash = strpos($pr_array['criteria'], '\\');
|
5292 |
-
if($pos !== false){
|
5293 |
-
$pd_value = str_replace("&","&",$pd_value);
|
5294 |
-
}
|
5295 |
-
if($pos_slash !== false){
|
5296 |
-
$pr_array['criteria'] = str_replace("\\","",$pr_array['criteria']);
|
5297 |
-
}
|
5298 |
|
5299 |
-
|
5300 |
-
|
5301 |
-
|
5302 |
-
|
5303 |
-
|
5304 |
-
|
5305 |
-
|
5306 |
-
|
5307 |
-
|
5308 |
-
|
5309 |
-
|
5310 |
-
|
5311 |
-
|
5312 |
-
|
5313 |
-
|
5314 |
-
|
5315 |
-
|
5316 |
-
|
5317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5318 |
case($pr_array['condition'] = "="):
|
5319 |
-
if (($pr_array['criteria'] == "$pd_value")
|
5320 |
$allowed = 0;
|
5321 |
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "include_only")){
|
5322 |
$found = strpos($pd_value,$pr_array['criteria']);
|
5323 |
-
|
5324 |
-
|
5325 |
-
|
5326 |
-
|
5327 |
-
|
5328 |
-
|
5329 |
-
|
5330 |
-
|
5331 |
-
|
5332 |
-
|
5333 |
-
|
5334 |
-
|
5335 |
-
|
5336 |
-
|
5337 |
-
|
5338 |
-
|
5339 |
-
|
5340 |
-
|
5341 |
-
|
5342 |
-
|
5343 |
-
|
5344 |
-
|
5345 |
-
if($allowed <> 0){
|
5346 |
-
$allowed = 1;
|
5347 |
-
}
|
5348 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5349 |
-
$allowed = 0;
|
5350 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5351 |
-
$allowed = 1;
|
5352 |
-
}
|
5353 |
-
break;
|
5354 |
-
case($pr_array['condition'] = "!="):
|
5355 |
-
if (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "exclude")){
|
5356 |
if($allowed <> 0){
|
5357 |
-
|
5358 |
-
|
5359 |
-
|
5360 |
-
|
5361 |
-
|
5362 |
-
|
5363 |
-
}
|
5364 |
-
|
5365 |
-
|
5366 |
-
|
5367 |
-
|
5368 |
-
|
5369 |
-
|
5370 |
-
|
5371 |
-
|
5372 |
-
|
5373 |
-
|
5374 |
-
|
5375 |
-
|
5376 |
-
|
5377 |
-
|
5378 |
-
|
5379 |
-
|
5380 |
-
|
5381 |
-
|
5382 |
-
|
5383 |
-
|
5384 |
-
|
5385 |
-
|
5386 |
-
|
5387 |
-
|
5388 |
-
|
5389 |
-
|
5390 |
-
|
5391 |
-
|
5392 |
-
|
5393 |
-
|
5394 |
-
|
5395 |
-
|
5396 |
-
|
5397 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5398 |
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
5399 |
-
|
5400 |
-
|
5401 |
-
|
5402 |
-
|
5403 |
-
|
5404 |
-
|
5405 |
-
|
5406 |
-
|
5407 |
-
|
5408 |
-
|
5409 |
-
|
5410 |
-
|
5411 |
-
|
5412 |
-
|
5413 |
-
|
5414 |
-
|
5415 |
|
5416 |
-
|
5417 |
-
|
5418 |
-
|
5419 |
-
|
5420 |
-
|
5421 |
-
|
5422 |
-
|
5423 |
}
|
23 |
* Function to add CDATA brackets to title, short_description and description attributes
|
24 |
*/
|
25 |
protected function woosea_append_cdata( $string ){
|
26 |
+
if(!empty($string)){
|
27 |
+
return "<![CDATA[$string]]>";
|
28 |
+
}
|
29 |
}
|
30 |
|
|
|
31 |
/**
|
32 |
* Check if a plugin is active
|
33 |
*/
|
58 |
* Get all approved product review comments for Google's Product Review Feeds
|
59 |
*/
|
60 |
public function woosea_get_reviews ( $product_data, $product ) {
|
61 |
+
// Rwviews for the parent variable product itself can be skipped, the review is added for the variation
|
62 |
+
if($product_data['product_type'] == "variable"){
|
63 |
+
return;
|
64 |
+
}
|
65 |
+
|
66 |
$approved_reviews = array();
|
67 |
$prod_id = $product_data['id'];
|
68 |
|
79 |
|
80 |
// Loop through all product reviews for this specific products (ternary operators)
|
81 |
foreach($reviews as $review_raw){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
|
83 |
+
// Only reviews that are approved will make it to the feed
|
84 |
+
if($review_raw->comment_approved == 1){
|
85 |
+
|
86 |
+
$review = array();
|
87 |
+
$review['review_reviewer_image'] = empty($product_data['reviewer_image']) ? '' : $product_data['reviewer_image'];
|
88 |
+
$review['review_ratings'] = get_comment_meta( $review_raw->comment_ID, 'rating', true);
|
89 |
+
$review['review_id'] = $review_raw->comment_ID;
|
90 |
+
|
91 |
+
// Names need to be anonomyzed
|
92 |
+
$name_pieces = explode(" ", $review_raw->comment_author);
|
93 |
+
$nr_name_pieces = count($name_pieces);
|
94 |
+
$cnt = 0;
|
95 |
+
$name = "";
|
96 |
+
foreach($name_pieces as $n_piece){
|
97 |
+
$n_piece = str_replace("&", "", $n_piece);
|
98 |
+
|
99 |
+
if($cnt > 0){
|
100 |
+
$n_piece = ucfirst(substr($n_piece, 0, 1));
|
101 |
+
}
|
102 |
+
$name .= $n_piece." ";
|
103 |
+
$cnt++;
|
104 |
+
}
|
105 |
+
|
106 |
+
// Remove strange charachters from reviewer name
|
107 |
+
$review['reviewer_name'] = $this->rip_tags(trim(ucfirst($name)));
|
108 |
+
$review['reviewer_name'] = html_entity_decode((str_replace("\r", "", $review['reviewer_name'])), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
109 |
+
$review['reviewer_name'] = preg_replace( '/\[(.*?)\]/', ' ', $review['reviewer_name'] );
|
110 |
+
$review['reviewer_name'] = str_replace(" ", "", $review['reviewer_name']);
|
111 |
+
$review['reviewer_name'] = str_replace(":", "", $review['reviewer_name']);
|
112 |
+
$review['reviewer_name'] = $this->woosea_utf8_for_xml( $review['reviewer_name'] );
|
113 |
+
|
114 |
+
$review['reviewer_id'] = $review_raw->user_id;
|
115 |
+
$review['review_timestamp'] = $review_raw->comment_date;
|
116 |
+
|
117 |
+
// Remove strange characters from review title
|
118 |
+
$review['title'] = empty($product_data['title']) ? '' : $product_data['title'];
|
119 |
+
$review['title'] = $this->rip_tags($review['title']);
|
120 |
+
$review['title'] = html_entity_decode((str_replace("\r", "", $review['title'])), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
121 |
+
$review['title'] = preg_replace( '/\[(.*?)\]/', ' ', $review['title'] );
|
122 |
+
$review['title'] = str_replace(" ", "", $review['title']);
|
123 |
+
$review['title'] = $this->woosea_utf8_for_xml( $review['title'] );
|
124 |
+
|
125 |
+
// Remove strange charchters from review content
|
126 |
+
$review['content'] = $review_raw->comment_content;
|
127 |
+
$review['content'] = $this->rip_tags($review['content']);
|
128 |
+
$review['content'] = html_entity_decode((str_replace("\r", "", $review['content'])), ENT_QUOTES | ENT_XML1, 'UTF-8');
|
129 |
+
$review['content'] = preg_replace( '/\[(.*?)\]/', ' ', $review['content'] );
|
130 |
+
$review['content'] = str_replace(" ", "", $review['content']);
|
131 |
+
$review['content'] = $this->woosea_utf8_for_xml( $review['content'] );
|
132 |
+
|
133 |
+
$review['review_product_name'] = $product_data['title'];
|
134 |
+
$review['review_url'] = $product_data['link'];
|
135 |
+
$review['review_product_url'] = $product_data['link'];
|
136 |
+
array_push($approved_reviews, $review);
|
137 |
+
}
|
138 |
}
|
139 |
$review_count = $product->get_review_count();
|
140 |
$review_average = $product->get_average_rating();
|
188 |
if($feed_config['fields'] == "google_drm"){
|
189 |
$utm_part .= "&$key=$value";
|
190 |
} else {
|
191 |
+
$utm_part .= "&$key=$value";
|
192 |
}
|
193 |
}
|
194 |
|
214 |
if($parentId > 0){
|
215 |
# Even though variation products always have parameters in the URL we still need to check and make sure they are there
|
216 |
if(strpos($link, '?') !== false){
|
217 |
+
$utm_part = "&".ltrim($utm_part, '&');
|
218 |
} else {
|
219 |
$utm_part = "?".ltrim($utm_part, '&');
|
220 |
}
|
262 |
$data = $wpdb->get_results($sql);
|
263 |
|
264 |
if (count($data)) {
|
|
|
265 |
foreach ($data as $key => $value) {
|
266 |
$value_display = str_replace("_", " ",$value->name);
|
267 |
+
if (!preg_match("/_product_attributes/i",$value->name)){
|
268 |
$list[$value->name] = ucfirst($value_display);
|
269 |
+
|
270 |
+
// Adding support for the Yoast WooCommerce SEO unique identifiers
|
271 |
+
if($value->name == "wpseo_global_identifier_values"){
|
272 |
+
$type_expl = explode("\";", $value->type);
|
273 |
+
|
274 |
+
$yoast_gtin8_value = explode(":\"", $type_expl[1]);
|
275 |
+
$yoast_gtin12_value = explode(":\"", $type_expl[3]);
|
276 |
+
$yoast_gtin13_value = explode(":\"", $type_expl[5]);
|
277 |
+
$yoast_gtin14_value = explode(":\"", $type_expl[7]);
|
278 |
+
$yoast_isbn_value = explode(":\"", $type_expl[9]);
|
279 |
+
$yoast_mpn_value = explode(":\"", $type_expl[11]);
|
280 |
+
|
281 |
+
$list["yoast_gtin8"] = $yoast_gtin8_value[1];
|
282 |
+
$list["yoast_gtin12"] = $yoast_gtin12_value[1];
|
283 |
+
$list["yoast_gtin13"] = $yoast_gtin13_value[1];
|
284 |
+
$list["yoast_gtin14"] = $yoast_gtin14_value[1];
|
285 |
+
$list["yoast_isbn"] = $yoast_isbn_value[1];
|
286 |
+
$list["yoast_mpn"] = $yoast_mpn_value[1];
|
287 |
+
}
|
288 |
+
} else {
|
289 |
+
$product_attr = unserialize($value->type);
|
290 |
+
if((!empty($product_attr)) AND (is_array($product_attr))){
|
291 |
+
foreach ($product_attr as $key_inner => $arr_value) {
|
292 |
+
if(is_array($arr_value)){
|
293 |
+
if(!array_key_exists('name', $arr_value)){
|
294 |
+
$value_display = @str_replace("_", " ",$arr_value['name']);
|
295 |
+
$list[$key_inner] = ucfirst($value_display);
|
296 |
+
}
|
297 |
+
}
|
298 |
}
|
299 |
}
|
300 |
}
|
301 |
+
}
|
302 |
return $list;
|
303 |
}
|
304 |
return false;
|
360 |
/**
|
361 |
* Get category path (needed for Prisjakt)
|
362 |
*/
|
363 |
+
public function woosea_get_term_parents( $id, $taxonomy, string $link = null, $project_taxonomy, $nicename = false, $visited = array() ) {
|
364 |
// Only add Home to the beginning of the chain when we start buildin the chain
|
365 |
if(empty($visited)){
|
366 |
$chain = 'Home';
|
399 |
return $chain;
|
400 |
}
|
401 |
|
402 |
+
/**
|
403 |
+
* Create a floatval for prices
|
404 |
+
*/
|
405 |
+
public function woosea_floatvalue($val){
|
406 |
+
$val = str_replace(",",".",$val);
|
407 |
+
$val = preg_replace('/\.(?=.*\.)/', '', $val);
|
408 |
+
return floatval($val);
|
409 |
+
}
|
410 |
+
|
411 |
/**
|
412 |
* Get all configured shipping zones
|
413 |
*/
|
697 |
/**
|
698 |
* Get shipping cost for product
|
699 |
*/
|
700 |
+
public function woosea_get_shipping_cost ($class_cost_id, $project_config, $price, $tax_rates, $fullrate, $shipping_zones, $product_id, $item_group_id) {
|
701 |
+
$shipping_cost = "";
|
702 |
$shipping_arr = array();
|
703 |
$zone_count = 0;
|
704 |
$nr_shipping_zones = count($shipping_zones);
|
757 |
$shipping_methods = $zone['shipping_methods'];
|
758 |
|
759 |
foreach ($shipping_methods as $k => $v){
|
760 |
+
$method = $v->method_title;
|
761 |
+
$shipping_rate_id = $v->instance_id;
|
762 |
|
763 |
if($v->enabled == "yes"){
|
764 |
if(empty($zone_details['country'])){
|
768 |
}
|
769 |
$taxable = $v->tax_status;
|
770 |
|
771 |
+
if(isset($v->instance_settings['cost'])){
|
772 |
+
$shipping_cost = $v->instance_settings['cost'];
|
773 |
+
$shipping_cost = str_replace("* [qty]", "", $shipping_cost);
|
774 |
+
$shipping_cost = trim($shipping_cost); // trim white spaces
|
|
|
775 |
|
776 |
+
if($shipping_cost > 0){
|
777 |
+
|
778 |
+
// Do we need to convert the shipping costs with the Aelia Currency Switcher
|
779 |
+
if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
|
780 |
|
781 |
+
if(!array_key_exists('base_currency', $project_config)){
|
782 |
+
$from_currency = get_woocommerce_currency();
|
783 |
+
} else {
|
784 |
+
$from_currency = $project_config['base_currency'];
|
785 |
+
}
|
786 |
+
|
787 |
+
// Get Aelia currency conversion prices
|
788 |
+
$shipping_cost = apply_filters('wc_aelia_cs_convert', $shipping_cost, $from_currency, $project_config['AELIA']);
|
789 |
+
}
|
790 |
|
791 |
+
if($taxable == "taxable"){
|
792 |
+
foreach ($tax_rates as $k_inner => $w){
|
793 |
+
if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
|
794 |
+
$rate = (($fullrate)/100);
|
795 |
|
796 |
+
$shipping_cost = str_replace(",", ".", $shipping_cost);
|
797 |
+
$shipping_cost = $shipping_cost*$rate;
|
798 |
+
$shipping_cost = round($shipping_cost, 2);
|
799 |
+
$shipping_cost = wc_format_localized_price($shipping_cost);
|
800 |
+
}
|
801 |
}
|
802 |
}
|
803 |
}
|
804 |
+
}
|
805 |
+
|
806 |
+
// WooCommerce Table Rate - Bolder Elements
|
807 |
+
if($method == "Table Rate"){
|
808 |
+
if($this->woosea_is_plugin_active( 'woocommerce-table-rate-shipping/woocommerce-table-rate-shipping.php' )) {
|
809 |
+
// Set shipping cost
|
810 |
+
$shipping_cost = 0;
|
811 |
+
if(!empty($product_id)){
|
812 |
+
// Add product to cart
|
813 |
+
if ((isset($product_id)) AND ($product_id > 0)){
|
814 |
+
$quantity = 1;
|
815 |
+
if(!empty($code_from_config)){
|
816 |
+
defined( 'WC_ABSPATH' ) || exit;
|
817 |
+
|
818 |
+
// Load cart functions which are loaded only on the front-end.
|
819 |
+
include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
|
820 |
+
include_once WC_ABSPATH . 'includes/class-wc-cart.php';
|
821 |
+
|
822 |
wc_load_cart();
|
823 |
|
824 |
WC()->customer->set_shipping_country( $code_from_config );
|
836 |
// Read cart and get schipping costs
|
837 |
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
|
838 |
$total_cost = WC()->cart->get_total();
|
839 |
+
$shipping_cost = WC()->cart->get_shipping_total();
|
840 |
+
$shipping_tax = WC()->cart->get_shipping_tax();
|
841 |
+
$shipping_cost = ($shipping_cost+$shipping_tax);
|
842 |
$shipping_cost = wc_format_localized_price($shipping_cost);
|
843 |
+
}
|
|
|
844 |
// Make sure to empty the cart again
|
845 |
WC()->cart->empty_cart();
|
846 |
+
}
|
847 |
+
}
|
848 |
+
}
|
849 |
+
}
|
850 |
+
}
|
851 |
+
|
852 |
+
// Official WooCommerce Table Rate plugin
|
853 |
+
if($method == "Table rates"){
|
854 |
+
if($this->woosea_is_plugin_active( 'woocommerce-table-rate-shipping/woocommerce-table-rate-shipping.php' )) {
|
855 |
+
// Set shipping cost
|
856 |
+
$shipping_cost = 0;
|
857 |
+
if(!empty($product_id)){
|
858 |
+
// Add product to cart
|
859 |
+
if ((isset($product_id)) AND ($product_id > 0)){
|
860 |
+
$quantity = 1;
|
861 |
+
if(!empty($code_from_config)){
|
862 |
+
defined( 'WC_ABSPATH' ) || exit;
|
863 |
+
|
864 |
+
// Load cart functions which are loaded only on the front-end.
|
865 |
+
include_once WC_ABSPATH . 'includes/wc-cart-functions.php';
|
866 |
+
include_once WC_ABSPATH . 'includes/class-wc-cart.php';
|
867 |
+
|
868 |
+
wc_load_cart();
|
869 |
+
|
870 |
+
WC()->shipping()->reset_shipping();
|
871 |
+
WC()->customer->set_shipping_country( $code_from_config );
|
872 |
+
|
873 |
+
if(isset($zone_details['region'])){
|
874 |
+
WC()->customer->set_shipping_state(wc_clean( $zone_details['region'] ));
|
875 |
+
}
|
876 |
+
|
877 |
+
if(isset($zone_details['postal_code'])){
|
878 |
+
WC()->customer->set_shipping_postcode(wc_clean( $zone_details['postal_code'] ));
|
879 |
+
}
|
880 |
+
WC()->cart->add_to_cart( $product_id, $quantity );
|
881 |
+
|
882 |
+
// Read cart and get schipping costs
|
883 |
+
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
|
884 |
+
// Loop though shipping packages
|
885 |
+
foreach ( WC()->shipping->get_packages() as $key => $package ) {
|
886 |
+
// Loop through Shipping rates
|
887 |
+
foreach($package['rates'] as $rate_id => $rate ){
|
888 |
+
if($rate->instance_id == $shipping_rate_id){
|
889 |
+
$shipping_cost = $rate->cost;
|
890 |
+
}
|
891 |
+
}
|
892 |
+
}
|
893 |
+
$shipping_tax = WC()->cart->get_shipping_tax();
|
894 |
+
$shipping_cost = ($shipping_cost+$shipping_tax);
|
895 |
+
$shipping_cost = wc_format_localized_price($shipping_cost);
|
896 |
+
}
|
897 |
+
|
898 |
+
if($taxable == "taxable"){
|
899 |
+
foreach ($tax_rates as $k_inner => $w){
|
900 |
+
if((isset($w['shipping'])) and ($w['shipping'] == "yes")){
|
901 |
+
$rate = (($w['rate']+100)/100);
|
902 |
+
|
903 |
+
$shipping_cost = str_replace(",", ".", $shipping_cost);
|
904 |
+
$shipping_cost = $shipping_cost*$rate;
|
905 |
+
$shipping_cost = round($shipping_cost, 2);
|
906 |
+
$shipping_cost = wc_format_localized_price($shipping_cost);
|
907 |
+
}
|
908 |
+
}
|
909 |
+
}
|
910 |
+
|
911 |
+
// Make sure to empty the cart again
|
912 |
+
WC()->cart->empty_cart();
|
913 |
+
}
|
914 |
+
}
|
915 |
+
}
|
916 |
+
}
|
917 |
+
}
|
918 |
|
919 |
// CLASS SHIPPING COSTS
|
920 |
if((isset($v->instance_settings[$class_cost_id])) AND ($class_cost_id != "no_class_cost")){
|
1048 |
unset($shipping_cost);
|
1049 |
}
|
1050 |
}
|
1051 |
+
|
1052 |
+
// User do not want to have free shipping in their feed
|
1053 |
+
$remove_free_shipping = "no";
|
1054 |
+
$remove_free_shipping = get_option ('remove_free_shipping');
|
1055 |
+
|
1056 |
+
if($remove_free_shipping == "yes"){
|
1057 |
+
unset($zone_details['service']);
|
1058 |
+
unset($zone_details['price']);
|
1059 |
+
unset($shipping_cost);
|
1060 |
+
}
|
1061 |
}
|
1062 |
|
1063 |
if(isset($zone_details)){
|
1075 |
}
|
1076 |
}
|
1077 |
}
|
1078 |
+
|
1079 |
+
// For Heureka remove currency
|
1080 |
+
if($project_config['fields'] == "heureka"){
|
1081 |
+
$currency = "";
|
1082 |
+
}
|
1083 |
+
|
1084 |
if(isset($shipping_cost)){
|
1085 |
if(strlen($shipping_cost) > 0){
|
1086 |
if($project_config['ship_suffix'] == "false"){
|
1089 |
$zone_details['price'] = trim($shipping_cost);
|
1090 |
}
|
1091 |
} else {
|
|
|
1092 |
if(isset($shipping_cost)){
|
1093 |
$zone_details['price'] = trim($currency." ".$shipping_cost);
|
1094 |
}
|
|
|
|
|
1095 |
}
|
1096 |
}
|
1097 |
}
|
1121 |
|
1122 |
// Remove other shipping classes when free shipping is relevant
|
1123 |
$free_check = "yes";
|
|
|
1124 |
|
1125 |
if(in_array($free_check, array_column($shipping_arr, 'free'))) { // search value in the array
|
1126 |
foreach($shipping_arr as $k => $v) {
|
1127 |
if(!in_array($free_check, $v)){
|
1128 |
+
|
1129 |
+
// User do not want to have free shipping in their feed
|
1130 |
+
// Only remove the other shipping classes when free shipping is not being removed
|
1131 |
+
$remove_free_shipping = "no";
|
1132 |
+
$remove_free_shipping = get_option ('remove_free_shipping');
|
1133 |
+
|
1134 |
+
if($remove_free_shipping == "no"){
|
1135 |
+
unset($shipping_arr[$k]);
|
1136 |
+
}
|
1137 |
}
|
1138 |
}
|
1139 |
}
|
1141 |
// Fix empty services
|
1142 |
foreach($shipping_arr as $k => $v){
|
1143 |
if(empty($v['service'])){
|
|
|
|
|
1144 |
unset($shipping_arr[$k]);
|
1145 |
}
|
1146 |
}
|
1275 |
$link = $product->addChild('g:additional_image_link', $v, $namespace['g']);
|
1276 |
//$product->$k = $v;
|
1277 |
} elseif (preg_match("/g:product_highlight/i",$k)){
|
1278 |
+
$v = preg_replace('/&/', '&', $v);
|
1279 |
$product_highlight = $product->addChild('g:product_highlight', $v, $namespace['g']);
|
1280 |
} elseif (preg_match("/g:product_detail/i",$k)){
|
1281 |
if(!empty($v)){
|
1282 |
$product_detail_split = explode("#", $v);
|
1283 |
+
$detail_complete = count($product_detail_split);
|
1284 |
+
if($detail_complete == 2){
|
1285 |
+
$product_detail = $product->addChild('g:product_detail', '', $namespace['g']);
|
1286 |
+
$name = str_replace("_", " ", $product_detail_split[0]);
|
1287 |
+
|
1288 |
+
$section_name = explode(":", $name);
|
1289 |
+
$section_name_start = ucfirst($section_name[0]);
|
1290 |
+
$name = ucfirst(trim($section_name[1]));
|
1291 |
+
|
1292 |
+
$section_name = $product_detail->addChild('g:section_name', "General", $namespace['g']);
|
1293 |
+
$product_detail_name = $product_detail->addChild('g:attribute_name', $section_name_start, $namespace['g']);
|
1294 |
+
$product_detail_value = $product_detail->addChild('g:attribute_value', $product_detail_split[1], $namespace['g']);
|
1295 |
+
}
|
1296 |
}
|
1297 |
} elseif ($k == "g:installment"){
|
1298 |
if(!empty($v)){
|
1397 |
} elseif ($feed_config['name'] == "Glami.gr") {
|
1398 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><SHOP></SHOP>');
|
1399 |
$xml->asXML($file);
|
1400 |
+
} elseif ($feed_config['name'] == "Vivino") {
|
1401 |
+
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><vivino-product-list></vivino-product-list>');
|
1402 |
+
$xml->asXML($file);
|
1403 |
} elseif ($feed_config['name'] == "Pricecheck.co.za") {
|
1404 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><Offers></Offers>');
|
1405 |
$xml->asXML($file);
|
1408 |
$xml->addAttribute('xmlns:content', 'http://purl.org/rss/1.0/modules/content/');
|
1409 |
$xml->addAttribute('xmlns:wfw', 'http://wellformedweb.org/CommentAPI/');
|
1410 |
$xml->addAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
|
|
|
1411 |
$xml->addAttribute('xmlns:sy', 'http://purl.org/rss/1.0/modules/syndication/');
|
1412 |
$xml->addAttribute('xmlns:slash', 'http://purl.org/rss/1.0/modules/slash/');
|
1413 |
$xml->addAttribute('version', '2.0');
|
1457 |
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><products></products>');
|
1458 |
$xml->addAttribute('version', '1.0');
|
1459 |
$xml->addAttribute('standalone', 'yes');
|
1460 |
+
//$xml->addChild('datetime', date('Y-m-d H:i:s'));
|
1461 |
+
//$xml->addChild('title', htmlspecialchars($feed_config['projectname']));
|
1462 |
+
//$xml->addChild('link', site_url());
|
1463 |
+
//$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 ');
|
1464 |
$xml->asXML($file);
|
1465 |
}
|
1466 |
} else {
|
1495 |
|
1496 |
// For Google Product review template
|
1497 |
if (($feed_config['name'] == "Google Product Review") AND (empty($xml->channel))) {
|
1498 |
+
|
1499 |
+
if(!is_bool($xml)){
|
1500 |
+
$product = $xml->addChild('reviews');
|
1501 |
|
1502 |
+
foreach ($products as $key => $value){
|
1503 |
+
|
1504 |
+
$expl = "||";
|
1505 |
|
1506 |
+
if(array_key_exists('reviews', $value)) {
|
1507 |
+
$review_data = explode("||", $value['reviews']);
|
1508 |
+
foreach($review_data as $rk => $rv){
|
|
|
1509 |
|
1510 |
+
$review_comp = explode(":::", $rv);
|
1511 |
+
$nr_reviews = count($review_comp);
|
1512 |
|
1513 |
+
if($nr_reviews > 1){
|
1514 |
+
$productz = $xml->reviews->addChild('review');
|
1515 |
|
1516 |
+
foreach($review_comp as $rck => $rcv){
|
1517 |
+
$nodes = explode("##", $rcv);
|
1518 |
+
$nodes = str_replace("::", "", $nodes);
|
1519 |
|
1520 |
+
if($nodes[0] == "REVIEW_RATINGS"){
|
1521 |
+
// Do nothing
|
1522 |
+
} elseif($nodes[0] == "REVIEW_URL"){
|
1523 |
+
$rev_url = $productz->addChild(strtolower($nodes[0]), htmlspecialchars($nodes[1]));
|
1524 |
+
$rev_url->addAttribute('type', 'singleton');
|
1525 |
+
} elseif(($nodes[0] == "REVIEWER_NAME") OR ($nodes[0] == "REVIEWER_ID")){
|
1526 |
+
if(isset($productz->reviewer)){
|
1527 |
+
if($nodes[0] == "REVIEWER_NAME"){
|
1528 |
+
$name = $nodes[1];
|
1529 |
+
if(empty($name)){
|
1530 |
+
$reviewer->addChild('name','Anonymous');
|
1531 |
+
$reviewer->name->addAttribute('is_anonymous', 'true');
|
1532 |
+
} else {
|
1533 |
+
$reviewer->addChild('name',$name);
|
1534 |
+
}
|
1535 |
} else {
|
1536 |
+
if(is_numeric($nodes[1])){
|
1537 |
+
$reviewer->addChild('reviewer_id',$nodes[1]);
|
1538 |
+
}
|
1539 |
}
|
1540 |
} else {
|
1541 |
+
$reviewer = $productz->addChild('reviewer');
|
1542 |
+
if($nodes[0] == "REVIEWER_NAME"){
|
1543 |
+
$name = $nodes[1];
|
1544 |
+
if(empty($name)){
|
1545 |
+
$reviewer->addChild('name','Anonymous');
|
1546 |
+
$reviewer->name->addAttribute('is_anonymous', 'true');
|
1547 |
+
} else {
|
1548 |
+
$reviewer->addChild('name',$name);
|
1549 |
+
}
|
1550 |
} else {
|
1551 |
+
if(is_numeric($nodes[1])){
|
1552 |
+
$reviewer->addChild('reviewer_id',$nodes[1]);
|
1553 |
+
}
|
1554 |
}
|
|
|
|
|
1555 |
}
|
1556 |
+
} else {
|
1557 |
+
if(isset($nodes[1])){
|
1558 |
+
$content = html_entity_decode($nodes[1]);
|
1559 |
+
$content = htmlspecialchars($content);
|
1560 |
+
$rev = $productz->addChild(strtolower($nodes[0]), $content);
|
1561 |
+
}
|
1562 |
}
|
1563 |
}
|
|
|
1564 |
|
1565 |
+
foreach($review_comp as $rck => $rcv){
|
1566 |
+
$nodes = explode("##", $rcv);
|
1567 |
+
$nodes = str_replace("::", "", $nodes);
|
1568 |
|
1569 |
+
if($nodes[0] == "REVIEW_RATINGS"){
|
1570 |
+
$rev = $productz->addChild('ratings');
|
1571 |
+
$over = $productz->ratings->addChild('overall', $nodes[1]);
|
1572 |
+
$over->addAttribute('min', '1');
|
1573 |
+
$over->addAttribute('max', '5');
|
1574 |
+
}
|
1575 |
}
|
|
|
|
|
1576 |
|
1577 |
+
$yo = $productz->addChild('products');
|
1578 |
+
$po = $yo->addChild('product');
|
1579 |
|
1580 |
+
$identifiers = array("gtin","mpn","sku","brand");
|
1581 |
|
1582 |
+
// Start determining order of product_ids in the Google review feed
|
1583 |
+
$proper_order = array("product_name","gtin","mpn","sku","brand","product_url","review_url","reviews");
|
1584 |
+
$order_sorted = array();
|
1585 |
+
foreach ($proper_order as &$order_value){
|
1586 |
+
if(isset($value[$order_value])){
|
1587 |
+
$order_sorted[$order_value] = $value[$order_value];
|
1588 |
+
}
|
1589 |
}
|
1590 |
+
// End
|
1591 |
+
|
1592 |
+
foreach($order_sorted as $k => $v) {
|
1593 |
+
if(($k != "product_name") AND ($k != "product_url")){
|
1594 |
+
if(!in_array($k, $identifiers)){
|
1595 |
+
if(($k != "reviews") AND ($k != "review_url")){
|
1596 |
+
if($k != "product_url"){
|
1597 |
+
$v = str_replace("&", "and", $v);
|
1598 |
+
}
|
1599 |
+
$poa = $po->addChild($k,htmlspecialchars($v));
|
1600 |
+
}
|
1601 |
+
} else {
|
1602 |
+
if(isset($po->product_ids)){
|
1603 |
+
if ($k == "gtin"){
|
1604 |
+
$poig = $poi->addChild('gtins');
|
1605 |
+
$poig->$k = $v;
|
1606 |
+
} elseif ($k == "mpn"){
|
1607 |
+
$poim = $poi->addChild('mpns');
|
1608 |
+
$poim->$k = $v;
|
1609 |
+
} elseif ($k == "sku"){
|
1610 |
+
$poix = $poi->addChild('skus');
|
1611 |
+
$poix->$k = $v;
|
1612 |
+
} elseif($k == "brand"){
|
1613 |
+
$poib = $poi->addChild('brands');
|
1614 |
+
$poib->$k = $v;
|
1615 |
+
} else {
|
1616 |
+
// Do nothing
|
1617 |
+
}
|
1618 |
+
} else {
|
1619 |
+
$poi = $po->addChild('product_ids');
|
1620 |
+
if ($k == "gtin"){
|
1621 |
+
$poig = $poi->addChild('gtins');
|
1622 |
+
$poig->$k = $v;
|
1623 |
+
} elseif ($k == "mpn"){
|
1624 |
+
$poim = $poi->addChild('mpns');
|
1625 |
+
$poim->$k = $v;
|
1626 |
+
} elseif ($k == "sku"){
|
1627 |
+
$poix = $poi->addChild('skus');
|
1628 |
+
$poix->$k = $v;
|
1629 |
+
} elseif($k == "brand"){
|
1630 |
+
$poib = $poi->addChild('brands');
|
1631 |
+
$poib->$k = $v;
|
1632 |
+
} else {
|
1633 |
+
// Do nothing
|
1634 |
+
}
|
1635 |
}
|
1636 |
+
}
|
1637 |
+
}
|
1638 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1639 |
|
1640 |
+
// foreach for product name and product url as order seems to mather to Google
|
1641 |
+
foreach($value as $k => $v) {
|
1642 |
+
if(($k == "product_name") OR ($k == "product_url")){
|
1643 |
+
if(!in_array($k, $identifiers)){
|
1644 |
+
if(($k != "reviews") AND ($k != "review_url")){
|
1645 |
+
if($k != "product_url"){
|
1646 |
+
$v = str_replace("&", "and", $v);
|
1647 |
+
}
|
1648 |
+
$poa = $po->addChild($k,htmlspecialchars($v));
|
1649 |
+
}
|
1650 |
+
} else {
|
1651 |
+
if(isset($po->product_ids)){
|
1652 |
+
if ($k == "gtin"){
|
1653 |
+
$poig = $poi->addChild('gtins');
|
1654 |
+
$poig->$k = $v;
|
1655 |
+
} elseif ($k == "mpn"){
|
1656 |
+
$poim = $poi->addChild('mpns');
|
1657 |
+
$poim->$k = $v;
|
1658 |
+
} elseif($k == "sku"){
|
1659 |
+
$poix = $poi->addChild('skus');
|
1660 |
+
$poix->$k = $v;
|
1661 |
+
} elseif($k == "brand"){
|
1662 |
+
$poib = $poi->addChild('brands');
|
1663 |
+
$poib->$k = $v;
|
1664 |
+
} else {
|
1665 |
+
// Do nothing
|
1666 |
+
}
|
1667 |
+
} else {
|
1668 |
+
$poi = $po->addChild('product_ids');
|
1669 |
+
if ($k == "gtin"){
|
1670 |
+
$poig = $poi->addChild('gtins');
|
1671 |
+
$poig->$k = $v;
|
1672 |
+
} elseif ($k == "mpn"){
|
1673 |
+
$poim = $poi->addChild('mpns');
|
1674 |
+
$poim->$k = $v;
|
1675 |
+
} elseif ($k == "sku"){
|
1676 |
+
$poix = $poi->addChild('skus');
|
1677 |
+
$poix->$k = $v;
|
1678 |
+
} elseif($k == "brand"){
|
1679 |
+
$poib = $poi->addChild('brands');
|
1680 |
+
$poib->$k = $v;
|
1681 |
+
} else {
|
1682 |
+
// Do nothing
|
1683 |
+
}
|
1684 |
}
|
1685 |
+
}
|
1686 |
+
}
|
1687 |
+
}
|
1688 |
+
}
|
1689 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1690 |
}
|
1691 |
}
|
1692 |
}
|
1693 |
}
|
1694 |
|
1695 |
foreach ($products as $key => $value){
|
|
|
1696 |
if ((is_array ( $value )) and (!empty( $value ))) {
|
1697 |
if ($feed_config['name'] == "Yandex") {
|
1698 |
$product = $xml->shop->offers->addChild('offer');
|
1716 |
|
1717 |
} else {
|
1718 |
if(count($value) > 0){
|
1719 |
+
if(is_object($xml)){
|
1720 |
+
$product = $xml->addChild('product');
|
1721 |
+
}
|
1722 |
}
|
1723 |
}
|
1724 |
|
1828 |
$product->addChild("$k");
|
1829 |
$product->$k = $v;
|
1830 |
} else {
|
1831 |
+
if (($feed_config['fields'] != 'standard') AND ($feed_config['fields'] != "customfeed")){
|
1832 |
$k = $this->get_alternative_key ($channel_attributes, $k);
|
1833 |
}
|
1834 |
if(!empty($k)){
|
|
|
1835 |
/**
|
1836 |
* Some Zbozi and Heureka attributes need some extra XML nodes
|
1837 |
*/
|
1866 |
$productp = $product->addChild($p,$v);
|
1867 |
$productp->addAttribute('name', $pieces[1]);
|
1868 |
} elseif ($feed_config['name'] == "Google Product Review") {
|
1869 |
+
} elseif ($feed_config['name'] == "Vivino") {
|
1870 |
+
$extra_arr = array('ean','jan','upc','producer','wine-name','appellation','vintage','country','color','image','description','alcohol','producer-address','importer-address','varietal','ageing','closure','winemaker','production-size','residual-sugar','acidity','ph','contains-milk-allergens','contains-egg-allergens','non-alcoholic');
|
1871 |
+
$unit_arr = array ('production-size','residual-sugar','acidity');
|
1872 |
|
1873 |
+
if(in_array($k, $extra_arr)){
|
1874 |
+
if(!isset($product->extras)){
|
1875 |
+
$productp = $product->addChild('extras');
|
1876 |
+
}
|
1877 |
+
|
1878 |
+
// Add units to it
|
1879 |
+
if(in_array($k, $unit_arr)){
|
1880 |
+
$productk = $productp->addChild($k,$v);
|
1881 |
+
if($k == "acidity"){
|
1882 |
+
$productk->addAttribute('unit', 'g/l');
|
1883 |
+
}
|
1884 |
+
if($k == "production-size"){
|
1885 |
+
$productk->addAttribute('unit', 'bottles');
|
1886 |
+
}
|
1887 |
+
if($k == "residual-sugar"){
|
1888 |
+
$productk->addAttribute('unit', 'g/l');
|
1889 |
+
}
|
1890 |
+
} else {
|
1891 |
+
$productp->$k = $v;
|
1892 |
+
}
|
1893 |
+
} else {
|
1894 |
+
$product->addChild("$k");
|
1895 |
+
$product->$k = $v;
|
1896 |
+
}
|
1897 |
} elseif ($feed_config['name'] == "Fruugo.nl") {
|
1898 |
$desc_arr = array('Language','Title','Description');
|
1899 |
$price_arr = array('Currency','NormalPriceWithoutVAT','NormalPriceWithVAT','VATRate');
|
1925 |
}
|
1926 |
|
1927 |
if(is_object($xml)){
|
1928 |
+
//$xml = html_entity_decode($xml->asXML());
|
1929 |
$xml->asXML($file);
|
1930 |
}
|
1931 |
unset($product);
|
1977 |
$channel_attributes = get_option('channel_attributes');
|
1978 |
}
|
1979 |
}
|
1980 |
+
|
1981 |
// Append or write to file
|
1982 |
$fp = fopen($file, 'a+');
|
1983 |
|
1994 |
$pieces = str_replace("'", "", $pieces);
|
1995 |
|
1996 |
foreach ($pieces as $k_inner => $v){
|
1997 |
+
if (($feed_config['fields'] != 'standard') AND ($feed_config['fields'] != "customfeed")){
|
1998 |
$v = $this->get_alternative_key ($channel_attributes, $v);
|
1999 |
}
|
2000 |
|
2059 |
fwrite($fp, $tab_line);
|
2060 |
}
|
2061 |
} else {
|
2062 |
+
$pieces = array_map('trim', $pieces);
|
2063 |
$tofile = fputcsv($fp, $pieces, $csv_delimiter, '"');
|
2064 |
}
|
2065 |
|
2173 |
$xml_piece = "";
|
2174 |
|
2175 |
// Get taxonomies
|
2176 |
+
$no_taxonomies = array("element_category","template_category","portfolio_category","portfolio_skills","portfolio_tags","faq_category","slide-page","category","post_tag","nav_menu","link_category","post_format","product_type","product_visibility","product_cat","product_shipping_class","product_tag");
|
2177 |
$taxonomies = get_taxonomies();
|
2178 |
$diff_taxonomies = array_diff($taxonomies, $no_taxonomies);
|
2179 |
|
2221 |
}
|
2222 |
}
|
2223 |
|
2224 |
+
// Get WooCommerce categories
|
2225 |
+
$product_categories = get_terms( 'product_cat', 'hide_empty=0' );
|
2226 |
+
$prod_cats = array();
|
2227 |
+
if ( ! empty( $product_categories ) && ! is_wp_error( $product_categories ) ) {
|
2228 |
+
foreach ( $product_categories as $category ) {
|
2229 |
+
$prod_cats[$category->slug] = $category->name;
|
2230 |
+
}
|
2231 |
+
}
|
2232 |
+
|
2233 |
+
// Get Fiters on categories
|
2234 |
+
$prod_cats_slugs = array();
|
2235 |
+
if(isset($project_config['rules'])){
|
2236 |
+
foreach ($project_config['rules'] as $rule){
|
2237 |
+
if(($rule['attribute'] == "categories") AND ($rule['condition'] == "=")){
|
2238 |
+
$slug = array_search($rule['criteria'], $prod_cats);
|
2239 |
+
array_push($prod_cats_slugs, $slug);
|
2240 |
+
}
|
2241 |
+
}
|
2242 |
+
}
|
2243 |
+
|
2244 |
+
$product_cat = "";
|
2245 |
+
if(count($prod_cats_slugs) > 0){
|
2246 |
+
foreach ( $prod_cats_slugs as $cat_slug ){
|
2247 |
+
$product_cat .= $cat_slug .",";
|
2248 |
+
}
|
2249 |
+
}
|
2250 |
+
|
2251 |
// Construct WP query
|
2252 |
$wp_query = array(
|
2253 |
'posts_per_page' => $offset_step_size,
|
2255 |
'post_type' => $post_type,
|
2256 |
'post_status' => 'publish',
|
2257 |
'fields' => 'ids',
|
2258 |
+
'no_found_rows' => true,
|
2259 |
+
// 'product_cat' => $product_cat
|
2260 |
+
);
|
2261 |
+
|
2262 |
$prods = new WP_Query($wp_query);
|
2263 |
$shipping_zones = $this->woosea_get_shipping_zones();
|
2264 |
|
2295 |
if(!in_array($product_data['id'], $allowed_product_orders)){ continue; }
|
2296 |
}
|
2297 |
}
|
|
|
2298 |
$product_data['title'] = $product->get_title();
|
2299 |
+
$product_data['title'] = $this->woosea_utf8_for_xml( $product_data['title'] );
|
2300 |
$product_data['mother_title'] = $product->get_title();
|
2301 |
$product_data['mother_title'] = $this->woosea_utf8_for_xml( $product_data['mother_title'] );
|
2302 |
$product_data['title_hyphen'] = $product_data['title'];
|
2456 |
// Check if there are mother categories
|
2457 |
if(!empty($product_cat)){
|
2458 |
$category_path = $this->woosea_get_term_parents( $product_cat->term_id, 'product_cat', $link = false, $project_taxonomy = $project_config['taxonomy'], $nicename = false, $visited = array() );
|
|
|
|
|
2459 |
|
2460 |
+
if(!is_object($category_path)){
|
2461 |
+
$category_path_skroutz = preg_replace('/>/', '>', $category_path);
|
2462 |
$product_data['category_path'] = $category_path;
|
2463 |
$product_data['category_path_skroutz'] = $category_path_skroutz;
|
2464 |
$product_data['category_path_skroutz'] = str_replace("Home >","",$product_data['category_path_skroutz']);
|
2497 |
}
|
2498 |
}
|
2499 |
|
2500 |
+
// Get the RankMath primary category
|
2501 |
+
if ($this->woosea_is_plugin_active('seo-by-rank-math/rank-math.php')){
|
2502 |
+
$item_id = $product_data['id'];
|
2503 |
+
if($product_data['item_group_id'] > 0){
|
2504 |
+
$item_id = $product_data['item_group_id'];
|
2505 |
+
}
|
2506 |
+
$primary_cat_id = get_post_meta( $item_id, 'rank_math_primary_product_cat', true );
|
2507 |
+
if ( $primary_cat_id ) {
|
2508 |
+
$product_cat = get_term( $primary_cat_id, 'product_cat' );
|
2509 |
+
if(!empty($product_cat->name)){
|
2510 |
+
$product_data['one_category'] = $product_cat->name;
|
2511 |
+
}
|
2512 |
+
}
|
2513 |
+
}
|
2514 |
+
|
2515 |
$product_data['category_path_short'] = str_replace("Home >","",$product_data['category_path']);
|
2516 |
$product_data['category_path_short'] = str_replace(">",">",$product_data['category_path_short']);
|
2517 |
$product_data['category_link'] = $catlink;
|
2547 |
$product_data['raw_description'] = substr($product_data['raw_description'], 0, 5000);
|
2548 |
$product_data['raw_short_description'] = substr($product_data['raw_short_description'], 0, 5000);
|
2549 |
|
2550 |
+
// Parent variable description
|
2551 |
+
$product_data['mother_description'] = $product_data['description'];
|
2552 |
+
$product_data['mother_short_description'] = $product_data['short_description'];
|
2553 |
+
|
2554 |
/**
|
2555 |
* Check of we need to add Google Analytics UTM parameters
|
2556 |
*/
|
2561 |
}
|
2562 |
|
2563 |
$product_data['link'] = get_permalink( $product_data['id'])."$utm_part";
|
2564 |
+
$product_data['link_no_tracking'] = get_permalink( $product_data['id']);
|
2565 |
$variable_link = htmlspecialchars(get_permalink( $product_data['id']));
|
2566 |
$vlink_piece = explode("?", $variable_link);
|
2567 |
$qutm_part = ltrim($utm_part, "&");
|
2569 |
$qutm_part = ltrim($qutm_part, "?");
|
2570 |
if($qutm_part){
|
2571 |
$product_data['variable_link'] = $vlink_piece[0]."?".$qutm_part;
|
2572 |
+
$product_data['link_no_tracking'] = $vlink_piece[0];
|
2573 |
} else {
|
2574 |
$product_data['variable_link'] = $vlink_piece[0];
|
2575 |
+
$product_data['link_no_tracking'] = $vlink_piece[0];
|
2576 |
}
|
2577 |
|
2578 |
$product_data['condition'] = ucfirst( get_post_meta( $product_data['id'], '_woosea_condition', true ) );
|
2579 |
+
$product_data['purchase_note'] = get_post_meta( $product_data['id'], '_purchase_note' );
|
2580 |
+
|
2581 |
if(empty($product_data['condition']) || $product_data['condition'] == "Array"){
|
2582 |
$product_data['condition'] = "New";
|
2583 |
}
|
2584 |
+
|
2585 |
+
// get_stock only works as of WC 5 and higher?
|
2586 |
$product_data['availability'] = $this->get_stock( $this->childID );
|
2587 |
|
2588 |
/**
|
2591 |
* Therefor, we need to check the stock_status and overwrite te availability value
|
2592 |
*/
|
2593 |
$stock_status = $product->get_stock_status();
|
2594 |
+
$product_data['stock_status'] = $stock_status;
|
2595 |
+
|
2596 |
if ($stock_status == "outofstock"){
|
2597 |
$product_data['availability'] = "out of stock";
|
2598 |
+
if (($project_config['taxonomy'] == "google_shopping") AND ($project_config['fields'] == "google_shopping")) {
|
2599 |
+
$product_data['availability'] = "out_of_stock";
|
2600 |
+
}
|
2601 |
} elseif ($stock_status == "onbackorder") {
|
2602 |
$product_data['availability'] = "on backorder";
|
2603 |
+
if (($project_config['taxonomy'] == "google_shopping") AND ($project_config['fields'] == "google_shopping")) {
|
2604 |
+
$product_data['availability'] = "backorder";
|
2605 |
+
}
|
2606 |
} else {
|
2607 |
$product_data['availability'] = "in stock";
|
2608 |
+
if (($project_config['taxonomy'] == "google_shopping") AND ($project_config['fields'] == "google_shopping")) {
|
2609 |
+
$product_data['availability'] = "in_stock";
|
2610 |
+
}
|
2611 |
}
|
2612 |
|
2613 |
$product_data['author'] = get_the_author();
|
2614 |
$product_data['quantity'] = $this->clean_quantity( $this->childID, "_stock" );
|
2615 |
+
$product_data['visibility'] = $product->get_catalog_visibility();
|
2616 |
$product_data['menu_order'] = get_post_field( 'menu_order', $product_data['id'] );
|
2617 |
$product_data['currency'] = get_woocommerce_currency();
|
2618 |
if(isset($project_config['WCML'])){
|
2629 |
$product_data['image_all'] = $product_data['image'];
|
2630 |
$product_data['all_images'] = $product_data['image'];
|
2631 |
$product_data['all_gallery_images'] = "";
|
2632 |
+
$product_data['product_type'] = $product->get_type();
|
2633 |
+
|
2634 |
+
// Get the number of active variations that are on stock for variable products
|
2635 |
+
if(($product_data['item_group_id'] > 0) AND ($product_data['product_type'] == "variation")){
|
2636 |
+
$parent_product = wc_get_product( $product_data['item_group_id'] );
|
2637 |
+
|
2638 |
+
if(is_object($parent_product)){
|
2639 |
+
$current_products = $parent_product->get_children();
|
2640 |
+
$product_data['nr_variations'] = count( $current_products );
|
2641 |
+
$vcnt = 0;
|
2642 |
+
|
2643 |
+
foreach ($current_products as $ckey => $cvalue){
|
2644 |
+
$stock_value = get_post_meta( $cvalue, "_stock_status", true );
|
2645 |
+
if($stock_value == "instock"){
|
2646 |
+
$vcnt++;
|
2647 |
+
|
2648 |
+
}
|
2649 |
+
}
|
2650 |
+
$product_data['nr_variations_stock'] = $vcnt;
|
2651 |
+
} else {
|
2652 |
+
$product_data['nr_variations'] = 9999;
|
2653 |
+
$product_data['nr_variations_stock'] = 9999;
|
2654 |
+
}
|
2655 |
+
} else {
|
2656 |
+
$product_data['nr_variations'] = 9999;
|
2657 |
+
$product_data['nr_variations_stock'] = 9999;
|
2658 |
+
}
|
2659 |
+
|
2660 |
+
// For variable products I need to get the product gallery images of the simple mother product
|
2661 |
if($product_data['item_group_id'] > 0){
|
2662 |
$parent_product = wc_get_product( $product_data['item_group_id'] );
|
2663 |
+
|
2664 |
if(is_object($parent_product)){
|
2665 |
$gallery_ids = $parent_product->get_gallery_image_ids();
|
2666 |
$product_data['image_all'] = wp_get_attachment_url($parent_product->get_image_id());
|
2686 |
$product_data['all_images'] = ltrim($product_data['all_images'],',');
|
2687 |
$product_data['all_images_kogan'] = preg_replace( '/,/', '|', $product_data['all_images'] );
|
2688 |
$product_data['all_gallery_images'] = ltrim($product_data['all_gallery_images'],',');
|
|
|
2689 |
|
2690 |
$product_data['content_type'] = "product";
|
2691 |
if($product_data['product_type'] == "variation"){
|
2701 |
|
2702 |
$product_data['shipping'] = 0;
|
2703 |
$tax_rates = WC_Tax::get_base_tax_rates( $product->get_tax_class() );
|
2704 |
+
$all_standard_taxes = WC_Tax::get_rates_for_tax_class( '' );
|
2705 |
+
|
2706 |
$shipping_class_id = $product->get_shipping_class_id();
|
2707 |
$shipping_class= $product->get_shipping_class();
|
2708 |
|
2712 |
}
|
2713 |
|
2714 |
$product_data['shipping_label'] = $product->get_shipping_class();
|
2715 |
+
$term = get_term_by( 'slug', $product->get_shipping_class(), 'product_shipping_class' );
|
2716 |
+
if(is_object($term)){
|
2717 |
+
$product_data['shipping_label_name'] = $term->name;
|
2718 |
+
}
|
2719 |
|
2720 |
// Get product prices
|
2721 |
$product_data['price'] = wc_get_price_including_tax($product, array('price'=> $product->get_price()));
|
2725 |
$product_data['regular_price'] = wc_get_price_including_tax($product, array('price'=> $product->get_regular_price()));
|
2726 |
$product_data['regular_price'] = wc_format_decimal($product_data['regular_price'],2);
|
2727 |
|
2728 |
+
// Untouched raw system pricing - DO NOT CHANGE THESE
|
2729 |
+
$float_system_net_price = floatval(wc_get_price_excluding_tax( $product ));
|
2730 |
+
$product_data['system_net_price'] = round($float_system_net_price, 2);
|
2731 |
+
$product_data['system_net_price'] = wc_format_decimal($product_data['system_net_price'],2);
|
2732 |
+
|
2733 |
+
// System regular price
|
2734 |
+
$float_system_regular_price = floatval($product->get_regular_price());
|
2735 |
+
$product_data['system_regular_price'] = round($float_system_regular_price,2);
|
2736 |
+
$product_data['system_regular_price'] = wc_format_decimal($product_data['system_regular_price'],2);
|
2737 |
+
|
2738 |
+
// System sale price
|
2739 |
+
$float_system_sale_price = floatval($product->get_sale_price());
|
2740 |
+
if($float_system_sale_price > 0){
|
2741 |
+
$product_data['system_sale_price'] = round($float_system_sale_price,2);
|
2742 |
+
$product_data['system_sale_price'] = wc_format_decimal($product_data['system_sale_price'],2);
|
2743 |
+
$sale_price = $product_data['system_sale_price'];
|
2744 |
+
}
|
2745 |
|
2746 |
+
$code_from_config = $this->woosea_country_to_code($project_config['countries']);
|
2747 |
|
2748 |
+
$nr_standard_rates = count($all_standard_taxes);
|
2749 |
+
if(!empty($all_standard_taxes) AND ($nr_standard_rates > 1)){
|
2750 |
+
foreach ($all_standard_taxes as $rate){
|
2751 |
+
$rate_arr = get_object_vars($rate);
|
2752 |
+
if($rate_arr['tax_rate_country'] == $code_from_config){
|
2753 |
+
$tax_rates[1]['rate'] = $rate_arr['tax_rate'];
|
2754 |
+
}
|
2755 |
+
}
|
2756 |
+
} else {
|
2757 |
+
if(!empty($tax_rates)){
|
2758 |
+
foreach ($tax_rates as $tk => $tv){
|
2759 |
+
if($tv['rate'] > 0){
|
2760 |
+
$tax_rates[1]['rate'] = $tv['rate'];
|
2761 |
+
} else {
|
2762 |
+
$tax_rates[1]['rate'] = 0;
|
2763 |
+
}
|
2764 |
}
|
2765 |
+
} else {
|
2766 |
+
$tax_rates[1]['rate'] = 0;
|
2767 |
+
}
|
2768 |
+
}
|
2769 |
+
|
2770 |
+
if(empty($tax_rates[1]['rate'])){
|
2771 |
+
if(!empty($all_standard_taxes) AND ($nr_standard_rates > 1)){
|
2772 |
+
foreach ($all_standard_taxes as $rate){
|
2773 |
+
$rate_arr = get_object_vars($rate);
|
2774 |
+
if($rate_arr['tax_rate_country'] == ""){
|
2775 |
+
$tax_rates[1]['rate'] = $rate_arr['tax_rate'];
|
2776 |
+
}
|
2777 |
+
}
|
2778 |
}
|
|
|
|
|
2779 |
}
|
2780 |
|
2781 |
$fullrate = 100+$tax_rates[1]['rate'];
|
2787 |
if($product->get_type() == "bundle"){
|
2788 |
if ($this->woosea_is_plugin_active('woocommerce-product-bundles/woocommerce-product-bundles.php')){
|
2789 |
$product_data['price'] = get_post_meta($product_data['id'], '_price', true);
|
2790 |
+
$product_data['sale_price'] = get_post_meta($product_data['id'], '_sale_price', true);
|
2791 |
if(is_numeric($tax_rates[1]['rate'])){
|
2792 |
$product_data['price_forced'] = round(get_post_meta($product_data['id'], '_price', true) * (100+$tax_rates[1]['rate'])/100,2);
|
2793 |
$product_data['regular_price'] = round(get_post_meta($product_data['id'], '_regular_price', true) * (100+$tax_rates[1]['rate'])/100,2);
|
2828 |
|
2829 |
// Make sure the product ID is not NULL either
|
2830 |
global $woocommerce_wpml;
|
2831 |
+
if(!is_null($project_config['WCML'])){
|
2832 |
+
//$product_data['non_geo_wcml_price'] = $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency( $product_data['id'], $project_config['WCML'] );
|
2833 |
+
$product_data['non_geo_wcml_price'] = wc_format_decimal(get_post_meta( $product_data['id'], '_regular_price', true),2);
|
2834 |
+
$product_data['non_geo_wcml_price'] = wc_format_localized_price($product_data['non_geo_wcml_price']);
|
2835 |
+
$product_data['non_geo_wcml_price_net_price'] = $product_data['non_geo_wcml_price']/((100+$tax_rates[1]['rate'])/100);
|
2836 |
+
|
2837 |
+
$non_geo_sale = get_post_meta( $product_data['id'], '_sale_price', true );
|
2838 |
+
if(!empty($non_geo_sale)){
|
2839 |
+
$product_data['non_geo_wcml_sale_price'] = wc_format_decimal(get_post_meta( $product_data['id'], '_sale_price', true),2);
|
2840 |
+
$product_data['non_geo_wcml_sale_price'] = wc_format_localized_price($product_data['non_geo_wcml_sale_price']);
|
2841 |
+
$product_data['non_geo_wcml_sale_price_net_price'] = $product_data['non_geo_wcml_sale_price']/((100-$tax_rates[1]['rate'])/100);
|
2842 |
+
}
|
2843 |
+
}
|
2844 |
|
2845 |
// When WCML manual prices have been entered
|
2846 |
if(!is_null($product_data['id'])){
|
2854 |
$product_data['regular_price'] = $custom_prices['_regular_price'];
|
2855 |
}
|
2856 |
|
2857 |
+
if(isset($custom_prices['_sale_price'])){
|
2858 |
+
if($custom_prices['_sale_price'] > 0){
|
2859 |
+
$product_data['sale_price'] = $custom_prices['_sale_price'];
|
2860 |
+
} else {
|
2861 |
+
// Unset these values as WCML prices have been filled in manually
|
2862 |
+
unset($product_data['sale_price']);
|
2863 |
+
unset($product_data['system_regular_price']);
|
2864 |
+
unset($product_data['system_price']);
|
2865 |
+
unset($product_data['system_sale_price']);
|
2866 |
+
}
|
2867 |
+
}
|
2868 |
}
|
2869 |
}
|
2870 |
|
2878 |
}
|
2879 |
if($product->get_regular_price()){
|
2880 |
$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);
|
2881 |
+
$product_data['net_regular_price'] = round(wc_get_price_excluding_tax($product, array('price'=> $product->get_regular_price())),2);
|
2882 |
+
//$product_data['net_regular_price'] = ($product->get_regular_price()/$fullrate)*100;
|
2883 |
+
//$product_data['net_regular_price'] = round($product_data['net_regular_price'],2);
|
2884 |
}
|
2885 |
if($product->get_sale_price()){
|
2886 |
$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);
|
2887 |
+
$product_data['net_sale_price'] = round(wc_get_price_excluding_tax($product, array('price'=> $product->get_sale_price())),2);
|
2888 |
+
|
|
|
2889 |
// We do not want to have 0 sale price values in the feed
|
2890 |
if($product_data['net_sale_price'] == 0){
|
2891 |
$product_data['net_sale_price'] = "";
|
2892 |
}
|
2893 |
}
|
2894 |
+
$float_net_price = floatval(wc_get_price_excluding_tax( $product ));
|
2895 |
+
$product_data['net_price'] = round($float_net_price, 2);
|
2896 |
+
$product_data['net_price'] = wc_format_decimal($product_data['net_price'],2);
|
2897 |
+
|
2898 |
$price = wc_get_price_including_tax($product,array('price'=> $product->get_price()));
|
2899 |
if($product_data['sale_price'] > 0){
|
2900 |
$price = $product_data['sale_price'];
|
2904 |
if ($this->woosea_is_plugin_active('woo-discount-rules/woo-discount-rules.php')){
|
2905 |
$discount = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', false, $product, 1, $product_data['sale_price'], 'discounted_price', true, true);
|
2906 |
if($discount !== false){
|
2907 |
+
// round discounted price on 2 decimals
|
2908 |
+
$discount = round($discount,2);
|
2909 |
+
|
2910 |
$product_data['sale_price'] = $discount;
|
2911 |
+
$product_data['price'] = $discount;
|
2912 |
$price_incl_tax = get_option( 'woocommerce_prices_include_tax' );
|
2913 |
if($price_incl_tax == "yes"){
|
2914 |
$product_data['price_forced'] = $product_data['price']*($fullrate/100);
|
3017 |
}
|
3018 |
}
|
3019 |
|
3020 |
+
// Is the Mix and Match plugin active
|
3021 |
+
if ($this->woosea_is_plugin_active('woocommerce-mix-and-match-products/woocommerce-mix-and-match-products.php')){
|
3022 |
+
if($product->is_type('mix-and-match')){
|
3023 |
+
if($product_data['price'] == "0.00"){
|
3024 |
+
$product_data['price'] = "";
|
3025 |
+
$product_data['regular_price'] = "";
|
3026 |
+
}
|
3027 |
+
|
3028 |
+
// Get minimum prices
|
3029 |
+
$product_data['mm_min_price'] = wc_format_localized_price($product->get_mnm_price());
|
3030 |
+
$product_data['mm_min_regular_price'] = wc_format_localized_price($product->get_mnm_regular_price());
|
3031 |
+
|
3032 |
+
// Get maximum prices
|
3033 |
+
$product_data['mm_max_price'] = wc_format_localized_price($product->get_mnm_price('max'));
|
3034 |
+
$product_data['mm_max_regular_price'] = wc_format_localized_price($product->get_mnm_regular_price('max'));
|
3035 |
+
}
|
3036 |
+
}
|
3037 |
+
|
3038 |
// Localize the price attributes
|
3039 |
$decimal_separator = wc_get_price_decimal_separator();
|
3040 |
$product_data['price'] = wc_format_localized_price($product_data['price']);
|
3042 |
$product_data['sale_price'] = wc_format_localized_price($product_data['sale_price']);
|
3043 |
if($product->get_price()){
|
3044 |
$product_data['price_forced'] = wc_format_localized_price($product_data['price_forced']);
|
3045 |
+
//$product_data['price_forced'] = (float)$product_data['price_forced'];
|
3046 |
+
//$product_data['price_forced_rounded'] = round($product_data['price_forced'],0);
|
3047 |
}
|
3048 |
if($product->get_regular_price()){
|
3049 |
$product_data['regular_price_forced'] = wc_format_localized_price($product_data['regular_price_forced']);
|
3050 |
+
//$product_data['regular_price_forced'] = (float)$product_data['regular_price_forced'];
|
3051 |
+
//$product_data['regular_price_forced_rounded'] = round($product_data['regular_price_forced'],0);
|
3052 |
}
|
3053 |
if($product->get_sale_price()){
|
3054 |
$product_data['sale_price_forced'] = wc_format_localized_price($product_data['sale_price_forced']);
|
3055 |
+
//$product_data['sale_price_forced_rounded'] = round($product_data['sale_price_forced'],0);
|
3056 |
+
|
3057 |
}
|
3058 |
$product_data['net_price'] = wc_format_localized_price($product_data['net_price']);
|
3059 |
|
3067 |
$product_data['net_sale_price'] = wc_format_localized_price($product_data['net_sale_price']);
|
3068 |
}
|
3069 |
|
3070 |
+
if(!empty($product_data['system_price'])){
|
3071 |
+
$product_data['system_price'] = wc_format_localized_price($product_data['system_price']);
|
3072 |
+
}
|
3073 |
+
|
3074 |
+
if(!empty($product_data['system_net_price'])){
|
3075 |
+
$product_data['system_net_price'] = wc_format_localized_price($product_data['system_net_price']);
|
3076 |
+
}
|
3077 |
+
|
3078 |
+
if(!empty($product_data['system_regular_price'])){
|
3079 |
+
$product_data['system_regular_price'] = wc_format_localized_price($product_data['system_regular_price']);
|
3080 |
+
}
|
3081 |
+
|
3082 |
+
if(!empty($product_data['system_sale_price'])){
|
3083 |
+
$product_data['system_sale_price'] = wc_format_localized_price($product_data['system_sale_price']);
|
3084 |
+
}
|
3085 |
|
3086 |
// Add rounded price options
|
3087 |
+
$decimal_separator = wc_get_price_decimal_separator();
|
3088 |
+
$float_price = floatval($product_data['price']);
|
3089 |
+
$float_regular_price = floatval($product_data['regular_price']);
|
3090 |
+
$float_sale_price = floatval($product_data['sale_price']);
|
3091 |
+
|
3092 |
+
if($decimal_separator == ","){
|
3093 |
+
$product_data['rounded_price'] = str_replace(',', '.', $product_data['price']);
|
3094 |
+
$product_data['rounded_price'] = round(number_format($product_data['rounded_price'], 2, '.', ''));
|
3095 |
+
$product_data['rounded_regular_price'] = str_replace(',', '.', $product_data['regular_price']);
|
3096 |
+
$product_data['rounded_regular_price'] = round(number_format($product_data['rounded_regular_price'], 2, '.', ''));
|
3097 |
+
|
3098 |
+
if($product_data['sale_price'] > 0){
|
3099 |
+
$product_data['rounded_sale_price'] = str_replace(',', '.', $product_data['sale_price']);
|
3100 |
+
$product_data['rounded_sale_price'] = round(number_format($product_data['rounded_sale_price'], 2, '.', ''));
|
3101 |
+
}
|
3102 |
+
} else {
|
3103 |
+
$product_data['rounded_price'] = round($float_price,0);
|
3104 |
+
$product_data['rounded_regular_price'] = (string) round($float_regular_price,0);
|
3105 |
+
$product_data['rounded_sale_price'] = round($float_sale_price,0);
|
3106 |
+
}
|
3107 |
|
3108 |
// Calculate discount percentage
|
3109 |
+
if(isset($product_data['rounded_sale_price'])){
|
3110 |
+
if($product_data['rounded_regular_price'] > 0){
|
3111 |
+
$disc = round(($product_data['rounded_sale_price'] * 100) / $product_data['rounded_regular_price'], 2);
|
3112 |
+
$product_data['discount_percentage'] = 100-$disc;
|
3113 |
+
//$product_data['discount_percentage'] = round(100-(($product_data['sale_price']/$product_data['regular_price'])*100),2);
|
3114 |
+
}
|
3115 |
}
|
3116 |
|
3117 |
foreach($project_config['attributes'] as $attr_key => $attr_arr){
|
3118 |
if(is_array($attr_arr)){
|
3119 |
if($attr_arr['attribute'] == "g:shipping"){
|
3120 |
if($product_data['price'] > 0){
|
3121 |
+
$product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $product_data['price'], $tax_rates, $fullrate, $shipping_zones, $product_data['id'], $product_data['item_group_id']);
|
3122 |
$shipping_str = $product_data['shipping'];
|
3123 |
}
|
3124 |
}
|
3125 |
}
|
3126 |
}
|
3127 |
|
3128 |
+
if ((array_key_exists('shipping', $project_config['attributes'])) OR (array_key_exists('lowest_shipping_costs', $project_config['attributes'])) OR (array_key_exists('shipping_price', $project_config['attributes'])) OR ($project_config['fields'] == "trovaprezzi") OR ($project_config['fields'] == "customfeed")){
|
3129 |
+
$product_data['shipping'] = $this->woosea_get_shipping_cost($class_cost_id, $project_config, $product_data['price'], $tax_rates, $fullrate, $shipping_zones, $product_data['id'], $product_data['item_group_id']);
|
3130 |
$shipping_str = $product_data['shipping'];
|
3131 |
}
|
3132 |
|
3134 |
if(!empty($shipping_str)){
|
3135 |
$product_data['shipping_price'] = 0;
|
3136 |
}
|
3137 |
+
$lowest_shipping_price = array();
|
3138 |
+
$shipping_arr = $product_data['shipping'];
|
3139 |
|
3140 |
if(is_array($shipping_arr)){
|
3141 |
foreach($shipping_arr as $akey => $arr){
|
3143 |
$pieces_ship = explode (" ", $arr['price']);
|
3144 |
if(isset($pieces_ship['1'])){
|
3145 |
$product_data['shipping_price'] = $pieces_ship['1'];
|
3146 |
+
$lowest_shipping_price[] = $pieces_ship['1'];
|
3147 |
}
|
3148 |
}
|
3149 |
|
3158 |
}
|
3159 |
}
|
3160 |
|
3161 |
+
// Get the lowest shipping costs
|
3162 |
+
if(!empty($lowest_shipping_price)){
|
3163 |
+
$decimal_separator = wc_get_price_decimal_separator();
|
3164 |
+
if($decimal_separator == ","){
|
3165 |
+
$numeric_lowest_shipping_price = array();
|
3166 |
+
foreach ($lowest_shipping_price as &$value) {
|
3167 |
+
$number = str_replace(',', '.', $value);
|
3168 |
+
if (is_numeric($number)) {
|
3169 |
+
$value = number_format($number, 2, '.', '');
|
3170 |
+
$numeric_lowest_shipping_price[] = $value;
|
3171 |
+
}
|
3172 |
+
}
|
3173 |
+
$lowest_shipping_price = $numeric_lowest_shipping_price;
|
3174 |
+
unset($value);
|
3175 |
+
}
|
3176 |
+
$product_data['lowest_shipping_costs'] = min($lowest_shipping_price);
|
3177 |
+
|
3178 |
+
if($decimal_separator == ","){
|
3179 |
+
$product_data['lowest_shipping_costs'] = str_replace('.', ',', $product_data['lowest_shipping_costs']);
|
3180 |
+
}
|
3181 |
+
}
|
3182 |
+
|
3183 |
+
// Google Dynamic Remarketing feeds require the English price notation
|
3184 |
+
if ($project_config['name'] == "Google Remarketing - DRM"){
|
3185 |
$thousand_separator = wc_get_price_thousand_separator();
|
3186 |
|
3187 |
if($thousand_separator != ','){
|
3245 |
|
3246 |
foreach($diff_taxonomies as $taxo){
|
3247 |
$term_value = get_the_terms($product_data['id'], $taxo);
|
3248 |
+
$product_data["$taxo"] = "";
|
3249 |
|
3250 |
if(is_array($term_value)){
|
3251 |
// Do not add variation values to the feed when they are out of stock
|
3255 |
$variations = $product_skroutz->get_available_variations();
|
3256 |
$variations_id = wp_list_pluck( $variations, 'variation_id' );
|
3257 |
$skroutz_att_array = array();
|
3258 |
+
|
3259 |
foreach($variations_id as $var_id){
|
3260 |
$stock_value = get_post_meta( $var_id, "_stock_status", true );
|
3261 |
if($stock_value == "instock"){
|
3269 |
$product_data[$taxo] = rtrim($product_data[$taxo],',');
|
3270 |
}
|
3271 |
}
|
3272 |
+
|
3273 |
foreach($skroutz_att_array as $skrtz_value){
|
3274 |
$product_data[$taxo] .= ",". $skrtz_value;
|
3275 |
}
|
3276 |
$product_data[$taxo] = ltrim($product_data[$taxo],',');
|
3277 |
$product_data[$taxo] = rtrim($product_data[$taxo],',');
|
3278 |
+
|
3279 |
} else {
|
3280 |
// Simple Skroutz product
|
3281 |
foreach($term_value as $term){
|
3318 |
/**
|
3319 |
* Get Custom Attributes for Single, Bundled and Composite products
|
3320 |
*/
|
3321 |
+
if (($product->is_type('simple')) OR ($product->is_type('woosb')) OR ($product->is_type('mix-and-match')) OR ($product->is_type('external')) OR ($product->is_type('bundle')) OR ($product->is_type('composite')) OR ($product_data['product_type'] == "variable") OR ($product_data['product_type'] == "auction") OR ($product->is_type('subscription'))){
|
3322 |
$custom_attributes = $this->get_custom_attributes( $product_data['id'] );
|
3323 |
|
3324 |
+
if(is_array($custom_attributes)){
|
|
|
|
|
|
|
|
|
|
|
3325 |
|
|
|
|
|
|
|
|
|
3326 |
|
3327 |
+
if(!in_array("woosea optimized title", $custom_attributes)){
|
3328 |
+
$woosea_opt = array (
|
3329 |
+
"_woosea_optimized_title" => "woosea optimized title",
|
3330 |
+
);
|
3331 |
+
$custom_attributes = array_merge($custom_attributes, $woosea_opt);
|
|
|
|
|
3332 |
}
|
3333 |
+
|
3334 |
+
if ( class_exists( 'All_in_One_SEO_Pack' ) ) {
|
3335 |
+
$custom_attributes['_aioseop_title'] = "All in one seo pack title";
|
3336 |
+
$custom_attributes['_aioseop_description'] = "All in one seo pack description";
|
3337 |
+
}
|
3338 |
+
|
3339 |
+
if ( class_exists( 'Yoast_WooCommerce_SEO' ) ) {
|
3340 |
+
if(array_key_exists("yoast_gtin8", $custom_attributes)){
|
3341 |
+
$product_data["yoast_gtin8"] = $custom_attributes["yoast_gtin8"];
|
3342 |
+
}
|
3343 |
+
if(array_key_exists("yoast_gtin12", $custom_attributes)){
|
3344 |
+
$product_data["yoast_gtin12"] = $custom_attributes["yoast_gtin12"];
|
3345 |
+
}
|
3346 |
+
if(array_key_exists("yoast_gtin13", $custom_attributes)){
|
3347 |
+
$product_data["yoast_gtin13"] = $custom_attributes["yoast_gtin13"];
|
3348 |
+
}
|
3349 |
+
if(array_key_exists("yoast_gtin14", $custom_attributes)){
|
3350 |
+
$product_data["yoast_gtin14"] = $custom_attributes["yoast_gtin14"];
|
3351 |
+
}
|
3352 |
+
if(array_key_exists("yoast_isbn", $custom_attributes)){
|
3353 |
+
$product_data["yoast_isbn"] = $custom_attributes["yoast_isbn"];
|
3354 |
+
}
|
3355 |
+
if(array_key_exists("yoast_mpn", $custom_attributes)){
|
3356 |
+
$product_data["yoast_mpn"] = $custom_attributes["yoast_mpn"];
|
3357 |
+
}
|
3358 |
+
}
|
3359 |
+
|
3360 |
+
foreach($custom_attributes as $custom_kk => $custom_vv){
|
3361 |
+
$custom_value = get_post_meta( $product_data['id'], $custom_kk, true );
|
3362 |
+
$new_key ="custom_attributes_" . $custom_kk;
|
3363 |
+
|
3364 |
+
// This is a ACF image field (PLEASE NOTE: the ACF field needs to contain image or bild in the name)
|
3365 |
+
if(preg_match("/image|bild/i", $custom_kk)) {
|
3366 |
+
if (class_exists('ACF') AND ($custom_value > 0)) {
|
3367 |
+
//$image = wp_get_attachment_image_src($custom_value, "large");
|
3368 |
+
if(isset($image[0])){
|
3369 |
+
$custom_value = $image[0];
|
3370 |
+
}
|
3371 |
+
}
|
3372 |
+
}
|
3373 |
+
|
3374 |
+
// Just to make sure the title is never empty
|
3375 |
+
if(($custom_kk == "_aioseop_title") && ($custom_value == "")){
|
3376 |
+
$custom_value = $product_data['title'];
|
3377 |
+
}
|
3378 |
|
3379 |
+
// Just to make sure the description is never empty
|
3380 |
+
if(($custom_kk == "_aioseop_description") && ($custom_value == "")){
|
3381 |
+
$custom_value = $product_data['description'];
|
3382 |
+
}
|
3383 |
|
3384 |
+
// Just to make sure product names are never empty
|
3385 |
+
if(($custom_kk == "_woosea_optimized_title") && ($custom_value == "")){
|
3386 |
+
$custom_value = $product_data['title'];
|
3387 |
+
}
|
3388 |
|
3389 |
+
// Just to make sure the condition field is never empty
|
3390 |
+
if(($custom_kk == "_woosea_condition") && ($custom_value == "")){
|
3391 |
+
$custom_value = $product_data['condition'];
|
3392 |
+
}
|
3393 |
|
3394 |
+
// Need to clean up the strange price Rightpress is returning
|
3395 |
+
if ($this->woosea_is_plugin_active('wc-dynamic-pricing-and-discounts/wc-dynamic-pricing-and-discounts.php')){
|
3396 |
+
if($custom_kk == "rp_wcdpd_price_cache"){
|
3397 |
+
if((isset($project_config['AELIA'])) AND (!empty($GLOBALS['woocommerce-aelia-currencyswitcher'])) AND (get_option ('add_aelia_support') == "yes")){
|
3398 |
+
$product_data['price'] = do_shortcode('[aelia_cs_product_price product_id="'.$product_data['id'].'" formatted="0" currency="'.$project_config['AELIA'].'"]');
|
3399 |
+
$product_data['sale_price'] = apply_filters('wc_aelia_cs_convert', $custom_value['sale_price']['p'], $from_currency, $project_config['AELIA']);
|
3400 |
+
} else {
|
3401 |
+
if(array_key_exists("price", $custom_value)){
|
3402 |
+
$product_data['price'] = $custom_value['price']['p'];
|
3403 |
+
}
|
3404 |
|
3405 |
+
if(array_key_exists("sale_price", $custom_value)){
|
3406 |
+
$product_data['sale_price'] = $custom_value['sale_price']['p'];
|
3407 |
+
}
|
3408 |
+
}
|
3409 |
}
|
3410 |
}
|
3411 |
+
$product_data[$new_key] = $custom_value;
|
3412 |
+
|
3413 |
}
|
3414 |
+
}
|
|
|
3415 |
|
3416 |
/**
|
3417 |
* We need to check if this product has individual custom product attributes
|
3421 |
$data = $wpdb->get_results($sql);
|
3422 |
if (count($data)) {
|
3423 |
foreach ($data as $key => $value) {
|
3424 |
+
$value_display = str_replace("_", " ",$value->name);
|
3425 |
if (preg_match("/_product_attributes/i",$value->name)){
|
3426 |
$product_attr = unserialize($value->type);
|
3427 |
if(!empty($product_attr)){
|
3439 |
|
3440 |
/**
|
3441 |
* Get Product Attributes for Single products
|
3442 |
+
* These are the attributes users create themselves in WooCommerce
|
3443 |
*/
|
3444 |
+
if (($product->is_type('simple')) OR ($product->is_type('external')) OR ($product->is_type('woosb')) OR ($product->is_type('mix-and-match')) OR ($product->is_type('bundle')) OR ($product->is_type('composite')) OR ($product->is_type('auction') OR ($product->is_type('subscription')) OR ($product->is_type('variable')))){
|
3445 |
$single_attributes = $product->get_attributes();
|
|
|
3446 |
foreach ($single_attributes as $attribute){
|
3447 |
+
$attr_name = strtolower($attribute->get_name());
|
3448 |
+
$attr_value = $product->get_attribute($attr_name);
|
3449 |
+
$product_data[$attr_name] = $attr_value;
|
3450 |
}
|
3451 |
}
|
3452 |
|
3459 |
}
|
3460 |
}
|
3461 |
|
|
|
|
|
|
|
3462 |
/**
|
3463 |
* Versioned products need a seperate approach
|
3464 |
* Get data for these products based on the mother products item group id
|
3469 |
$product_variations = new WC_Product_Variation( $product_data['id'] );
|
3470 |
$variations = $product_variations->get_variation_attributes();
|
3471 |
|
3472 |
+
// For Skroutz and Bestprice apparal products we can only append colours to the product name
|
3473 |
// When a product has both a size and color attribute we assume its an apparal product
|
3474 |
+
if(($project_config['fields'] == "skroutz") OR ($project_config['fields'] == "bestprice")){
|
3475 |
$size_found = "no";
|
3476 |
$color_found = "no";
|
3477 |
|
3505 |
if(isset($sz_attribute)){
|
3506 |
$skroutz_size = get_post_meta( $product_data['id'], "attribute_".$sz_attribute, true );
|
3507 |
}
|
3508 |
+
|
3509 |
if((!empty($skroutz_color)) AND (!empty($skroutz_size))){
|
3510 |
|
3511 |
foreach($variations as $kvar => $vvar){
|
3547 |
}
|
3548 |
}
|
3549 |
|
|
|
|
|
3550 |
if((isset($project_config['lowest_price_variations'])) OR (isset($project_config['default_variations']))){
|
|
|
3551 |
// Determine the default variation product
|
3552 |
if( ($product_data['item_group_id'] > 0) AND (is_object(wc_get_product( $product_data['item_group_id']))) AND (($product_data['product_type'] == "variation") OR ($product_data['product_type'] == "subscription_variation"))){
|
3553 |
+
$mother_product = new WC_Product_Variable($product_data['item_group_id']);
|
3554 |
+
//$mother_product = wc_get_product($product_data['item_group_id']);
|
3555 |
+
$def_attributes = $mother_product->get_default_attributes();
|
3556 |
|
3557 |
if(isset($project_config['lowest_price_variations'])){
|
3558 |
+
|
3559 |
// Determine lowest priced variation
|
3560 |
$variation_min_price = $mother_product->get_variation_price('min');
|
3561 |
$variation_min_price = wc_format_decimal($variation_min_price,2);
|
3562 |
$variation_min_price = wc_format_localized_price($variation_min_price);
|
3563 |
+
$var_price = get_post_meta($product_data['id'], '_price', true);
|
3564 |
+
$var_price = wc_format_decimal($var_price,2);
|
3565 |
+
$var_price = wc_format_localized_price($var_price);
|
3566 |
+
$variation_prices = $mother_product->get_variation_prices();
|
3567 |
+
$variation_prices_price = array_values($variation_prices['price']);
|
3568 |
+
if(!empty($variation_prices_price)){
|
3569 |
+
$lowest_price = min($variation_prices_price);
|
3570 |
+
} else {
|
3571 |
+
$lowest_price = 0;
|
3572 |
+
}
|
3573 |
|
3574 |
+
if(($var_price == $lowest_price) OR ($var_price == $variation_min_price) OR ($product_data['system_regular_price'] == $variation_min_price) OR ($product_data['system_net_price'] == $variation_min_price)){
|
3575 |
$variation_pass = "true";
|
3576 |
} else {
|
3577 |
$variation_pass = "false";
|
3709 |
/**
|
3710 |
* Although this is a product variation we also need to grap the Dynamic attributes belonging to the simple mother prodict
|
3711 |
*/
|
3712 |
+
$stock_value = get_post_meta( $product_data['id'], "_stock_status", true );
|
3713 |
+
//if($stock_value == "instock"){
|
3714 |
foreach($diff_taxonomies as $taxo){
|
3715 |
$term_value = get_the_terms($product_data['item_group_id'], $taxo);
|
3716 |
unset($product_data[$taxo]);
|
3717 |
if(is_array($term_value)){
|
3718 |
foreach($term_value as $term){
|
3719 |
if(empty($product_data[$taxo])){
|
3720 |
+
$product_data[$taxo] = $term->name;
|
3721 |
} else {
|
3722 |
+
$product_data[$taxo] .= " ".$term->name;
|
3723 |
}
|
3724 |
}
|
3725 |
}
|
3726 |
+
}
|
3727 |
|
3728 |
/**
|
3729 |
* Add product tags to the product data array
|
3743 |
|
3744 |
// Add attribute values to the variation product names to make them unique
|
3745 |
$product_data['title_hyphen'] = $product_data['title']." - ";
|
3746 |
+
$product_data['mother_title_hyphen'] = $product_data['mother_title']." - ";
|
3747 |
|
3748 |
foreach($variations as $kk => $vv){
|
3749 |
$custom_key = $kk;
|
3777 |
/**
|
3778 |
* Get Custom Attributes for this variable product
|
3779 |
*/
|
|
|
3780 |
$custom_attributes = $this->get_custom_attributes( $product_data['id'] );
|
3781 |
|
3782 |
if(!in_array("woosea optimized title", $custom_attributes)){
|
3790 |
$custom_attributes['_aioseop_title'] = "All in one seo pack title";
|
3791 |
$custom_attributes['_aioseop_description'] = "All in one seo pack description";
|
3792 |
}
|
3793 |
+
|
3794 |
+
if ( class_exists( 'Yoast_WooCommerce_SEO' ) ) {
|
3795 |
+
if(array_key_exists("yoast_gtin8", $custom_attributes)){
|
3796 |
+
$product_data["yoast_gtin8"] = $custom_attributes["yoast_gtin8"];
|
3797 |
+
}
|
3798 |
+
if(array_key_exists("yoast_gtin12", $custom_attributes)){
|
3799 |
+
$product_data["yoast_gtin12"] = $custom_attributes["yoast_gtin12"];
|
3800 |
+
}
|
3801 |
+
if(array_key_exists("yoast_gtin13", $custom_attributes)){
|
3802 |
+
$product_data["yoast_gtin13"] = $custom_attributes["yoast_gtin13"];
|
3803 |
+
}
|
3804 |
+
if(array_key_exists("yoast_gtin14", $custom_attributes)){
|
3805 |
+
$product_data["yoast_gtin14"] = $custom_attributes["yoast_gtin14"];
|
3806 |
+
}
|
3807 |
+
if(array_key_exists("yoast_isbn", $custom_attributes)){
|
3808 |
+
$product_data["yoast_isbn"] = $custom_attributes["yoast_isbn"];
|
3809 |
+
}
|
3810 |
+
if(array_key_exists("yoast_mpn", $custom_attributes)){
|
3811 |
+
$product_data["yoast_mpn"] = $custom_attributes["yoast_mpn"];
|
3812 |
+
}
|
3813 |
+
}
|
3814 |
+
|
3815 |
foreach($custom_attributes as $custom_kk => $custom_vv){
|
3816 |
$custom_value = get_post_meta( $product_data['id'], $custom_kk, true );
|
3817 |
|
3843 |
$new_key = str_replace("var","product",$new_key);
|
3844 |
if(!empty( $custom_value )){
|
3845 |
$product_data[$new_key] = $custom_value;
|
3846 |
+
}
|
3847 |
}
|
3848 |
}
|
3849 |
|
3858 |
$value_display = str_replace("_", " ",$value->name);
|
3859 |
if (preg_match("/_product_attributes/i",$value->name)){
|
3860 |
$product_attr = unserialize($value->type);
|
3861 |
+
if((!empty($product_attr)) AND (is_array($product_attr))){
|
3862 |
foreach ($product_attr as $key => $arr_value) {
|
3863 |
$new_key ="custom_attributes_" . $key;
|
3864 |
$product_data[$new_key] = $arr_value['value'];
|
3873 |
*/
|
3874 |
$custom_attributes_mother = $this->get_custom_attributes( $product_data['item_group_id'] );
|
3875 |
|
3876 |
+
if ( class_exists( 'Yoast_WooCommerce_SEO' ) ) {
|
3877 |
+
if(array_key_exists("yoast_gtin8", $custom_attributes_mother)){
|
3878 |
+
$product_data["yoast_gtin8"] = $custom_attributes_mother["yoast_gtin8"];
|
3879 |
+
}
|
3880 |
+
if(array_key_exists("yoast_gtin12", $custom_attributes_mother)){
|
3881 |
+
$product_data["yoast_gtin12"] = $custom_attributes_mother["yoast_gtin12"];
|
3882 |
+
}
|
3883 |
+
if(array_key_exists("yoast_gtin13", $custom_attributes_mother)){
|
3884 |
+
$product_data["yoast_gtin13"] = $custom_attributes_mother["yoast_gtin13"];
|
3885 |
+
}
|
3886 |
+
if(array_key_exists("yoast_gtin14", $custom_attributes_mother)){
|
3887 |
+
$product_data["yoast_gtin14"] = $custom_attributes_mother["yoast_gtin14"];
|
3888 |
+
}
|
3889 |
+
if(array_key_exists("yoast_isbn", $custom_attributes_mother)){
|
3890 |
+
$product_data["yoast_isbn"] = $custom_attributes_mother["yoast_isbn"];
|
3891 |
+
}
|
3892 |
+
if(array_key_exists("yoast_mpn", $custom_attributes_mother)){
|
3893 |
+
$product_data["yoast_mpn"] = $custom_attributes_mother["yoast_mpn"];
|
3894 |
+
}
|
3895 |
+
}
|
3896 |
+
|
3897 |
foreach($custom_attributes_mother as $custom_kk_m => $custom_value_m){
|
3898 |
|
3899 |
if(!array_key_exists($custom_kk_m, $product_data)){
|
3933 |
* we will add CDATA brackets to the title and description attributes
|
3934 |
*/
|
3935 |
$product_data['title_lc'] = ucfirst(strtolower($product_data['title']));
|
3936 |
+
$product_data['title_lcw'] = ucwords(strtolower($product_data['title']));
|
3937 |
+
|
3938 |
+
// Add CDATA to title and descriptions
|
3939 |
+
//$add_woosea_cdata = get_option ('add_woosea_cdata');
|
3940 |
+
//if($add_woosea_cdata == "yes"){
|
3941 |
+
// $product_data['title'] = $this->woosea_append_cdata ( $product_data['title'] );
|
3942 |
+
// $product_data['description'] = $this->woosea_append_cdata ( $product_data['description'] );
|
3943 |
+
// $product_data['short_description'] = $this->woosea_append_cdata ( $product_data['short_description'] );
|
3944 |
+
//}
|
3945 |
|
3946 |
/**
|
3947 |
* Get product reviews for Google Product Review Feeds
|
3948 |
*/
|
3949 |
$product_data['reviews'] = $this->woosea_get_reviews( $product_data, $product );
|
3950 |
|
3951 |
+
|
3952 |
+
/**
|
3953 |
+
* Filter out reviews that do not have text
|
3954 |
+
*/
|
3955 |
+
if(!empty($product_data['reviews'])){
|
3956 |
+
foreach($product_data['reviews'] as $review_id => $review_details){
|
3957 |
+
if(empty($review_details['content'])){
|
3958 |
+
unset($product_data['reviews'][$review_id]);
|
3959 |
+
}
|
3960 |
+
}
|
3961 |
+
}
|
3962 |
+
|
3963 |
+
/**
|
3964 |
+
* Filter out reviews that do not have a rating
|
3965 |
+
*/
|
3966 |
+
if(!empty($product_data['reviews'])){
|
3967 |
+
foreach($product_data['reviews'] as $review_id => $review_details){
|
3968 |
+
if(empty($review_details['review_ratings'])){
|
3969 |
+
unset($product_data['reviews'][$review_id]);
|
3970 |
+
}
|
3971 |
+
}
|
3972 |
+
}
|
3973 |
+
|
3974 |
+
/**
|
3975 |
+
* Filter out reviews that have a link in the review text / content as that is now allowed by Google
|
3976 |
+
*/
|
3977 |
+
if(!empty($product_data['reviews'])){
|
3978 |
+
foreach($product_data['reviews'] as $review_id => $review_details){
|
3979 |
+
$pos = strpos($review_details['content'], 'www');
|
3980 |
+
if($pos !== false){
|
3981 |
+
unset($product_data['reviews'][$review_id]);
|
3982 |
+
}
|
3983 |
+
|
3984 |
+
$pos = strpos($review_details['content'], 'http');
|
3985 |
+
if($pos !== false){
|
3986 |
+
unset($product_data['reviews'][$review_id]);
|
3987 |
+
}
|
3988 |
+
}
|
3989 |
+
}
|
3990 |
+
|
3991 |
/**
|
3992 |
* Check if individual products need to be excluded
|
3993 |
*/
|
4032 |
$product_data = $this->woocommerce_sea_filters( $project_config['rules'], $product_data );
|
4033 |
}
|
4034 |
}
|
4035 |
+
|
4036 |
+
if(isset($product_data['title_lcw'])){
|
4037 |
+
$product_data['title_lcw'] = ucwords($product_data['title_lcw']);
|
4038 |
+
}
|
4039 |
|
4040 |
// Check if the sale price is effective
|
4041 |
if(isset($product_data['sale_price_start_date'])){
|
4057 |
// For these channels parent products are allowed
|
4058 |
$allowed_channel_parents = array(
|
4059 |
"skroutz",
|
4060 |
+
"bestprice",
|
4061 |
"google_dsa",
|
4062 |
"google_product_review",
|
4063 |
);
|
4064 |
|
4065 |
+
if(array_key_exists('fields', $project_config)){
|
4066 |
+
if (!in_array($project_config['fields'], $allowed_channel_parents)){
|
4067 |
+
if(($product->is_type('variable')) AND ($product_data['item_group_id'] == 0)){
|
4068 |
+
$product_data = array();
|
4069 |
+
$product_data = null;
|
4070 |
+
}
|
4071 |
+
}
|
4072 |
+
}
|
4073 |
|
4074 |
/**
|
4075 |
* Remove variation products that are not THE default variation product
|
4082 |
/**
|
4083 |
* And item_group_id is not allowed for simple products, prevent users from adding this to the feedd
|
4084 |
*/
|
4085 |
+
if (($product->is_type('simple')) OR ($product->is_type('external')) OR ($product->is_type('woosb')) OR ($product->is_type('mix-and-match')) OR ($product->is_type('bundle')) OR ($product->is_type('composite')) OR ($product->is_type('auction') OR ($product->is_type('subscription')) OR ($product->is_type('variable')))){
|
4086 |
unset($product_data['item_group_id']);
|
4087 |
}
|
4088 |
|
4096 |
}
|
4097 |
}
|
4098 |
|
4099 |
+
/**
|
4100 |
+
* Do final check on Skroutz out of stock sizes
|
4101 |
+
* When a size is not on stock remove it
|
4102 |
+
*/
|
4103 |
+
if($project_config['fields'] == "skroutz"){
|
4104 |
+
if(isset($product_data['id'])){
|
4105 |
+
foreach($project_config['attributes'] as $ky => $vy){
|
4106 |
+
if(isset($vy['attribute'])){
|
4107 |
+
if($vy['attribute'] == "size"){
|
4108 |
+
$size_found = "yes";
|
4109 |
+
$sz_attribute = $vy['mapfrom'];
|
4110 |
+
}
|
4111 |
+
if($vy['attribute'] == "color"){
|
4112 |
+
$color_found = "yes";
|
4113 |
+
$clr_attribute = $vy['mapfrom'];
|
4114 |
+
}
|
4115 |
+
}
|
4116 |
+
}
|
4117 |
+
|
4118 |
+
$stock_value = get_post_meta( $product_data['id'], "_stock_status", true );
|
4119 |
+
$sz_attr_value = get_post_meta( $product_data['id'], $sz_attribute, true );
|
4120 |
+
|
4121 |
+
if(!empty($clr_attribute)){
|
4122 |
+
$clr_attr_value = get_post_meta( $product_data['id'], "attribute_".$clr_attribute, true );
|
4123 |
+
}
|
4124 |
+
|
4125 |
+
// HIER MOET EEN CHECK IN OP product_type
|
4126 |
+
if(isset($product_data['item_group_id']) AND ($product_data['product_type'] == "variable")){
|
4127 |
+
if($product_data['item_group_id'] > 0){
|
4128 |
+
$product_skroutz = wc_get_product($product_data['item_group_id']);
|
4129 |
+
$variations = $product_skroutz->get_available_variations();
|
4130 |
+
$variations_id = wp_list_pluck( $variations, 'variation_id' );
|
4131 |
+
|
4132 |
+
foreach($variations_id as $var_id){
|
4133 |
+
$clr_variation = get_post_meta( $var_id, "attribute_".$clr_attribute, true );
|
4134 |
+
$size_variation = get_post_meta( $var_id, "attribute_".$sz_attribute, true );
|
4135 |
+
$stock_variation = get_post_meta( $var_id, "_stock_status", true );
|
4136 |
+
if($clr_variation == $clr_attr_value){
|
4137 |
+
if($stock_variation == "outofstock"){
|
4138 |
+
// Remove this size as it is not on stock
|
4139 |
+
if(array_key_exists($sz_attribute, $product_data)){
|
4140 |
+
$product_data[$sz_attribute] = str_replace(ucfirst($size_variation),"",$product_data[$sz_attribute]);
|
4141 |
+
$product_data[$sz_attribute] = str_replace(", , ",",",$product_data[$sz_attribute]);
|
4142 |
+
$product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], " ");
|
4143 |
+
$product_data[$sz_attribute] = trim($product_data[$sz_attribute], ",");
|
4144 |
+
}
|
4145 |
+
}
|
4146 |
+
}
|
4147 |
+
}
|
4148 |
+
} else {
|
4149 |
+
// This is a parent variable product
|
4150 |
+
$product_skroutz = wc_get_product($product_data['id']);
|
4151 |
+
$variations = $product_skroutz->get_available_variations();
|
4152 |
+
$variations_id = wp_list_pluck( $variations, 'variation_id' );
|
4153 |
+
|
4154 |
+
foreach($variations_id as $var_id){
|
4155 |
+
//$clr_variation = get_post_meta( $var_id, "attribute_".$clr_attribute, true );
|
4156 |
+
$size_variation = get_post_meta( $var_id, "attribute_".$sz_attribute, true );
|
4157 |
+
$stock_variation = get_post_meta( $var_id, "_stock_status", true );
|
4158 |
+
if($stock_variation == "outofstock"){
|
4159 |
+
// Remove this size as it is not on stock
|
4160 |
+
if(array_key_exists($sz_attribute, $product_data)){
|
4161 |
+
$product_data[$sz_attribute] = str_replace(ucfirst($size_variation),"",$product_data[$sz_attribute]);
|
4162 |
+
$product_data[$sz_attribute] = str_replace(", , ",",",$product_data[$sz_attribute]);
|
4163 |
+
$product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], " ");
|
4164 |
+
$product_data[$sz_attribute] = rtrim($product_data[$sz_attribute], ",");
|
4165 |
+
|
4166 |
+
}
|
4167 |
+
}
|
4168 |
+
}
|
4169 |
+
}
|
4170 |
+
}
|
4171 |
+
}
|
4172 |
+
}
|
4173 |
+
|
4174 |
/**
|
4175 |
* When product has passed the filter rules it can continue with the rest
|
4176 |
*/
|
4204 |
}
|
4205 |
} else {
|
4206 |
if((strlen($attr_value['mapfrom'])) AND (array_key_exists($attr_value['mapfrom'], $product_data))){
|
4207 |
+
if(($attr_value['attribute'] == "URL") OR ($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "g:link_template") OR ($attr_value['attribute'] == "g:image_link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "Final URL") OR ($attr_value['attribute'] == "SKU")){
|
4208 |
$attr_line = "'".$attr_value['prefix']."".$product_data[$attr_value['mapfrom']]."".$attr_value['suffix']."'";
|
4209 |
} else {
|
4210 |
$attr_line = "'".$attr_value['prefix']. "".$product_data[$attr_value['mapfrom']]."" .$attr_value['suffix']."'";
|
4276 |
}
|
4277 |
} else {
|
4278 |
if(strlen($product_data[$attr_value['mapfrom']])){
|
4279 |
+
if(($attr_value['attribute'] == "URL") OR ($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "g:link_template") OR ($attr_value['attribute'] == "g:image_link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "Final URL") OR ($attr_value['attribute'] == "SKU")){
|
4280 |
if(($product_data['product_type'] == "variation") AND (preg_match("/aelia_cs_currency/", $attr_value['suffix']))){
|
4281 |
$attr_value['suffix'] = str_replace("?","&",$attr_value['suffix']);
|
4282 |
$attr_line .= ",'".$attr_value['prefix']."".$product_data[$attr_value['mapfrom']]."".$attr_value['suffix']."'";
|
4460 |
$shipping_str .= ":WOOSEA_POSTAL_CODE##$v";
|
4461 |
} elseif ($k == "price"){
|
4462 |
$shipping_str .= ":WOOSEA_PRICE##$attr_value[prefix] $v $attr_value[suffix]";
|
4463 |
+
//$shipping_str .= ":WOOSEA_PRICE##$v";
|
4464 |
} else {
|
4465 |
// UNKNOWN, DO NOT ADD
|
4466 |
}
|
4497 |
}
|
4498 |
} else {
|
4499 |
if(strlen($product_data[$attr_value['mapfrom']])){
|
4500 |
+
if(($attr_value['attribute'] == "URL") OR ($attr_value['attribute'] == "g:link") OR ($attr_value['attribute'] == "link") OR ($attr_value['attribute'] == "g:link_template")){
|
4501 |
if(($product_data['product_type'] == "variation") AND (preg_match("/aelia_cs_currency/", $attr_value['suffix']))){
|
4502 |
$attr_value['suffix'] = str_replace("?","&",$attr_value['suffix']);
|
4503 |
$xml_product[$attr_value['attribute']] = "$attr_value[prefix]". $product_data[$attr_value['mapfrom']] ."$attr_value[suffix]";
|
4767 |
}
|
4768 |
// New policy of Google, only when the value is yes add it to the feed
|
4769 |
// 28 October 2019
|
4770 |
+
if(array_key_exists('calculated', $project_config['attributes'])){
|
4771 |
$xml_product['g:identifier_exists'] = $identifier_exists;
|
4772 |
+
}
|
4773 |
}
|
4774 |
return $xml_product;
|
4775 |
}
|
5027 |
return $product_data;
|
5028 |
}
|
5029 |
|
5030 |
+
/**
|
5031 |
+
* Execute project rules
|
5032 |
+
*/
|
5033 |
private function woocommerce_sea_rules( $project_rules2, $product_data ){
|
5034 |
$aantal_prods = count($product_data);
|
5035 |
+
if($aantal_prods > 0){
|
|
|
|
|
5036 |
|
5037 |
+
foreach ($project_rules2 as $pr_key => $pr_array){
|
5038 |
|
5039 |
+
foreach ($product_data as $pd_key => $pd_value){
|
|
|
5040 |
|
5041 |
+
// Check is there is a rule on specific attributes
|
5042 |
+
if($pd_key == $pr_array['attribute']){
|
5043 |
+
// This is because for data manipulation the than attribute is empty
|
5044 |
+
if(!array_key_exists('than_attribute', $pr_array)){
|
5045 |
+
$pr_array['than_attribute'] = $pd_key;
|
5046 |
+
}
|
5047 |
|
5048 |
// Check if a rule has been set for Google categories
|
5049 |
if (!empty($product_data['categories']) AND ($pr_array['than_attribute'] == "google_category") AND ($product_data[$pr_array['attribute']] == $pr_array['criteria'])){
|
5050 |
+
|
5051 |
+
$pr_array['than_attribute'] = "categories";
|
5052 |
$category_id = explode("-", $pr_array['newvalue']);
|
5053 |
$pr_array['newvalue'] = $category_id[0];
|
5054 |
+
$product_data['categories'] = $pr_array['newvalue'];
|
5055 |
+
}
|
5056 |
|
5057 |
+
// Make sure that rules on numerics are on true numerics
|
5058 |
+
if (!is_array($pd_value) AND (!preg_match('/[A-Za-z]/', $pd_value))){
|
5059 |
+
$pd_value = strtr($pd_value, ',', '.');
|
5060 |
+
}
|
5061 |
|
5062 |
|
5063 |
+
// Make sure the price or sale price is numeric
|
5064 |
+
if(($pr_array['attribute'] == "sale_price") OR ($pr_array['attribute'] == "price")){
|
5065 |
+
settype($pd_value, "double");
|
5066 |
+
}
|
5067 |
|
5068 |
+
if (((is_numeric($pd_value)) AND ($pr_array['than_attribute'] != "shipping"))){
|
5069 |
|
5070 |
+
// Rules for numeric values
|
5071 |
+
switch ($pr_array['condition']) {
|
5072 |
+
case($pr_array['condition'] = "contains"):
|
5073 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
5074 |
+
$product_data[$pr_array['than_attribute']] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $pd_value);
|
5075 |
+
}
|
5076 |
+
break;
|
5077 |
+
case($pr_array['condition'] = "containsnot"):
|
5078 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
5079 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5080 |
+
}
|
5081 |
+
break;
|
5082 |
+
case($pr_array['condition'] = "="):
|
5083 |
+
if (($pd_value == $pr_array['criteria'])){
|
5084 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5085 |
+
}
|
5086 |
+
break;
|
5087 |
+
case($pr_array['condition'] = "!="):
|
5088 |
+
if (($pd_value != $pr_array['criteria'])){
|
5089 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5090 |
+
}
|
5091 |
+
break;
|
5092 |
+
case($pr_array['condition'] = ">"):
|
5093 |
+
if (($pd_value > $pr_array['criteria'])){
|
5094 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5095 |
+
}
|
5096 |
+
break;
|
5097 |
+
case($pr_array['condition'] = ">="):
|
5098 |
+
if (($pd_value >= $pr_array['criteria'])){
|
5099 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5100 |
+
}
|
5101 |
+
break;
|
5102 |
+
case($pr_array['condition'] = "<"):
|
5103 |
+
if (($pd_value < $pr_array['criteria'])){
|
5104 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5105 |
+
}
|
5106 |
+
break;
|
5107 |
+
case($pr_array['condition'] = "=<"):
|
5108 |
+
if (($pd_value <= $pr_array['criteria'])){
|
5109 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5110 |
+
}
|
5111 |
+
break;
|
5112 |
+
case($pr_array['condition'] = "empty"):
|
5113 |
+
if(empty($product_data[$pr_array['attribute']])){
|
5114 |
+
if ((strlen($pd_value) < 1)){
|
5115 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5116 |
+
} else {
|
5117 |
+
$product_data[$pr_array['attribute']] = $product_data[$pr_array['than_attribute']];
|
5118 |
+
}
|
5119 |
+
}
|
5120 |
+
break;
|
5121 |
+
case($pr_array['condition'] = "multiply"):
|
5122 |
+
$pr_array['criteria'] = strtr($pr_array['criteria'], ',', '.');
|
5123 |
+
$convert_back = "false";
|
5124 |
+
$pos = strpos($pd_value, ',');
|
5125 |
+
if($pos !== false){
|
5126 |
+
$convert_back = "true";
|
5127 |
+
}
|
5128 |
+
$pd_value = strtr($pd_value, ',', '.');
|
5129 |
+
$newvalue = $pd_value*$pr_array['criteria'];
|
5130 |
+
$newvalue = round($newvalue, 2);
|
5131 |
+
if($convert_back == "true"){
|
5132 |
+
$newvalue = strtr($newvalue, '.',',');
|
5133 |
+
}
|
5134 |
+
$product_data[$pr_array['attribute']] = $newvalue;
|
5135 |
+
break;
|
5136 |
+
case($pr_array['condition'] = "divide"):
|
5137 |
+
$newvalue = ($pd_value / $pr_array['criteria']);
|
5138 |
+
$newvalue = round($newvalue, 2);
|
5139 |
+
$newvalue = strtr($newvalue, '.',',');
|
5140 |
+
$product_data[$pr_array['attribute']] = $newvalue;
|
5141 |
+
break;
|
5142 |
+
case($pr_array['condition'] = "plus"):
|
5143 |
+
$newvalue = ($pd_value + $pr_array['criteria']);
|
5144 |
+
$product_data[$pr_array['attribute']] = $newvalue;
|
5145 |
+
break;
|
5146 |
+
case($pr_array['condition'] = "minus"):
|
5147 |
+
$newvalue = ($pd_value - $pr_array['criteria']);
|
5148 |
+
$product_data[$pr_array['attribute']] = $newvalue;
|
5149 |
+
break;
|
5150 |
+
case($pr_array['condition'] = "findreplace"):
|
5151 |
+
if (strpos($pd_value, $pr_array['criteria']) !== false){
|
5152 |
// Make sure that a new value has been set
|
5153 |
+
if(!empty($pr_array['newvalue'])){
|
5154 |
+
// Find and replace only work on same attribute field, otherwise create a contains rule
|
5155 |
if($pr_array['attribute'] == $pr_array['than_attribute']){
|
5156 |
$newvalue = str_replace($pr_array['criteria'],$pr_array['newvalue'], $pd_value);
|
5157 |
$product_data[$pr_array['than_attribute']] = ucfirst($newvalue);
|
5158 |
}
|
5159 |
+
}
|
5160 |
+
}
|
5161 |
+
break;
|
5162 |
+
default:
|
5163 |
+
break;
|
5164 |
+
}
|
5165 |
+
} elseif (is_array($pd_value)) {
|
5166 |
+
|
5167 |
+
// For now only shipping details are in an array
|
5168 |
+
foreach ($pd_value as $k => $v){
|
5169 |
+
if(is_array($v)){
|
5170 |
+
foreach ($v as $kk => $vv){
|
5171 |
+
// Only shipping detail rule can be on price for now
|
5172 |
+
if($kk == "price"){
|
5173 |
+
switch ($pr_array['condition']) {
|
5174 |
+
case($pr_array['condition'] = "contains"):
|
5175 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5176 |
+
$pd_value[$k]['price'] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $vv);
|
5177 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5178 |
+
}
|
5179 |
+
break;
|
5180 |
+
case($pr_array['condition'] = "containsnot"):
|
5181 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5182 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5183 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5184 |
+
}
|
5185 |
+
break;
|
5186 |
+
case($pr_array['condition'] = "="):
|
5187 |
+
if (($vv == $pr_array['criteria'])){
|
5188 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5189 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5190 |
+
}
|
5191 |
+
break;
|
5192 |
+
case($pr_array['condition'] = "!="):
|
5193 |
+
if (($vv != $pr_array['criteria'])){
|
5194 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5195 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5196 |
+
}
|
5197 |
+
break;
|
5198 |
+
case($pr_array['condition'] = ">"):
|
5199 |
+
if (($vv > $pr_array['criteria'])){
|
5200 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5201 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5202 |
+
}
|
5203 |
+
break;
|
5204 |
+
case($pr_array['condition'] = ">="):
|
5205 |
+
if (($vv >= $pr_array['criteria'])){
|
5206 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5207 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5208 |
+
}
|
5209 |
+
break;
|
5210 |
+
case($pr_array['condition'] = "<"):
|
5211 |
+
if (($vv < $pr_array['criteria'])){
|
5212 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5213 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5214 |
+
}
|
5215 |
+
break;
|
5216 |
+
case($pr_array['condition'] = "=<"):
|
5217 |
+
if (($vv <= $pr_array['criteria'])){
|
5218 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5219 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5220 |
+
}
|
5221 |
+
break;
|
5222 |
+
case($pr_array['condition'] = "empty"):
|
5223 |
+
if ((strlen($vv) < 1)){
|
5224 |
+
$pd_value[$k]['price'] = $pr_array['newvalue'];
|
5225 |
+
$product_data[$pr_array['than_attribute']] = $pd_value;
|
5226 |
+
}
|
5227 |
+
break;
|
5228 |
+
case($pr_array['condition'] = "multiply"):
|
5229 |
+
// Only shipping array
|
5230 |
+
if(is_array($pd_value)){
|
5231 |
+
$pr_array['criteria'] = strtr($pr_array['criteria'], ',', '.');
|
5232 |
+
foreach ($pd_value as $ship_a_key => $shipping_arr){
|
5233 |
+
foreach($shipping_arr as $ship_key => $ship_value){
|
5234 |
+
if($ship_key == "price"){
|
5235 |
+
$ship_pieces = explode(" ", $ship_value);
|
5236 |
+
$pd_value = strtr($ship_pieces[1], ',', '.');
|
5237 |
+
$newvalue = $pd_value*$pr_array['criteria'];
|
5238 |
+
$newvalue = round($newvalue, 2);
|
5239 |
+
$newvalue = strtr($newvalue, '.',',');
|
5240 |
+
$newvalue = $ship_pieces[0]." ".$newvalue;
|
5241 |
+
$product_data[$pr_array['than_attribute']][$ship_a_key]['price'] = $newvalue;
|
5242 |
+
}
|
5243 |
+
}
|
5244 |
+
}
|
5245 |
+
}
|
5246 |
+
break;
|
5247 |
+
default:
|
5248 |
+
break;
|
5249 |
+
}
|
5250 |
+
}
|
5251 |
+
}
|
5252 |
+
} else {
|
5253 |
+
// Rules on product tags
|
5254 |
+
foreach ($pd_value as $k => $v){
|
5255 |
+
|
5256 |
+
// Rules for string values
|
5257 |
+
if (!array_key_exists('cs', $pr_array)){
|
5258 |
+
$v = strtolower($v);
|
5259 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5260 |
+
}
|
5261 |
+
|
5262 |
+
switch ($pr_array['condition']) {
|
5263 |
+
case($pr_array['condition'] = "contains"):
|
5264 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5265 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5266 |
+
}
|
5267 |
+
break;
|
5268 |
+
case($pr_array['condition'] = "containsnot"):
|
5269 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5270 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5271 |
+
}
|
5272 |
+
break;
|
5273 |
+
case($pr_array['condition'] = "="):
|
5274 |
+
if (($v == $pr_array['criteria'])){
|
5275 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5276 |
+
}
|
5277 |
+
break;
|
5278 |
+
case($pr_array['condition'] = "!="):
|
5279 |
+
if (($v != $pr_array['criteria'])){
|
5280 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5281 |
+
}
|
5282 |
+
break;
|
5283 |
+
case($pr_array['condition'] = ">"):
|
5284 |
+
if (($v > $pr_array['criteria'])){
|
5285 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5286 |
+
}
|
5287 |
+
break;
|
5288 |
+
case($pr_array['condition'] = ">="):
|
5289 |
+
if (($v >= $pr_array['criteria'])){
|
5290 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5291 |
+
}
|
5292 |
+
break;
|
5293 |
+
case($pr_array['condition'] = "<"):
|
5294 |
+
if (($v < $pr_array['criteria'])){
|
5295 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5296 |
+
}
|
5297 |
+
break;
|
5298 |
+
case($pr_array['condition'] = "=<"):
|
5299 |
+
if (($v <= $pr_array['criteria'])){
|
5300 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5301 |
+
}
|
5302 |
+
break;
|
5303 |
+
case($pr_array['condition'] = "empty"):
|
5304 |
+
if ((strlen($v) < 1)){
|
5305 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5306 |
+
}
|
5307 |
+
break;
|
5308 |
+
case($pr_array['condition'] = "multiply"):
|
5309 |
+
// Only shipping array
|
5310 |
+
if(is_array($v)){
|
5311 |
+
$pr_array['criteria'] = strtr($pr_array['criteria'], ',', '.');
|
5312 |
+
foreach ($v as $ship_a_key => $shipping_arr){
|
5313 |
+
foreach($shipping_arr as $ship_key => $ship_value){
|
5314 |
+
if($ship_key == "price"){
|
5315 |
+
$ship_pieces = explode(" ", $ship_value);
|
5316 |
+
$pd_value = strtr($ship_pieces[1], ',', '.');
|
5317 |
+
$newvalue = $pd_value*$pr_array['criteria'];
|
5318 |
+
$newvalue = round($newvalue, 2);
|
5319 |
+
$newvalue = strtr($newvalue, '.',',');
|
5320 |
+
$newvalue = $ship_pieces[0]." ".$newvalue;
|
5321 |
+
$product_data[$pr_array['than_attribute']][$ship_a_key]['price'] = $newvalue;
|
5322 |
+
}
|
5323 |
+
}
|
5324 |
+
}
|
5325 |
+
}
|
5326 |
+
break;
|
5327 |
+
default:
|
5328 |
+
break;
|
5329 |
+
}
|
5330 |
+
}
|
5331 |
+
}
|
5332 |
+
}
|
5333 |
+
} else {
|
5334 |
+
// Rules for string values
|
5335 |
+
if (!array_key_exists('cs', $pr_array)){
|
5336 |
+
if($pr_array['attribute'] != "image"){
|
5337 |
+
$pd_value = strtolower($pd_value);
|
5338 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5339 |
+
}
|
5340 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5341 |
|
5342 |
+
switch ($pr_array['condition']) {
|
5343 |
+
case($pr_array['condition'] = "contains"):
|
5344 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
5345 |
+
// Specifically for shipping price rules
|
5346 |
+
if(!empty($product_data[$pr_array['than_attribute']])){
|
5347 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5348 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5349 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5350 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5351 |
+
}
|
5352 |
+
} else {
|
5353 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5354 |
+
}
|
5355 |
+
} else {
|
5356 |
+
// This attribute value is empty for this product
|
5357 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5358 |
+
}
|
5359 |
+
}
|
5360 |
+
break;
|
5361 |
+
case($pr_array['condition'] = "containsnot"):
|
5362 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value))){
|
5363 |
+
// Specifically for shipping price rules
|
5364 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5365 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5366 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5367 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5368 |
+
}
|
5369 |
+
} else {
|
5370 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5371 |
+
}
|
5372 |
+
}
|
5373 |
+
break;
|
5374 |
+
case($pr_array['condition'] = "="):
|
5375 |
+
if (($pr_array['criteria'] == "$pd_value")){
|
5376 |
+
// Specifically for shipping price rules
|
5377 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5378 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5379 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5380 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5381 |
+
}
|
5382 |
+
} else {
|
5383 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5384 |
+
}
|
5385 |
+
}
|
5386 |
+
$ship = $product_data['shipping'];
|
5387 |
+
break;
|
5388 |
+
case($pr_array['condition'] = "!="):
|
5389 |
+
if (($pr_array['criteria'] != "$pd_value")){
|
5390 |
+
// Specifically for shipping price rules
|
5391 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5392 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5393 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5394 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5395 |
+
}
|
5396 |
+
} else {
|
5397 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5398 |
+
}
|
5399 |
+
}
|
5400 |
+
break;
|
5401 |
+
case($pr_array['condition'] = ">"):
|
5402 |
+
// Use a lexical order on relational string operators
|
5403 |
+
if (($pd_value > $pr_array['criteria'])){
|
5404 |
+
// Specifically for shipping price rules
|
5405 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5406 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5407 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5408 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5409 |
+
}
|
5410 |
+
} else {
|
5411 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5412 |
+
}
|
5413 |
+
}
|
5414 |
+
break;
|
5415 |
+
case($pr_array['condition'] = ">="):
|
5416 |
+
// Use a lexical order on relational string operators
|
5417 |
+
if (($pd_value >= $pr_array['criteria'])){
|
5418 |
+
// Specifically for shipping price rules
|
5419 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5420 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5421 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5422 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5423 |
+
}
|
5424 |
+
} else {
|
5425 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5426 |
+
}
|
5427 |
+
}
|
5428 |
+
break;
|
5429 |
+
case($pr_array['condition'] = "<"):
|
5430 |
+
// Use a lexical order on relational string operators
|
5431 |
+
if (($pd_value < $pr_array['criteria'])){
|
5432 |
+
// Specifically for shipping price rules
|
5433 |
+
if(isset($product_data[$pr_array['than_attribute']]) AND (is_array($product_data[$pr_array['than_attribute']]))){
|
5434 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5435 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5436 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5437 |
+
}
|
5438 |
+
} else {
|
5439 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5440 |
+
}
|
5441 |
+
}
|
5442 |
+
break;
|
5443 |
+
case($pr_array['condition'] = "=<"):
|
5444 |
+
// Use a lexical order on relational string operators
|
5445 |
+
if (($pd_value <= $pr_array['criteria'])){
|
5446 |
+
// Specifically for shipping price rules
|
5447 |
+
if(is_array($product_data[$pr_array['than_attribute']])){
|
5448 |
+
$arr_size = (count($product_data[$pr_array['than_attribute']])-1);
|
5449 |
+
for ($x = 0; $x <= $arr_size; $x++) {
|
5450 |
+
$product_data[$pr_array['than_attribute']][$x]['price'] = $pr_array['newvalue'];
|
5451 |
+
}
|
5452 |
+
} else {
|
5453 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5454 |
+
}
|
5455 |
+
}
|
5456 |
+
break;
|
5457 |
+
|
5458 |
+
case($pr_array['condition'] = "empty"):
|
5459 |
+
if(empty($product_data[$pr_array['attribute']])){
|
5460 |
+
if(empty($product_data[$pr_array['than_attribute']])){
|
5461 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5462 |
+
} else {
|
5463 |
+
$product_data[$pr_array['attribute']] = $product_data[$pr_array['than_attribute']];
|
5464 |
+
}
|
5465 |
+
}
|
5466 |
+
break;
|
5467 |
+
case($pr_array['condition'] = "replace"):
|
5468 |
+
$product_data[$pr_array['than_attribute']] = str_replace($pr_array['criteria'], $pr_array['newvalue'], $product_data[$pr_array['than_attribute']]);
|
5469 |
+
break;
|
5470 |
case($pr_array['condition'] = "findreplace"):
|
5471 |
if (strpos($pd_value, $pr_array['criteria']) !== false){
|
5472 |
+
// Make sure that a new value has been set
|
5473 |
+
if(!empty($pr_array['newvalue'])){
|
5474 |
+
// Find and replace only work on same attribute field, otherwise create a contains rule
|
5475 |
if($pr_array['attribute'] == $pr_array['than_attribute']){
|
5476 |
+
$newvalue = str_replace($pr_array['criteria'],$pr_array['newvalue'], $pd_value);
|
5477 |
+
//$product_data[$pr_array['than_attribute']] = ucfirst($newvalue);
|
5478 |
+
$product_data[$pr_array['than_attribute']] = $newvalue;
|
5479 |
+
}
|
5480 |
+
}
|
5481 |
+
}
|
5482 |
break;
|
5483 |
+
default:
|
5484 |
+
break;
|
5485 |
+
}
|
5486 |
+
}
|
5487 |
+
} else {
|
5488 |
+
// When a rule has been set on an attribute that is not in product_data
|
5489 |
+
// Add the newvalue to product_data
|
5490 |
+
if (!array_key_exists($pr_array['attribute'], $product_data)){
|
5491 |
if(!empty($pr_array['newvalue'])){
|
5492 |
+
if ($pr_array['condition'] == "empty") {
|
5493 |
+
$product_data[$pr_array['than_attribute']] = $pr_array['newvalue'];
|
5494 |
+
}
|
5495 |
} else {
|
5496 |
+
if(!empty($pr_array['than_attribute'])){
|
5497 |
+
if(array_key_exists($pr_array['than_attribute'], $product_data)){
|
5498 |
+
$product_data[$pr_array['attribute']] = $product_data[$pr_array['than_attribute']];
|
5499 |
+
}
|
5500 |
}
|
5501 |
+
}
|
5502 |
+
}
|
5503 |
+
}
|
5504 |
+
}
|
5505 |
+
}
|
5506 |
+
}
|
5507 |
+
return $product_data;
|
5508 |
+
}
|
5509 |
|
5510 |
/**
|
5511 |
* Function to exclude products based on individual product exclusions
|
5528 |
}
|
5529 |
}
|
5530 |
|
5531 |
+
|
5532 |
+
/**
|
5533 |
+
* Execute project filters (include / exclude)
|
5534 |
+
*/
|
5535 |
private function woocommerce_sea_filters( $project_rules, $product_data ){
|
5536 |
+
$allowed = 1;
|
5537 |
|
5538 |
+
// Check if product was already excluded from the feed
|
5539 |
+
$product_excluded = ucfirst( get_post_meta( $product_data['id'], '_woosea_exclude_product', true ) );
|
5540 |
|
5541 |
+
if( $product_excluded == "Yes"){
|
5542 |
+
$allowed = 0;
|
5543 |
+
}
|
5544 |
|
5545 |
+
foreach ($project_rules as $pr_key => $pr_array){
|
5546 |
|
5547 |
+
if($pr_array['attribute'] == "categories"){
|
5548 |
+
$pr_array['attribute'] = "raw_categories";
|
5549 |
}
|
5550 |
|
5551 |
+
if(!array_key_exists($pr_array['attribute'], $product_data)) {
|
5552 |
+
$product_data[$pr_array['attribute']] = ""; // Sets an empty postmeta value in place of a missing one.
|
5553 |
+
}
|
|
|
|
|
5554 |
|
5555 |
+
foreach ($product_data as $pd_key => $pd_value){
|
5556 |
+
// Check is there is a rule on specific attributes
|
5557 |
+
if(in_array($pd_key, $pr_array, TRUE)){
|
5558 |
+
if($pd_key == "price" || $pd_key == "regular_price"){
|
5559 |
+
//$pd_value = @number_format($pd_value,2);
|
5560 |
+
$pd_value = wc_format_decimal($pd_value);
|
5561 |
+
}
|
5562 |
|
5563 |
+
if (is_numeric($pd_value)){
|
5564 |
+
$old_value = $pd_value;
|
5565 |
+
if($pd_key == "price" || $pd_key == "regular_price"){
|
5566 |
+
$pd_value = @number_format($pd_value,2);
|
5567 |
+
}
|
5568 |
|
5569 |
+
// Rules for numeric values
|
5570 |
+
switch ($pr_array['condition']) {
|
5571 |
+
case($pr_array['condition'] = "contains"):
|
5572 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5573 |
+
$allowed = 0;
|
5574 |
+
} elseif ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5575 |
+
$allowed = 0;
|
5576 |
+
}
|
5577 |
+
break;
|
5578 |
+
case($pr_array['condition'] = "containsnot"):
|
5579 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5580 |
+
$allowed = 0;
|
5581 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5582 |
+
$allowed = 0;
|
5583 |
+
}
|
5584 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5585 |
case($pr_array['condition'] = "="):
|
5586 |
+
if (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5587 |
+
$allowed = 0;
|
5588 |
+
} elseif (($old_value != $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5589 |
+
$allowed = 0;
|
5590 |
}
|
5591 |
+
break;
|
5592 |
+
case($pr_array['condition'] = "!="):
|
5593 |
+
if (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5594 |
+
if($allowed <> 0){
|
5595 |
+
$allowed = 1;
|
5596 |
+
}
|
5597 |
+
} elseif (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5598 |
+
$allowed = 0;
|
5599 |
+
}
|
5600 |
+
break;
|
5601 |
+
case($pr_array['condition'] = ">"):
|
5602 |
+
if (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5603 |
+
$allowed = 0;
|
5604 |
+
} elseif (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5605 |
+
$allowed = 0;
|
5606 |
+
}
|
5607 |
+
break;
|
5608 |
+
case($pr_array['condition'] = ">="):
|
5609 |
+
if (($old_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5610 |
+
$allowed = 0;
|
5611 |
+
} elseif (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5612 |
+
$allowed = 0;
|
5613 |
+
}
|
5614 |
+
break;
|
5615 |
+
case($pr_array['condition'] = "<"):
|
5616 |
+
if (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5617 |
+
$allowed = 0;
|
5618 |
+
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5619 |
+
$allowed = 0;
|
5620 |
+
}
|
5621 |
+
break;
|
5622 |
+
case($pr_array['condition'] = "=<"):
|
5623 |
+
if (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5624 |
+
$allowed = 0;
|
5625 |
+
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5626 |
+
$allowed = 0;
|
5627 |
+
}
|
5628 |
+
break;
|
5629 |
+
case($pr_array['condition'] = "empty"):
|
5630 |
+
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
5631 |
+
$allowed = 0;
|
5632 |
+
} elseif ((strlen($pd_value > 0)) && ($pr_array['than'] == "include_only")){
|
5633 |
+
$allowed = 0;
|
5634 |
+
}
|
5635 |
+
break;
|
5636 |
+
default:
|
5637 |
+
break;
|
5638 |
+
}
|
5639 |
+
} elseif (is_array($pd_value)){
|
5640 |
+
// Tis can either be a shipping or product_tag array
|
5641 |
+
if(($pr_array['attribute'] == "product_tag") OR ($pr_array['attribute'] == "purchase_note")){
|
5642 |
+
$in_tag_array = "not";
|
5643 |
+
|
5644 |
+
foreach($pd_value as $pt_key => $pt_value){
|
5645 |
+
// Rules for string values
|
5646 |
+
if (!array_key_exists('cs', $pr_array)){
|
5647 |
+
$pt_value = strtolower($pt_value);
|
5648 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5649 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5650 |
|
5651 |
+
if(preg_match('/'.$pr_array['criteria'].'/', $pt_value)){
|
5652 |
+
$in_tag_array = "yes";
|
5653 |
+
}
|
5654 |
+
}
|
5655 |
+
|
5656 |
+
if($in_tag_array == "yes"){
|
5657 |
+
//if(in_array($pr_array['criteria'], $pd_value, TRUE)) {
|
5658 |
+
$v = $pr_array['criteria'];
|
5659 |
+
switch ($pr_array['condition']) {
|
5660 |
+
case($pr_array['condition'] = "contains"):
|
5661 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5662 |
+
if($pr_array['than'] == "include_only"){
|
5663 |
+
if($allowed <> 0){
|
5664 |
+
$allowed = 1;
|
5665 |
+
}
|
5666 |
+
} else {
|
5667 |
+
$allowed = 0;
|
5668 |
+
}
|
5669 |
+
} else {
|
5670 |
+
$allowed = 0;
|
5671 |
+
}
|
5672 |
+
break;
|
5673 |
+
case($pr_array['condition'] = "containsnot"):
|
5674 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5675 |
+
if($pr_array['than'] == "include_only"){
|
5676 |
+
if($allowed <> 0){
|
5677 |
+
$allowed = 1;
|
5678 |
+
}
|
5679 |
+
} else {
|
5680 |
+
$allowed = 0;
|
5681 |
+
}
|
5682 |
+
} else {
|
5683 |
+
$allowed = 0;
|
5684 |
+
}
|
5685 |
+
break;
|
5686 |
+
case($pr_array['condition'] = "="):
|
5687 |
+
if (($v == $pr_array['criteria'])){
|
5688 |
+
if($pr_array['than'] == "include_only"){
|
5689 |
+
if($allowed <> 0){
|
5690 |
+
$allowed = 1;
|
5691 |
+
}
|
5692 |
+
} else {
|
5693 |
+
$allowed = 0;
|
5694 |
+
}
|
5695 |
+
} else {
|
5696 |
+
$allowed = 0;
|
5697 |
+
}
|
5698 |
+
break;
|
5699 |
+
case($pr_array['condition'] = "!="):
|
5700 |
+
if (($v != $pr_array['criteria'])){
|
5701 |
+
if($pr_array['than'] == "include_only"){
|
5702 |
+
if($allowed <> 0){
|
5703 |
+
$allowed = 1;
|
5704 |
+
}
|
5705 |
+
} else {
|
5706 |
+
$allowed = 0;
|
5707 |
+
}
|
5708 |
+
}
|
5709 |
+
break;
|
5710 |
+
case($pr_array['condition'] = ">"):
|
5711 |
+
if (($v > $pr_array['criteria'])){
|
5712 |
+
if($pr_array['than'] == "include_only"){
|
5713 |
+
if($allowed <> 0){
|
5714 |
+
$allowed = 1;
|
5715 |
+
}
|
5716 |
+
} else {
|
5717 |
+
$allowed = 0;
|
5718 |
+
}
|
5719 |
+
}
|
5720 |
+
break;
|
5721 |
+
case($pr_array['condition'] = ">="):
|
5722 |
+
if (($v >= $pr_array['criteria'])){
|
5723 |
+
if($pr_array['than'] == "include_only"){
|
5724 |
+
if($allowed <> 0){
|
5725 |
+
$allowed = 1;
|
5726 |
+
}
|
5727 |
+
} else {
|
5728 |
+
$allowed = 0;
|
5729 |
+
}
|
5730 |
+
}
|
5731 |
+
break;
|
5732 |
+
case($pr_array['condition'] = "<"):
|
5733 |
+
if (($v < $pr_array['criteria'])){
|
5734 |
+
if($pr_array['than'] == "include_only"){
|
5735 |
+
if($allowed <> 0){
|
5736 |
+
$allowed = 1;
|
5737 |
+
}
|
5738 |
+
} else {
|
5739 |
+
$allowed = 0;
|
5740 |
+
}
|
5741 |
+
}
|
5742 |
+
break;
|
5743 |
+
case($pr_array['condition'] = "=<"):
|
5744 |
+
if (($v <= $pr_array['criteria'])){
|
5745 |
+
if($pr_array['than'] == "include_only"){
|
5746 |
+
if($allowed <> 0){
|
5747 |
+
$allowed = 1;
|
5748 |
+
}
|
5749 |
+
} else {
|
5750 |
+
$allowed = 0;
|
5751 |
+
}
|
5752 |
+
}
|
5753 |
+
break;
|
5754 |
+
case($pr_array['condition'] = "empty"):
|
5755 |
+
if (strlen($v) < 1){
|
5756 |
+
if($pr_array['than'] == "include_only"){
|
5757 |
+
if($allowed <> 0){
|
5758 |
+
$allowed = 1;
|
5759 |
+
}
|
5760 |
+
} else {
|
5761 |
+
if(!empty($pt_value)){
|
5762 |
+
$allowed = 1;
|
5763 |
+
} else {
|
5764 |
+
$allowed = 0;
|
5765 |
+
}
|
5766 |
+
}
|
5767 |
+
}
|
5768 |
+
break;
|
5769 |
+
default:
|
5770 |
+
break;
|
5771 |
+
}
|
5772 |
+
} else {
|
5773 |
+
switch ($pr_array['condition']) {
|
5774 |
+
case($pr_array['condition'] = "contains"):
|
5775 |
+
if($pr_array['than'] == "include_only"){
|
5776 |
+
$allowed = 0;
|
5777 |
+
} else {
|
5778 |
+
if($allowed <> 0){
|
5779 |
+
$allowed = 1;
|
5780 |
+
}
|
5781 |
+
}
|
5782 |
+
break;
|
5783 |
+
case($pr_array['condition'] = "containsnot"):
|
5784 |
+
if($pr_array['than'] == "include_only"){
|
5785 |
+
if($allowed <> 0){
|
5786 |
+
$allowed = 1;
|
5787 |
+
}
|
5788 |
+
} else {
|
5789 |
+
$allowed = 0;
|
5790 |
+
}
|
5791 |
+
break;
|
5792 |
+
case($pr_array['condition'] = "="):
|
5793 |
+
if($pr_array['than'] == "include_only"){
|
5794 |
+
$allowed = 0;
|
5795 |
+
} else {
|
5796 |
+
if($allowed <> 0){
|
5797 |
+
$allowed = 1;
|
5798 |
+
}
|
5799 |
+
}
|
5800 |
+
break;
|
5801 |
+
case($pr_array['condition'] = "!="):
|
5802 |
+
if($pr_array['than'] == "include_only"){
|
5803 |
+
if($allowed <> 0){
|
5804 |
+
$allowed = 1;
|
5805 |
+
}
|
5806 |
+
} else {
|
5807 |
+
$allowed = 0;
|
5808 |
+
}
|
5809 |
+
break;
|
5810 |
+
case($pr_array['condition'] = ">"):
|
5811 |
+
if($pr_array['than'] == "include_only"){
|
5812 |
+
$allowed = 0;
|
5813 |
+
} else {
|
5814 |
+
$allowed = 0;
|
5815 |
+
}
|
5816 |
+
break;
|
5817 |
+
case($pr_array['condition'] = ">="):
|
5818 |
+
if($pr_array['than'] == "include_only"){
|
5819 |
+
$allowed = 0;
|
5820 |
+
} else {
|
5821 |
+
$allowed = 0;
|
5822 |
+
}
|
5823 |
+
break;
|
5824 |
+
case($pr_array['condition'] = "<"):
|
5825 |
+
if($pr_array['than'] == "include_only"){
|
5826 |
+
$allowed = 0;
|
5827 |
+
} else {
|
5828 |
+
$allowed = 0;
|
5829 |
+
}
|
5830 |
+
break;
|
5831 |
+
case($pr_array['condition'] = "=<"):
|
5832 |
+
if($pr_array['than'] == "include_only"){
|
5833 |
+
$allowed = 0;
|
5834 |
+
} else {
|
5835 |
+
$allowed = 0;
|
5836 |
+
}
|
5837 |
+
break;
|
5838 |
+
case($pr_array['condition'] = "empty"):
|
5839 |
+
if($pr_array['than'] == "include_only"){
|
5840 |
+
if($allowed <> 0){
|
5841 |
+
$allowed = 1;
|
5842 |
+
}
|
5843 |
+
} else {
|
5844 |
+
$allowed = 0;
|
5845 |
+
}
|
5846 |
+
break;
|
5847 |
+
default:
|
5848 |
+
break;
|
5849 |
+
}
|
5850 |
+
}
|
5851 |
+
} else {
|
5852 |
+
// For now only shipping details are in an array
|
5853 |
+
foreach ($pd_value as $k => $v){
|
5854 |
+
foreach ($v as $kk => $vv){
|
5855 |
+
// Only shipping detail rule can be on price for now
|
5856 |
+
if($kk == "price"){
|
5857 |
+
switch ($pr_array['condition']) {
|
5858 |
+
case($pr_array['condition'] = "contains"):
|
5859 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5860 |
+
$allowed = 0;
|
5861 |
+
}
|
5862 |
+
break;
|
5863 |
+
case($pr_array['condition'] = "containsnot"):
|
5864 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5865 |
+
$allowed = 0;
|
5866 |
+
}
|
5867 |
+
break;
|
5868 |
+
case($pr_array['condition'] = "="):
|
5869 |
+
if (($vv == $pr_array['criteria'])){
|
5870 |
+
$allowed = 0;
|
5871 |
+
}
|
5872 |
+
break;
|
5873 |
+
case($pr_array['condition'] = "!="):
|
5874 |
+
if (($vv != $pr_array['criteria'])){
|
5875 |
+
$allowed = 0;
|
5876 |
+
}
|
5877 |
+
break;
|
5878 |
+
case($pr_array['condition'] = ">"):
|
5879 |
+
if (($vv > $pr_array['criteria'])){
|
5880 |
+
$allowed = 0;
|
5881 |
+
}
|
5882 |
+
break;
|
5883 |
+
case($pr_array['condition'] = ">="):
|
5884 |
+
if (($vv >= $pr_array['criteria'])){
|
5885 |
+
$allowed = 0;
|
5886 |
+
}
|
5887 |
+
break;
|
5888 |
+
case($pr_array['condition'] = "<"):
|
5889 |
+
if (($vv < $pr_array['criteria'])){
|
5890 |
+
$allowed = 0;
|
5891 |
+
}
|
5892 |
+
break;
|
5893 |
+
case($pr_array['condition'] = "=<"):
|
5894 |
+
if (($vv <= $pr_array['criteria'])){
|
5895 |
+
$allowed = 0;
|
5896 |
+
}
|
5897 |
+
break;
|
5898 |
+
case($pr_array['condition'] = "empty"):
|
5899 |
+
if (strlen($vv) < 1){
|
5900 |
+
$allowed = 0;
|
5901 |
+
}
|
5902 |
+
break;
|
5903 |
+
default:
|
5904 |
+
break;
|
5905 |
+
}
|
5906 |
+
}
|
5907 |
+
}
|
5908 |
+
}
|
5909 |
+
}
|
5910 |
+
} else {
|
5911 |
+
// Filters for string values
|
5912 |
+
// If case-sensitve is off than lowercase both the criteria and attribute value
|
5913 |
+
if (array_key_exists('cs', $pr_array)){
|
5914 |
+
if ($pr_array['cs'] != "on"){
|
5915 |
+
$pd_value = strtolower($pd_value);
|
5916 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5917 |
+
}
|
5918 |
+
}
|
5919 |
+
$pos = strpos($pd_value, '&');
|
5920 |
+
$pos_slash = strpos($pr_array['criteria'], '\\');
|
5921 |
+
if($pos !== false){
|
5922 |
+
$pd_value = str_replace("&","&",$pd_value);
|
5923 |
+
}
|
5924 |
+
if($pos_slash !== false){
|
5925 |
+
$pr_array['criteria'] = str_replace("\\","",$pr_array['criteria']);
|
5926 |
+
}
|
5927 |
+
|
5928 |
+
switch ($pr_array['condition']) {
|
5929 |
+
case($pr_array['condition'] = "contains"):
|
5930 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5931 |
+
$allowed = 0;
|
5932 |
+
} elseif ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5933 |
+
$allowed = 0;
|
5934 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5935 |
+
if($allowed <> 0){
|
5936 |
+
$allowed = 1;
|
5937 |
+
}
|
5938 |
+
}
|
5939 |
+
break;
|
5940 |
+
case($pr_array['condition'] = "containsnot"):
|
5941 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5942 |
+
$allowed = 0;
|
5943 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5944 |
+
$allowed = 0;
|
5945 |
+
}
|
5946 |
+
break;
|
5947 |
case($pr_array['condition'] = "="):
|
5948 |
+
if (($pr_array['criteria'] == "$pd_value") AND ($pr_array['than'] == "exclude")){
|
5949 |
$allowed = 0;
|
5950 |
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "include_only")){
|
5951 |
$found = strpos($pd_value,$pr_array['criteria']);
|
5952 |
+
if ($found !== false) {
|
5953 |
+
//for category mapping check if its an array
|
5954 |
+
if($pr_array['attribute'] == "raw_categories"){
|
5955 |
+
$raw_cats_arr = explode("||",$pd_value);
|
5956 |
+
if(is_array($raw_cats_arr)){
|
5957 |
+
if(in_array($pr_array['criteria'],$raw_cats_arr, TRUE)){
|
5958 |
+
if($allowed <> 0){
|
5959 |
+
$allowed = 1;
|
5960 |
+
}
|
5961 |
+
} else {
|
5962 |
+
$allowed = 0;
|
5963 |
+
}
|
5964 |
+
}
|
5965 |
+
} else {
|
5966 |
+
if($allowed <> 0){
|
5967 |
+
$allowed = 1;
|
5968 |
+
}
|
5969 |
+
}
|
5970 |
+
} else {
|
5971 |
+
$allowed = 0;
|
5972 |
+
}
|
5973 |
+
} elseif (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "include_only")){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5974 |
if($allowed <> 0){
|
5975 |
+
$allowed = 1;
|
5976 |
+
}
|
5977 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5978 |
+
// $allowed = 0;
|
5979 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5980 |
+
$allowed = 1;
|
5981 |
+
} else {
|
5982 |
+
// $allowed = 1; // Change made on February 24th 2021
|
5983 |
+
}
|
5984 |
+
break;
|
5985 |
+
case($pr_array['condition'] = "!="):
|
5986 |
+
if (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "exclude")){
|
5987 |
+
if($allowed <> 0){
|
5988 |
+
$allowed = 1;
|
5989 |
+
}
|
5990 |
+
} elseif (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "include_only")){
|
5991 |
+
$allowed = 0;
|
5992 |
+
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "exclude")){
|
5993 |
+
$allowed = 0;
|
5994 |
+
}
|
5995 |
+
break;
|
5996 |
+
case($pr_array['condition'] = ">"):
|
5997 |
+
// Use a lexical order on relational string operators
|
5998 |
+
if (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5999 |
+
$allowed = 0;
|
6000 |
+
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
6001 |
+
$allowed = 0;
|
6002 |
+
}
|
6003 |
+
break;
|
6004 |
+
case($pr_array['condition'] = ">="):
|
6005 |
+
// Use a lexical order on relational string operators
|
6006 |
+
if (($pd_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
6007 |
+
$allowed = 0;
|
6008 |
+
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
6009 |
+
$allowed = 0;
|
6010 |
+
}
|
6011 |
+
break;
|
6012 |
+
case($pr_array['condition'] = "<"):
|
6013 |
+
// Use a lexical order on relational string operators
|
6014 |
+
if (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
6015 |
+
$allowed = 0;
|
6016 |
+
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
6017 |
+
$allowed = 0;
|
6018 |
+
}
|
6019 |
+
break;
|
6020 |
+
case($pr_array['condition'] = "=<"):
|
6021 |
+
// Use a lexical order on relational string operators
|
6022 |
+
if (($pd_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
6023 |
+
$allowed = 0;
|
6024 |
+
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
6025 |
+
$allowed = 0;
|
6026 |
+
}
|
6027 |
+
break;
|
6028 |
+
case($pr_array['condition'] = "empty"):
|
6029 |
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
6030 |
+
$allowed = 0;
|
6031 |
+
} elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "exclude")){
|
6032 |
+
if($allowed <> 0){
|
6033 |
+
$allowed = 1;
|
6034 |
+
}
|
6035 |
+
} elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "include_only")){
|
6036 |
+
$allowed = 0;
|
6037 |
+
}
|
6038 |
+
break;
|
6039 |
+
default:
|
6040 |
+
break;
|
6041 |
+
}
|
6042 |
+
}
|
6043 |
+
}
|
6044 |
+
}
|
6045 |
+
}
|
6046 |
|
6047 |
+
if ($allowed < 1){
|
6048 |
+
$product_data = array();
|
6049 |
+
$product_data = null;
|
6050 |
+
} else {
|
6051 |
+
return $product_data;
|
6052 |
+
}
|
6053 |
+
}
|
6054 |
}
|
css/woosea_admin.css
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
margin-right: 24px;
|
6 |
padding: 8px 12px;
|
7 |
position: absolute;
|
8 |
-
z-index: 1000
|
9 |
}
|
10 |
.typeahead {
|
11 |
background-color: #FFFFFF;
|
@@ -260,13 +260,16 @@ input:checked + .woo-product-feed-pro-slider:before {
|
|
260 |
.woo-product-feed-pro-form-style-2 .input-field-midsmall:focus,
|
261 |
.woo-product-feed-pro-form-style-2 .input-field-small:focus,
|
262 |
.woo-product-feed-pro-form-style-2 .input-field-medium:focus,
|
|
|
263 |
.woo-product-feed-pro-form-style-2 .textarea-field:focus,
|
|
|
264 |
.woo-product-feed-pro-form-style-2 .select-field:focus{
|
265 |
border: 1px solid #0C0;
|
266 |
}
|
267 |
.woo-product-feed-pro-form-style-2 .textarea-field{
|
268 |
height:100px;
|
269 |
width: 55%;
|
|
|
270 |
}
|
271 |
.woo-product-feed-pro-form-style-2 input[type=submit],
|
272 |
.woo-product-feed-pro-form-style-2 input[type=button]{
|
5 |
margin-right: 24px;
|
6 |
padding: 8px 12px;
|
7 |
position: absolute;
|
8 |
+
/* z-index: 1000;*/
|
9 |
}
|
10 |
.typeahead {
|
11 |
background-color: #FFFFFF;
|
260 |
.woo-product-feed-pro-form-style-2 .input-field-midsmall:focus,
|
261 |
.woo-product-feed-pro-form-style-2 .input-field-small:focus,
|
262 |
.woo-product-feed-pro-form-style-2 .input-field-medium:focus,
|
263 |
+
/*
|
264 |
.woo-product-feed-pro-form-style-2 .textarea-field:focus,
|
265 |
+
*/
|
266 |
.woo-product-feed-pro-form-style-2 .select-field:focus{
|
267 |
border: 1px solid #0C0;
|
268 |
}
|
269 |
.woo-product-feed-pro-form-style-2 .textarea-field{
|
270 |
height:100px;
|
271 |
width: 55%;
|
272 |
+
word-break: break-all;
|
273 |
}
|
274 |
.woo-product-feed-pro-form-style-2 input[type=submit],
|
275 |
.woo-product-feed-pro-form-style-2 input[type=button]{
|
js/woosea_add_cart.js
CHANGED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($) {
|
2 |
+
//localStorage.removeItem("attributes");
|
3 |
+
$( "select" ).change(function() {
|
4 |
+
|
5 |
+
//localStorage.removeItem("attributes");
|
6 |
+
var productId = $('input[name=product_id]').val();
|
7 |
+
var selectedName = $(this).attr("name");
|
8 |
+
var selectedValue = $(this).find('option:selected').text();
|
9 |
+
var storedAttributes = JSON.parse(localStorage.getItem("attributes"));
|
10 |
+
|
11 |
+
// Already saved a selection in local storage
|
12 |
+
if(storedAttributes){
|
13 |
+
// Only add new selections to the local storage
|
14 |
+
var len_value = selectedValue.length;
|
15 |
+
if(len_value > 0){
|
16 |
+
storedAttributes[selectedName] = selectedValue;
|
17 |
+
localStorage.setItem("attributes", JSON.stringify(storedAttributes));
|
18 |
+
}
|
19 |
+
} else {
|
20 |
+
var json_attributes = new Object();
|
21 |
+
json_attributes.productId = productId;
|
22 |
+
json_attributes[selectedName] = selectedValue;
|
23 |
+
localStorage.setItem("attributes", JSON.stringify(json_attributes));
|
24 |
+
}
|
25 |
+
|
26 |
+
var storedAttributes = JSON.parse(localStorage.getItem("attributes"));
|
27 |
+
|
28 |
+
// Now AJAX call to save in options
|
29 |
+
var inputdata = {
|
30 |
+
'action': 'woosea_storedattributes_details',
|
31 |
+
'data_to_pass': productId,
|
32 |
+
'storedAttributes': storedAttributes,
|
33 |
+
}
|
34 |
+
|
35 |
+
$.post(frontEndAjax.ajaxurl, inputdata, function( response ) {
|
36 |
+
}, 'json' );
|
37 |
+
|
38 |
+
console.log(storedAttributes);
|
39 |
+
});
|
40 |
+
|
41 |
+
// For shop pages
|
42 |
+
$(".add_to_cart_button").click(function(){
|
43 |
+
var productId = $(this).attr('data-product_id');
|
44 |
+
|
45 |
+
console.log(productId);
|
46 |
+
|
47 |
+
// Ajax frontend
|
48 |
+
var inputdata = {
|
49 |
+
'action': 'woosea_addtocart_details',
|
50 |
+
'data_to_pass': productId,
|
51 |
+
}
|
52 |
+
|
53 |
+
$.post(frontEndAjax.ajaxurl, inputdata, function( response ) {
|
54 |
+
fbq("track", "AddToCart", {
|
55 |
+
content_ids: "['" + response.product_id + "']",
|
56 |
+
content_name: response.product_name,
|
57 |
+
content_category: response.product_cats,
|
58 |
+
content_type: "product",
|
59 |
+
value: response.product_price,
|
60 |
+
currency: response.product_currency,
|
61 |
+
});
|
62 |
+
}, 'json' );
|
63 |
+
});
|
64 |
+
|
65 |
+
// For product pages
|
66 |
+
$(".single_add_to_cart_button").click(function(){
|
67 |
+
var productId = $('input[name=product_id]').val();
|
68 |
+
|
69 |
+
if(!productId){
|
70 |
+
productId = $(this).attr('value');
|
71 |
+
}
|
72 |
+
|
73 |
+
console.log(productId);
|
74 |
+
|
75 |
+
// Ajax frontend
|
76 |
+
var inputdata = {
|
77 |
+
'action': 'woosea_addtocart_details',
|
78 |
+
'data_to_pass': productId,
|
79 |
+
}
|
80 |
+
|
81 |
+
$.post(frontEndAjax.ajaxurl, inputdata, function( response ) {
|
82 |
+
|
83 |
+
fbq("track", "AddToCart", {
|
84 |
+
content_ids: "['" + response.product_id + "']",
|
85 |
+
content_name: response.product_name,
|
86 |
+
content_category: response.product_cats,
|
87 |
+
content_type: "product",
|
88 |
+
value: response.product_price,
|
89 |
+
currency: response.product_currency,
|
90 |
+
});
|
91 |
+
}, 'json' );
|
92 |
+
});
|
93 |
+
});
|
js/woosea_autocomplete.js
CHANGED
@@ -5695,8 +5695,10 @@ jQuery(document).ready(function($) {
|
|
5695 |
jQuery(".js-autosuggest").on('click',function(){
|
5696 |
var className = $(this).attr("class").split(' ')[3];
|
5697 |
var rowCount = className.split("_")[1]
|
5698 |
-
|
5699 |
-
|
|
|
|
|
5700 |
input: '.js-autosuggest',
|
5701 |
source: google_taxonomy,
|
5702 |
hint: true,
|
@@ -5708,7 +5710,6 @@ jQuery(document).ready(function($) {
|
|
5708 |
});
|
5709 |
jQuery( ".autocomplete_" + rowCount ).focus();
|
5710 |
|
5711 |
-
|
5712 |
jQuery(this).on('change', function(){ // on change of state
|
5713 |
|
5714 |
var minimum = 1;
|
@@ -5741,7 +5742,6 @@ jQuery(document).ready(function($) {
|
|
5741 |
}
|
5742 |
} else {
|
5743 |
var map_to_category = "";
|
5744 |
-
|
5745 |
jQuery.ajax({
|
5746 |
method: "POST",
|
5747 |
url: ajaxurl,
|
5695 |
jQuery(".js-autosuggest").on('click',function(){
|
5696 |
var className = $(this).attr("class").split(' ')[3];
|
5697 |
var rowCount = className.split("_")[1]
|
5698 |
+
|
5699 |
+
//$('#the-basics-11603 .autocomplete_11603').typeahead({
|
5700 |
+
jQuery("." + className).typeahead({
|
5701 |
+
//jQuery(".autocomplete_" + rowCount ).typeahead({
|
5702 |
input: '.js-autosuggest',
|
5703 |
source: google_taxonomy,
|
5704 |
hint: true,
|
5710 |
});
|
5711 |
jQuery( ".autocomplete_" + rowCount ).focus();
|
5712 |
|
|
|
5713 |
jQuery(this).on('change', function(){ // on change of state
|
5714 |
|
5715 |
var minimum = 1;
|
5742 |
}
|
5743 |
} else {
|
5744 |
var map_to_category = "";
|
|
|
5745 |
jQuery.ajax({
|
5746 |
method: "POST",
|
5747 |
url: ajaxurl,
|
js/woosea_key.js
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
jQuery(document).ready(function($) {
|
2 |
-
|
3 |
jQuery("#deactivate_license").on('click', function(){
|
4 |
//jQuery("#deactivate_license").click(function(){
|
5 |
$('.notice').replaceWith("<div class='notice notice-info is-dismissible'><p>Your license has been deactivated.</p></div>");
|
@@ -27,7 +26,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=
|
31 |
jsonp: 'callback',
|
32 |
dataType: 'jsonp',
|
33 |
type: 'GET',
|
1 |
jQuery(document).ready(function($) {
|
|
|
2 |
jQuery("#deactivate_license").on('click', function(){
|
3 |
//jQuery("#deactivate_license").click(function(){
|
4 |
$('.notice').replaceWith("<div class='notice notice-info is-dismissible'><p>Your license has been deactivated.</p></div>");
|
26 |
var license_key = $('#license-key').val();
|
27 |
|
28 |
jQuery.ajax({
|
29 |
+
url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=10.7.9',
|
30 |
jsonp: 'callback',
|
31 |
dataType: 'jsonp',
|
32 |
type: 'GET',
|
js/woosea_manage.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
jQuery(function($) {
|
2 |
-
|
|
|
3 |
var project_hash = null;
|
4 |
var project_status = null;
|
5 |
var get_value = null;
|
@@ -256,6 +257,26 @@ jQuery(function($) {
|
|
256 |
}
|
257 |
})
|
258 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
// Check if user would like to enable debug logging
|
260 |
$('#add_woosea_logging').on('change', function(){ // on change of state
|
261 |
if(this.checked){
|
@@ -276,6 +297,26 @@ jQuery(function($) {
|
|
276 |
}
|
277 |
})
|
278 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
279 |
// Check if user would like to add a Facebook Pixel to their website
|
280 |
$('#woosea_content_ids').on('change', function(){ // on change of state
|
281 |
var content_ids = $('#woosea_content_ids').val();
|
@@ -290,13 +331,19 @@ jQuery(function($) {
|
|
290 |
|
291 |
// Check if user would like to add a Facebook Pixel to their website
|
292 |
$('#add_facebook_pixel').on('change', function(){ // on change of state
|
|
|
|
|
293 |
if(this.checked){
|
294 |
|
295 |
// Checkbox is on
|
296 |
jQuery.ajax({
|
297 |
method: "POST",
|
298 |
url: ajaxurl,
|
299 |
-
data: {
|
|
|
|
|
|
|
|
|
300 |
})
|
301 |
.done(function( data ) {
|
302 |
$('#facebook_pixel').after('<tr id="facebook_pixel_id"><td colspan="2"><span>Insert Facebook pixel ID:</span> <input type="text" class="input-field-medium" id="fb_pixel_id" name="fb_pixel_id"> <input type="button" id="save_facebook_pixel_id" value="Save"></td></tr>');
|
@@ -309,7 +356,11 @@ jQuery(function($) {
|
|
309 |
jQuery.ajax({
|
310 |
method: "POST",
|
311 |
url: ajaxurl,
|
312 |
-
data: {
|
|
|
|
|
|
|
|
|
313 |
})
|
314 |
.done(function( data ) {
|
315 |
$('#facebook_pixel_id').remove();
|
@@ -320,6 +371,49 @@ jQuery(function($) {
|
|
320 |
}
|
321 |
})
|
322 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
// Check if user would like to change the batch size
|
324 |
$('#add_batch').on('change', function(){ // on change of state
|
325 |
if(this.checked){
|
@@ -381,13 +475,19 @@ jQuery(function($) {
|
|
381 |
|
382 |
// Check if user would like to enable Dynamic Remarketing
|
383 |
$('#add_remarketing').on('change', function(){ // on change of state
|
384 |
-
|
|
|
|
|
385 |
|
386 |
// Checkbox is on
|
387 |
jQuery.ajax({
|
388 |
method: "POST",
|
389 |
url: ajaxurl,
|
390 |
-
data: {
|
|
|
|
|
|
|
|
|
391 |
})
|
392 |
.done(function( data ) {
|
393 |
$('#remarketing').after('<tr id="adwords_conversion_id"><td colspan="2"><span>Insert your Dynamic Remarketing Conversion tracking ID:</span> <input type="text" class="input-field-medium" id="adwords_conv_id" name="adwords_conv_id"> <input type="submit" id="save_conversion_id" value="Save"></td></tr>');
|
@@ -400,7 +500,11 @@ jQuery(function($) {
|
|
400 |
jQuery.ajax({
|
401 |
method: "POST",
|
402 |
url: ajaxurl,
|
403 |
-
data: {
|
|
|
|
|
|
|
|
|
404 |
})
|
405 |
.done(function( data ) {
|
406 |
$('#adwords_conversion_id').remove();
|
@@ -414,7 +518,7 @@ jQuery(function($) {
|
|
414 |
// Save Google Dynamic Remarketing pixel ID
|
415 |
jQuery("#save_conversion_id").on('click',function(){
|
416 |
var adwords_conversion_id = $('#adwords_conv_id').val();
|
417 |
-
var re = /^[0-9]*$/;
|
418 |
|
419 |
var woosea_valid_conversion_id=re.test(adwords_conversion_id);
|
420 |
// Check for allowed characters
|
@@ -456,7 +560,30 @@ jQuery(function($) {
|
|
456 |
url: ajaxurl,
|
457 |
data: { 'action': 'woosea_save_facebook_pixel_id', 'facebook_pixel_id': facebook_pixel_id }
|
458 |
})
|
459 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
460 |
}
|
461 |
})
|
462 |
|
1 |
jQuery(function($) {
|
2 |
+
|
3 |
+
//jQuery(document).ready(function($) {
|
4 |
var project_hash = null;
|
5 |
var project_status = null;
|
6 |
var get_value = null;
|
257 |
}
|
258 |
})
|
259 |
|
260 |
+
// Check if user would like the plugin to remove the free shipping class
|
261 |
+
$('#remove_free_shipping').on('change', function(){ // on change of state
|
262 |
+
if(this.checked){
|
263 |
+
|
264 |
+
// Checkbox is on
|
265 |
+
jQuery.ajax({
|
266 |
+
method: "POST",
|
267 |
+
url: ajaxurl,
|
268 |
+
data: { 'action': 'woosea_remove_free_shipping', 'status': "on" }
|
269 |
+
})
|
270 |
+
} else {
|
271 |
+
// Checkbox is off
|
272 |
+
jQuery.ajax({
|
273 |
+
method: "POST",
|
274 |
+
url: ajaxurl,
|
275 |
+
data: { 'action': 'woosea_remove_free_shipping', 'status': "off" }
|
276 |
+
})
|
277 |
+
}
|
278 |
+
})
|
279 |
+
|
280 |
// Check if user would like to enable debug logging
|
281 |
$('#add_woosea_logging').on('change', function(){ // on change of state
|
282 |
if(this.checked){
|
297 |
}
|
298 |
})
|
299 |
|
300 |
+
// Check if user would like to enable addition of CDATA
|
301 |
+
$('#add_woosea_cdata').on('change', function(){ // on change of state
|
302 |
+
if(this.checked){
|
303 |
+
|
304 |
+
// Checkbox is on
|
305 |
+
jQuery.ajax({
|
306 |
+
method: "POST",
|
307 |
+
url: ajaxurl,
|
308 |
+
data: { 'action': 'woosea_add_woosea_cdata', 'status': "on" }
|
309 |
+
})
|
310 |
+
} else {
|
311 |
+
// Checkbox is off
|
312 |
+
jQuery.ajax({
|
313 |
+
method: "POST",
|
314 |
+
url: ajaxurl,
|
315 |
+
data: { 'action': 'woosea_add_woosea_cdata', 'status': "off" }
|
316 |
+
})
|
317 |
+
}
|
318 |
+
})
|
319 |
+
|
320 |
// Check if user would like to add a Facebook Pixel to their website
|
321 |
$('#woosea_content_ids').on('change', function(){ // on change of state
|
322 |
var content_ids = $('#woosea_content_ids').val();
|
331 |
|
332 |
// Check if user would like to add a Facebook Pixel to their website
|
333 |
$('#add_facebook_pixel').on('change', function(){ // on change of state
|
334 |
+
var nonce = $('#add_facebook_pixel').val();
|
335 |
+
|
336 |
if(this.checked){
|
337 |
|
338 |
// Checkbox is on
|
339 |
jQuery.ajax({
|
340 |
method: "POST",
|
341 |
url: ajaxurl,
|
342 |
+
data: {
|
343 |
+
'action': 'woosea_add_facebook_pixel_setting',
|
344 |
+
'security': nonce,
|
345 |
+
'status': "on"
|
346 |
+
}
|
347 |
})
|
348 |
.done(function( data ) {
|
349 |
$('#facebook_pixel').after('<tr id="facebook_pixel_id"><td colspan="2"><span>Insert Facebook pixel ID:</span> <input type="text" class="input-field-medium" id="fb_pixel_id" name="fb_pixel_id"> <input type="button" id="save_facebook_pixel_id" value="Save"></td></tr>');
|
356 |
jQuery.ajax({
|
357 |
method: "POST",
|
358 |
url: ajaxurl,
|
359 |
+
data: {
|
360 |
+
'action': 'woosea_add_facebook_pixel_setting',
|
361 |
+
'security': nonce,
|
362 |
+
'status': "off"
|
363 |
+
}
|
364 |
})
|
365 |
.done(function( data ) {
|
366 |
$('#facebook_pixel_id').remove();
|
371 |
}
|
372 |
})
|
373 |
|
374 |
+
// Check if user would like to enable the Facebook Conversion API
|
375 |
+
$('#add_facebook_capi').on('change', function(){ // on change of state
|
376 |
+
var nonce = $('#add_facebook_capi').val();
|
377 |
+
|
378 |
+
if(this.checked){
|
379 |
+
|
380 |
+
// Checkbox is on
|
381 |
+
jQuery.ajax({
|
382 |
+
method: "POST",
|
383 |
+
url: ajaxurl,
|
384 |
+
data: {
|
385 |
+
'action': 'woosea_add_facebook_capi_setting',
|
386 |
+
'security': nonce,
|
387 |
+
'status': "on"
|
388 |
+
}
|
389 |
+
})
|
390 |
+
.done(function( data ) {
|
391 |
+
$('#facebook_capi').after('<tr id="facebook_capi_token"><td colspan="2"><span>Insert your Facebook Conversion API token:</span><br/><br/><input type="textarea" class="textarea-field" id="fb_capi_token" name="fb_capi_token"><br/><br/><input type="button" id="save_facebook_capi_token" value="Save"></td></tr>');
|
392 |
+
})
|
393 |
+
.fail(function( data ) {
|
394 |
+
console.log('Failed AJAX Call :( /// Return Data: ' + data);
|
395 |
+
});
|
396 |
+
} else {
|
397 |
+
// Checkbox is off
|
398 |
+
jQuery.ajax({
|
399 |
+
method: "POST",
|
400 |
+
url: ajaxurl,
|
401 |
+
data: {
|
402 |
+
'action': 'woosea_add_facebook_capi_setting',
|
403 |
+
'security': nonce,
|
404 |
+
'status': "off"
|
405 |
+
}
|
406 |
+
})
|
407 |
+
.done(function( data ) {
|
408 |
+
$('#facebook_capi_token').remove();
|
409 |
+
})
|
410 |
+
.fail(function( data ) {
|
411 |
+
console.log('Failed AJAX Call :( /// Return Data: ' + data);
|
412 |
+
});
|
413 |
+
}
|
414 |
+
})
|
415 |
+
|
416 |
+
|
417 |
// Check if user would like to change the batch size
|
418 |
$('#add_batch').on('change', function(){ // on change of state
|
419 |
if(this.checked){
|
475 |
|
476 |
// Check if user would like to enable Dynamic Remarketing
|
477 |
$('#add_remarketing').on('change', function(){ // on change of state
|
478 |
+
var nonce = $('#add_remarketing').val();
|
479 |
+
|
480 |
+
if(this.checked){
|
481 |
|
482 |
// Checkbox is on
|
483 |
jQuery.ajax({
|
484 |
method: "POST",
|
485 |
url: ajaxurl,
|
486 |
+
data: {
|
487 |
+
'action': 'woosea_add_remarketing',
|
488 |
+
'security': nonce,
|
489 |
+
'status': "on"
|
490 |
+
}
|
491 |
})
|
492 |
.done(function( data ) {
|
493 |
$('#remarketing').after('<tr id="adwords_conversion_id"><td colspan="2"><span>Insert your Dynamic Remarketing Conversion tracking ID:</span> <input type="text" class="input-field-medium" id="adwords_conv_id" name="adwords_conv_id"> <input type="submit" id="save_conversion_id" value="Save"></td></tr>');
|
500 |
jQuery.ajax({
|
501 |
method: "POST",
|
502 |
url: ajaxurl,
|
503 |
+
data: {
|
504 |
+
'action': 'woosea_add_remarketing',
|
505 |
+
'security': nonce,
|
506 |
+
'status': "off"
|
507 |
+
}
|
508 |
})
|
509 |
.done(function( data ) {
|
510 |
$('#adwords_conversion_id').remove();
|
518 |
// Save Google Dynamic Remarketing pixel ID
|
519 |
jQuery("#save_conversion_id").on('click',function(){
|
520 |
var adwords_conversion_id = $('#adwords_conv_id').val();
|
521 |
+
var re = /^[0-9,-]*$/;
|
522 |
|
523 |
var woosea_valid_conversion_id=re.test(adwords_conversion_id);
|
524 |
// Check for allowed characters
|
560 |
url: ajaxurl,
|
561 |
data: { 'action': 'woosea_save_facebook_pixel_id', 'facebook_pixel_id': facebook_pixel_id }
|
562 |
})
|
563 |
+
}
|
564 |
+
})
|
565 |
+
|
566 |
+
// Save Facebook Conversion API token
|
567 |
+
jQuery("#save_facebook_capi_token").on('click',function(){
|
568 |
+
var facebook_capi_token = $('#fb_capi_token').val();
|
569 |
+
var re = /^[0-9A-Za-z]*$/;
|
570 |
+
var woosea_valid_facebook_capi_token=re.test(facebook_capi_token);
|
571 |
+
|
572 |
+
// Check for allowed characters
|
573 |
+
if (!woosea_valid_facebook_capi_token){
|
574 |
+
$('.notice').replaceWith("<div class='notice notice-error woosea-notice-conversion is-dismissible'><p>Sorry, this is not a valid Facebook Conversion API Token.</p></div>");
|
575 |
+
// Disable submit button too
|
576 |
+
$('#save_facebook_capi_token').attr('disabled',true);
|
577 |
+
} else {
|
578 |
+
$('.woosea-notice-conversion').remove();
|
579 |
+
$('#save_facebook_capi_token').attr('disabled',false);
|
580 |
+
|
581 |
+
// Now we need to save the Facebook Conversion API Token
|
582 |
+
jQuery.ajax({
|
583 |
+
method: "POST",
|
584 |
+
url: ajaxurl,
|
585 |
+
data: { 'action': 'woosea_save_facebook_capi_token', 'facebook_capi_token': facebook_capi_token }
|
586 |
+
})
|
587 |
}
|
588 |
})
|
589 |
|
pages/admin/woosea-generate-feed-step-0.php
CHANGED
@@ -395,7 +395,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
395 |
</td>
|
396 |
</tr>
|
397 |
<tr id="product_variations">
|
398 |
-
<td><span><?php _e('Include
|
399 |
<td>
|
400 |
<label class="woo-product-feed-pro-switch">
|
401 |
<?php
|
@@ -410,7 +410,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
410 |
</td>
|
411 |
</tr>
|
412 |
<tr id="default_variation">
|
413 |
-
<td><span><?php _e( '
|
414 |
<td>
|
415 |
<label class="woo-product-feed-pro-switch">
|
416 |
<?php
|
@@ -425,7 +425,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
425 |
</td>
|
426 |
</tr>
|
427 |
<tr id="lowest_price_variation">
|
428 |
-
<td><span><?php _e( '
|
429 |
<td>
|
430 |
<label class="woo-product-feed-pro-switch">
|
431 |
<?php
|
395 |
</td>
|
396 |
</tr>
|
397 |
<tr id="product_variations">
|
398 |
+
<td><span><?php _e('Include product variations','woo-product-feed-pro' );?>:</span></td>
|
399 |
<td>
|
400 |
<label class="woo-product-feed-pro-switch">
|
401 |
<?php
|
410 |
</td>
|
411 |
</tr>
|
412 |
<tr id="default_variation">
|
413 |
+
<td><span><?php _e( 'And only include default product variation','woo-product-feed-pro' );?>:</span></td>
|
414 |
<td>
|
415 |
<label class="woo-product-feed-pro-switch">
|
416 |
<?php
|
425 |
</td>
|
426 |
</tr>
|
427 |
<tr id="lowest_price_variation">
|
428 |
+
<td><span><?php _e( 'And only include lowest priced product variation(s)','woo-product-feed-pro' );?>:</span></td>
|
429 |
<td>
|
430 |
<label class="woo-product-feed-pro-switch">
|
431 |
<?php
|
pages/admin/woosea-generate-feed-step-1.php
CHANGED
@@ -101,7 +101,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
|
|
101 |
|
102 |
$r .= "<tr class=\"catmapping\">";
|
103 |
$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>";
|
104 |
-
$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>";
|
105 |
if(($yo == $nr_categories) AND ($nr_subcats == 0)){
|
106 |
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
107 |
} else {
|
@@ -115,7 +115,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
|
|
115 |
} else {
|
116 |
$r .= "<tr class=\"catmapping\">";
|
117 |
$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>";
|
118 |
-
$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>";
|
119 |
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
120 |
$r .= "</tr>";
|
121 |
}
|
@@ -227,7 +227,7 @@ function woosea_hierarchical_term_tree($category, $prev_mapped){
|
|
227 |
|
228 |
<table class="woo-product-feed-pro-table">
|
229 |
<tr>
|
230 |
-
<td><strong><?php _e( 'We
|
231 |
</tr>
|
232 |
<tr>
|
233 |
<td>
|
101 |
|
102 |
$r .= "<tr class=\"catmapping\">";
|
103 |
$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>";
|
104 |
+
$r .= "<td><div id=\"the-basics-$x\"><input type=\"search\" name=\"mappings[$x][map_to_category]\" class=\"$mapped_active_class js-typeahead js-autosuggest autocomplete_$x\" value=\"$mapped_category\"></div></td>";
|
105 |
if(($yo == $nr_categories) AND ($nr_subcats == 0)){
|
106 |
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
107 |
} else {
|
115 |
} else {
|
116 |
$r .= "<tr class=\"catmapping\">";
|
117 |
$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>";
|
118 |
+
$r .= "<td><div id=\"the-basics-$x\"><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\"></div></td>";
|
119 |
$r .= "<td><span class=\"copy_category_$x\" style=\"display: inline-block;\" title=\"Copy this category to all others\"></span></td>";
|
120 |
$r .= "</tr>";
|
121 |
}
|
227 |
|
228 |
<table class="woo-product-feed-pro-table">
|
229 |
<tr>
|
230 |
+
<td><strong><?php _e( 'We have got you covered!','woo-product-feed-pro' );?></strong></td>
|
231 |
</tr>
|
232 |
<tr>
|
233 |
<td>
|
pages/admin/woosea-generate-feed-step-4.php
CHANGED
@@ -77,7 +77,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
77 |
$criteria = "";
|
78 |
}
|
79 |
?>
|
80 |
-
|
81 |
<td><input type="hidden" name="rules[<?php print "$rule_key";?>][rowCount]" value="<?php print "$rule_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
82 |
<td><i><?php _e( 'Filter','woo-product-feed-pro' );?></i></td>
|
83 |
<td>
|
@@ -155,7 +155,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
155 |
</td>
|
156 |
<td>
|
157 |
<div style="display: block;">
|
158 |
-
<input type="text" id="rulevalue" name="rules[<?php print "$rule_key";?>][criteria]" class="input-field-large" value=
|
159 |
</div>
|
160 |
</td>
|
161 |
<td>
|
@@ -314,7 +314,7 @@ if (array_key_exists('project_hash', $_GET)){
|
|
314 |
</td>
|
315 |
<td>
|
316 |
<div style="display: block;">
|
317 |
-
<input type="text" id="rulevalue" name="rules2[<?php print "$rule2_key";?>][criteria]" class="input-field-large" value=
|
318 |
</div>
|
319 |
</td>
|
320 |
<?php
|
77 |
$criteria = "";
|
78 |
}
|
79 |
?>
|
80 |
+
<tr class="rowCount">
|
81 |
<td><input type="hidden" name="rules[<?php print "$rule_key";?>][rowCount]" value="<?php print "$rule_key";?>"><input type="checkbox" name="record" class="checkbox-field"></td>
|
82 |
<td><i><?php _e( 'Filter','woo-product-feed-pro' );?></i></td>
|
83 |
<td>
|
155 |
</td>
|
156 |
<td>
|
157 |
<div style="display: block;">
|
158 |
+
<input type="text" id="rulevalue" name="rules[<?php print "$rule_key";?>][criteria]" class="input-field-large" value='<?php print $criteria;?>'>
|
159 |
</div>
|
160 |
</td>
|
161 |
<td>
|
314 |
</td>
|
315 |
<td>
|
316 |
<div style="display: block;">
|
317 |
+
<input type="text" id="rulevalue" name="rules2[<?php print "$rule2_key";?>][criteria]" class="input-field-large" value='<?php print $criteria;?>'>
|
318 |
</div>
|
319 |
</td>
|
320 |
<?php
|
pages/admin/woosea-manage-feed.php
CHANGED
@@ -67,6 +67,7 @@ if(!empty($license_information)){
|
|
67 |
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
68 |
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
69 |
}
|
|
|
70 |
?>
|
71 |
<div class="wrap">
|
72 |
<div class="woo-product-feed-pro-form-style-2">
|
@@ -96,7 +97,15 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
|
96 |
foreach($cron_projects as $key => $value){
|
97 |
$cron_projects[$key]['active'] = "true";
|
98 |
}
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
} else {
|
101 |
// Set default notification to show
|
102 |
$getelite_notice = get_option('woosea_getelite_notification');
|
@@ -124,6 +133,23 @@ if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
|
124 |
<?php
|
125 |
}
|
126 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
?>
|
128 |
|
129 |
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Manage feeds','woo-product-feed-pro' );?></div>
|
67 |
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
68 |
$notifications_box = $notifications_obj->get_admin_notifications ( '12', 'false' );
|
69 |
}
|
70 |
+
|
71 |
?>
|
72 |
<div class="wrap">
|
73 |
<div class="woo-product-feed-pro-form-style-2">
|
97 |
foreach($cron_projects as $key => $value){
|
98 |
$cron_projects[$key]['active'] = "true";
|
99 |
}
|
100 |
+
update_option('cron_projects', $cron_projects,'no');
|
101 |
+
} elseif (array_key_exists('force-clean', $_GET)){
|
102 |
+
// Forcefully remove all feed and plugin configurations
|
103 |
+
delete_option( 'cron_projects' );
|
104 |
+
delete_option( 'channel_statics' );
|
105 |
+
delete_option( 'woosea_getelite_notification' );
|
106 |
+
delete_option( 'woosea_license_notification_closed' );
|
107 |
+
wp_clear_scheduled_hook( 'woosea_cron_hook' );
|
108 |
+
wp_clear_scheduled_hook( 'woosea_check_license' );
|
109 |
} else {
|
110 |
// Set default notification to show
|
111 |
$getelite_notice = get_option('woosea_getelite_notification');
|
133 |
<?php
|
134 |
}
|
135 |
}
|
136 |
+
|
137 |
+
|
138 |
+
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
139 |
+
?>
|
140 |
+
<div class="notice notice-error is-dismissible">
|
141 |
+
<p>
|
142 |
+
<strong><?php _e( 'WARNING: Your WP-Cron is disabled', 'woo-product-feed-pro' );?></strong><br/></br/>
|
143 |
+
We detected that your WP-cron has been disabled in your wp-config.php file. Our plugin heavily depends on the WP-cron being active otherwise it cannot update and generate your product feeds. <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=cron-warning&utm_content=notification" target="_blank"><strong>Please enable your WP-cron first</strong></a>.
|
144 |
+
</p>
|
145 |
+
</div>
|
146 |
+
<?php
|
147 |
+
}
|
148 |
+
|
149 |
+
// Double check if the woosea_cron_hook is there, when it is not create a new one
|
150 |
+
if (!wp_next_scheduled( 'woosea_cron_hook' ) ) {
|
151 |
+
wp_schedule_event ( time(), 'hourly', 'woosea_cron_hook');
|
152 |
+
}
|
153 |
?>
|
154 |
|
155 |
<div class="woo-product-feed-pro-form-style-2-heading"><?php _e( 'Manage feeds','woo-product-feed-pro' );?></div>
|
pages/admin/woosea-manage-settings.php
CHANGED
@@ -73,6 +73,10 @@ add_filter('admin_footer_text', 'my_footer_text');
|
|
73 |
//we check if the page is visited by click on the tabs or on the menu button.
|
74 |
//then we get the active tab.
|
75 |
$active_tab = "woosea_manage_settings";
|
|
|
|
|
|
|
|
|
76 |
$header_text = __( 'Plugin settings', 'woo-product-feed-pro' );
|
77 |
if(isset($_GET["tab"])) {
|
78 |
if($_GET["tab"] == "woosea_manage_settings"){
|
@@ -101,6 +105,20 @@ if(isset($_GET["tab"])) {
|
|
101 |
?>
|
102 |
</span>
|
103 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
<!-- wordpress provides the styling for tabs. -->
|
106 |
<h2 class="nav-tab-wrapper">
|
@@ -161,7 +179,7 @@ if(isset($_GET["tab"])) {
|
|
161 |
</tr>
|
162 |
<tr class="<?php print"$elite_disable";?>" id="identifier_option">
|
163 |
<td>
|
164 |
-
<span><?php _e( 'Add GTIN, MPN, UPC, EAN, Product condition, Optimised title, Installment, Unit measure and
|
165 |
</td>
|
166 |
<td>
|
167 |
<label class="woo-product-feed-pro-switch">
|
@@ -179,7 +197,7 @@ if(isset($_GET["tab"])) {
|
|
179 |
</tr>
|
180 |
<tr class="<?php print"$elite_disable";?>" id="manipulation_option">
|
181 |
<td>
|
182 |
-
<span><?php _e( 'Enable Product
|
183 |
</td>
|
184 |
<td>
|
185 |
<label class="woo-product-feed-pro-switch">
|
@@ -238,7 +256,7 @@ if(isset($_GET["tab"])) {
|
|
238 |
?>
|
239 |
<tr>
|
240 |
<td>
|
241 |
-
<span><?php _e( 'Use
|
242 |
</td>
|
243 |
<td>
|
244 |
<label class="woo-product-feed-pro-switch">
|
@@ -256,7 +274,7 @@ if(isset($_GET["tab"])) {
|
|
256 |
</tr>
|
257 |
<tr>
|
258 |
<td>
|
259 |
-
<span><?php _e( 'Add shipping costs for all countries to feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
260 |
</td>
|
261 |
<td>
|
262 |
<label class="woo-product-feed-pro-switch">
|
@@ -292,7 +310,25 @@ if(isset($_GET["tab"])) {
|
|
292 |
</tr>
|
293 |
<tr>
|
294 |
<td>
|
295 |
-
<span><?php _e( 'Remove the
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
296 |
</td>
|
297 |
<td>
|
298 |
<label class="woo-product-feed-pro-switch">
|
@@ -326,6 +362,24 @@ if(isset($_GET["tab"])) {
|
|
326 |
</label>
|
327 |
</td>
|
328 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
|
330 |
<tr id="facebook_pixel">
|
331 |
<td>
|
@@ -336,9 +390,9 @@ if(isset($_GET["tab"])) {
|
|
336 |
<?php
|
337 |
$add_facebook_pixel = get_option ('add_facebook_pixel');
|
338 |
if($add_facebook_pixel == "yes"){
|
339 |
-
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\" checked>";
|
340 |
} else {
|
341 |
-
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\">";
|
342 |
}
|
343 |
?>
|
344 |
<div class="woo-product-feed-pro-slider round"></div>
|
@@ -373,20 +427,48 @@ if(isset($_GET["tab"])) {
|
|
373 |
</select>
|
374 |
</td>
|
375 |
</tr>
|
376 |
-
|
377 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
<tr id="remarketing">
|
379 |
<td>
|
380 |
<span><?php _e( 'Add Google Dynamic Remarketing Pixel:', 'woo-product-feed-pro');?></span>
|
381 |
</td>
|
382 |
<td>
|
383 |
<label class="woo-product-feed-pro-switch">
|
384 |
-
|
385 |
$add_remarketing = get_option ('add_remarketing');
|
386 |
if($add_remarketing == "yes"){
|
387 |
-
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" checked>";
|
388 |
} else {
|
389 |
-
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\">";
|
390 |
}
|
391 |
?>
|
392 |
<div class="woo-product-feed-pro-slider round"></div>
|
@@ -423,7 +505,7 @@ if(isset($_GET["tab"])) {
|
|
423 |
if($add_batch == "yes"){
|
424 |
$woosea_batch_size = get_option('woosea_batch_size');
|
425 |
|
426 |
-
print "<tr id=\"woosea_batch_size\"><td colspan=\"2\"><span>Insert batch size:</span> <input type=\"text\" class=\"input-field-medium\" id=\"batch_size\" name=\"batch_size\" value=\"$woosea_batch_size\"> <input type=\"
|
427 |
}
|
428 |
?>
|
429 |
</form>
|
@@ -440,70 +522,89 @@ if(isset($_GET["tab"])) {
|
|
440 |
$external_path_tsv = $external_base . "/woo-product-feed-pro/";
|
441 |
$external_path_logs = $external_base . "/woo-product-feed-pro/";
|
442 |
$test_file = $external_path . "/tesfile.txt";
|
443 |
-
$test_file_xml = $external_path . "
|
444 |
-
$test_file_csv = $external_path . "
|
445 |
-
$test_file_txt = $external_path . "
|
446 |
-
$test_file_tsv = $external_path . "
|
447 |
-
$test_file_logs = $external_path . "
|
448 |
|
449 |
if (is_writable($external_path)) {
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
507 |
} else {
|
508 |
$directory_perm = "False";
|
509 |
}
|
@@ -515,10 +616,14 @@ if(isset($_GET["tab"])) {
|
|
515 |
$cron_enabled = "True";
|
516 |
}
|
517 |
|
|
|
|
|
|
|
|
|
518 |
print "<table class=\"woo-product-feed-pro-table\">";
|
519 |
print "<tr><td><strong>System check</strong></td><td><strong>Status</strong></td></tr>";
|
520 |
print "<tr><td>WP-Cron enabled</td><td>$cron_enabled</td></tr>";
|
521 |
-
print "<tr><td>PHP-version
|
522 |
print "<tr><td>Product feed directory writable</td><td>$directory_perm</td></tr>";
|
523 |
print "<tr><td>Product feed XML directory writable</td><td>$directory_perm_xml</td></tr>";
|
524 |
print "<tr><td>Product feed CSV directory writable</td><td>$directory_perm_csv</td></tr>";
|
73 |
//we check if the page is visited by click on the tabs or on the menu button.
|
74 |
//then we get the active tab.
|
75 |
$active_tab = "woosea_manage_settings";
|
76 |
+
|
77 |
+
// create nonce
|
78 |
+
$nonce = wp_create_nonce( 'woosea_ajax_nonce' );
|
79 |
+
|
80 |
$header_text = __( 'Plugin settings', 'woo-product-feed-pro' );
|
81 |
if(isset($_GET["tab"])) {
|
82 |
if($_GET["tab"] == "woosea_manage_settings"){
|
105 |
?>
|
106 |
</span>
|
107 |
</div>
|
108 |
+
|
109 |
+
<?php
|
110 |
+
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
111 |
+
?>
|
112 |
+
<div class="notice notice-error is-dismissible">
|
113 |
+
<p>
|
114 |
+
<strong><?php _e( 'WARNING: Your WP-Cron is disabled', 'woo-product-feed-pro' );?></strong><br/></br/>
|
115 |
+
We detected that your WP-cron has been disabled in your wp-config.php file. Our plugin heavily depends on the WP-cron being active for it to be able to update and generate your product feeds. More information on the inner workings of our plugin and instructions on how to enable your WP-Cron can be found here: <a href="https://adtribes.io/help-my-feed-processing-is-stuck/?utm_source=<?php print"$host";?>&utm_medium=manage-feed&utm_campaign=cron-warning&utm_content=notification" target="_blank"><strong>My feed won't update or is stuck processing</strong></a>.
|
116 |
+
</p>
|
117 |
+
</div>
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
?>
|
121 |
+
|
122 |
|
123 |
<!-- wordpress provides the styling for tabs. -->
|
124 |
<h2 class="nav-tab-wrapper">
|
179 |
</tr>
|
180 |
<tr class="<?php print"$elite_disable";?>" id="identifier_option">
|
181 |
<td>
|
182 |
+
<span><?php _e( 'Add GTIN, MPN, UPC, EAN, Product condition, Optimised title, Installment, Unit measure, Brand and many more attributes to your store:', 'woo-product-feed-pro' );?> (<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"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
183 |
</td>
|
184 |
<td>
|
185 |
<label class="woo-product-feed-pro-switch">
|
197 |
</tr>
|
198 |
<tr class="<?php print"$elite_disable";?>" id="manipulation_option">
|
199 |
<td>
|
200 |
+
<span><?php _e( 'Enable the Product Data Manipulation feature:', 'woo-product-feed-pro' );?> (<a href="https://adtribes.io/feature-product-data-manipulation/?utm_source=<?php print "$host";?>&utm_medium=manage-settings&utm_content=wpml support" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
201 |
</td>
|
202 |
<td>
|
203 |
<label class="woo-product-feed-pro-switch">
|
256 |
?>
|
257 |
<tr>
|
258 |
<td>
|
259 |
+
<span><?php _e( 'Use parent variable product image for variations', 'woo-product-feed-pro');?></span>
|
260 |
</td>
|
261 |
<td>
|
262 |
<label class="woo-product-feed-pro-switch">
|
274 |
</tr>
|
275 |
<tr>
|
276 |
<td>
|
277 |
+
<span><?php _e( 'Add shipping costs for all countries to your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
278 |
</td>
|
279 |
<td>
|
280 |
<label class="woo-product-feed-pro-switch">
|
310 |
</tr>
|
311 |
<tr>
|
312 |
<td>
|
313 |
+
<span><?php _e( 'Remove the free shipping zone from your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
314 |
+
</td>
|
315 |
+
<td>
|
316 |
+
<label class="woo-product-feed-pro-switch">
|
317 |
+
<?php
|
318 |
+
$remove_free_shipping = get_option ('remove_free_shipping');
|
319 |
+
if($remove_free_shipping == "yes"){
|
320 |
+
print "<input type=\"checkbox\" id=\"remove_free_shipping\" name=\"remove_free_shipping\" class=\"checkbox-field\" checked>";
|
321 |
+
} else {
|
322 |
+
print "<input type=\"checkbox\" id=\"remove_free_shipping\" name=\"remove_free_shipping\" class=\"checkbox-field\">";
|
323 |
+
}
|
324 |
+
?>
|
325 |
+
<div class="woo-product-feed-pro-slider round"></div>
|
326 |
+
</label>
|
327 |
+
</td>
|
328 |
+
</tr>
|
329 |
+
<tr>
|
330 |
+
<td>
|
331 |
+
<span><?php _e( 'Remove the local pickup shipping zone from your feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
|
332 |
</td>
|
333 |
<td>
|
334 |
<label class="woo-product-feed-pro-switch">
|
362 |
</label>
|
363 |
</td>
|
364 |
</tr>
|
365 |
+
<tr>
|
366 |
+
<td>
|
367 |
+
<span><?php _e( 'Add CDATA to title, description and short description:', 'woo-product-feed-pro');?></span>
|
368 |
+
</td>
|
369 |
+
<td>
|
370 |
+
<label class="woo-product-feed-pro-switch">
|
371 |
+
<?php
|
372 |
+
$add_woosea_cdata = get_option ('add_woosea_cdata');
|
373 |
+
if($add_woosea_cdata == "yes"){
|
374 |
+
print "<input type=\"checkbox\" id=\"add_woosea_cdata\" name=\"add_woosea_cdata\" class=\"checkbox-field\" checked>";
|
375 |
+
} else {
|
376 |
+
print "<input type=\"checkbox\" id=\"add_woosea_cdata\" name=\"add_woosea_cdata\" class=\"checkbox-field\">";
|
377 |
+
}
|
378 |
+
?>
|
379 |
+
<div class="woo-product-feed-pro-slider round"></div>
|
380 |
+
</label>
|
381 |
+
</td>
|
382 |
+
</tr>
|
383 |
|
384 |
<tr id="facebook_pixel">
|
385 |
<td>
|
390 |
<?php
|
391 |
$add_facebook_pixel = get_option ('add_facebook_pixel');
|
392 |
if($add_facebook_pixel == "yes"){
|
393 |
+
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
394 |
} else {
|
395 |
+
print "<input type=\"checkbox\" id=\"add_facebook_pixel\" name=\"add_facebook_pixel\" class=\"checkbox-field\" value=\"$nonce\">";
|
396 |
}
|
397 |
?>
|
398 |
<div class="woo-product-feed-pro-slider round"></div>
|
427 |
</select>
|
428 |
</td>
|
429 |
</tr>
|
430 |
+
<?php
|
431 |
+
if($elite_disable == "enabled"){
|
432 |
+
?>
|
433 |
+
<tr class="<?php print"$elite_disable";?>" id="facebook_capi">
|
434 |
+
<td>
|
435 |
+
<span><?php _e( 'Enable Facebook Conversion API:', 'woo-product-feed-pro');?> (<a href="https://adtribes.io/facebook-conversion-api/" target="_blank"><?php _e( 'Read more about this', 'woo-product-feed-pro' );?>)</a></span>
|
436 |
+
</td>
|
437 |
+
<td>
|
438 |
+
<label class="woo-product-feed-pro-switch">
|
439 |
+
<?php
|
440 |
+
$add_facebook_capi = get_option ('add_facebook_capi');
|
441 |
+
if($add_facebook_capi == "yes"){
|
442 |
+
print "<input type=\"checkbox\" id=\"add_facebook_capi\" name=\"add_facebook_capi\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
443 |
+
} else {
|
444 |
+
print "<input type=\"checkbox\" id=\"add_facebook_capi\" name=\"add_facebook_capi\" class=\"checkbox-field\" value=\"$nonce\">";
|
445 |
+
}
|
446 |
+
?>
|
447 |
+
<div class="woo-product-feed-pro-slider round"></div>
|
448 |
+
</label>
|
449 |
+
</td>
|
450 |
+
</tr>
|
451 |
+
<?php
|
452 |
+
if($add_facebook_capi == "yes"){
|
453 |
+
$facebook_capi_token = get_option('woosea_facebook_capi_token');
|
454 |
+
print "<tr id=\"facebook_capi_token\"><td colspan=\"2\"><span>Insert your Facebook Conversion API token:</span><br/><br/><input type=\"textarea\" class=\"textarea-field\" id=\"fb_capi_token\" name=\"fb_capi_token\" value=\"$facebook_capi_token\"><br/><br/><input type=\"button\" id=\"save_facebook_capi_token\" value=\"Save\"></td></tr>";
|
455 |
+
}
|
456 |
+
?>
|
457 |
+
<?php
|
458 |
+
}
|
459 |
+
?>
|
460 |
<tr id="remarketing">
|
461 |
<td>
|
462 |
<span><?php _e( 'Add Google Dynamic Remarketing Pixel:', 'woo-product-feed-pro');?></span>
|
463 |
</td>
|
464 |
<td>
|
465 |
<label class="woo-product-feed-pro-switch">
|
466 |
+
<?php
|
467 |
$add_remarketing = get_option ('add_remarketing');
|
468 |
if($add_remarketing == "yes"){
|
469 |
+
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" value=\"$nonce\" checked>";
|
470 |
} else {
|
471 |
+
print "<input type=\"checkbox\" id=\"add_remarketing\" name=\"add_remarketing\" class=\"checkbox-field\" value=\"$nonce\">";
|
472 |
}
|
473 |
?>
|
474 |
<div class="woo-product-feed-pro-slider round"></div>
|
505 |
if($add_batch == "yes"){
|
506 |
$woosea_batch_size = get_option('woosea_batch_size');
|
507 |
|
508 |
+
print "<tr id=\"woosea_batch_size\"><td colspan=\"2\"><span>Insert batch size:</span> <input type=\"text\" class=\"input-field-medium\" id=\"batch_size\" name=\"batch_size\" value=\"$woosea_batch_size\"> <input type=\"button\" id=\"save_batch_size\" value=\"Save\"></td></tr>";
|
509 |
}
|
510 |
?>
|
511 |
</form>
|
522 |
$external_path_tsv = $external_base . "/woo-product-feed-pro/";
|
523 |
$external_path_logs = $external_base . "/woo-product-feed-pro/";
|
524 |
$test_file = $external_path . "/tesfile.txt";
|
525 |
+
$test_file_xml = $external_path . "xml/tesfile.txt";
|
526 |
+
$test_file_csv = $external_path . "csv/tesfile.txt";
|
527 |
+
$test_file_txt = $external_path . "txt/tesfile.txt";
|
528 |
+
$test_file_tsv = $external_path . "tsv/tesfile.txt";
|
529 |
+
$test_file_logs = $external_path . "logs/tesfile.txt";
|
530 |
|
531 |
if (is_writable($external_path)) {
|
532 |
+
// Normal root category
|
533 |
+
$fp = @fopen($test_file, 'w');
|
534 |
+
@fwrite($fp, 'Cats chase mice');
|
535 |
+
@fclose($fp);
|
536 |
+
if(is_file($test_file)){
|
537 |
+
$directory_perm = "True";
|
538 |
+
}
|
539 |
+
|
540 |
+
// XML subcategory
|
541 |
+
$fp = @fopen($test_file_xml, 'w');
|
542 |
+
if(!is_bool($fp)){
|
543 |
+
@fwrite($fp, 'Cats chase mice');
|
544 |
+
@fclose($fp);
|
545 |
+
if(is_file($test_file_xml)){
|
546 |
+
$directory_perm_xml = "True";
|
547 |
+
} else {
|
548 |
+
$directory_perm_xml = "False";
|
549 |
+
}
|
550 |
+
} else {
|
551 |
+
$directory_perm_xml = "Unknown";
|
552 |
+
}
|
553 |
+
|
554 |
+
// CSV subcategory
|
555 |
+
$fp = @fopen($test_file_csv, 'w');
|
556 |
+
if(!is_bool($fp)){
|
557 |
+
@fwrite($fp, 'Cats chase mice');
|
558 |
+
@fclose($fp);
|
559 |
+
if(is_file($test_file_csv)){
|
560 |
+
$directory_perm_csv = "True";
|
561 |
+
} else {
|
562 |
+
$directory_perm_csv = "False";
|
563 |
+
}
|
564 |
+
} else {
|
565 |
+
$directory_perm_csv = "Unknown";
|
566 |
+
}
|
567 |
+
|
568 |
+
// TXT subcategory
|
569 |
+
$fp = @fopen($test_file_txt, 'w');
|
570 |
+
if(!is_bool($fp)){
|
571 |
+
@fwrite($fp, 'Cats chase mice');
|
572 |
+
@fclose($fp);
|
573 |
+
if(is_file($test_file_txt)){
|
574 |
+
$directory_perm_txt = "True";
|
575 |
+
} else {
|
576 |
+
$directory_perm_txt = "False";
|
577 |
+
}
|
578 |
+
} else {
|
579 |
+
$directory_perm_txt = "Unknown";
|
580 |
+
}
|
581 |
+
// TSV subcategory
|
582 |
+
$fp = @fopen($test_file_tsv, 'w');
|
583 |
+
if(!is_bool($fp)){
|
584 |
+
@fwrite($fp, 'Cats chase mice');
|
585 |
+
@fclose($fp);
|
586 |
+
if(is_file($test_file_tsv)){
|
587 |
+
$directory_perm_tsv = "True";
|
588 |
+
} else {
|
589 |
+
$directory_perm_tsv = "False";
|
590 |
+
}
|
591 |
+
} else {
|
592 |
+
$directory_perm_tsv = "Uknown";
|
593 |
+
}
|
594 |
+
|
595 |
+
// Logs subcategory
|
596 |
+
$fp = @fopen($test_file_logs, 'w');
|
597 |
+
if(!is_bool($fp)){
|
598 |
+
@fwrite($fp, 'Cats chase mice');
|
599 |
+
@fclose($fp);
|
600 |
+
if(is_file($test_file_logs)){
|
601 |
+
$directory_perm_logs = "True";
|
602 |
+
} else {
|
603 |
+
$directory_perm_logs = "False";
|
604 |
+
}
|
605 |
+
} else {
|
606 |
+
$directory_perm_logs = "Unknown";
|
607 |
+
}
|
608 |
} else {
|
609 |
$directory_perm = "False";
|
610 |
}
|
616 |
$cron_enabled = "True";
|
617 |
}
|
618 |
|
619 |
+
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
|
620 |
+
$cron_enabled = "<strong>False</strong>";
|
621 |
+
}
|
622 |
+
|
623 |
print "<table class=\"woo-product-feed-pro-table\">";
|
624 |
print "<tr><td><strong>System check</strong></td><td><strong>Status</strong></td></tr>";
|
625 |
print "<tr><td>WP-Cron enabled</td><td>$cron_enabled</td></tr>";
|
626 |
+
print "<tr><td>PHP-version</td><td>$php_validation ($versions[PHP])</td></tr>";
|
627 |
print "<tr><td>Product feed directory writable</td><td>$directory_perm</td></tr>";
|
628 |
print "<tr><td>Product feed XML directory writable</td><td>$directory_perm_xml</td></tr>";
|
629 |
print "<tr><td>Product feed CSV directory writable</td><td>$directory_perm_csv</td></tr>";
|
readme.txt
CHANGED
@@ -2,17 +2,17 @@
|
|
2 |
Contributors: jorisverwater,supportadtribes,evavangelooven
|
3 |
License: GPLv3
|
4 |
License URI: http://www.gnu.org/licenses/gpl.html
|
5 |
-
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, Google Product Review feed
|
6 |
Requires at least: 4.5
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag:
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
-
Generate WooCommerce product feeds for all your marketing channels, such as Google Shopping (merchant center), Facebook Remarketing, Bing Ads, Billiger.de, Pricerunner,
|
13 |
|
14 |
= Why choose this plugin? =
|
15 |
-
Simply because this is the most complete plugin offering support for an unlimited number of products and feeds, including features such as category- & field-mapping and advanced, rule-based, filtering and product variables support.
|
16 |
|
17 |
= Our mission =
|
18 |
Offer free and advanced, intuitive, tooling and plugins for website owners and marketers to easily set-up and manage their online marketing campaigns.
|
@@ -61,21 +61,27 @@ This plugin enables you to add and configure Google Analytics UTM tracking-codes
|
|
61 |
= Shipping class support =
|
62 |
This plugin enables you to set the shipping zone (and shipping class) so the right shipping cost end up in your product feed. Our plugin uses all shipping zone settings you have configured in WooCommerce (flat rates, classes and free shipping). Our support also supports US and Australian postal codes and regions.
|
63 |
|
|
|
|
|
|
|
64 |
= WooCommerce Shipping Table Rate (Bolder Elements) support =
|
65 |
Our plugin supports the WooCommerce Shipping Table Rate plugin created by Bolder Elements.
|
66 |
|
67 |
= Product variations / Variables =
|
68 |
This plugin supports product variables so all your variations make it to product feeds as individual products too.
|
69 |
|
70 |
-
= Facebook Pixel
|
71 |
This plugin adds the Facebook pixel code on your websites and makes sure it matches the content of your Facebook catalogue product feed
|
72 |
Our plugin add's the following Facebook pixel events:
|
73 |
* on your product pages, both for simple, variable and variations pages
|
74 |
* on your category pages (ViewCategory event)
|
75 |
* on your search result pages (Search event)
|
76 |
* on your cart page (AddToCart event)
|
77 |
-
* on the
|
78 |
-
* on the thank you page (PurChase event)
|
|
|
|
|
|
|
79 |
|
80 |
= Google Dynamic Remarketing Pixel =
|
81 |
This plugin adds the Google Dynamic Remarketing pixel code on your website.
|
@@ -112,6 +118,8 @@ Our plugin supports Polylang
|
|
112 |
* XML, CSV, TSV and TXT formats;
|
113 |
* Supports WPML (version 4.1 and higher)
|
114 |
* Supports WCML, WooCommerce Multilingual
|
|
|
|
|
115 |
* Intuitive interface;
|
116 |
* Supports product variations / variables;
|
117 |
* Scheduled product feed refreshes: daily, twice-daily or every hour;
|
@@ -125,6 +133,7 @@ Our plugin supports Polylang
|
|
125 |
* Google Analytics support: add Google Analytics UTM parameters to your product feed and individual products.
|
126 |
* Supports the official Facebook for WooCommerce plugin (SKU_ID parameter)
|
127 |
* Supports Yoasts primary category feature
|
|
|
128 |
* Supports the official "WooCommerce Brands" plugin
|
129 |
* Supports Yith brand attributes
|
130 |
* Supports the official "WooCommerce Product Bundles" plugin
|
@@ -134,19 +143,20 @@ Our plugin supports Polylang
|
|
134 |
* Supports WooCommerce Dynamic Pricing & Discounts from RightPress
|
135 |
* Supports the Discount Rules for WooCommerce plugin from FlyCart
|
136 |
* Supports WC Fields Factory
|
|
|
137 |
* Supports Table Rate Shipping for WooCommerce from Bolder Elements
|
138 |
* Supports usage of the All In One SEO pack title and description attributes
|
|
|
139 |
|
140 |
Some of the above mentioned feature can only be used by users who upgraded to the Elite version of our plugin
|
141 |
|
142 |
=== Elite paid features ===
|
143 |
-
* WPML support
|
144 |
* Aelia currency switcher support
|
145 |
* Polylang support
|
146 |
* Addition of the extra fields on your product edit pages
|
147 |
* Data manipulation feature
|
148 |
* WooCommerce structured data bug fix
|
149 |
-
* Facebook pixel
|
150 |
|
151 |
=== Channels ===
|
152 |
* Custom feeds
|
@@ -158,9 +168,11 @@ Some of the above mentioned feature can only be used by users who upgraded to th
|
|
158 |
* Google Local Products
|
159 |
* Google Local Products Inventory
|
160 |
* Google Shopping Actions
|
161 |
-
* Facebook Dynamic Ad
|
162 |
* Bing Shopping
|
|
|
163 |
* Pinterest
|
|
|
164 |
* <a href="https://businesshelp.snapchat.com/en-US/a/product-catalog-specs" target="_blank">Snapchat</a>
|
165 |
* <a href="https://yandex.com/support/market-tech-requirements/index.html" target="_blank">Yandex</a>
|
166 |
* ShopMania
|
@@ -175,6 +187,7 @@ Some of the above mentioned feature can only be used by users who upgraded to th
|
|
175 |
* <a href="https://www.beslist.nl" target="_blank" rel="nofollow">Beslist.nl</a>
|
176 |
* <a href="https://www.beslist.be" target="_blank" rel="nofollow">Beslist.be</a>
|
177 |
* <a href="https://www.fashionchick.nl" target="_blank">Fashionchick.nl</a>
|
|
|
178 |
* Bol.com
|
179 |
* Stylight
|
180 |
* Incurvy
|
@@ -229,6 +242,7 @@ Some of the above mentioned feature can only be used by users who upgraded to th
|
|
229 |
* <a href="https://www.guenstiger.de" target="_blank" rel="nofollow">Guenstiger.de</a>
|
230 |
* Hood.de
|
231 |
* Ladenzeile.de
|
|
|
232 |
* Livingo.de
|
233 |
* Medizinfuchs.de
|
234 |
* <a href="https://www.moebel.de" target="_blank">Moebel.de</a>
|
@@ -249,13 +263,13 @@ Some of the above mentioned feature can only be used by users who upgraded to th
|
|
249 |
== Installation ==
|
250 |
|
251 |
=== From within Wordpress ===
|
252 |
-
1. Visit
|
253 |
-
1. Search for
|
254 |
-
1. Activate
|
255 |
|
256 |
=== Manually ===
|
257 |
1. Upload the woo-product-feed-pro folder to your /wp-content/plugins/ directory;
|
258 |
-
1. Activate
|
259 |
|
260 |
== Frequently Asked Questions ==
|
261 |
|
@@ -322,6 +336,443 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
|
|
322 |
|
323 |
=== Changelog ===
|
324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
= 9.3.7 (2021-01-12) =
|
326 |
* Added the Bestprice.gr template
|
327 |
|
@@ -2988,6 +3439,444 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
|
|
2988 |
|
2989 |
== Upgrade Notice ==
|
2990 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2991 |
= 9.3.7 =
|
2992 |
Added the Bestprice.gr template
|
2993 |
|
2 |
Contributors: jorisverwater,supportadtribes,evavangelooven
|
3 |
License: GPLv3
|
4 |
License URI: http://www.gnu.org/licenses/gpl.html
|
5 |
+
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 pixel, Facebook Conversion API, Facebook CAPI,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, Google Product Review feed
|
6 |
Requires at least: 4.5
|
7 |
+
Tested up to: 5.8
|
8 |
+
Stable tag: 10.7.9
|
9 |
|
10 |
== Description ==
|
11 |
|
12 |
+
Generate WooCommerce product feeds for all your marketing channels, such as Google Shopping (merchant center), Facebook Remarketing, Bing Ads, Billiger.de, Pricerunner, Skroutz and many more. Next to custom feeds there are over 100 pre-defined templates included for marketplaces, comparison shopping engines and search engines. This plugin provides high-quality product feed for Google Shopping and many many more.
|
13 |
|
14 |
= Why choose this plugin? =
|
15 |
+
Simply because this is the most complete plugin offering support for an unlimited number of products and feeds, including features such as category- & field-mapping and advanced, rule-based, filtering and product variables support. Next to creating product feeds this plugin also add's the Facebook pixel, Facebook Conversion API (CAPI) and Google Dynamic Remarketing pixel to your website and makes sure they are aligned with your feeds.
|
16 |
|
17 |
= Our mission =
|
18 |
Offer free and advanced, intuitive, tooling and plugins for website owners and marketers to easily set-up and manage their online marketing campaigns.
|
61 |
= Shipping class support =
|
62 |
This plugin enables you to set the shipping zone (and shipping class) so the right shipping cost end up in your product feed. Our plugin uses all shipping zone settings you have configured in WooCommerce (flat rates, classes and free shipping). Our support also supports US and Australian postal codes and regions.
|
63 |
|
64 |
+
= WooCommerce Shipping Table Rate (official WooCommerce) support =
|
65 |
+
Our plugin supports the official shipping table rate plugin of WooCommerce
|
66 |
+
|
67 |
= WooCommerce Shipping Table Rate (Bolder Elements) support =
|
68 |
Our plugin supports the WooCommerce Shipping Table Rate plugin created by Bolder Elements.
|
69 |
|
70 |
= Product variations / Variables =
|
71 |
This plugin supports product variables so all your variations make it to product feeds as individual products too.
|
72 |
|
73 |
+
= Facebook Pixel =
|
74 |
This plugin adds the Facebook pixel code on your websites and makes sure it matches the content of your Facebook catalogue product feed
|
75 |
Our plugin add's the following Facebook pixel events:
|
76 |
* on your product pages, both for simple, variable and variations pages
|
77 |
* on your category pages (ViewCategory event)
|
78 |
* on your search result pages (Search event)
|
79 |
* on your cart page (AddToCart event)
|
80 |
+
* on the checkout page (initiateCheckout event)
|
81 |
+
* on the order thank you page (PurChase event)
|
82 |
+
|
83 |
+
= Facebook Conversion API (CAPI) =
|
84 |
+
This plugin connects to the Facebook Conversion API so all your website conversions are being tracked properly
|
85 |
|
86 |
= Google Dynamic Remarketing Pixel =
|
87 |
This plugin adds the Google Dynamic Remarketing pixel code on your website.
|
118 |
* XML, CSV, TSV and TXT formats;
|
119 |
* Supports WPML (version 4.1 and higher)
|
120 |
* Supports WCML, WooCommerce Multilingual
|
121 |
+
* Supports Aelia Currency Switcher
|
122 |
+
* Supports Polylang
|
123 |
* Intuitive interface;
|
124 |
* Supports product variations / variables;
|
125 |
* Scheduled product feed refreshes: daily, twice-daily or every hour;
|
133 |
* Google Analytics support: add Google Analytics UTM parameters to your product feed and individual products.
|
134 |
* Supports the official Facebook for WooCommerce plugin (SKU_ID parameter)
|
135 |
* Supports Yoasts primary category feature
|
136 |
+
* Supports Rankmaths primary category feature
|
137 |
* Supports the official "WooCommerce Brands" plugin
|
138 |
* Supports Yith brand attributes
|
139 |
* Supports the official "WooCommerce Product Bundles" plugin
|
143 |
* Supports WooCommerce Dynamic Pricing & Discounts from RightPress
|
144 |
* Supports the Discount Rules for WooCommerce plugin from FlyCart
|
145 |
* Supports WC Fields Factory
|
146 |
+
* Supports Table Rate Shipping for WooCommerce from WooCommerce
|
147 |
* Supports Table Rate Shipping for WooCommerce from Bolder Elements
|
148 |
* Supports usage of the All In One SEO pack title and description attributes
|
149 |
+
* Supports the WPC Product Bundles for WooCommerce plugin
|
150 |
|
151 |
Some of the above mentioned feature can only be used by users who upgraded to the Elite version of our plugin
|
152 |
|
153 |
=== Elite paid features ===
|
154 |
+
* WPML / WCML support
|
155 |
* Aelia currency switcher support
|
156 |
* Polylang support
|
157 |
* Addition of the extra fields on your product edit pages
|
158 |
* Data manipulation feature
|
159 |
* WooCommerce structured data bug fix
|
|
|
160 |
|
161 |
=== Channels ===
|
162 |
* Custom feeds
|
168 |
* Google Local Products
|
169 |
* Google Local Products Inventory
|
170 |
* Google Shopping Actions
|
171 |
+
* Facebook Dynamic Ad's / remarketing
|
172 |
* Bing Shopping
|
173 |
+
* Bing Shopping Promotions
|
174 |
* Pinterest
|
175 |
+
* <a href="https://help.vivino.com/s/article/How-do-I-create-my-product-feed-XML?language=en_US" target="_blank">Vivino</a>
|
176 |
* <a href="https://businesshelp.snapchat.com/en-US/a/product-catalog-specs" target="_blank">Snapchat</a>
|
177 |
* <a href="https://yandex.com/support/market-tech-requirements/index.html" target="_blank">Yandex</a>
|
178 |
* ShopMania
|
187 |
* <a href="https://www.beslist.nl" target="_blank" rel="nofollow">Beslist.nl</a>
|
188 |
* <a href="https://www.beslist.be" target="_blank" rel="nofollow">Beslist.be</a>
|
189 |
* <a href="https://www.fashionchick.nl" target="_blank">Fashionchick.nl</a>
|
190 |
+
* <a href="https://www.boetiek.nl" target="_blank">Boetiek.nl</a>
|
191 |
* Bol.com
|
192 |
* Stylight
|
193 |
* Incurvy
|
242 |
* <a href="https://www.guenstiger.de" target="_blank" rel="nofollow">Guenstiger.de</a>
|
243 |
* Hood.de
|
244 |
* Ladenzeile.de
|
245 |
+
* <a href="https://connect.idealo.de/import/en/csv/#_attributes_documentation" target="_blank">Idealo.de</a>
|
246 |
* Livingo.de
|
247 |
* Medizinfuchs.de
|
248 |
* <a href="https://www.moebel.de" target="_blank">Moebel.de</a>
|
263 |
== Installation ==
|
264 |
|
265 |
=== From within Wordpress ===
|
266 |
+
1. Visit Plugins > Add New;
|
267 |
+
1. Search for Product Feed PRO for WooCommerce;
|
268 |
+
1. Activate Product Feed PRO for WooCommerce from your plugins page.
|
269 |
|
270 |
=== Manually ===
|
271 |
1. Upload the woo-product-feed-pro folder to your /wp-content/plugins/ directory;
|
272 |
+
1. Activate Product Feed PRO for WooCommerce from your plugins page.
|
273 |
|
274 |
== Frequently Asked Questions ==
|
275 |
|
336 |
|
337 |
=== Changelog ===
|
338 |
|
339 |
+
= 10.7.9 (2021-10-24) =
|
340 |
+
* Tested for compatibility with WooCommerce 5.8
|
341 |
+
|
342 |
+
= 10.7.8 (2021-10-18) =
|
343 |
+
* Reviews that have no rating or have deeplinks in the review text are now being removed fromn review feeds automatically as they are not allowed by Google
|
344 |
+
|
345 |
+
= 10.7.7 (2021-10-17) =
|
346 |
+
* Added the Region Id attribute for Google Shopping feeds
|
347 |
+
|
348 |
+
= 10.7.5 (2021-10-14) =
|
349 |
+
* Added the Miinto.fr template
|
350 |
+
|
351 |
+
= 10.7.4 (2021-10-13) =
|
352 |
+
* Fixed a division by zero error
|
353 |
+
|
354 |
+
= 10.7.3 (2021-10-12) =
|
355 |
+
* Fixed filters on purchase note array's
|
356 |
+
|
357 |
+
= 10.7.2 (2021-10-12) =
|
358 |
+
* Added support for the WPC Product Bundles for WooCommerce plugin
|
359 |
+
|
360 |
+
= 10.7.1 (2021-10-11) =
|
361 |
+
* Added purchase note attribute
|
362 |
+
|
363 |
+
= 10.7.0 (2021-10-05) =
|
364 |
+
* Made changes to the code to calculate the number of product variations that are on stock as it did not work for some users
|
365 |
+
|
366 |
+
= 10.6.9 (2021-10-01) =
|
367 |
+
* Solved some PHP 8 compatibility issues that caused feeds to get stuck processing
|
368 |
+
|
369 |
+
= 10.6.8 (2021-09-30) =
|
370 |
+
* Solved a Call to undefined method WC_Product_Simple::get_available_variations error
|
371 |
+
|
372 |
+
= 10.6.7 (2021-09-29) =
|
373 |
+
* Made a change to the code so it uses less memory when processing a feed
|
374 |
+
|
375 |
+
= 10.6.6 (2021-09-28) =
|
376 |
+
* Solved an issue where the plugin got stuck when variable products get deleted in WooCommerce during processing of the feed
|
377 |
+
|
378 |
+
= 10.6.5 (2021-09-22) =
|
379 |
+
* Build in an extra check to see if the cron events are active to update feeds. When not this cron event is being created.
|
380 |
+
|
381 |
+
= 10.6.4 (2021-09-14) =
|
382 |
+
* Added capacity attribute to the Google Shopping template
|
383 |
+
|
384 |
+
= 10.6.3 (2021-09-13) =
|
385 |
+
* Added display ads attributes to the Google Shopping template
|
386 |
+
|
387 |
+
= 10.6.2 (2021-09-13) =
|
388 |
+
* Fixed an issue where simple products with variations (which in theory is not possible) caused the feed processing to get stuck
|
389 |
+
|
390 |
+
= 10.6.1 (2021-09-09) =
|
391 |
+
* Solved an undefined array issue when creating a new feed
|
392 |
+
|
393 |
+
= 10.6.0 (2021-09-09) =
|
394 |
+
* Solved an issue with wrong sale prices when WCML was enabled and manual prices were entered
|
395 |
+
|
396 |
+
= 10.5.9 (2021-09-08) =
|
397 |
+
* Somehow simple products got an item_group_id for some users causing a critical error. Added a check on this to fix the error.
|
398 |
+
|
399 |
+
= 10.5.8 (2021-09-07) =
|
400 |
+
* Added a feature to be able to remove products from feeds when only few variations are in stock
|
401 |
+
|
402 |
+
= 10.5.7 (2021-09-07) =
|
403 |
+
* Fixed an issue where Rankmath plugin is installed but no primary category has been set. This resulted in a PHP notice in the logs. This has been solved now.
|
404 |
+
|
405 |
+
= 10.5.6 (2021-09-03) =
|
406 |
+
* Fixed an undefined variable issue for the facebook pixel id
|
407 |
+
|
408 |
+
= 10.5.5 (2021-09-01) =
|
409 |
+
* Fixed a Google Remarketing Pixel issue on the cart page
|
410 |
+
|
411 |
+
= 10.5.4 (2021-09-01) =
|
412 |
+
* Fixed a shipping cost issue where shipping classes that had no shipping costs set where empty
|
413 |
+
* Fixed a Google Remarketing pixel, added apostrophe on the AW-XXXXXX parameter
|
414 |
+
|
415 |
+
= 10.5.3 (2021-08-29) =
|
416 |
+
* Solved a bug: when the XML variable was not an object is returned a fatal error. Issue is solved now.
|
417 |
+
|
418 |
+
= 10.5.2 (2021-08-25) =
|
419 |
+
* Tested for compatibility with WooCommerce 5.6
|
420 |
+
|
421 |
+
= 10.5.1 (2021-08-18) =
|
422 |
+
* Fixed an issue where the visibility attribute did not return anything
|
423 |
+
|
424 |
+
= 10.5.0 (2021-08-11) =
|
425 |
+
* Added the Vivino template to the plugin
|
426 |
+
|
427 |
+
= 10.4.9 (2021-08-10) =
|
428 |
+
* Added support for Prisjakt (Sweden, Norway, Finland) feeds. The Google Shopping feed requirements are being used for it as of this release.
|
429 |
+
|
430 |
+
= 10.4.8 (2021-08-10) =
|
431 |
+
* Added support for the Yoast SEO WooCommerce unique identifiers GTIN's, ISBN, MPN so they can be used for feeds.
|
432 |
+
|
433 |
+
= 10.4.7 (2021-07-28) =
|
434 |
+
* Checked for compatibility with WP 5.8
|
435 |
+
|
436 |
+
= 10.4.6 (2021-07-22) =
|
437 |
+
* Facebook is not yet using the new availability values yet so reverting it back for Facebook only
|
438 |
+
|
439 |
+
= 10.4.5 (2021-07-21) =
|
440 |
+
* Google changed its availability requirements (underscores in the availability values), we have adjusted the plugin on this.
|
441 |
+
|
442 |
+
= 10.4.4 (2021-07-15) =
|
443 |
+
* Fixed a product review feed bug where review names with a : in it broke the feed.
|
444 |
+
|
445 |
+
= 10.4.3 (2021-07-12) =
|
446 |
+
* Added the non tax price attribute for WCML
|
447 |
+
|
448 |
+
= 10.4.2 (2021-07-09) =
|
449 |
+
* Fixed a shipping issue where table rates where put on 0 when pickup was available too.
|
450 |
+
|
451 |
+
= 10.4.1 (2021-07-08) =
|
452 |
+
* Implemented Google's new Dynamic Remarketing event pixelcode and added the Purchase and Add To Cart events for it
|
453 |
+
|
454 |
+
= 10.4.0 (2021-07-03) =
|
455 |
+
* Fixed a PHP notice on a foreach loop when a non-array was used for it
|
456 |
+
|
457 |
+
= 10.3.9 (2021-07-02) =
|
458 |
+
* A PHP warning was thrown when a review feed was created while there were no reviews in WooCommerce
|
459 |
+
|
460 |
+
= 10.3.8 (2021-07-02) =
|
461 |
+
* Fixed a bug: When a find and replace rule was created it converted strings to lowercases, this has been fixed.
|
462 |
+
|
463 |
+
= 10.3.7 (2021-07-01) =
|
464 |
+
* Added Facebook Auto / Vehicle fields to the Facebook templating
|
465 |
+
|
466 |
+
= 10.3.6 (2021-06-30) =
|
467 |
+
* Added eventID's to the Facebook pixel and Facebook Conversion API in order to prevent duplicate events being measured
|
468 |
+
|
469 |
+
= 10.3.5 (2021-06-29) =
|
470 |
+
* Fixed a bug: using a rounding price attribute did not work properly when in WooCommerce currency options the decimal or thousand separator was left blank, it always rounded down. This has been fixed.
|
471 |
+
|
472 |
+
= 10.3.4 (2021-06-28) =
|
473 |
+
* Added the quantity_to_sell_on_facebook field to the Facebook template
|
474 |
+
|
475 |
+
= 10.3.3 (2021-06-25) =
|
476 |
+
* Added a 'Link without parameters' attribute (which holds no attribute or UTM parameters in the URL)
|
477 |
+
|
478 |
+
= 10.3.2 (2021-06-18) =
|
479 |
+
* Added some product data attributes to the Google Shopping template: capacity, count, disclosure date, feature description, flavor, format, product line, product page url, release date, scent, size system, size type, suggested retail price, theme and video link
|
480 |
+
|
481 |
+
= 10.3.1 (2021-06-16) =
|
482 |
+
* Removed Okazii.ro from the list of supported channels
|
483 |
+
|
484 |
+
= 10.3.0 (2021-06-16) =
|
485 |
+
* Cleaning-up some debug code for the Facebook CAPI implementation
|
486 |
+
|
487 |
+
= 10.2.9 (2021-06-15) =
|
488 |
+
* Added support for the Facebook Conversion API (CAPI) - still in beta!
|
489 |
+
* Stripped whitespaces from values in CSV feeds
|
490 |
+
|
491 |
+
= 10.2.8 (2021-06-14) =
|
492 |
+
* Checked for compatibility with WooCommerce 5.4
|
493 |
+
|
494 |
+
= 10.2.7 (2021-06-13) =
|
495 |
+
* Added Adwords grouping, Adwords labels and Adwords redirect fields to the Bing Shopping template
|
496 |
+
|
497 |
+
= 10.2.6 (2021-06-11) =
|
498 |
+
* Added an array check on custom attributes
|
499 |
+
|
500 |
+
= 10.2.5 (2021-06-09) =
|
501 |
+
* When discount plugins are being used prices will be rounded on 2 decimals
|
502 |
+
|
503 |
+
= 10.2.4 (2021-06-09) =
|
504 |
+
* Fixed a CDATA issue
|
505 |
+
|
506 |
+
= 10.2.3 (2021-06-08) =
|
507 |
+
* Added seller name to Google & Bing shopping templates
|
508 |
+
|
509 |
+
= 10.2.2 (2021-06-04) =
|
510 |
+
* Removed an useless nonce
|
511 |
+
|
512 |
+
= 10.2.1 (2021-06-04) =
|
513 |
+
* Added XSS vulnerability checks on both the Google Remarketing pixel and Facebook pixel feature.
|
514 |
+
|
515 |
+
= 10.2.0 (2021-06-02) =
|
516 |
+
* Removed a CSS z-index as it conflicted with Jetpack
|
517 |
+
|
518 |
+
= 10.1.9 (2021-06-01) =
|
519 |
+
* Fixed a PHP notice that showed when users created an empty rule
|
520 |
+
|
521 |
+
= 10.1.8 (2021-05-31) =
|
522 |
+
* When the identifier exists field mapping is removed from the field mapping also remove it from the feed
|
523 |
+
* Some minor textual changes in the feed configuration forms
|
524 |
+
|
525 |
+
= 10.1.7 (2021-05-27) =
|
526 |
+
* Fixed a bug: The Facebook pixel addToCart, initiateCheckout and Purchase event does not accept comma's in prices. Fixed.
|
527 |
+
|
528 |
+
= 10.1.6 (2021-05-27) =
|
529 |
+
* Fixed a bug: The Facebook pixel viewContent event does not accept comma's in prices. Fixed.
|
530 |
+
|
531 |
+
= 10.1.5 (2021-05-24) =
|
532 |
+
* Fixed a bug: exclude filters on regular prices did not work
|
533 |
+
|
534 |
+
= 10.1.4 (2021-05-24) =
|
535 |
+
* Adding CDATA feature so CDATA can be added to the title, description and short description fields
|
536 |
+
|
537 |
+
= 10.1.3 (2021-05-24) =
|
538 |
+
* Fixed an issue with taxes being added in the system sale prices
|
539 |
+
|
540 |
+
= 10.1.2 (2021-05-14) =
|
541 |
+
* Added the product type field mapping as default mapping for Google Shopping feeds
|
542 |
+
|
543 |
+
= 10.1.1 (2021-05-12) =
|
544 |
+
* Added support for Mix and Match minimum and maximum prices
|
545 |
+
* Removed the item_group_id for Mix and Match products
|
546 |
+
|
547 |
+
= 10.1.0 (2021-05-12) =
|
548 |
+
* Tested for compatibility with WooCommerce 5.3
|
549 |
+
* Changed UI when saving new plugin batch size so it shows the correct batch number immediatly
|
550 |
+
|
551 |
+
= 10.0.9 (2021-05-04) =
|
552 |
+
* Added extra fields for Google's local storefront shopping feeds
|
553 |
+
|
554 |
+
= 10.0.8 (2021-04-28) =
|
555 |
+
* Fixed an issue with the image field for custom feeds, it was added as image_link. This has been fixed now.
|
556 |
+
|
557 |
+
= 10.0.7 (2021-04-27) =
|
558 |
+
* Added support for ACF image fields (make sure to use image or bild in your field name)
|
559 |
+
|
560 |
+
= 10.0.6 (2021-04-27) =
|
561 |
+
* Added support for the WooCommerce Shipping & Tax plugin
|
562 |
+
|
563 |
+
= 10.0.5 (2021-04-21) =
|
564 |
+
* Added the "pickup today / merchant hosted local storefront" fields for Google Shopping
|
565 |
+
|
566 |
+
= 10.0.4 (2021-04-19) =
|
567 |
+
* Fixed an issue where shipping costs where missing from feeds
|
568 |
+
* Lowest shipping costs did not return the lowest price when prices where not numeric. This has been fixed now.
|
569 |
+
|
570 |
+
= 10.0.3 (2021-04-19) =
|
571 |
+
* When variations are out of stock we remove them from the parent product for Skroutz feeds
|
572 |
+
|
573 |
+
= 10.0.2 (2021-04-18) =
|
574 |
+
* Fixed a bug: rules that where set on attributes that were empty accidently added values to the product data. This has been fixed now.
|
575 |
+
|
576 |
+
= 10.0.1 (2021-04-16) =
|
577 |
+
* Fixed a bug: the multiple standard tax rates are now also taken into account for shipping costs
|
578 |
+
|
579 |
+
= 10.0.0 (2021-04-15) =
|
580 |
+
* Fixed a bug: when multiple standard tax rates for multiple countries where configured the plugin did not pick the correct tax rate when a feed was configured for a country other then the base country. This has been fixed now.
|
581 |
+
|
582 |
+
= 9.9.9 (2021-04-12) =
|
583 |
+
* Added a "force clean-up" feature that in one go removes all feed configurations and scheduled jobs
|
584 |
+
|
585 |
+
= 9.9.8 (2021-04-12) =
|
586 |
+
* Added support for non numeric characters in the AW Dynamic tracking ID
|
587 |
+
|
588 |
+
= 9.9.7 (2021-04-11) =
|
589 |
+
* Fixed helptexts and notifications
|
590 |
+
|
591 |
+
= 9.9.6 (2021-04-08) =
|
592 |
+
* Added support for the Rankmath primary category
|
593 |
+
|
594 |
+
= 9.9.5 (2021-04-08) =
|
595 |
+
* Fixed an issue with the product_url field for Google review feeds. The & charcater was shown as AND. Issue fixed now.
|
596 |
+
|
597 |
+
= 9.9.4 (2021-03-30) =
|
598 |
+
* Added lowest shipping costs attribute
|
599 |
+
|
600 |
+
= 9.9.3 (2021-03-29) =
|
601 |
+
* Removed currency from shipping costs of Heureka feeds
|
602 |
+
|
603 |
+
= 9.9.2 (2021-03-27) =
|
604 |
+
* Fixed an issue for the shipping table rate plugin, when multiple where configured only one price made it to the feed. Issue is fixed.
|
605 |
+
|
606 |
+
= 9.9.1 (2021-03-25) =
|
607 |
+
* Added support for the official WooCommerce Table Rate plugin (by WooCommerce)
|
608 |
+
|
609 |
+
= 9.9.0 (2021-03-24) =
|
610 |
+
* Added product type field mapping to the Facebook template
|
611 |
+
* Change the default field mapping for title to "product name parent product" so grouping on variable products works better in Facebook
|
612 |
+
|
613 |
+
= 9.8.9 (2021-03-22) =
|
614 |
+
* Fixed a Table Rate shipping issue that overwrote shipping costs for Flat Rates.
|
615 |
+
|
616 |
+
= 9.8.8 (2021-03-22) =
|
617 |
+
* Fixed an UI issue with filters and rules, apostrofs were not showing. Issue is fixed now.
|
618 |
+
|
619 |
+
= 9.8.7 (2021-03-22) =
|
620 |
+
* Bundle and composite products should not get an item group ID in the feed, removed it from the feed.
|
621 |
+
|
622 |
+
= 9.8.6 (2021-03-19) =
|
623 |
+
* Fixed an issue where shipping tax was not added for WooCommerce table rate shipping costs
|
624 |
+
|
625 |
+
= 9.8.5 (2021-03-18) =
|
626 |
+
* Affiliate / external product types got an item_group_id of 0 in the feed whereas it should be empty. Issue is fixed now.
|
627 |
+
|
628 |
+
= 9.8.4 (2021-03-18) =
|
629 |
+
* Added the Idealo.de Germany template, including their Direktkauf fields
|
630 |
+
|
631 |
+
= 9.8.3 (2021-03-15) =
|
632 |
+
* Solved a rounding issue for sale prices including VAT
|
633 |
+
|
634 |
+
= 9.8.2 (2021-03-15) =
|
635 |
+
* Fixed a Facebook Purchase event where only the value of the last product was added to the Facebook pixel instead of the value of all products bought
|
636 |
+
|
637 |
+
= 9.8.1 (2021-03-13) =
|
638 |
+
* The plugin systems check showed a critical error for users that are on PHP 8. Issue is fixed now.
|
639 |
+
|
640 |
+
= 9.8.0 (2021-03-11) =
|
641 |
+
* Only reviews that are approved make it to the review feeds, disapproved reviews are removed
|
642 |
+
|
643 |
+
= 9.7.9 (2021-03-10) =
|
644 |
+
* Checked for compatibility with WordPress 5.7
|
645 |
+
* Checked for compatibility with WooCommerce 5.1
|
646 |
+
|
647 |
+
= 9.7.8 (2021-03-10) =
|
648 |
+
* Added a boolean check on the review feed creation
|
649 |
+
|
650 |
+
= 9.7.7 (2021-03-09) =
|
651 |
+
* Removed the woosea_add_cart.js from the source as it was an empty file
|
652 |
+
|
653 |
+
= 9.7.6 (2021-03-08) =
|
654 |
+
* Fixed an issue with the Facebook Purchase event that did not track the order value correct
|
655 |
+
|
656 |
+
= 9.7.5 (2021-03-07) =
|
657 |
+
* Another recode of the lowest price variation feature
|
658 |
+
|
659 |
+
= 9.7.4 (2021-03-05) =
|
660 |
+
* Added Bing Shopping Promotions template
|
661 |
+
|
662 |
+
= 9.7.3 (2021-03-04) =
|
663 |
+
* Added a new attribute "Stock Status WooCommerce"
|
664 |
+
* Fixed another quote issue with the Facebook pixel
|
665 |
+
|
666 |
+
= 9.7.2 (2021-03-03) =
|
667 |
+
* Fixed an issue with the Facebook pixel. Product names that had an apostrophe in them were not measured.
|
668 |
+
|
669 |
+
= 9.7.1 (2021-03-03) =
|
670 |
+
* Added another fix to take into account prices excluding VAT for filtering out all but the minimum priced variation
|
671 |
+
|
672 |
+
= 9.7.0 (2021-03-03) =
|
673 |
+
* Fixed a bug where lowest priced variations where not making it to feeds
|
674 |
+
|
675 |
+
= 9.6.9 (2021-02-28) =
|
676 |
+
* Added product name parent hyphen attribute
|
677 |
+
|
678 |
+
= 9.6.8 (2021-02-25) =
|
679 |
+
* Added Google category taxonomy mapping for Snapchat feeds
|
680 |
+
|
681 |
+
= 9.6.7 (2021-02-25) =
|
682 |
+
* When suffixes and prefixes are used for the Heureka URL fields spaces are removed
|
683 |
+
|
684 |
+
= 9.6.6 (2021-02-24) =
|
685 |
+
* Added support for PHP 8.0
|
686 |
+
|
687 |
+
= 9.6.5 (2021-02-24) =
|
688 |
+
* Do not add Skroutz variable products to the feed when they do not have item_group_id's
|
689 |
+
|
690 |
+
= 9.6.4 (2021-02-24) =
|
691 |
+
* Fixed an issue with rules and filters
|
692 |
+
* When a rule was set on an image link, no longer lowercase the image link
|
693 |
+
|
694 |
+
= 9.6.3 (2021-02-23) =
|
695 |
+
* Fixed a bug, the Facebook pixel is now also measuing revenue for multiple items in Cart, InititiateCheckout and Purchase events
|
696 |
+
* Reverted back some changes in filters and rules
|
697 |
+
|
698 |
+
= 9.6.2 (2021-02-22) =
|
699 |
+
* For Skroutz feed removing sizes from feeds when they are out-of-stock
|
700 |
+
|
701 |
+
= 9.6.1 (2021-02-19) =
|
702 |
+
* Added attribute that will allow you to uppercase every first character of a string in product names
|
703 |
+
|
704 |
+
= 9.6.0 (2021-02-19) =
|
705 |
+
* Changed g:itemid to g:id for the Google Local Product Feeds
|
706 |
+
|
707 |
+
= 9.5.9 (2021-02-19) =
|
708 |
+
* Added a fail-safe when users do not select a marketing channel which let to PHP notices in logs
|
709 |
+
|
710 |
+
= 9.5.8 (2021-02-18) =
|
711 |
+
* Added shipping class name attribute
|
712 |
+
|
713 |
+
= 9.5.7 (2021-02-17) =
|
714 |
+
* Dynamic attribute values are now also added to parent variable products for Skroutz feeds
|
715 |
+
|
716 |
+
= 9.5.6 (2021-02-17) =
|
717 |
+
* Changed attribute name primary category to Yoast primary category as it caused lots of confussion
|
718 |
+
|
719 |
+
= 9.5.5 (2021-02-11) =
|
720 |
+
* Fixed a PHP notice that showed when creating a new rule
|
721 |
+
* Tested for compatibility with WooCommerce 5.0
|
722 |
+
|
723 |
+
= 9.5.4 (2021-02-09) =
|
724 |
+
* When free shipping zones are removed do not remove the other shipping zones
|
725 |
+
|
726 |
+
= 9.5.3 (2021-02-08) =
|
727 |
+
* Added a feature to remove free shipping zones from Google and Facebook feeds
|
728 |
+
|
729 |
+
= 9.5.2 (2021-02-08) =
|
730 |
+
* Fixed a minor issue in exclude rules for WooCommerce category names
|
731 |
+
|
732 |
+
= 9.5.1 (2021-02-02) =
|
733 |
+
* Dynamic attributes without values that are used for product details should be skipped which not always happened. This is fixed now.
|
734 |
+
|
735 |
+
= 9.5.0 (2021-02-01) =
|
736 |
+
* Discount rules created with the FlyCart plugin did not make it to Skroutz feeds. This has been solved now
|
737 |
+
|
738 |
+
= 9.4.9 (2021-01-31) =
|
739 |
+
* Added a seperate sale price attribute for bundled products
|
740 |
+
* Reviews for parent variable products are removed, the reviews are attached to its variations
|
741 |
+
|
742 |
+
= 9.4.8 (2021-01-30) =
|
743 |
+
* Fixed an issue with the ecomm_prodid on the cart page
|
744 |
+
|
745 |
+
= 9.4.7 (2021-01-29) =
|
746 |
+
* Solved an issue that shipping costs to the first product in a custom feed where empty
|
747 |
+
|
748 |
+
= 9.4.6 (2021-01-28) =
|
749 |
+
* Added a new attribute: product description parent product
|
750 |
+
|
751 |
+
= 9.4.5 (2021-01-28) =
|
752 |
+
* Added a Google Shopping field to their template: g:ship_from_country
|
753 |
+
* Stripping & characters from review names as it breaks the review feeds
|
754 |
+
|
755 |
+
= 9.4.4 (2021-01-27) =
|
756 |
+
* Fixed an issue where reviews without review text caused the feed to be disapproved by Google. We now remove reviews from feeds that have no review texts.
|
757 |
+
|
758 |
+
= 9.4.3 (2021-01-27) =
|
759 |
+
* Fixed an issue with an undefined ecomm_price variable on product variable pages
|
760 |
+
|
761 |
+
= 9.4.2 (2021-01-26) =
|
762 |
+
* Added the Dutch Boetiek.nl template
|
763 |
+
|
764 |
+
= 9.4.1 (2021-01-19) =
|
765 |
+
* Fixed a bug: exclude filters on empty product tags were broken. This is fixed now.
|
766 |
+
|
767 |
+
= 9.4.0 (2021-01-14) =
|
768 |
+
* Added a WP-cron check and notifications
|
769 |
+
|
770 |
+
= 9.3.9 (2021-01-14) =
|
771 |
+
* Bestprice.gr apparel products are now grouped by color
|
772 |
+
|
773 |
+
= 9.3.8 (2021-01-13) =
|
774 |
+
* Tested for compatibility with WooCommerce 4.9
|
775 |
+
|
776 |
= 9.3.7 (2021-01-12) =
|
777 |
* Added the Bestprice.gr template
|
778 |
|
3439 |
|
3440 |
== Upgrade Notice ==
|
3441 |
|
3442 |
+
= 10.7.9 =
|
3443 |
+
Tested for compatibility with WooCommerce 5.8
|
3444 |
+
|
3445 |
+
= 10.7.8 =
|
3446 |
+
Reviews that have no rating or have deeplinks in the review text are now being removed fromn review feeds automatically as they are not allowed by Google
|
3447 |
+
|
3448 |
+
= 10.7.7 =
|
3449 |
+
Added the Region Id attribute for Google Shopping feeds
|
3450 |
+
|
3451 |
+
= 10.7.5 =
|
3452 |
+
Added the Miinto.fr template
|
3453 |
+
|
3454 |
+
= 10.7.4 =
|
3455 |
+
Fixed a division by zero error
|
3456 |
+
|
3457 |
+
= 10.7.3 =
|
3458 |
+
Fixed filters on purchase note array's
|
3459 |
+
|
3460 |
+
= 10.7.2 =
|
3461 |
+
Added support for the WPC Product Bundles for WooCommerce plugin
|
3462 |
+
|
3463 |
+
= 10.7.1 =
|
3464 |
+
Added purchase note attribute
|
3465 |
+
|
3466 |
+
= 10.7.0 =
|
3467 |
+
Made changes to the code to calculate the number of product variations that are on stock as it did not work for some users
|
3468 |
+
|
3469 |
+
= 10.6.9 =
|
3470 |
+
Solved some PHP 8 compatibility issues that caused feeds to get stuck processing
|
3471 |
+
|
3472 |
+
= 10.6.8 =
|
3473 |
+
Solved a Call to undefined method WC_Product_Simple::get_available_variations error
|
3474 |
+
|
3475 |
+
= 10.6.7 =
|
3476 |
+
Made a change to the code so it uses less memory when processing a feed
|
3477 |
+
|
3478 |
+
= 10.6.6 =
|
3479 |
+
Solved an issue where the plugin got stuck when variable products get deleted in WooCommerce during processing of the feed
|
3480 |
+
|
3481 |
+
= 10.6.5 =
|
3482 |
+
Build in an extra check to see if the cron events are active to update feeds. When not this cron event is being created.
|
3483 |
+
|
3484 |
+
= 10.6.4 =
|
3485 |
+
Added capacity attribute to the Google Shopping template
|
3486 |
+
|
3487 |
+
= 10.6.3 =
|
3488 |
+
Added display ads attributes to the Google Shopping template
|
3489 |
+
|
3490 |
+
= 10.6.2 =
|
3491 |
+
Fixed an issue where simple products with variations (which in theory is not possible) caused the feed processing to get stuck
|
3492 |
+
|
3493 |
+
= 10.6.1 =
|
3494 |
+
Solved an undefined array issue when creating a new feed
|
3495 |
+
|
3496 |
+
= 10.6.0 =
|
3497 |
+
Solved an issue with wrong sale prices when WCML was enabled and manual prices were entered
|
3498 |
+
|
3499 |
+
= 10.5.9 =
|
3500 |
+
Somehow simple products got an item_group_id for some users causing a critical error. Added a check on this to fix the error.
|
3501 |
+
|
3502 |
+
= 10.5.8 =
|
3503 |
+
Added a feature to be able to remove products from feeds when only few variations are in stock
|
3504 |
+
|
3505 |
+
= 10.5.7 =
|
3506 |
+
Fixed an issue where Rankmath plugin is installed but no primary category has been set. This resulted in a PHP notice in the logs. This has been solved now.
|
3507 |
+
|
3508 |
+
= 10.5.6 =
|
3509 |
+
Fixed an undefined variable issue for the facebook pixel id
|
3510 |
+
|
3511 |
+
= 10.5.5 =
|
3512 |
+
Fixed a Google Remarketing Pixel issue on the cart page
|
3513 |
+
|
3514 |
+
= 10.5.4 =
|
3515 |
+
Fixed a shipping cost issue where shipping classes that had no shipping costs set where empty
|
3516 |
+
Fixed a Google Remarketing pixel, added apostrophe on the AW-XXXXXX parameter
|
3517 |
+
|
3518 |
+
= 10.5.3 =
|
3519 |
+
Solved a bug: when the XML variable was not an object is returned a fatal error. Issue is solved now.
|
3520 |
+
|
3521 |
+
= 10.5.2 =
|
3522 |
+
Tested for compatibility with WooCommerce 5.6
|
3523 |
+
|
3524 |
+
= 10.5.1 =
|
3525 |
+
Fixed an issue where the visibility attribute did not return anything
|
3526 |
+
|
3527 |
+
= 10.5.0 =
|
3528 |
+
Added the Vivino template to the plugin
|
3529 |
+
|
3530 |
+
= 10.4.9 =
|
3531 |
+
Added support for Prisjakt (Sweden, Norway, Finland) feeds. The Google Shopping feed requirements are being used for it as of this release.
|
3532 |
+
|
3533 |
+
= 10.4.8 =
|
3534 |
+
Added support for the Yoast SEO WooCommerce unique identifiers GTIN's, ISBN, MPN so they can be used for feeds.
|
3535 |
+
|
3536 |
+
= 10.4.7 =
|
3537 |
+
Checked for compatibility with WP 5.8
|
3538 |
+
|
3539 |
+
= 10.4.6 =
|
3540 |
+
Reverting back the availability changes for Facebook only
|
3541 |
+
|
3542 |
+
= 10.4.5 =
|
3543 |
+
Google changed its availability requirements (underscores in the availability values), we have adjusted the plugin on this.
|
3544 |
+
|
3545 |
+
= 10.4.4 =
|
3546 |
+
Fixed a product review feed bug where review names with a : in it broke the feed.
|
3547 |
+
|
3548 |
+
= 10.4.3 =
|
3549 |
+
Added the non tax price attribute for WCML
|
3550 |
+
|
3551 |
+
= 10.4.2 =
|
3552 |
+
Fixed a shipping issue where table rates where put on 0 when pickup was available too.
|
3553 |
+
|
3554 |
+
= 10.4.1 =
|
3555 |
+
Implemented Google's new Dynamic Remarketing event pixelcode and added the Purchase and Add To Cart events for it
|
3556 |
+
|
3557 |
+
= 10.4.0 =
|
3558 |
+
Fixed a PHP notice on a foreach loop when a non-array was used for it
|
3559 |
+
|
3560 |
+
= 10.3.9 =
|
3561 |
+
A PHP warning was thrown when a review feed was created while there were no reviews in WooCommerce
|
3562 |
+
|
3563 |
+
= 10.3.8 =
|
3564 |
+
Fixed a bug: When a find and replace rule was created it converted strings to lowercases, this has been fixed.
|
3565 |
+
|
3566 |
+
= 10.3.7 =
|
3567 |
+
Added Facebook Auto / Vehicle fields to the Facebook templating
|
3568 |
+
|
3569 |
+
= 10.3.6 =
|
3570 |
+
Added eventID's to the Facebook pixel and Facebook Conversion API in order to prevent duplicate events being measured
|
3571 |
+
|
3572 |
+
= 10.3.5 =
|
3573 |
+
Fixed a bug: using a rounding price attribute did not work properly when in WooCommerce currency options the decimal or thousand separator was left blank, it always rounded down. This has been fixed.
|
3574 |
+
|
3575 |
+
= 10.3.4 =
|
3576 |
+
Added the quantity_to_sell_on_facebook field to the Facebook template
|
3577 |
+
|
3578 |
+
= 10.3.3 =
|
3579 |
+
Added a 'Link without parameters' attribute (which holds no attribute or UTM parameters in the URL)
|
3580 |
+
|
3581 |
+
= 10.3.2 =
|
3582 |
+
Added some product data attributes to the Google Shopping template: capacity, count, disclosure date, feature description, flavor, format, product line, product pag
|
3583 |
+
e url, release date, scent, size system, size type, suggested retail price, theme and video link
|
3584 |
+
|
3585 |
+
= 10.3.1 =
|
3586 |
+
Removed Okazii.ro from the list of supported channels
|
3587 |
+
|
3588 |
+
= 10.3.0 =
|
3589 |
+
Cleaning-up some debug code for the Facebook CAPI implementation
|
3590 |
+
|
3591 |
+
= 10.2.9 =
|
3592 |
+
Added support for the Facebook Conversion API (CAPI) - still in beta!
|
3593 |
+
Stripped whitespaces from values in CSV feeds
|
3594 |
+
|
3595 |
+
= 10.2.8 =
|
3596 |
+
Checked for compatibility with WooCommerce 5.4
|
3597 |
+
|
3598 |
+
= 10.2.7 =
|
3599 |
+
Added Adwords grouping, Adwords labels and Adwords redirect fields to the Bing Shopping template
|
3600 |
+
|
3601 |
+
= 10.2.6 =
|
3602 |
+
Added an array check on custom attributes
|
3603 |
+
|
3604 |
+
= 10.2.5 =
|
3605 |
+
When discount plugins are being used prices will be rounded on 2 decimals
|
3606 |
+
|
3607 |
+
= 10.2.4 =
|
3608 |
+
Fixed a CDATA issue
|
3609 |
+
|
3610 |
+
= 10.2.3 =
|
3611 |
+
Added seller name to Google & Bing shopping templates
|
3612 |
+
|
3613 |
+
= 10.2.2 =
|
3614 |
+
Removed an useless nonce
|
3615 |
+
|
3616 |
+
= 10.2.1 =
|
3617 |
+
Added XSS vulnerability checks on both the Google Remarketing pixel and Facebook pixel feature.
|
3618 |
+
|
3619 |
+
= 10.2.0 =
|
3620 |
+
Removed a CSS z-index as it conflicted with Jetpack
|
3621 |
+
|
3622 |
+
= 10.1.9 =
|
3623 |
+
Fixed a PHP notice that showed when users created an empty rule
|
3624 |
+
|
3625 |
+
= 10.1.8 =
|
3626 |
+
When the identifier exists field mapping is removed from the field mapping also remove it from the feed
|
3627 |
+
Some minor textual changes in the feed configuration forms
|
3628 |
+
|
3629 |
+
= 10.1.7 =
|
3630 |
+
Fixed a bug: The Facebook pixel addToCart, initiateCheckout and Purchase event does not accept comma's in prices. Fixed.
|
3631 |
+
|
3632 |
+
= 10.1.6 =
|
3633 |
+
Fixed a bug: The Facebook pixel viewContent event does not accept comma's in prices. Fixed.
|
3634 |
+
|
3635 |
+
= 10.1.5 =
|
3636 |
+
Fixed a bug: exclude filters on regular prices did not work
|
3637 |
+
|
3638 |
+
= 10.1.4 =
|
3639 |
+
Adding CDATA feature so CDATA can be added to the title, description and short description fields
|
3640 |
+
|
3641 |
+
= 10.1.3 =
|
3642 |
+
Fixed an issue with taxes being added in the system sale prices
|
3643 |
+
|
3644 |
+
= 10.1.2 =
|
3645 |
+
Added the product type field mapping as default mapping for Google Shopping feeds
|
3646 |
+
|
3647 |
+
= 10.1.1 =
|
3648 |
+
Added support for Mix and Match minimum and maximum prices
|
3649 |
+
Removed the item_group_id for Mix and Match products
|
3650 |
+
|
3651 |
+
= 10.1.0 =
|
3652 |
+
Tested for compatibility with WooCommerce 5.3
|
3653 |
+
Changed UI when saving new plugin batch size so it shows the correct batch number immediatly
|
3654 |
+
|
3655 |
+
= 10.0.9 =
|
3656 |
+
Added extra fields for Google's local storefront shopping feeds
|
3657 |
+
|
3658 |
+
= 10.0.8 =
|
3659 |
+
Fixed an issue with the image field for custom feeds, it was added as image_link. This has been fixed now.
|
3660 |
+
|
3661 |
+
= 10.0.7 =
|
3662 |
+
Added support for ACF image fields (make sure to use image or bild in your field name)
|
3663 |
+
|
3664 |
+
= 10.0.6 =
|
3665 |
+
Added support for the WooCommerce Shipping & Tax plugin
|
3666 |
+
|
3667 |
+
= 10.0.5 =
|
3668 |
+
Added the "pickup today / merchant hosted local storefront" fields for Google Shopping
|
3669 |
+
|
3670 |
+
= 10.0.4 =
|
3671 |
+
Fixed an issue where shipping costs where missing from feeds
|
3672 |
+
Lowest shipping costs did not return the lowest price when prices where not numeric. This has been fixed now.
|
3673 |
+
|
3674 |
+
= 10.0.3 =
|
3675 |
+
When variations are out of stock we remove them from the parent product for Skroutz feeds
|
3676 |
+
|
3677 |
+
= 10.0.2 =
|
3678 |
+
Fixed a bug: rules that where set on attributes that were empty accidently added values to the product data. This has been fixed now.
|
3679 |
+
|
3680 |
+
= 10.0.1 =
|
3681 |
+
Fixed a bug: the multiple standard tax rates are now also taken into account for shipping costs
|
3682 |
+
|
3683 |
+
= 10.0.0 =
|
3684 |
+
Fixed a bug: when multiple standard tax rates for multiple countries where configured the plugin did not pick the correct tax rate when a feed was configured for a country other then the base country. This has been fixed now.
|
3685 |
+
|
3686 |
+
= 9.9.9 =
|
3687 |
+
Added a "force clean-up" feature that in one go removes all feed configurations and scheduled jobs
|
3688 |
+
|
3689 |
+
= 9.9.8 =
|
3690 |
+
Added support for non numeric characters in the AW Dynamic tracking ID
|
3691 |
+
|
3692 |
+
= 9.9.7 =
|
3693 |
+
Fixed helptexts and notifications
|
3694 |
+
|
3695 |
+
= 9.9.6 =
|
3696 |
+
Added support for the Rankmath primary category
|
3697 |
+
|
3698 |
+
= 9.9.5 =
|
3699 |
+
Fixed an issue with the product_url field for Google review feeds. The & charcater was shown as AND. Issue fixed now.
|
3700 |
+
|
3701 |
+
= 9.9.4 =
|
3702 |
+
Added lowest shipping costs attribute
|
3703 |
+
|
3704 |
+
= 9.9.3 =
|
3705 |
+
Removed currency from shipping costs of Heureka feeds
|
3706 |
+
|
3707 |
+
= 9.9.2 =
|
3708 |
+
Fixed an issue for the shipping table rate plugin, when multiple where configured only one price made it to the feed. Issue is fixed.
|
3709 |
+
|
3710 |
+
= 9.9.1 =
|
3711 |
+
Added support for the official WooCommerce Table Rate plugin (by WooCommerce)
|
3712 |
+
|
3713 |
+
= 9.9.0 =
|
3714 |
+
Added product type field mapping to the Facebook template
|
3715 |
+
Change the default field mapping for title to "product name parent product" so grouping on variable products works better in Facebook
|
3716 |
+
|
3717 |
+
= 9.8.9 =
|
3718 |
+
Fixed a Table Rate shipping issue that overwrote shipping costs for Flat Rates.
|
3719 |
+
|
3720 |
+
= 9.8.8 =
|
3721 |
+
Fixed an UI issue with filters and rules, apostrofs were not showing. Issue is fixed now.
|
3722 |
+
|
3723 |
+
= 9.8.7 =
|
3724 |
+
Bundle and composite products should not get an item group ID in the feed, removed it from the feed.
|
3725 |
+
|
3726 |
+
= 9.8.6 =
|
3727 |
+
Fixed an issue where shipping tax was not added for WooCommerce table rate shipping costs
|
3728 |
+
|
3729 |
+
= 9.8.5 =
|
3730 |
+
Affiliate / external product types got an item_group_id of 0 in the feed whereas it should be empty. Issue is fixed now.
|
3731 |
+
|
3732 |
+
= 9.8.4 =
|
3733 |
+
Added the Idealo.de Germany template, including their Direktkauf fields
|
3734 |
+
|
3735 |
+
= 9.8.3 =
|
3736 |
+
Solved a rounding issue for sale prices including VAT
|
3737 |
+
|
3738 |
+
= 9.8.2 =
|
3739 |
+
Fixed a Facebook Purchase event where only the value of the last product was added to the Facebook pixel instead of the value of all products bought
|
3740 |
+
|
3741 |
+
= 9.8.1 =
|
3742 |
+
The plugin systems check showed a critical error for users that are on PHP 8. Issue is fixed now.
|
3743 |
+
|
3744 |
+
= 9.8.0 =
|
3745 |
+
Only reviews that are approved make it to the review feeds, disapproved reviews are removed
|
3746 |
+
|
3747 |
+
= 9.7.9 =
|
3748 |
+
Checked for compatibility with WordPress 5.7
|
3749 |
+
Checked for compatibility with WooCommerce 5.1.0
|
3750 |
+
|
3751 |
+
= 9.7.8 =
|
3752 |
+
Added a boolean check on the review feed creation
|
3753 |
+
|
3754 |
+
= 9.7.7 =
|
3755 |
+
Removed the woosea_add_cart.js from the source as it was an empty file
|
3756 |
+
|
3757 |
+
= 9.7.6 =
|
3758 |
+
Fixed an issue with the Facebook Purchase event that did not track the order value correct
|
3759 |
+
|
3760 |
+
= 9.7.5 =
|
3761 |
+
Another recode of the lowest price variation feature
|
3762 |
+
|
3763 |
+
= 9.7.4 =
|
3764 |
+
Added Bing Shopping Promotions template
|
3765 |
+
|
3766 |
+
= 9.7.3 =
|
3767 |
+
Added a new attribute "Stock Status WooCommerce"
|
3768 |
+
Fixed another quote issue with the Facebook pixel
|
3769 |
+
|
3770 |
+
= 9.7.2 =
|
3771 |
+
Fixed an issue with the Facebook pixel. Product names that had an apostrophe in them were not measured.
|
3772 |
+
|
3773 |
+
= 9.7.1 =
|
3774 |
+
Added another fix to take into account prices excluding VAT for filtering out all but the minimum priced variation
|
3775 |
+
|
3776 |
+
= 9.7.0 =
|
3777 |
+
Fixed a bug where lowest priced variations where not making it to feeds
|
3778 |
+
|
3779 |
+
= 9.6.9 =
|
3780 |
+
Added product name parent hyphen attribute
|
3781 |
+
|
3782 |
+
= 9.6.8 =
|
3783 |
+
Added Google category taxonomy mapping for Snapchat feeds
|
3784 |
+
|
3785 |
+
= 9.6.7 =
|
3786 |
+
When suffixes and prefixes are used for the Heureka URL fields spaces are removed
|
3787 |
+
|
3788 |
+
= 9.6.6 =
|
3789 |
+
Added support for PHP 8.0
|
3790 |
+
|
3791 |
+
= 9.6.5 =
|
3792 |
+
Do not add Skroutz variable products to the feed when they do not have item_group_id's
|
3793 |
+
|
3794 |
+
= 9.6.4 =
|
3795 |
+
Fixed an issue with rules and filters
|
3796 |
+
When a rule was set on an image link, no longer lowercase the image link
|
3797 |
+
|
3798 |
+
= 9.6.3 =
|
3799 |
+
Fixed a bug, the Facebook pixel is now also measuing revenue for multiple items in Cart, InititiateCheckout and Purchase events
|
3800 |
+
Reverted back some changes in filters and rules
|
3801 |
+
|
3802 |
+
= 9.6.2 =
|
3803 |
+
For Skroutz feed removing sizes from feeds when they are out-of-stock
|
3804 |
+
|
3805 |
+
= 9.6.1 =
|
3806 |
+
Added attribute that will allow you to uppercase every first character of a string in product names
|
3807 |
+
|
3808 |
+
= 9.6.0 =
|
3809 |
+
Changed g:itemid to g:id for the Google Local Product Feeds
|
3810 |
+
|
3811 |
+
= 9.5.9 =
|
3812 |
+
* Added a fail-safe when users do not select a marketing channel which let to PHP notices in logs
|
3813 |
+
|
3814 |
+
= 9.5.8 =
|
3815 |
+
Added shipping class name attribute
|
3816 |
+
|
3817 |
+
= 9.5.7 =
|
3818 |
+
Dynamic attribute values are now also added to parent variable products for Skroutz feeds
|
3819 |
+
|
3820 |
+
= 9.5.6 =
|
3821 |
+
Changed attribute name primary category to Yoast primary category as it caused lots of confussion
|
3822 |
+
|
3823 |
+
= 9.5.5 =
|
3824 |
+
Fixed a PHP notice that showed when creating a new rule
|
3825 |
+
Tested for compatibility with WooCommerce 5.0
|
3826 |
+
|
3827 |
+
= 9.5.4 =
|
3828 |
+
When free shipping zones are removed do not remove the other shipping zones
|
3829 |
+
|
3830 |
+
= 9.5.3 =
|
3831 |
+
Added a feature to remove free shipping zones from Google and Facebook feeds
|
3832 |
+
|
3833 |
+
= 9.5.2 =
|
3834 |
+
Fixed a minor issue in exclude rules for WooCommerce category names
|
3835 |
+
|
3836 |
+
= 9.5.1 =
|
3837 |
+
Dynamic attributes without values that are used for product details should be skipped which not always happened. This is fixed now.
|
3838 |
+
|
3839 |
+
= 9.5.0 =
|
3840 |
+
Discount rules created with the FlyCart plugin did not make it to Skroutz feeds. This has been solved now
|
3841 |
+
|
3842 |
+
= 9.4.9 =
|
3843 |
+
Added a seperate sale price attribute for bundled products
|
3844 |
+
Reviews for parent variable products are removed, the reviews are attached to its variations
|
3845 |
+
|
3846 |
+
= 9.4.8 =
|
3847 |
+
Fixed an issue with the ecomm_prodid on the cart page
|
3848 |
+
|
3849 |
+
= 9.4.7 =
|
3850 |
+
Solved an issue that shipping costs to the first product in a custom feed where empty
|
3851 |
+
|
3852 |
+
= 9.4.6 =
|
3853 |
+
Added a new attribute: product description parent product
|
3854 |
+
|
3855 |
+
= 9.4.5 =
|
3856 |
+
Added a Google Shopping field to their template: g:ship_from_country
|
3857 |
+
Stripping & characters from review names as it breaks the review feeds
|
3858 |
+
|
3859 |
+
= 9.4.4 =
|
3860 |
+
Fixed an issue where reviews without review text caused the feed to be disapproved by Google. We now remove reviews from feeds that have no review texts.
|
3861 |
+
|
3862 |
+
= 9.4.3 =
|
3863 |
+
Fixed an issue with an undefined ecomm_price variable on product variable pages
|
3864 |
+
|
3865 |
+
= 9.4.2 =
|
3866 |
+
Added the Dutch Boetiek.nl template
|
3867 |
+
|
3868 |
+
= 9.4.1 =
|
3869 |
+
Fixed a bug: exclude filters on empty product tags were broken. This is fixed now.
|
3870 |
+
|
3871 |
+
= 9.4.0 =
|
3872 |
+
Added a WP-cron check and notifications
|
3873 |
+
|
3874 |
+
= 9.3.9 =
|
3875 |
+
Bestprice.gr apparel products are now grouped by color
|
3876 |
+
|
3877 |
+
= 9.3.8 =
|
3878 |
+
Tested for compatibility with WooCommerce 4.9
|
3879 |
+
|
3880 |
= 9.3.7 =
|
3881 |
Added the Bestprice.gr template
|
3882 |
|
woocommerce-sea.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Product Feed PRO for WooCommerce
|
4 |
-
* Version:
|
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
|
@@ -11,13 +11,13 @@
|
|
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.
|
15 |
*
|
16 |
* Text Domain: woo-product-feed-pro
|
17 |
* Domain Path: /languages
|
18 |
*
|
19 |
* WC requires at least: 4.4
|
20 |
-
* WC tested up to:
|
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
|
@@ -48,7 +48,7 @@ if (!defined('ABSPATH')) {
|
|
48 |
* Plugin versionnumber, please do not override.
|
49 |
* Define some constants
|
50 |
*/
|
51 |
-
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '
|
52 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
|
53 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
|
54 |
|
@@ -101,7 +101,8 @@ function woosea_scripts($hook) {
|
|
101 |
wp_enqueue_script('jquery-ui-datepicker');
|
102 |
|
103 |
// Only register and enqueue JS scripts from within the plugin itself
|
104 |
-
|
|
|
105 |
// JS files for ChartJS
|
106 |
wp_register_script( 'woosea_chart-bundle-js', plugin_dir_url( __FILE__ ) . 'js/Chart.bundle.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
107 |
wp_enqueue_script( 'woosea_chart-bundle-js' );
|
@@ -115,7 +116,7 @@ function woosea_scripts($hook) {
|
|
115 |
wp_enqueue_script( 'typeahead-js' );
|
116 |
|
117 |
// JS for adding input field validation
|
118 |
-
wp_register_script( 'woosea_validation-js', plugin_dir_url( __FILE__ ) . 'js/woosea_validation.js
|
119 |
wp_enqueue_script( 'woosea_validation-js' );
|
120 |
|
121 |
// JS for autocomplete
|
@@ -123,7 +124,7 @@ function woosea_scripts($hook) {
|
|
123 |
wp_enqueue_script( 'woosea_autocomplete-js' );
|
124 |
|
125 |
// JS for adding table rows to the rules page
|
126 |
-
wp_register_script( 'woosea_rules-js', plugin_dir_url( __FILE__ ) . 'js/woosea_rules.js
|
127 |
wp_enqueue_script( 'woosea_rules-js' );
|
128 |
|
129 |
// JS for adding table rows to the field mappings page
|
@@ -138,13 +139,27 @@ function woosea_scripts($hook) {
|
|
138 |
wp_register_script( 'woosea_key-js', plugin_dir_url( __FILE__ ) . 'js/woosea_key.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
139 |
wp_enqueue_script( 'woosea_key-js' );
|
140 |
|
|
|
|
|
|
|
141 |
}
|
142 |
// JS for manage projects page
|
143 |
-
wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
144 |
wp_enqueue_script( 'woosea_manage-js' );
|
145 |
}
|
146 |
add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
/**
|
149 |
* Get product variation ID based on dropdown selects product page
|
150 |
*/
|
@@ -279,7 +294,7 @@ add_filter('plugin_action_links', 'woosea_plugin_action_links', 10, 2);
|
|
279 |
/**
|
280 |
* Get category path for Facebook pixel
|
281 |
*/
|
282 |
-
function woosea_get_term_parents( $id, $taxonomy, $link = false, $
|
283 |
// Only add Home to the beginning of the chain when we start buildin the chain
|
284 |
if(empty($visited)){
|
285 |
$chain = 'Home';
|
@@ -302,7 +317,7 @@ function woosea_get_term_parents( $id, $taxonomy, $link = false, $project_taxono
|
|
302 |
|
303 |
if ($parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited, TRUE )){
|
304 |
$visited[] = $parent->parent;
|
305 |
-
$chain .= woosea_get_term_parents( $parent->parent, $taxonomy, $
|
306 |
}
|
307 |
|
308 |
if ($link){
|
@@ -314,7 +329,6 @@ function woosea_get_term_parents( $id, $taxonomy, $link = false, $project_taxono
|
|
314 |
return $chain;
|
315 |
}
|
316 |
|
317 |
-
|
318 |
/**
|
319 |
* Add Facebook pixel
|
320 |
*/
|
@@ -324,17 +338,40 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
324 |
}
|
325 |
$fb_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
|
326 |
$add_facebook_pixel = get_option ('add_facebook_pixel');
|
|
|
|
|
|
|
327 |
$currency = get_woocommerce_currency();
|
328 |
-
|
329 |
if($add_facebook_pixel == "yes"){
|
330 |
$facebook_pixel_id = get_option("woosea_facebook_pixel_id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
|
332 |
-
if($facebook_pixel_id > 0){
|
333 |
if ($fb_pagetype == "product"){
|
334 |
if ( '' !== $product->get_price()) {
|
335 |
|
336 |
$fb_prodid = get_the_id();
|
337 |
$product_name = $product->get_name();
|
|
|
|
|
|
|
338 |
$cats = "";
|
339 |
$all_cats = get_the_terms( $fb_prodid, 'product_cat' );
|
340 |
if(!empty($all_cats)){
|
@@ -345,9 +382,10 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
345 |
// strip last comma
|
346 |
$cats = rtrim($cats, ",");
|
347 |
$cats = str_replace("&","&", $cats);
|
|
|
|
|
348 |
|
349 |
if(!empty($fb_prodid)){
|
350 |
-
|
351 |
if(!$product) {
|
352 |
return -1;
|
353 |
}
|
@@ -384,7 +422,17 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
384 |
$fb_price = $fb_lowprice;
|
385 |
}
|
386 |
}
|
387 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
388 |
} else {
|
389 |
// This is a parent variable product
|
390 |
// Since these are not allowed in the feed, at the variations product ID's
|
@@ -415,12 +463,32 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
415 |
$fb_highprice = wc_format_localized_price( $highest );
|
416 |
$fb_price = $fb_lowprice;
|
417 |
}
|
418 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
419 |
}
|
420 |
} else {
|
421 |
// This is a simple product page
|
422 |
-
|
423 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
}
|
425 |
}
|
426 |
}
|
@@ -433,8 +501,8 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
433 |
$order = wc_get_order( $order_id );
|
434 |
$order_items = $order->get_items();
|
435 |
$currency = get_woocommerce_currency();
|
436 |
-
$order_real = 0;
|
437 |
$contents = "";
|
|
|
438 |
|
439 |
if ( !is_wp_error( $order_items )) {
|
440 |
foreach( $order_items as $item_id => $order_item) {
|
@@ -443,26 +511,33 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
443 |
if($variation_id > 0){
|
444 |
$prod_id = $variation_id;
|
445 |
}
|
446 |
-
|
447 |
$prod_quantity = $order_item->get_quantity();
|
448 |
-
$order_real = wc_format_localized_price( $order_item->get_total() );
|
449 |
-
|
450 |
-
// $order_subtotal = number_format(($order_item->get_subtotal()),2, '.', '');
|
451 |
-
// $order_subtotal_tax= number_format(($order_item->get_subtotal_tax()),2, '.', '');
|
452 |
-
// $order_real = number_format(($order_subtotal+$order_subtotal_tax+$order_real),2,',','');
|
453 |
$contents .= "{'id': '$prod_id', 'quantity': $prod_quantity},";
|
454 |
}
|
455 |
}
|
456 |
$contents = rtrim($contents, ",");
|
457 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
458 |
}
|
459 |
} else {
|
460 |
// This is on the cart page itself
|
461 |
$currency = get_woocommerce_currency();
|
462 |
$cart_items = WC()->cart->get_cart();
|
|
|
|
|
463 |
$cart_real = 0;
|
464 |
$contents = "";
|
465 |
|
|
|
|
|
|
|
466 |
$checkoutpage = wc_get_checkout_url();
|
467 |
$current_url = get_permalink(get_the_ID());
|
468 |
|
@@ -470,6 +545,8 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
470 |
if( !is_wp_error( $cart_items )) {
|
471 |
foreach( $cart_items as $cart_id => $cart_item) {
|
472 |
$prod_id = $cart_item['product_id'];
|
|
|
|
|
473 |
if($cart_item['variation_id'] > 0){
|
474 |
$prod_id = $cart_item['variation_id'];
|
475 |
}
|
@@ -477,20 +554,31 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
477 |
//$contents .= "$prod_id,";
|
478 |
|
479 |
$cart_real = wc_format_localized_price( $cart_item['line_total'] );
|
480 |
-
|
481 |
-
// $line_total = number_format(($cart_item['line_total']),2, '.','');
|
482 |
-
// $line_tax = number_format(($cart_item['line_tax']),2, '.','');
|
483 |
-
// $cart_real = number_format($cart_real,2, '.','');
|
484 |
-
// $cart_real = number_format(($line_total+$line_tax+$cart_real),2,',','');
|
485 |
}
|
486 |
$contents = rtrim($contents, ",");
|
487 |
|
488 |
// User is on the billing pages
|
489 |
if($checkoutpage == $current_url){
|
490 |
-
$viewContent = "fbq(\"track\",\"InitiateCheckout\",{currency:\"$currency\", value:\"$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
} else {
|
492 |
// User is on the basket page
|
493 |
-
$viewContent = "fbq(\"track\",\"AddToCart\",{currency:\"$currency\", value:\"$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
494 |
}
|
495 |
}
|
496 |
}
|
@@ -523,8 +611,14 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
523 |
}
|
524 |
$fb_prodid = rtrim($fb_prodid, ",");
|
525 |
$category_name = $term->name;
|
526 |
-
$category_path = woosea_get_term_parents( $term->term_id, 'product_cat', $
|
527 |
-
$viewContent = "fbq(\"track\",\"ViewCategory\",{content_category
|
|
|
|
|
|
|
|
|
|
|
|
|
528 |
} elseif ($fb_pagetype == "searchresults"){
|
529 |
$term = get_queried_object();
|
530 |
$search_string = sanitize_text_field($_GET['s']);
|
@@ -553,9 +647,15 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
553 |
}
|
554 |
}
|
555 |
$fb_prodid = rtrim($fb_prodid, ",");
|
556 |
-
$viewContent = "fbq(\"trackCustom\",\"Search\",{search_string:\"$search_string\", content_type:\"product\", content_ids:\"[
|
|
|
|
|
|
|
|
|
|
|
557 |
} else {
|
558 |
// This is another page than a product page
|
|
|
559 |
$viewContent = "";
|
560 |
}
|
561 |
?>
|
@@ -574,7 +674,8 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
574 |
t.src=v;s=b.getElementsByTagName(e)[0];
|
575 |
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
576 |
'https://connect.facebook.net/en_US/fbevents.js');
|
577 |
-
|
|
|
578 |
fbq("track", "PageView");
|
579 |
<?php
|
580 |
if(strlen($viewContent) > 2){
|
@@ -583,10 +684,42 @@ function woosea_add_facebook_pixel( $product = null ){
|
|
583 |
?>
|
584 |
</script>
|
585 |
<noscript>
|
586 |
-
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=<?php
|
587 |
</noscript>
|
588 |
<!-- End Facebook Pixel Code -->
|
589 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
}
|
591 |
}
|
592 |
}
|
@@ -601,11 +734,26 @@ function woosea_add_remarketing_tags( $product = null ){
|
|
601 |
}
|
602 |
$ecomm_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
|
603 |
$add_remarketing = get_option ('add_remarketing');
|
604 |
-
|
605 |
if($add_remarketing == "yes"){
|
606 |
$adwords_conversion_id = get_option("woosea_adwords_conversion_id");
|
|
|
|
|
|
|
|
|
607 |
|
608 |
if($adwords_conversion_id > 0){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
609 |
if ($ecomm_pagetype == "product"){
|
610 |
if ( '' !== $product->get_price()) {
|
611 |
$ecomm_prodid = get_the_id();
|
@@ -622,7 +770,7 @@ function woosea_add_remarketing_tags( $product = null ){
|
|
622 |
// In that case we need to put in the AggregateOffer structured data
|
623 |
$variation_id = woosea_find_matching_product_variation( $product, $_GET );
|
624 |
$nr_get = count($_GET);
|
625 |
-
|
626 |
if($nr_get > 0){
|
627 |
$variable_product = wc_get_product($variation_id);
|
628 |
|
@@ -659,7 +807,9 @@ function woosea_add_remarketing_tags( $product = null ){
|
|
659 |
$ecomm_price = wc_format_decimal( $lowest, wc_get_price_decimals());
|
660 |
} else {
|
661 |
$ecomm_lowprice = wc_format_decimal( $lowest, wc_get_price_decimals() );
|
662 |
-
|
|
|
|
|
663 |
}
|
664 |
}
|
665 |
} else {
|
@@ -667,58 +817,83 @@ function woosea_add_remarketing_tags( $product = null ){
|
|
667 |
}
|
668 |
}
|
669 |
?>
|
670 |
-
<script
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
|
|
|
|
|
|
676 |
</script>
|
677 |
-
|
678 |
<?php
|
679 |
}
|
680 |
} elseif ($ecomm_pagetype == "cart"){
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
722 |
}
|
723 |
}
|
724 |
}
|
@@ -804,6 +979,7 @@ function woosea_request_review(){
|
|
804 |
}
|
805 |
add_action('admin_notices', 'woosea_request_review');
|
806 |
|
|
|
807 |
/**
|
808 |
* Create a seperate MySql table for saving conversion information
|
809 |
*/
|
@@ -928,11 +1104,19 @@ function woosea_categories_dropdown() {
|
|
928 |
}
|
929 |
add_action( 'wp_ajax_woosea_categories_dropdown', 'woosea_categories_dropdown' );
|
930 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
931 |
/**
|
932 |
* Save Google Dynamic Remarketing Conversion Tracking ID
|
933 |
*/
|
934 |
function woosea_save_adwords_conversion_id() {
|
935 |
$adwords_conversion_id = sanitize_text_field($_POST['adwords_conversion_id']);
|
|
|
936 |
update_option("woosea_adwords_conversion_id", $adwords_conversion_id);
|
937 |
}
|
938 |
add_action( 'wp_ajax_woosea_save_adwords_conversion_id', 'woosea_save_adwords_conversion_id' );
|
@@ -951,10 +1135,21 @@ add_action( 'wp_ajax_woosea_save_batch_size', 'woosea_save_batch_size' );
|
|
951 |
*/
|
952 |
function woosea_save_facebook_pixel_id() {
|
953 |
$facebook_pixel_id = sanitize_text_field($_POST['facebook_pixel_id']);
|
|
|
954 |
update_option("woosea_facebook_pixel_id", $facebook_pixel_id);
|
955 |
}
|
956 |
add_action( 'wp_ajax_woosea_save_facebook_pixel_id', 'woosea_save_facebook_pixel_id' );
|
957 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
958 |
/**
|
959 |
* Mass map categories to the correct Google Shopping category taxonomy
|
960 |
*/
|
@@ -2285,6 +2480,21 @@ function woosea_local_pickup_shipping (){
|
|
2285 |
}
|
2286 |
add_action( 'wp_ajax_woosea_local_pickup_shipping', 'woosea_local_pickup_shipping' );
|
2287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2288 |
/**
|
2289 |
* This function enables the setting to use
|
2290 |
* logging
|
@@ -2301,20 +2511,59 @@ function woosea_add_woosea_logging (){
|
|
2301 |
add_action( 'wp_ajax_woosea_add_woosea_logging', 'woosea_add_woosea_logging' );
|
2302 |
|
2303 |
/**
|
2304 |
-
* This function enables the setting to add
|
2305 |
-
* the Faceook pixel
|
2306 |
*/
|
2307 |
-
function
|
2308 |
$status = sanitize_text_field($_POST['status']);
|
2309 |
|
2310 |
if ($status == "off"){
|
2311 |
-
update_option( '
|
2312 |
} else {
|
2313 |
-
update_option( '
|
2314 |
}
|
2315 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2316 |
add_action( 'wp_ajax_woosea_add_facebook_pixel_setting', 'woosea_add_facebook_pixel_setting' );
|
2317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2318 |
/**
|
2319 |
* This function saves the value that needs to be used in the Facebook pixel content_ids parameter
|
2320 |
*/
|
@@ -2334,13 +2583,18 @@ add_action( 'wp_ajax_woosea_facebook_content_ids', 'woosea_facebook_content_ids'
|
|
2334 |
* Google's Dynamic Remarketing
|
2335 |
*/
|
2336 |
function woosea_add_remarketing (){
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
|
|
|
|
|
|
|
|
|
|
2344 |
}
|
2345 |
add_action( 'wp_ajax_woosea_add_remarketing', 'woosea_add_remarketing' );
|
2346 |
|
@@ -2351,10 +2605,14 @@ add_action( 'wp_ajax_woosea_add_remarketing', 'woosea_add_remarketing' );
|
|
2351 |
function woosea_add_batch (){
|
2352 |
$status = sanitize_text_field($_POST['status']);
|
2353 |
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
|
|
|
|
|
|
|
|
2358 |
}
|
2359 |
}
|
2360 |
add_action( 'wp_ajax_woosea_add_batch', 'woosea_add_batch' );
|
@@ -4618,13 +4876,16 @@ function woosea_blog_widgets() {
|
|
4618 |
|
4619 |
add_meta_box('woosea_rss_dashboard_widget', __('Latest Product Feed Pro Tutorials', 'rc_mdm'), 'woosea_my_rss_box','dashboard','side','high');
|
4620 |
}
|
4621 |
-
add_action('wp_dashboard_setup', 'woosea_blog_widgets');
|
4622 |
|
4623 |
/**
|
4624 |
* Creates the RSS metabox
|
4625 |
*/
|
|
|
|
|
|
|
|
|
4626 |
function woosea_my_rss_box() {
|
4627 |
-
|
4628 |
// Get RSS Feed(s)
|
4629 |
include_once(ABSPATH . WPINC . '/feed.php');
|
4630 |
$domain = $_SERVER['HTTP_HOST'];
|
@@ -4633,6 +4894,8 @@ function woosea_my_rss_box() {
|
|
4633 |
$my_feeds = array(
|
4634 |
'https://www.adtribes.io/feed/'
|
4635 |
);
|
|
|
|
|
4636 |
|
4637 |
// Loop through Feeds
|
4638 |
foreach ( $my_feeds as $feed) :
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Product Feed PRO for WooCommerce
|
4 |
+
* Version: 10.7.9
|
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
|
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.8
|
15 |
*
|
16 |
* Text Domain: woo-product-feed-pro
|
17 |
* Domain Path: /languages
|
18 |
*
|
19 |
* WC requires at least: 4.4
|
20 |
+
* WC tested up to: 5.8
|
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
|
48 |
* Plugin versionnumber, please do not override.
|
49 |
* Define some constants
|
50 |
*/
|
51 |
+
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '10.7.9' );
|
52 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
|
53 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
|
54 |
|
101 |
wp_enqueue_script('jquery-ui-datepicker');
|
102 |
|
103 |
// Only register and enqueue JS scripts from within the plugin itself
|
104 |
+
if (preg_match("/product-feed-pro/i",$hook)){
|
105 |
+
|
106 |
// JS files for ChartJS
|
107 |
wp_register_script( 'woosea_chart-bundle-js', plugin_dir_url( __FILE__ ) . 'js/Chart.bundle.js', WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
108 |
wp_enqueue_script( 'woosea_chart-bundle-js' );
|
116 |
wp_enqueue_script( 'typeahead-js' );
|
117 |
|
118 |
// JS for adding input field validation
|
119 |
+
wp_register_script( 'woosea_validation-js', plugin_dir_url( __FILE__ ) . 'js/woosea_validation.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
120 |
wp_enqueue_script( 'woosea_validation-js' );
|
121 |
|
122 |
// JS for autocomplete
|
124 |
wp_enqueue_script( 'woosea_autocomplete-js' );
|
125 |
|
126 |
// JS for adding table rows to the rules page
|
127 |
+
wp_register_script( 'woosea_rules-js', plugin_dir_url( __FILE__ ) . 'js/woosea_rules.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
128 |
wp_enqueue_script( 'woosea_rules-js' );
|
129 |
|
130 |
// JS for adding table rows to the field mappings page
|
139 |
wp_register_script( 'woosea_key-js', plugin_dir_url( __FILE__ ) . 'js/woosea_key.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
140 |
wp_enqueue_script( 'woosea_key-js' );
|
141 |
|
142 |
+
// JS for managing addToCart event
|
143 |
+
// wp_register_script( 'woosea_addcart-js', plugin_dir_url( __FILE__ ) . 'js/woosea_add_cart.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
144 |
+
// wp_enqueue_script( 'woosea_addcart-js' );
|
145 |
}
|
146 |
// JS for manage projects page
|
147 |
+
wp_register_script( 'woosea_manage-js', plugin_dir_url( __FILE__ ) . 'js/woosea_manage.js?yo=12', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
148 |
wp_enqueue_script( 'woosea_manage-js' );
|
149 |
}
|
150 |
add_action( 'admin_enqueue_scripts' , 'woosea_scripts' );
|
151 |
|
152 |
+
/**
|
153 |
+
* Enqueue front end scripts
|
154 |
+
*/
|
155 |
+
function woosea_fe_scripts($hook) {
|
156 |
+
// JS for managing addToCart event
|
157 |
+
wp_enqueue_script( 'ajax-script', get_template_directory_uri() . 'js/my-ajax-script.js', array('jquery') );
|
158 |
+
wp_register_script( 'woosea_addcart-js', plugin_dir_url( __FILE__ ) . 'js/woosea_add_cart.js', '',WOOCOMMERCESEA_PLUGIN_VERSION, true );
|
159 |
+
wp_enqueue_script( 'woosea_addcart-js' );
|
160 |
+
}
|
161 |
+
//add_action('wp_enqueue_scripts', 'woosea_fe_scripts');
|
162 |
+
|
163 |
/**
|
164 |
* Get product variation ID based on dropdown selects product page
|
165 |
*/
|
294 |
/**
|
295 |
* Get category path for Facebook pixel
|
296 |
*/
|
297 |
+
function woosea_get_term_parents( $id, $taxonomy, $project_taxonomy, $link = false, $nicename = false, $visited = array() ) {
|
298 |
// Only add Home to the beginning of the chain when we start buildin the chain
|
299 |
if(empty($visited)){
|
300 |
$chain = 'Home';
|
317 |
|
318 |
if ($parent->parent && ( $parent->parent != $parent->term_id ) && !in_array( $parent->parent, $visited, TRUE )){
|
319 |
$visited[] = $parent->parent;
|
320 |
+
$chain .= woosea_get_term_parents( $parent->parent, $taxonomy, $separator, $link = false, $nicename, $visited );
|
321 |
}
|
322 |
|
323 |
if ($link){
|
329 |
return $chain;
|
330 |
}
|
331 |
|
|
|
332 |
/**
|
333 |
* Add Facebook pixel
|
334 |
*/
|
338 |
}
|
339 |
$fb_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
|
340 |
$add_facebook_pixel = get_option ('add_facebook_pixel');
|
341 |
+
$add_facebook_capi = get_option ('add_facebook_capi');
|
342 |
+
$viewContent = "";
|
343 |
+
$event_id = uniqid (rand (),true);
|
344 |
$currency = get_woocommerce_currency();
|
345 |
+
|
346 |
if($add_facebook_pixel == "yes"){
|
347 |
$facebook_pixel_id = get_option("woosea_facebook_pixel_id");
|
348 |
+
$facebook_capi_token = get_option("woosea_facebook_capi_token");
|
349 |
+
|
350 |
+
// Add vulnerability check
|
351 |
+
if(!is_numeric($facebook_pixel_id)){
|
352 |
+
unset($facebook_pixel_id);
|
353 |
+
}
|
354 |
+
|
355 |
+
if(isset($facebook_pixel_id) AND ($facebook_pixel_id > 0)){
|
356 |
+
// Set Facebook conversion API data
|
357 |
+
define('FACEBOOK_APP_ACCESS_TOKEN', $facebook_capi_token);
|
358 |
+
define('FACEBOOK_PIXEL_OFFLINE_EVENT_SET_ID', $facebook_pixel_id);
|
359 |
+
$fb_capi_data["match_keys"] = array();
|
360 |
+
$fb_capi_data["event_time"] = time();
|
361 |
+
$fb_capi_data["event_id"] = $event_id;
|
362 |
+
$fb_capi_data["user_data"]["client_ip_address"] = WC_Geolocation::get_ip_address();
|
363 |
+
$fb_capi_data["user_data"]["client_user_agent"] = $_SERVER['HTTP_USER_AGENT'];
|
364 |
+
$fb_capi_data["action_source"] = "website";
|
365 |
+
$fb_capi_data["event_source_url"] = home_url($_SERVER['REQUEST_URI']);
|
366 |
|
|
|
367 |
if ($fb_pagetype == "product"){
|
368 |
if ( '' !== $product->get_price()) {
|
369 |
|
370 |
$fb_prodid = get_the_id();
|
371 |
$product_name = $product->get_name();
|
372 |
+
$product_name = str_replace("\"","",$product_name);
|
373 |
+
$product_name = str_replace("'","",$product_name);
|
374 |
+
|
375 |
$cats = "";
|
376 |
$all_cats = get_the_terms( $fb_prodid, 'product_cat' );
|
377 |
if(!empty($all_cats)){
|
382 |
// strip last comma
|
383 |
$cats = rtrim($cats, ",");
|
384 |
$cats = str_replace("&","&", $cats);
|
385 |
+
$cats = str_replace("\"","",$cats);
|
386 |
+
$cats = str_replace("'","",$cats);
|
387 |
|
388 |
if(!empty($fb_prodid)){
|
|
|
389 |
if(!$product) {
|
390 |
return -1;
|
391 |
}
|
422 |
$fb_price = $fb_lowprice;
|
423 |
}
|
424 |
}
|
425 |
+
$fb_price = floatval(str_replace(',', '.', str_replace(',', '.', $fb_price)));
|
426 |
+
$viewContent = "fbq(\"track\",\"ViewContent\",{content_category:\"$cats\", content_name:\"$product_name\", content_type:\"product\", content_ids:[\"$fb_prodid\"], value:\"$fb_price\", currency:\"$currency\"},{eventID:\"$event_id\"});";
|
427 |
+
|
428 |
+
// Facebook CAPI data
|
429 |
+
$fb_capi_data["event_name"] = "ViewContent";
|
430 |
+
$fb_capi_data["custom_data"]["content_ids"] = $fb_prodid;
|
431 |
+
$fb_capi_data["custom_data"]["content_name"] = $product_name;
|
432 |
+
$fb_capi_data["custom_data"]["content_category"] = $cats;
|
433 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
434 |
+
$fb_capi_data["custom_data"]["value"] = $fb_price;
|
435 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
436 |
} else {
|
437 |
// This is a parent variable product
|
438 |
// Since these are not allowed in the feed, at the variations product ID's
|
463 |
$fb_highprice = wc_format_localized_price( $highest );
|
464 |
$fb_price = $fb_lowprice;
|
465 |
}
|
466 |
+
$fb_price = floatval(str_replace(',', '.', str_replace(',', '.', $fb_price)));
|
467 |
+
$viewContent = "fbq(\"track\",\"ViewContent\",{content_category:\"$cats\", content_name:\"$product_name\", content_type:\"product_group\", content_ids:[$content], value:\"$fb_price\", currency:\"$currency\"},{eventID:\"$event_id\"});";
|
468 |
+
|
469 |
+
// Facebook CAPI data
|
470 |
+
$fb_capi_data["event_name"] = "ViewContent";
|
471 |
+
$fb_capi_data["custom_data"]["content_ids"] = $fb_prodid;
|
472 |
+
$fb_capi_data["custom_data"]["content_name"] = $product_name;
|
473 |
+
$fb_capi_data["custom_data"]["content_category"] = $cats;
|
474 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
475 |
+
$fb_capi_data["custom_data"]["value"] = $fb_price;
|
476 |
+
$fb_capi_data["custom_data"]["content_type"] = "product_group";
|
477 |
}
|
478 |
} else {
|
479 |
// This is a simple product page
|
480 |
+
$fb_price = wc_format_localized_price( $product->get_price() );
|
481 |
+
$fb_price = floatval(str_replace(',', '.', str_replace(',', '.', $fb_price)));
|
482 |
+
$viewContent = "fbq(\"track\",\"ViewContent\",{content_category:\"$cats\", content_name:\"$product_name\", content_type:\"product\", content_ids:[\"$fb_prodid\"], value:\"$fb_price\", currency:\"$currency\"},{eventID:\"$event_id\"});";
|
483 |
+
|
484 |
+
// Facebook CAPI data
|
485 |
+
$fb_capi_data["event_name"] = "ViewContent";
|
486 |
+
$fb_capi_data["custom_data"]["content_ids"] = $fb_prodid;
|
487 |
+
$fb_capi_data["custom_data"]["content_name"] = $product_name;
|
488 |
+
$fb_capi_data["custom_data"]["content_category"] = $cats;
|
489 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
490 |
+
$fb_capi_data["custom_data"]["value"] = $fb_price;
|
491 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
492 |
}
|
493 |
}
|
494 |
}
|
501 |
$order = wc_get_order( $order_id );
|
502 |
$order_items = $order->get_items();
|
503 |
$currency = get_woocommerce_currency();
|
|
|
504 |
$contents = "";
|
505 |
+
$order_real = wc_format_localized_price($order->get_total());
|
506 |
|
507 |
if ( !is_wp_error( $order_items )) {
|
508 |
foreach( $order_items as $item_id => $order_item) {
|
511 |
if($variation_id > 0){
|
512 |
$prod_id = $variation_id;
|
513 |
}
|
|
|
514 |
$prod_quantity = $order_item->get_quantity();
|
|
|
|
|
|
|
|
|
|
|
515 |
$contents .= "{'id': '$prod_id', 'quantity': $prod_quantity},";
|
516 |
}
|
517 |
}
|
518 |
$contents = rtrim($contents, ",");
|
519 |
+
$order_real = floatval(str_replace(',', '.', str_replace(',', '.', $order_real)));
|
520 |
+
$viewContent = "fbq('track','Purchase',{currency:'$currency', value:'$order_real', content_type:'product', contents:[$contents]},{eventID:\"$event_id\"});";
|
521 |
+
|
522 |
+
// Facebook CAPI data
|
523 |
+
$fb_capi_data["event_name"] = "Purchase";
|
524 |
+
$fb_capi_data["custom_data"]["content_ids"] = $prod_id;
|
525 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
526 |
+
$fb_capi_data["custom_data"]["value"] = $order_real;
|
527 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
528 |
}
|
529 |
} else {
|
530 |
// This is on the cart page itself
|
531 |
$currency = get_woocommerce_currency();
|
532 |
$cart_items = WC()->cart->get_cart();
|
533 |
+
$cart_quantity = count($cart_items);
|
534 |
+
|
535 |
$cart_real = 0;
|
536 |
$contents = "";
|
537 |
|
538 |
+
$cart_total_amount = wc_format_localized_price(WC()->cart->get_cart_contents_total());
|
539 |
+
$cart_total_amount = floatval(str_replace(',', '.', str_replace(',', '.', $cart_total_amount)));
|
540 |
+
|
541 |
$checkoutpage = wc_get_checkout_url();
|
542 |
$current_url = get_permalink(get_the_ID());
|
543 |
|
545 |
if( !is_wp_error( $cart_items )) {
|
546 |
foreach( $cart_items as $cart_id => $cart_item) {
|
547 |
$prod_id = $cart_item['product_id'];
|
548 |
+
$product = $cart_item['data'];
|
549 |
+
$product_name = $product->get_name();
|
550 |
if($cart_item['variation_id'] > 0){
|
551 |
$prod_id = $cart_item['variation_id'];
|
552 |
}
|
554 |
//$contents .= "$prod_id,";
|
555 |
|
556 |
$cart_real = wc_format_localized_price( $cart_item['line_total'] );
|
|
|
|
|
|
|
|
|
|
|
557 |
}
|
558 |
$contents = rtrim($contents, ",");
|
559 |
|
560 |
// User is on the billing pages
|
561 |
if($checkoutpage == $current_url){
|
562 |
+
$viewContent = "fbq(\"track\",\"InitiateCheckout\",{currency:\"$currency\", value:\"$cart_total_amount\", content_type:\"product\", content_ids:[$contents]},{eventID:\"$event_id\"});";
|
563 |
+
|
564 |
+
// Facebook CAPI data
|
565 |
+
$fb_capi_data["event_name"] = "InitiateCheckout";
|
566 |
+
$fb_capi_data["custom_data"]["content_ids"] = $contents;
|
567 |
+
$fb_capi_data["custom_data"]["content_name"] = $product_name;
|
568 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
569 |
+
$fb_capi_data["custom_data"]["value"] = $cart_total_amount;
|
570 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
571 |
} else {
|
572 |
// User is on the basket page
|
573 |
+
$viewContent = "fbq(\"track\",\"AddToCart\",{currency:\"$currency\", value:\"$cart_total_amount\", content_type:\"product\", content_ids:[$contents]},{eventID:\"$event_id\"});";
|
574 |
+
|
575 |
+
// Facebook CAPI data
|
576 |
+
$fb_capi_data["event_name"] = "AddToCart";
|
577 |
+
$fb_capi_data["custom_data"]["content_ids"] = $contents;
|
578 |
+
$fb_capi_data["custom_data"]["content_name"] = $product_name;
|
579 |
+
$fb_capi_data["custom_data"]["currency"] = $currency;
|
580 |
+
$fb_capi_data["custom_data"]["value"] = $cart_total_amount;
|
581 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
582 |
}
|
583 |
}
|
584 |
}
|
611 |
}
|
612 |
$fb_prodid = rtrim($fb_prodid, ",");
|
613 |
$category_name = $term->name;
|
614 |
+
$category_path = woosea_get_term_parents( $term->term_id, 'product_cat', $project_taxonomy = false, $link = false, $nicename = false, $visited = array() );
|
615 |
+
$viewContent = "fbq(\"track\",\"ViewCategory\",{content_category:'$category_path', content_name:'$category_name', content_type:\"product\", content_ids:\"[$fb_prodid]\"},{eventID:\"$event_id\"});";
|
616 |
+
|
617 |
+
// Facebook CAPI data
|
618 |
+
$fb_capi_data["event_name"] = "ViewCategory";
|
619 |
+
$fb_capi_data["custom_data"]["content_ids"] = $ids;
|
620 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
621 |
+
|
622 |
} elseif ($fb_pagetype == "searchresults"){
|
623 |
$term = get_queried_object();
|
624 |
$search_string = sanitize_text_field($_GET['s']);
|
647 |
}
|
648 |
}
|
649 |
$fb_prodid = rtrim($fb_prodid, ",");
|
650 |
+
$viewContent = "fbq(\"trackCustom\",\"Search\",{search_string:\"$search_string\", content_type:\"product\", content_ids:\"[$fb_prodid]\"},{eventID:\"$event_id\"});";
|
651 |
+
|
652 |
+
// Facebook CAPI data
|
653 |
+
$fb_capi_data["event_name"] = "Search";
|
654 |
+
$fb_capi_data["custom_data"]["content_ids"] = $ids;
|
655 |
+
$fb_capi_data["custom_data"]["content_type"] = "product";
|
656 |
} else {
|
657 |
// This is another page than a product page
|
658 |
+
$fb_capi_data["event_name"] = "ViewContent";
|
659 |
$viewContent = "";
|
660 |
}
|
661 |
?>
|
674 |
t.src=v;s=b.getElementsByTagName(e)[0];
|
675 |
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
676 |
'https://connect.facebook.net/en_US/fbevents.js');
|
677 |
+
|
678 |
+
fbq("init", "<?php echo htmlentities($facebook_pixel_id, ENT_QUOTES, 'UTF-8');?>");
|
679 |
fbq("track", "PageView");
|
680 |
<?php
|
681 |
if(strlen($viewContent) > 2){
|
684 |
?>
|
685 |
</script>
|
686 |
<noscript>
|
687 |
+
<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=<?php echo htmlentities($facebook_pixel_id, ENT_QUOTES, 'UTF-8');;?>&ev=PageView&noscript=1&eid=<?php print"$event_id";?>"/>
|
688 |
</noscript>
|
689 |
<!-- End Facebook Pixel Code -->
|
690 |
<?php
|
691 |
+
|
692 |
+
// POST data to Facebook Conversion API
|
693 |
+
if(($add_facebook_capi == "yes") AND (!empty($facebook_capi_token))){
|
694 |
+
// Turn Data to JSON
|
695 |
+
$data_json = json_encode(array($fb_capi_data));
|
696 |
+
|
697 |
+
// Fill available fields
|
698 |
+
$fields = array();
|
699 |
+
$fields['access_token'] = FACEBOOK_APP_ACCESS_TOKEN;
|
700 |
+
$fields['upload_tag'] = $fb_capi_data["event_name"] . '-' . time(); // You should set a tag here (feel free to adjust)
|
701 |
+
$fields['data'] = $data_json;
|
702 |
+
$url = 'https://graph.facebook.com/v11.0/' . FACEBOOK_PIXEL_OFFLINE_EVENT_SET_ID . '/events';
|
703 |
+
$curl = curl_init($url);
|
704 |
+
|
705 |
+
curl_setopt_array($curl, array(
|
706 |
+
// Replace with your offline_event_set_id
|
707 |
+
CURLOPT_URL => 'https://graph.facebook.com/v11.0/' . FACEBOOK_PIXEL_OFFLINE_EVENT_SET_ID . '/events',
|
708 |
+
CURLOPT_RETURNTRANSFER => true,
|
709 |
+
CURLOPT_ENCODING => "",
|
710 |
+
CURLOPT_MAXREDIRS => 10,
|
711 |
+
CURLOPT_TIMEOUT => 30,
|
712 |
+
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
713 |
+
CURLOPT_CUSTOMREQUEST => "POST",
|
714 |
+
CURLOPT_POSTFIELDS => http_build_query($fields),
|
715 |
+
CURLOPT_HTTPHEADER => array(
|
716 |
+
"cache-control: no-cache",
|
717 |
+
//"content-type: multipart/form-data",
|
718 |
+
"Accept: application/json" ),
|
719 |
+
));
|
720 |
+
$response = curl_exec($curl);
|
721 |
+
curl_close($curl);
|
722 |
+
}
|
723 |
}
|
724 |
}
|
725 |
}
|
734 |
}
|
735 |
$ecomm_pagetype = WooSEA_Google_Remarketing::woosea_google_remarketing_pagetype();
|
736 |
$add_remarketing = get_option ('add_remarketing');
|
737 |
+
|
738 |
if($add_remarketing == "yes"){
|
739 |
$adwords_conversion_id = get_option("woosea_adwords_conversion_id");
|
740 |
+
// Add vulnerability check, unset when no proper comversion ID was inserted
|
741 |
+
if(!is_numeric($adwords_conversion_id)){
|
742 |
+
unset($adwords_conversion_id);
|
743 |
+
}
|
744 |
|
745 |
if($adwords_conversion_id > 0){
|
746 |
+
?>
|
747 |
+
<!-- Global site tag (gtag.js) - Google Ads: <?php echo htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?> - Added by the Product Feed Pro plugin from AdTribes.io -->
|
748 |
+
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-<?php echo htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?>"></script>
|
749 |
+
<script>
|
750 |
+
window.dataLayer = window.dataLayer || [];
|
751 |
+
function gtag(){dataLayer.push(arguments);}
|
752 |
+
gtag('js', new Date());
|
753 |
+
|
754 |
+
gtag('config', '<?php echo 'AW-'.htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?>');
|
755 |
+
</script>
|
756 |
+
<?php
|
757 |
if ($ecomm_pagetype == "product"){
|
758 |
if ( '' !== $product->get_price()) {
|
759 |
$ecomm_prodid = get_the_id();
|
770 |
// In that case we need to put in the AggregateOffer structured data
|
771 |
$variation_id = woosea_find_matching_product_variation( $product, $_GET );
|
772 |
$nr_get = count($_GET);
|
773 |
+
|
774 |
if($nr_get > 0){
|
775 |
$variable_product = wc_get_product($variation_id);
|
776 |
|
807 |
$ecomm_price = wc_format_decimal( $lowest, wc_get_price_decimals());
|
808 |
} else {
|
809 |
$ecomm_lowprice = wc_format_decimal( $lowest, wc_get_price_decimals() );
|
810 |
+
$ecomm_highprice = wc_format_decimal( $highest, wc_get_price_decimals() );
|
811 |
+
$ecomm_price = $ecomm_lowprice;
|
812 |
+
|
813 |
}
|
814 |
}
|
815 |
} else {
|
817 |
}
|
818 |
}
|
819 |
?>
|
820 |
+
<script>
|
821 |
+
gtag('event', 'view_item', {
|
822 |
+
'send_to' : '<?php echo 'AW-'.htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?>',
|
823 |
+
'value' : <?php print "$ecomm_price";?>,
|
824 |
+
'items' : [{
|
825 |
+
'id': <?php print "$ecomm_prodid";?>,
|
826 |
+
'google_business_vertical': 'retail'
|
827 |
+
}]
|
828 |
+
});
|
829 |
</script>
|
|
|
830 |
<?php
|
831 |
}
|
832 |
} elseif ($ecomm_pagetype == "cart"){
|
833 |
+
// This is on the order thank you page
|
834 |
+
if( isset( $_GET['key'] ) && is_wc_endpoint_url( 'order-received' ) ) {
|
835 |
+
$order_string = sanitize_text_field($_GET['key']);
|
836 |
+
if(!empty($order_string)){
|
837 |
+
$order_id = wc_get_order_id_by_order_key( $order_string );
|
838 |
+
$order = wc_get_order( $order_id );
|
839 |
+
$order_items = $order->get_items();
|
840 |
+
$currency = get_woocommerce_currency();
|
841 |
+
$contents = "";
|
842 |
+
$order_real = wc_format_localized_price($order->get_total());
|
843 |
+
|
844 |
+
if ( !is_wp_error( $order_items )) {
|
845 |
+
foreach( $order_items as $item_id => $order_item) {
|
846 |
+
$prod_id = $order_item->get_product_id();
|
847 |
+
$variation_id = $order_item->get_variation_id();
|
848 |
+
if($variation_id > 0){
|
849 |
+
$prod_id = $variation_id;
|
850 |
+
}
|
851 |
+
$prod_quantity = $order_item->get_quantity();
|
852 |
+
}
|
853 |
+
}
|
854 |
+
$order_real = floatval(str_replace(',', '.', str_replace(',', '.', $order_real)));
|
855 |
+
?>
|
856 |
+
<script>
|
857 |
+
gtag('event', 'purchase', {
|
858 |
+
'send_to' : '<?php echo 'AW-'.htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?>',
|
859 |
+
'value' : <?php print "$order_real";?>,
|
860 |
+
'items' : [{
|
861 |
+
'id': <?php print "$prod_id";?>,
|
862 |
+
'google_business_vertical': 'retail'
|
863 |
+
}]
|
864 |
+
});
|
865 |
+
</script>
|
866 |
+
<?php
|
867 |
+
}
|
868 |
+
} else {
|
869 |
+
// This is on the cart page, no purchase yet
|
870 |
+
// Get the first product from cart and use that product ID
|
871 |
+
foreach( WC()->cart->get_cart() as $cart_item ){
|
872 |
+
$ecomm_prodid = $cart_item['product_id'];
|
873 |
+
break;
|
874 |
+
}
|
875 |
+
|
876 |
+
if($ecomm_prodid > 0){
|
877 |
+
$currency = get_woocommerce_currency();
|
878 |
+
$cart_items = WC()->cart->get_cart();
|
879 |
+
$cart_quantity = count($cart_items);
|
880 |
+
$cart_total_amount = wc_format_localized_price(WC()->cart->get_cart_contents_total()+WC()->cart->tax_total);
|
881 |
+
$cart_total_amount = floatval(str_replace(',', '.', str_replace(',', '.', $cart_total_amount)));
|
882 |
+
?>
|
883 |
+
<script>
|
884 |
+
gtag('event', 'add_to_cart', {
|
885 |
+
'send_to' : '<?php echo 'AW-'.htmlentities($adwords_conversion_id, ENT_QUOTES, 'UTF-8');?>',
|
886 |
+
'value' : <?php print "$cart_total_amount";?>,
|
887 |
+
'items' : [{
|
888 |
+
'id': <?php print "$ecomm_prodid";?>,
|
889 |
+
'google_business_vertical': 'retail'
|
890 |
+
}]
|
891 |
+
});
|
892 |
+
</script>
|
893 |
+
<?php
|
894 |
+
}
|
895 |
+
}
|
896 |
+
}
|
897 |
}
|
898 |
}
|
899 |
}
|
979 |
}
|
980 |
add_action('admin_notices', 'woosea_request_review');
|
981 |
|
982 |
+
|
983 |
/**
|
984 |
* Create a seperate MySql table for saving conversion information
|
985 |
*/
|
1104 |
}
|
1105 |
add_action( 'wp_ajax_woosea_categories_dropdown', 'woosea_categories_dropdown' );
|
1106 |
|
1107 |
+
/**
|
1108 |
+
* Sanitize XSS
|
1109 |
+
*/
|
1110 |
+
function woosea_sanitize_xss($value) {
|
1111 |
+
return htmlspecialchars(strip_tags($value));
|
1112 |
+
}
|
1113 |
+
|
1114 |
/**
|
1115 |
* Save Google Dynamic Remarketing Conversion Tracking ID
|
1116 |
*/
|
1117 |
function woosea_save_adwords_conversion_id() {
|
1118 |
$adwords_conversion_id = sanitize_text_field($_POST['adwords_conversion_id']);
|
1119 |
+
$adwords_conversion_id = woosea_sanitize_xss($adwords_conversion_id);
|
1120 |
update_option("woosea_adwords_conversion_id", $adwords_conversion_id);
|
1121 |
}
|
1122 |
add_action( 'wp_ajax_woosea_save_adwords_conversion_id', 'woosea_save_adwords_conversion_id' );
|
1135 |
*/
|
1136 |
function woosea_save_facebook_pixel_id() {
|
1137 |
$facebook_pixel_id = sanitize_text_field($_POST['facebook_pixel_id']);
|
1138 |
+
$facebook_pixel_id = woosea_sanitize_xss($facebook_pixel_id);
|
1139 |
update_option("woosea_facebook_pixel_id", $facebook_pixel_id);
|
1140 |
}
|
1141 |
add_action( 'wp_ajax_woosea_save_facebook_pixel_id', 'woosea_save_facebook_pixel_id' );
|
1142 |
|
1143 |
+
/**
|
1144 |
+
* Save Facebook Conversion API Token
|
1145 |
+
*/
|
1146 |
+
function woosea_save_facebook_capi_token() {
|
1147 |
+
$facebook_capi_token = sanitize_text_field($_POST['facebook_capi_token']);
|
1148 |
+
$facebook_capi_token = woosea_sanitize_xss($facebook_capi_token);
|
1149 |
+
update_option("woosea_facebook_capi_token", $facebook_capi_token);
|
1150 |
+
}
|
1151 |
+
add_action( 'wp_ajax_woosea_save_facebook_capi_token', 'woosea_save_facebook_capi_token' );
|
1152 |
+
|
1153 |
/**
|
1154 |
* Mass map categories to the correct Google Shopping category taxonomy
|
1155 |
*/
|
2480 |
}
|
2481 |
add_action( 'wp_ajax_woosea_local_pickup_shipping', 'woosea_local_pickup_shipping' );
|
2482 |
|
2483 |
+
/**
|
2484 |
+
* This function enables the setting to remove
|
2485 |
+
* free shipping zones
|
2486 |
+
*/
|
2487 |
+
function woosea_remove_free_shipping (){
|
2488 |
+
$status = sanitize_text_field($_POST['status']);
|
2489 |
+
|
2490 |
+
if ($status == "off"){
|
2491 |
+
update_option( 'remove_free_shipping', 'no', 'yes');
|
2492 |
+
} else {
|
2493 |
+
update_option( 'remove_free_shipping', 'yes', 'yes');
|
2494 |
+
}
|
2495 |
+
}
|
2496 |
+
add_action( 'wp_ajax_woosea_remove_free_shipping', 'woosea_remove_free_shipping' );
|
2497 |
+
|
2498 |
/**
|
2499 |
* This function enables the setting to use
|
2500 |
* logging
|
2511 |
add_action( 'wp_ajax_woosea_add_woosea_logging', 'woosea_add_woosea_logging' );
|
2512 |
|
2513 |
/**
|
2514 |
+
* This function enables the setting to add CDATA to title and descriptions
|
|
|
2515 |
*/
|
2516 |
+
function woosea_add_woosea_cdata (){
|
2517 |
$status = sanitize_text_field($_POST['status']);
|
2518 |
|
2519 |
if ($status == "off"){
|
2520 |
+
update_option( 'add_woosea_cdata', 'no', 'yes');
|
2521 |
} else {
|
2522 |
+
update_option( 'add_woosea_cdata', 'yes', 'yes');
|
2523 |
}
|
2524 |
}
|
2525 |
+
add_action( 'wp_ajax_woosea_add_woosea_cdata', 'woosea_add_woosea_cdata' );
|
2526 |
+
|
2527 |
+
/**
|
2528 |
+
* This function enables the setting to add
|
2529 |
+
* the Faceook pixel
|
2530 |
+
*/
|
2531 |
+
function woosea_add_facebook_pixel_setting (){
|
2532 |
+
check_ajax_referer('woosea_ajax_nonce', 'security');
|
2533 |
+
$status = sanitize_text_field($_POST['status']);
|
2534 |
+
|
2535 |
+
// Only admin users are allowed to make changes that impact the front-end
|
2536 |
+
$user = wp_get_current_user();
|
2537 |
+
if ( in_array( 'administrator', (array) $user->roles ) ) {
|
2538 |
+
if ($status == "off"){
|
2539 |
+
update_option( 'add_facebook_pixel', 'no', 'yes');
|
2540 |
+
} else {
|
2541 |
+
update_option( 'add_facebook_pixel', 'yes', 'yes');
|
2542 |
+
}
|
2543 |
+
}
|
2544 |
+
}
|
2545 |
add_action( 'wp_ajax_woosea_add_facebook_pixel_setting', 'woosea_add_facebook_pixel_setting' );
|
2546 |
|
2547 |
+
/**
|
2548 |
+
* This function enables the setting to enable
|
2549 |
+
* the Faceook Conversion API (CAPI)
|
2550 |
+
*/
|
2551 |
+
function woosea_add_facebook_capi_setting (){
|
2552 |
+
check_ajax_referer('woosea_ajax_nonce', 'security');
|
2553 |
+
$status = sanitize_text_field($_POST['status']);
|
2554 |
+
|
2555 |
+
// Only admin users are allowed to make changes that impact the front-end
|
2556 |
+
$user = wp_get_current_user();
|
2557 |
+
if ( in_array( 'administrator', (array) $user->roles ) ) {
|
2558 |
+
if ($status == "off"){
|
2559 |
+
update_option( 'add_facebook_capi', 'no', 'yes');
|
2560 |
+
} else {
|
2561 |
+
update_option( 'add_facebook_capi', 'yes', 'yes');
|
2562 |
+
}
|
2563 |
+
}
|
2564 |
+
}
|
2565 |
+
add_action( 'wp_ajax_woosea_add_facebook_capi_setting', 'woosea_add_facebook_capi_setting' );
|
2566 |
+
|
2567 |
/**
|
2568 |
* This function saves the value that needs to be used in the Facebook pixel content_ids parameter
|
2569 |
*/
|
2583 |
* Google's Dynamic Remarketing
|
2584 |
*/
|
2585 |
function woosea_add_remarketing (){
|
2586 |
+
check_ajax_referer('woosea_ajax_nonce', 'security');
|
2587 |
+
$status = sanitize_text_field($_POST['status']);
|
2588 |
+
|
2589 |
+
// Only admin users are allowed to make changes that impact the front-end
|
2590 |
+
$user = wp_get_current_user();
|
2591 |
+
if ( in_array( 'administrator', (array) $user->roles ) ) {
|
2592 |
+
if ($status == "off"){
|
2593 |
+
update_option( 'add_remarketing', 'no', 'yes');
|
2594 |
+
} else {
|
2595 |
+
update_option( 'add_remarketing', 'yes', 'yes');
|
2596 |
+
}
|
2597 |
+
}
|
2598 |
}
|
2599 |
add_action( 'wp_ajax_woosea_add_remarketing', 'woosea_add_remarketing' );
|
2600 |
|
2605 |
function woosea_add_batch (){
|
2606 |
$status = sanitize_text_field($_POST['status']);
|
2607 |
|
2608 |
+
// Only admin users are allowed to make changes that impact the performance
|
2609 |
+
$user = wp_get_current_user();
|
2610 |
+
if ( in_array( 'administrator', (array) $user->roles ) ) {
|
2611 |
+
if ($status == "off"){
|
2612 |
+
update_option( 'add_batch', 'no', 'yes');
|
2613 |
+
} else {
|
2614 |
+
update_option( 'add_batch', 'yes', 'yes');
|
2615 |
+
}
|
2616 |
}
|
2617 |
}
|
2618 |
add_action( 'wp_ajax_woosea_add_batch', 'woosea_add_batch' );
|
4876 |
|
4877 |
add_meta_box('woosea_rss_dashboard_widget', __('Latest Product Feed Pro Tutorials', 'rc_mdm'), 'woosea_my_rss_box','dashboard','side','high');
|
4878 |
}
|
4879 |
+
//add_action('wp_dashboard_setup', 'woosea_blog_widgets');
|
4880 |
|
4881 |
/**
|
4882 |
* Creates the RSS metabox
|
4883 |
*/
|
4884 |
+
function woosea_feed_interval( $seconds ) {
|
4885 |
+
return 172800; // Cache the feed for 2 days
|
4886 |
+
}
|
4887 |
+
|
4888 |
function woosea_my_rss_box() {
|
|
|
4889 |
// Get RSS Feed(s)
|
4890 |
include_once(ABSPATH . WPINC . '/feed.php');
|
4891 |
$domain = $_SERVER['HTTP_HOST'];
|
4894 |
$my_feeds = array(
|
4895 |
'https://www.adtribes.io/feed/'
|
4896 |
);
|
4897 |
+
|
4898 |
+
add_filter( 'wp_feed_cache_transient_lifetime' , 'woosea_feed_interval' );
|
4899 |
|
4900 |
// Loop through Feeds
|
4901 |
foreach ( $my_feeds as $feed) :
|