These lines of code is change the add to cart button to out of stock, this is not working in drupal 7

$context['subject']['field'] = 'add_to_cart';
$context['class'] = array('add_to_cart');
$node->content['add_to_cart'] = array('#value' => '**Out of Stock', '#cell_attriubtes' => array('nowrap' => 'nowrap'));

Any one can give me hints to rewrite above code to drupal 7?

Comments

redsd’s picture

Hi,

Can you indicatie in what functions, modules they are called.
It's kind of hard to judge not seeing the variabeles in the function they are in.

jaypan’s picture

As always, Ubercart is buggy as hell. It's a horribly written set of modules.

Try this:

$node->content['add_to_cart'] = array('#markup' => '**Out of Stock', '#cell_attributes' => array('nowrap' => 'nowrap'));

Contact me to contract me for D7 -> D10/11 migrations.

hkvega01’s picture

thanks~