public getProductQuantity ( string $productClassId ) : integer | ||
$productClassId | string | |
return | integer |
public function getProductQuantity($productClassId)
{
$CartItem = $this->cart->getCartItemByIdentifier('Eccube\\Entity\\ProductClass', (string) $productClassId);
if ($CartItem) {
return $CartItem->getQuantity();
} else {
return 0;
}
}