Index: ec_cart/ec_cart.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_cart/ec_cart.install,v retrieving revision 1.2.2.2 diff -u -r1.2.2.2 ec_cart.install --- ec_cart/ec_cart.install 15 Nov 2008 01:19:18 -0000 1.2.2.2 +++ ec_cart/ec_cart.install 31 Mar 2009 04:43:08 -0000 @@ -27,6 +27,8 @@ function ec_cart_uninstall() { drupal_uninstall_schema('ec_cart'); variable_del('ec_cart_empty_hide'); + variable_del('ec_cart_add_goto'); + variable_del('ec_cart_empty_link'); if (db_column_exists('ec_product', 'hide_cart_link')) { $ret = array(); @@ -82,3 +84,20 @@ return $ret; } +/** + * Implementation of hook_update_n(). + * + * Rename cart variables. + */ +function ec_cart_update_6401() { + if (variable_get('ec_goto_cart_change', NULL) !== NULL) { + variable_set('ec_cart_add_goto', variable_get('ec_goto_cart_change', NULL)); + variable_del('ec_goto_cart_change'); + } + if (variable_get('ec_goto_cart_empty', NULL) !== NULL) { + variable_set('ec_cart_empty_link', variable_get('ec_goto_cart_empty', NULL)); + variable_del('ec_goto_cart_empty'); + } + + return array(); +} Index: ec_cart/ec_cart.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_cart/ec_cart.module,v retrieving revision 1.5.2.31 diff -u -r1.5.2.31 ec_cart.module --- ec_cart/ec_cart.module 30 Mar 2009 23:55:41 -0000 1.5.2.31 +++ ec_cart/ec_cart.module 31 Mar 2009 04:43:09 -0000 @@ -66,6 +66,15 @@ 'secure' => 1, ); + $items['admin/ecsettings/cart'] = array( + 'title' => 'Cart', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('ec_cart_settings'), + 'description' => 'Configure shopping cart.', + 'access arguments' => array(EC_PERM_SETTINGS), + 'file' => 'ec_cart.admin.inc', + ); + return $items; } @@ -189,7 +198,7 @@ if (isset($node->ptype) && ec_product_attributes_get($node, 'use_product_cart_form') !== TRUE && ec_checkout_validate_item($node, 'ec_cart', $qty, $data, EC_VALIDATE_ITEM_SEVERITY_LOW)) { $cart_items = ec_cart_current(); - $goto = variable_get('ec_goto_cart_change', 'cart/view'); + $goto = variable_get('ec_cart_add_goto', 'cart/view'); // Is it already in our cart? if (isset($cart_items[$node->nid])) { @@ -303,7 +312,7 @@ } } } - if ($destination = variable_get('ec_goto_cart_change', '')) { + if ($destination = variable_get('ec_cart_add_goto', '')) { $form_state['redirect'] = $destination; } } @@ -650,7 +659,7 @@ function ec_cart_delete($item_id) { ec_cart_update_item($item_id, 0); drupal_set_message(t('Your item has been removed.')); - drupal_goto(variable_get('ec_goto_cart_change', 'cart/view')); + drupal_goto(variable_get('ec_cart_add_goto', 'cart/view')); } /** @@ -661,7 +670,7 @@ if (ec_cart_update_item($item_id, isset($_REQUEST['qty']) ? $_REQUEST['qty'] : $qty, $_REQUEST['edit'] ? $_REQUEST['edit'] : array())) { drupal_set_message(t('Your item has been updated.')); } - drupal_goto(variable_get('ec_goto_cart_change', 'cart/view')); + drupal_goto(variable_get('ec_cart_add_goto', 'cart/view')); } /** @@ -674,7 +683,7 @@ if (ec_cart_update_item($item_id, $qty, $data)) { drupal_set_message(t('Your item has been added.')); } - drupal_goto(variable_get('ec_goto_cart_change', 'cart/view')); + drupal_goto(variable_get('ec_cart_add_goto', 'cart/view')); } /** Index: ec_store/ec_store.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_store/ec_store.install,v retrieving revision 1.2.2.15 diff -u -r1.2.2.15 ec_store.install --- ec_store/ec_store.install 23 Mar 2009 01:42:33 -0000 1.2.2.15 +++ ec_store/ec_store.install 31 Mar 2009 04:43:09 -0000 @@ -57,7 +57,6 @@ variable_del('cancel_transaction'); variable_del('product_cart_is_destination'); - variable_del('ec_goto_cart_change'); variable_del('ec_country'); variable_del('ec_measure_weight'); variable_del('ec_measure_length'); Index: ec_store/ec_store.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_store/ec_store.admin.inc,v retrieving revision 1.3.2.11 diff -u -r1.3.2.11 ec_store.admin.inc --- ec_store/ec_store.admin.inc 2 Mar 2009 04:28:38 -0000 1.3.2.11 +++ ec_store/ec_store.admin.inc 31 Mar 2009 04:43:09 -0000 @@ -21,26 +21,6 @@ '#default_value' => variable_get('ec_display_email', 1), ); - // Links settings. - $form['ec_links'] = array( - '#type' => 'fieldset', - '#title' => t('Links'), - '#collapsible' => TRUE, - '#collapsed' => TRUE - ); - $form['ec_links']['ec_goto_cart_change'] = array( - '#type' => 'textfield', - '#title' => t('After add an item link'), - '#default_value' => variable_get('ec_goto_cart_change', 'cart/view'), - '#description' => t('Enter the user destination after adding a product to the cart (eg. "node/1"). If left blank, the user will remain on the same page and a message will alert them that the item has been added to their cart. To send the user to cart, enter "cart/view".'), - ); - $form['ec_links']['ec_goto_cart_empty'] = array( - '#type' => 'textfield', - '#title' => t('Empty cart link'), - '#default_value' => variable_get('ec_goto_cart_empty', ''), - '#description' => t('If the user cart is empty, you can send him/her to a given page.'), - ); - return system_settings_form($form); } Index: ec_cart/templates/theme.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_cart/templates/Attic/theme.inc,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 theme.inc --- ec_cart/templates/theme.inc 17 Mar 2009 12:25:59 -0000 1.1.2.2 +++ ec_cart/templates/theme.inc 31 Mar 2009 04:43:09 -0000 @@ -10,7 +10,7 @@ * Create preprocessed variables for ec_cart_empty(). */ function template_preprocess_ec_cart_empty(&$variables) { - $variables['empty_text'] = t('Your shopping cart is empty. You may !start_shopping.', array('!start_shopping' => l(t('start shopping'), variable_get('ec_goto_cart_empty', 'products')))); + $variables['empty_text'] = t('Your shopping cart is empty. You may !start_shopping.', array('!start_shopping' => l(t('start shopping'), variable_get('ec_cart_empty_link', 'products')))); } /** Index: ec_cart/ec_cart.admin.inc =================================================================== RCS file: ec_cart/ec_cart.admin.inc diff -N ec_cart/ec_cart.admin.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ec_cart/ec_cart.admin.inc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,19 @@ + 'textfield', + '#title' => t('After add an item link'), + '#default_value' => variable_get('ec_cart_add_goto', 'cart/view'), + '#description' => t('Enter the user destination after adding a product to the cart (eg. "node/1"). If left blank, the user will remain on the same page and a message will alert them that the item has been added to their cart. To send the user to cart, enter "cart/view".'), + ); + $form['ec_cart_empty_link'] = array( + '#type' => 'textfield', + '#title' => t('Empty cart link'), + '#default_value' => variable_get('ec_cart_empty_link', ''), + '#description' => t('If the user cart is empty, you can send him/her to a given page.'), + ); + + return system_settings_form($form); +}