You are here

function uc_product_handler_field_buyitnow::render in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_product/views/uc_product_handler_field_buyitnow.inc \uc_product_handler_field_buyitnow::render()

Overrides views_handler_field::render().

Overrides views_handler_field::render

File

uc_product/views/uc_product_handler_field_buyitnow.inc, line 24
Views handler: Simpler "Add to cart" form as a field.

Class

uc_product_handler_field_buyitnow
Displays the simpler Add to cart form like the catalog.

Code

function render($values) {
  $product = node_load($values->{$this->aliases['nid']});
  if (uc_product_is_product($product)) {
    $form = drupal_get_form('uc_catalog_buy_it_now_form_' . $values->{$this->aliases['nid']}, $product);
    return drupal_render($form);
  }
}