0

How to get product name by id? I want send mail with product name to customer after confirm commerce order.

3

A product is an entity, so you can use entity_load().

$product = entity_load('commerce_product', $product_id);
$title = $product->title;

Commerce provides its own shortcut, though:

$product = commerce_product_load($product_id);
$title = $product->title;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.