Active
Project:
UC Store Credit
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
22 Sep 2009 at 18:38 UTC
Updated:
22 Sep 2009 at 18:38 UTC
Instead of:
drupal_add_js('uc_store_credit_hide_method = '. variable_get('uc_store_credit_hide_method', 0) .';', 'inline');
drupal_add_js('uc_store_credit_user_total = '. uc_store_credit_user_total() .';', 'inline');
drupal_add_js('uc_store_credit_cart_total = '. uc_store_credit_cart_total() .';', 'inline');
drupal_add_js('uc_store_credit_line_item_rate = '. variable_get('uc_store_credit_conversion_rate', 100) .';', 'inline');
drupal_add_js("uc_store_credit_subtotal_string = '". t('Subtotal') ."';", 'inline');Use:
drupal_add_js(
array(
'uc_store_credit' => array(
'hide_method' => variable_get('uc_store_credit_hide_method', 0),
'user_total' => uc_store_credit_user_total(),
'cart_total' => uc_store_credit_cart_total(),
'line_item_rate' => variable_get('uc_store_credit_conversion_rate', 100),
'subtotal_string' => t('Subtotal'),
),
),
'setting'
);Your variables are then available as Drupal.settings.uc_store_credit.hide_method instead.