You are here

function commerce_bpc_setting_set in Commerce Bulk Product Creation 7

Same name and namespace in other branches
  1. 7.2 commerce_bpc.settings.inc \commerce_bpc_setting_set()

Sets a variable value.

Parameters

string $group: String specifying the settings group this variable belongs to.

string $varname: The name of the variable.

mixed $value: The value of the variable.

string $type: (optional) The product type for which the value is being set. Pass NULL in order to set the global value.

4 calls to commerce_bpc_setting_set()
CommerceBpcSettingsTest::testSettingAndRetrievingSettings in ./commerce_bpc.test
Tests saving and retrieval of settings.
commerce_bpc_settings_form_submit in ./commerce_bpc.admin.inc
Form submission handler for commerce_bpc_settings_form().
commerce_bpc_update_7101 in ./commerce_bpc.install
Rewrite old tokens to new ones.
commerce_bpc_update_7102 in ./commerce_bpc.install
Fix rewritten tokens.

File

./commerce_bpc.settings.inc, line 81
Helper functions for settings-related functionality.

Code

function commerce_bpc_setting_set($group, $varname, $value, $type = NULL) {
  $varname = 'commerce_bpc_' . $group . '_' . $varname;
  if (!empty($type)) {
    $varname .= '_' . $type;
  }
  variable_set($varname, $value);
}