<commit_before><?php
/**
 * [RO] Actualizeaza anumite date ale produselor dintr-o comanda (pentru lista completa de date, vezi sectiunea de exemplu)
 * [EN] Updates certain data for the products that belong to a certain order (for the full list of data that can be updated, check the example section)
 */
include __DIR__ . '/../api_include.php';

use celmarket\Auth;
Auth::setUserDetails('USERNAME', 'PASSWORD');

use celmarket\Orders\OrdersUpdate;

#19#
#FUNCTION#
function updateProductsFromOrder($cmd, $arrModels){
    $object = new OrdersUpdate();

    try{
        $response = $object->updateProductsFromOrder($cmd, $arrModels);
        print_r($response);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}

#EXAMPLE#
$cmd = 564076;
$products = array(
    array(
        'model' =>  'Model1',
        'products_price'    =>  305.44,
        'cantitate' =>  1,
        'tva'   =>  20,
        'id_prod_com'   =>  1001960,
        'deschidere_colet'  =>  1,
        'status_livrare' => 0
    )
);
updateProductsFromOrder(492347, $products);<commit_msg>Removed field 	modified:   Orders/4.updateProductsFromOrder.php<commit_after><?php
/**
 * [RO] Actualizeaza anumite date ale produselor dintr-o comanda (pentru lista completa de date, vezi sectiunea de exemplu)
 * [EN] Updates certain data for the products that belong to a certain order (for the full list of data that can be updated, check the example section)
 */
include __DIR__ . '/../api_include.php';

use celmarket\Auth;
Auth::setUserDetails('USERNAME', 'PASSWORD');

use celmarket\Orders\OrdersUpdate;

#19#
#FUNCTION#
function updateProductsFromOrder($cmd, $arrModels){
    $object = new OrdersUpdate();

    try{
        $response = $object->updateProductsFromOrder($cmd, $arrModels);
        print_r($response);
    } catch (Exception $e) {
        echo $e->getMessage();
    }
}

#EXAMPLE#
$cmd = 564076;
$products = array(
    array(
        'products_price'    =>  305.44,
        'cantitate' =>  1,
        'tva'   =>  20,
        'id_prod_com'   =>  1001960,
        'deschidere_colet'  =>  1,
        'status_livrare' => 0
    )
);
updateProductsFromOrder(492347, $products);
{'fraction_non_alphanumeric': 0.13250230840258542, 'fraction_numerical': 0.029547553093259463, 'mean_word_length': 3.2490196078431373, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '506714', 'n_tokens_mistral': 769, 'n_tokens_neox': 725, 'n_words': 188}