File tree Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Expand file tree Collapse file tree 2 files changed +2
-26
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ function execute()
2929 foreach ($ all_ids as $ order ) {
3030 $ shipment_data = [[
3131 'method ' => 'order ' ,
32- 'data ' => Helpers::getOrderData ($ order ->ID )
32+ 'data ' => Helpers::getOrderData ($ order ->ID , $ order )
3333 ]];
3434
3535 $ response = $ webhook ->push ($ shipment_data );
Original file line number Diff line number Diff line change 44
55use Exception ;
66use SmartPack \WMS \WMSApi \Webhook ;
7+ use SmartPack \WMS \Helpers ;
78
89class CLI_Products
910{
10- function __get_product_data_simple ($ product_id ) {
11- $ wc_product_data = \wc_get_product ( $ product_id );
12- $ image_id = $ wc_product_data ->get_image_id ();
13- $ image_url = \wp_get_attachment_image_url ( $ image_id , 'full ' );
14-
15- $ obj_product = Helpers::getProtectedValue ($ wc_product_data , 'data ' );
16-
17- $ product_data = [
18- 'method ' => 'product ' ,
19- 'data ' => [
20- 'id ' => (string ) $ product_id ,
21- 'sku ' => $ obj_product ['sku ' ],
22- 'title ' => $ obj_product ['name ' ],
23- 'description ' => $ obj_product ['description ' ],
24- 'cost ' => $ obj_product ['price ' ],
25- 'vendor ' => '' ,
26- 'manufacturer ' => '' ,
27- 'weight ' => $ obj_product ['weight ' ],
28- 'imageUrl ' => $ image_url
29- ]
30- ];
31-
32- return $ product_data ;
33- }
34-
3511 function execute ()
3612 {
3713 echo 'Start product sync ' ;
You can’t perform that action at this time.
0 commit comments