Forked from
project / syncart
8 commits behind the upstream repository.
-
Aleksey.Alekseev authored862b7709
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Пока не создавайте тег для drupal.org
Altering:
<?
/**
* Implements hook_syncart_variation_alter().
*/
function HOOK_syncart_variation_alter(&$info, $variation) {
\Drupal::messenger()->addStatus(__FUNCTION__);
// Variation.
foreach (['field_variation_color', 'field_variation_size'] as $field) {
$term = $variation->$field->entity;
$info[$field] = is_object($term) ? $term->getName() : '';
}
// Product.
if (is_object($product = $variation->getProduct())) {
$info['code'] = $product->field_code->value;
}
}