protected function CartLinkToken::generateTokenValue in Commerce Add To Cart Link 2.x
Same name and namespace in other branches
- 8 src/CartLinkToken.php \Drupal\commerce_add_to_cart_link\CartLinkToken::generateTokenValue()
Generates the value used for the token generation.
Parameters
\Drupal\commerce_product\Entity\ProductVariationInterface $variation: The product variation.
Return value
string The value used for the token generation.
1 call to CartLinkToken::generateTokenValue()
- CartLinkToken::generate in src/
CartLinkToken.php - Generates a token for the given product variation.
File
- src/
CartLinkToken.php, line 99
Class
- CartLinkToken
- Default cart link token service implementation.
Namespace
Drupal\commerce_add_to_cart_linkCode
protected function generateTokenValue(ProductVariationInterface $variation) {
return sprintf('cart_link:%s:%s', $variation
->getProductId(), $variation
->id());
}