Can anyone help, I'm trying to create a hook to add in custom wording to my 'add to cart' form submit button when the status of a commerce product is disabled. I'm using Commerce 7.x-1.4 and by default the wording on the form submit button when the product status is disabled is 'Product not available'. I'd like to add my own wording. I'm not a developer so am unable to write the hook function myself, any help would be greatly appreciated.

Here is part of the function that creates the default wording in the module:

 // Load all the active products intended for sale on this form.
  $products = commerce_product_load_multiple($product_ids, array('status' => 1));

  // If no products were returned...
  if (count($products) == 0) {
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Product not available'),
      '#weight' => 15,
      // Do not set #disabled in order not to prevent submission.
      '#attributes' => array('disabled' => 'disabled'),
      '#validate' => array('commerce_cart_add_to_cart_form_disabled_validate'),
    );
  }

Comments

rszrama’s picture

Status: Active » Closed (won't fix)

Please repost your question to http://www.drupalcommerce.org/questions, as we don't answer such support requests in this queue.