<<

NAME

ProductOpener::APIProductWrite - implementation of WRITE API for creating and updating products

DESCRIPTION

skip_protected_field($product_ref, $field, $moderator = 0)

Return 1 if we should ignore a field value sent by a user because we already have a value sent by the producer.

update_field_with_0_or_1_value($request_ref, $product_ref, $field, $value)

Update a field that takes only 0 or 1 as a value (e.g. packagings_complete).

update_packagings($request_ref, $product_ref, $field, $add_to_existing_components, $value)

Update packagings.

update_tags_fields ($request_ref, $product_ref, $field, $add_to_existing_tags, $value)

Update packagings.

update_product_fields ($request_ref, $product_ref, $response_ref)

Update product fields based on input product data.

process_change_product_code_request_if_we_have_one($request_ref, $response_ref, $product_ref, $new_code)

Process a change of code request if we have one.

Parameters

$request_ref (input)

Reference to the request object.

$response_ref (input)

Reference to the response object.

$product_ref (input)

Reference to the product object.

$new_code (input)

New code.

Return value

undef if we don't have a change product code request, or if it was processed correctly. an error id if there was an error (e.g. no_permisssion or invalid_product_type).

write_product_api($request_ref)

Process API v3 WRITE product requests.

TODO: v0 / v1 / v2 WRITE product requests are still handled by cgi/product_jqm_multilingual.pl which contains similar code. Internally, we should be able to upgrade those requests to v3, and then customize the response to make it return the v2 expected response.

<<