I'm trying to integrate this module with Ubercart's attribute selections (handled with AJAX). I installed the module, copied JS.php, added to .htaccess.

I'm having a difficult time understanding how to implement it with the Ubercart module however. This looks like the function I want to edit in the uc_product.module:

function uc_product_view_ajax_commands($form_state, $keys) {
  $commands = array();
  if (variable_get('uc_product_update_node_view', FALSE) && !empty($form_state['storage']['variant'])) {
    $node_div = '.uc-product-' . $form_state['storage']['variant']->nid;
    $build = node_view($form_state['storage']['variant']);
    foreach ($keys as $key) {
      if (isset($build[$key])) {
        $id = $node_div . '.' . str_replace('_', '-', $key);
        $commands[] = ajax_command_replace($id, drupal_render($build[$key]));
      }
    }
  }
  return $commands;
}

However I don't know how to adjust it to properly implement. Any help is greatly appreciated. Thank you.

Comments

markhalliwell’s picture

Status: Active » Closed (outdated)

7.x-1.x is outdated.

I'm not all that familiar with Ubercart TBH, but from the above code, it looks like it implements it's own callback... so I'm not entirely sure it can be integrated with this module. Might have to follow-up with that module specifically.