Skip to content

Commit aa98ea8

Browse files
bugfixing
1 parent 052ca94 commit aa98ea8

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

src/Controllers/CLI/Order_Controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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);

src/Controllers/CLI/Product_Controller.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,10 @@
44

55
use Exception;
66
use SmartPack\WMS\WMSApi\Webhook;
7+
use SmartPack\WMS\Helpers;
78

89
class 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';

0 commit comments

Comments
 (0)