I wanted to get all of my field labels bold and their data normal, and not all ubercart fields on the product pages allow this. The price labels are all in spans with classes, but dimensions, weight, and SKU/Model are just text strings inside a div. It seemed logical to simply render those fields quite similarly to how the rest of the class="product-info" fields (such as sell price, list price, and cost) display: inside spans with appropriate classes.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bancarddata’s picture

Status: Active » Needs review
FileSize
1.74 KB

Status: Needs review » Needs work

The last submitted patch, 1471372-product-info-spans.patch, failed testing.

bancarddata’s picture

Status: Needs work » Needs review
FileSize
1.7 KB

Whoops... the theme functions were moved!

longwave’s picture

Status: Needs review » Needs work

The SKU, Weight and Dimensions label strings still need to wrapped in t(), and there is no need to use t() on single strings such as @sku (use check_plain instead) or !weight (use uc_weight_format directly).

TR’s picture

@bancarddata: You've assigned this issue to yourself - are you still working on this? Can you provide a new patch that addresses the issues raised in #4?

TR’s picture

Assigned: bancarddata » Unassigned
longwave’s picture

Status: Needs work » Needs review
FileSize
1.77 KB

This patch fixes the above issues and uses consistent classes so e.g. you can make all the labels bold with one CSS rule.

Status: Needs review » Needs work

The last submitted patch, 1471372-uc_product-markup.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review

#7: 1471372-uc_product-markup.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 1471372-uc_product-markup.patch, failed testing.

longwave’s picture

Status: Needs work » Needs review

#7: 1471372-uc_product-markup.patch queued for re-testing.

TR’s picture

I see that most of the product theme functions accept an argument of $variables['attributes'], which allows additional CSS classes to be attached to the element being output by the theme function. The exceptions are theme_uc_product_model() and theme_uc_product_model(), which don't allow this.

I think *all* the theme functions should do this - it's only a small change. It should also be documented in the function comments - right now we make no mention that 'attributes' is a valid key for the input array.

Because you're already modifying these functions, it would probably be easier to handle the change in this issue rather than open a new one.

longwave’s picture

longwave’s picture

Status: Needs review » Fixed

Committed #13.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.