Skip to main content

Ubercart 3

How to form alter Ubercart 3 Address Pane Fields

I recently needed to alter the address fields within the Ubercart 3 billing pane. Unfortunately, due to the way Ubercart 3 builds these form elements, the standard hook_form_alter() hook was not going to work. After a few hours of searching I finally discovered this post:

https://drupal.org/node/2063949#comment-7750227

With that information I was able to alter my billing pane's company field into a select list taken from a taxonomy. The code below was entered into my theme's template.php file.


Ubercart: Add Unit Price to the Shopping Cart Table.

We are working on an Ubercart store running Drupal 7 and we needed to add the price per unit to the shopping cart page. I didn't see any options for enabling this in the store administration area so I began looking for some code to make this happen. I came across this post, http://pixeljets.com/blog/adding-price-field-ubercart-cart-page, which was close to what I needed, but I figured there was a theme function I could use instead of a custom module.