For the initial launch, we want to keep both the pull and push mechanisms working together. This PR enables sending the notification (pull mechanism) and the usual job to push the data.
Screenshots:
Detailed test instructions:
Enable the Pull mechanism with the following filter: add_filter( 'woocommerce_gla_notifications_enabled', '__return_true' ); and run this command wp option update gla_wpcom_rest_api_status "approved"
Create Product
Create a product with the visibility "Sync and Show"
Go to WC -> Status -> Scheduled jobs
See that there is a job gla/jobs/update_products/process_item with the product that you created
See that there is a job gla/jobs/notifications/products/process_item with the itemID = the product ID that you created and the topic product.create
Update Product
Update a product
See that there is a job gla/jobs/update_products/process_item with the product that you updated
See that there is a job gla/jobs/notifications/products/process_item with the itemID = the product ID that you updated and the topic product.update
Delete Product
Delete a product
See that there is a job gla/jobs/delete_products/process_item with the product that you deleted.
See that there is a job gla/jobs/notifications/products/process_item with the itemID = the product ID that you deleted and the topic product.delete
Create Coupon
Create a coupon with the visibility "Show Coupon on Google"
See that there is a job gla/jobs/update_coupon/process_item with the coupon that you created
See that there is a job gla/jobs/notifications/coupons/process_item with the itemID = the coupon ID that you created and the topic coupon.create
Update Coupon
Update a coupon
See that there is a job gla/jobs/update_coupon/process_item with the coupon that you updated
See that there is a job gla/jobs/notifications/coupons/process_item with the itemID = the coupon ID that you updated and the topic product.update
Delete Coupon
Delete a product
See that there is a job gla/jobs/delete_coupon/process_item with the coupon that you deleted.
See that there is a job gla/jobs/notifications/coupons/process_item with the itemID = the coupon ID that you deleted and the topic coupon.delete
Update Shipping Settings
Go to WC -> Settings -> Shippings and edit one of the shipping methods
See that there is a job gla/jobs/update_shipping_settings/process_item` scheduled
See that there is a job gla/jobs/notifications/shipping/process_item with the topic shipping.update
Changes proposed in this Pull Request:
Part of https://github.com/woocommerce/google-listings-and-ads/issues/2146
For the initial launch, we want to keep both the pull and push mechanisms working together. This PR enables sending the notification (pull mechanism) and the usual job to push the data.
Screenshots:
Detailed test instructions:
add_filter( 'woocommerce_gla_notifications_enabled', '__return_true' );
and run this commandwp option update gla_wpcom_rest_api_status "approved"
Create Product
gla/jobs/update_products/process_item
with the product that you createdgla/jobs/notifications/products/process_item
with the itemID = the product ID that you created and the topicproduct.create
Update Product
gla/jobs/update_products/process_item
with the product that you updatedgla/jobs/notifications/products/process_item
with the itemID = the product ID that you updated and the topicproduct.update
Delete Product
gla/jobs/delete_products/process_item
with the product that you deleted.gla/jobs/notifications/products/process_item
with the itemID = the product ID that you deleted and the topicproduct.delete
Create Coupon
gla/jobs/update_coupon/process_item
with the coupon that you createdgla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you created and the topiccoupon.create
Update Coupon
gla/jobs/update_coupon/process_item
with the coupon that you updatedgla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you updated and the topicproduct.update
Delete Coupon
gla/jobs/delete_coupon/process_item
with the coupon that you deleted.gla/jobs/notifications/coupons/process_item
with the itemID = the coupon ID that you deleted and the topiccoupon.delete
Update Shipping Settings
gla/jobs/notifications/shipping/process_item
with the topicshipping.update
Additional details:
Currently, for shipping notifications, we haven't included the topic in the body, only in the header. For consistency, I think it's better to include it in the body as well, so I added it here.: https://github.com/woocommerce/google-listings-and-ads/pull/2428/files#diff-f9aaeb6620028c10c8ce8c3178abf2f6db34168939ba33c4d8bcef410a5125b5R148
Changelog entry