You are here

protected function TestController::attachProductOption in Dropdown Attributes 8

Attach an option to a product.

Parameters

int $oid: Option ID.

int $nid: Product node ID.

2 calls to TestController::attachProductOption()
TestController::product in uc_dropdown_test/src/Controller/TestController.php
TestController::productKit in uc_dropdown_test/src/Controller/TestController.php

File

uc_dropdown_test/src/Controller/TestController.php, line 598

Class

TestController
Additional test of Dropdown Attributes UI.

Namespace

Drupal\uc_dropdown_test\Controller

Code

protected function attachProductOption($oid, $nid) {
  \Drupal::database()
    ->merge('uc_product_options')
    ->key(array(
    'nid' => $nid,
    'oid' => $oid,
  ))
    ->fields(array(
    'cost' => 0.0,
    'price' => 0.0,
    'weight' => 0,
    'ordering' => 0,
  ))
    ->execute();
}