Required. Product information. Required field(s): * * Product.id Optional override field(s): * * Product.price_info If any supported optional fields are provided, we will treat them as a full override when looking up product information from the catalog. Thus, it is important to ensure that the overriding fields are accurate and complete. All other product fields are ignored and instead populated via catalog lookup after event ingestion.
Quantity of the product associated with the user event. For example, this field will be 2 if two products are added to the shopping cart for purchase-complete event. Required for add-to-cart and purchase-complete event types.
Product.price_info
If any supported optional fields are provided, we will treat them as a full
override when looking up product information from the catalog. Thus, it is
important to ensure that the overriding fields are accurate and
complete.
All other product fields are ignored and instead populated via catalog
lookup after event ingestion.
Product.price_info
If any supported optional fields are provided, we will treat them as a full
override when looking up product information from the catalog. Thus, it is
important to ensure that the overriding fields are accurate and
complete.
All other product fields are ignored and instead populated via catalog
lookup after event ingestion.
Quantity of the product associated with the user event.
For example, this field will be 2 if two products are added to the shopping
cart for purchase-complete event. Required for add-to-cart and
purchase-complete event types.
Quantity of the product associated with the user event.
For example, this field will be 2 if two products are added to the shopping
cart for purchase-complete event. Required for add-to-cart and
purchase-complete event types.
Returns
Type
Description
int|null
setQuantity
Quantity of the product associated with the user event.
For example, this field will be 2 if two products are added to the shopping
cart for purchase-complete event. Required for add-to-cart and
purchase-complete event types.
Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.
Quantity of the product associated with the user event.
For example, this field will be 2 if two products are added to the shopping
cart for purchase-complete event. Required for add-to-cart and
purchase-complete event types.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class ProductDetail (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.ProductDetail)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.ProductDetail)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.ProductDetail)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.ProductDetail)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.ProductDetail)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.ProductDetail)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.ProductDetail)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.ProductDetail)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.ProductDetail)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.ProductDetail)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.ProductDetail)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.ProductDetail)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.ProductDetail) \nReference documentation and code samples for the Google Cloud Retail V2 Client class ProductDetail.\n\nDetailed product information associated with a user event.\n\nGenerated from protobuf message `google.cloud.retail.v2.ProductDetail`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getProduct\n\nRequired. [Product](/php/docs/reference/cloud-retail/latest/V2.Product) information.\n\nRequired field(s):\n\n- [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__) Optional override field(s):\n- [Product.price_info](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getPriceInfo__) If any supported optional fields are provided, we will treat them as a full override when looking up product information from the catalog. Thus, it is important to ensure that the overriding fields are accurate and complete. All other product fields are ignored and instead populated via catalog lookup after event ingestion.\n\n### hasProduct\n\n### clearProduct\n\n### setProduct\n\nRequired. [Product](/php/docs/reference/cloud-retail/latest/V2.Product) information.\n\nRequired field(s):\n\n- [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__) Optional override field(s):\n- [Product.price_info](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getPriceInfo__) If any supported optional fields are provided, we will treat them as a full override when looking up product information from the catalog. Thus, it is important to ensure that the overriding fields are accurate and complete. All other product fields are ignored and instead populated via catalog lookup after event ingestion.\n\n### getQuantity\n\nQuantity of the product associated with the user event.\n\nFor example, this field will be 2 if two products are added to the shopping\ncart for `purchase-complete` event. Required for `add-to-cart` and\n`purchase-complete` event types.\n\n### hasQuantity\n\n### clearQuantity\n\n### getQuantityUnwrapped\n\nReturns the unboxed value from `getQuantity()`\n\nQuantity of the product associated with the user event.\nFor example, this field will be 2 if two products are added to the shopping\ncart for `purchase-complete` event. Required for `add-to-cart` and\n`purchase-complete` event types.\n\n### setQuantity\n\nQuantity of the product associated with the user event.\n\nFor example, this field will be 2 if two products are added to the shopping\ncart for `purchase-complete` event. Required for `add-to-cart` and\n`purchase-complete` event types.\n\n### setQuantityUnwrapped\n\nSets the field by wrapping a primitive type in a Google\\\\Protobuf\\\\Int32Value object.\n\nQuantity of the product associated with the user event.\nFor example, this field will be 2 if two products are added to the shopping\ncart for `purchase-complete` event. Required for `add-to-cart` and\n`purchase-complete` event types."]]