@@ -665,7 +665,7 @@ public function getOrderInfo( $store_id=null, $order_id=null )
665665 try {
666666
667667 $ this ->order ->getConfig ()->setApiKey ('store_key ' , $ store_id );
668- $ result = $ this ->order ->orderInfo ( $ order_id ,'force_all ' );
668+ $ result = $ this ->order ->orderInfo ( $ order_id , null , 'force_all ' );
669669 $ this ->logApiCall ( 'order.info.json ' , $ result ->getResult (), $ result ->getReturnCode (), $ this ->order ->getConfig (), null , null , null , $ result ->getReturnMessage () ,['order_id ' =>$ order_id ] );
670670
671671 if ($ result ->getReturnCode () == 0 ) {
@@ -901,6 +901,7 @@ public function updateProduct($store_id=null, $product_id=null, $fields=[])
901901 $ result = $ this ->product ->productUpdate (
902902 $ product_id ,
903903 null ,
904+ null ,
904905 (isset ($ fields ['price ' ])) ? $ fields ['price ' ] : null ,
905906 null ,
906907 null ,
@@ -914,15 +915,14 @@ public function updateProduct($store_id=null, $product_id=null, $fields=[])
914915 null ,
915916 null ,
916917 null ,
917- (isset ($ fields ['name ' ])) ? $ fields ['name ' ] : null ,
918- null ,
919918 null ,
919+ (isset ($ fields ['name ' ])) ? $ fields ['name ' ] : null ,
920920 null ,
921921 null ,
922- (isset ($ fields ['description ' ])) ? $ fields ['description ' ] : null ,
923922 null ,
924923 null ,
925924 null ,
925+ (isset ($ fields ['description ' ])) ? $ fields ['description ' ] : null ,
926926 null ,
927927 null ,
928928 null ,
@@ -1190,19 +1190,12 @@ public function addProductImage($store_id=null, $product_id=null, $fields=[])
11901190 $ this ->order ->getConfig ()->setApiKey ('store_key ' , $ store_id );
11911191
11921192 if ($ fields ) {
1193- $ result = $ this ->product ->productImageAdd (
1194- $ product_id ,
1195- $ fields ['image_name ' ],
1196- $ fields ['type ' ],
1197- $ fields ['url ' ],
1198- null ,
1199- null ,
1200- null ,
1201- null ,
1202- null ,
1203- null ,
1204- null
1205- );
1193+ $ model = new \Api2Cart \Client \Model \ProductImageAdd ();
1194+ $ model ->setProductId ($ product_id )
1195+ ->setType ($ fields ['type ' ] ?? 'base ' )
1196+ ->setUrl ($ fields ['url ' ])
1197+ ->setImageName ($ fields ['image_name ' ] ?? '' );
1198+ $ result = $ this ->product ->productImageAdd ($ model );
12061199
12071200 $ this ->logApiCall ( 'product.image.add.json ' , $ result ->getResult (), $ result ->getReturnCode (), $ this ->product ->getConfig (), null , null , null , $ result ->getReturnMessage (), array_merge (['product_id ' =>$ product_id ],$ fields ) );
12081201
0 commit comments