Hello,

Ubercart rules and allows for customization of almost every aspect. However, I can't find any way to theme the shipping quotes. As mentioned in the thread to which this issue's title alludes (http://drupal.org/node/410428), there are indeed some theme functions. But, they are only for UPS and FedEx from what I understand, and more importantly, they only allow theming of what's INSIDE each form-item.

Right now, my markup looks like this:

<div class="form-item">
  <input name="rate[fedex---GROUND_HOME_DELIVERY]" value="6.97" type="hidden">
  <label class="option">
    <input class="form-radio" name="quote-option" value="fedex---GROUND_HOME_DELIVERY" type="radio">
    <img class="fedex-logo" src="/sites/all/modules/contrib/uc_fedex/uc_fedex_logo.gif" alt="FedEx Logo">Home Delivery (1 package): $7
  </label>
</div>
<div class="form-item">
  <input name="rate[fedex---FEDEX_EXPRESS_SAVER]" value="12.9" type="hidden">
  <label class="option">
    <input class="form-radio" name="quote-option" value="fedex---FEDEX_EXPRESS_SAVER" type="radio">
    <img class="fedex-logo" src="/sites/all/modules/contrib/uc_fedex/uc_fedex_logo.gif" alt="FedEx Logo">Express Saver (1 package): $13
  </label>
</div>
<div class="form-item">
  <input name="rate[usps---22]" value="13.95" type="hidden">
  <label class="option">
    <input class="form-radio" name="quote-option" value="usps---22" type="radio">U.S.P.S. Priority Mail Large Flat-Rate Box: $14
  </label>
</div>
<div class="form-item">
  <input name="rate[usps---3]" value="15" type="hidden">
  <label class="option">
    <input class="form-radio" name="quote-option" value="usps---3" type="radio">U.S.P.S. Express Mail: $15
  </label>
</div>

As you can see, each shipping option is only wrapped in a "form-item" div, and there is NO way to distinguish between different shipping providers. I'd like for each shipping provider to be wrapped in its own div with an id; something like:

<div id="fedex-quotes">
  form-item option 1
  form-item option 2
</div>
<div id="usps-quotes">
  form-item option 1
  form-item option 2
</div>

This would allow much easier theming (ideally, i'd like to put them in jquery tabs or something so they don't expand down the page so much). Is there any way to do this..? Perhaps with theme_form_element()..? I'm worried that since the markup is generated with AJAX that I won't have access with a PHP approach that will allow me to wrap the radios based on provider.

Any help would be much appreciated. Thank you.

Comments

TR’s picture

Your proposal requires rewriting uc_quote.js, because that is where the markup is generated. It should probably be rewritten anyway, to use the new (in D6) Drupal.theme JavaScript object (http://drupal.org/node/132442#javascript-themeing). That will give you the ability to override the markup generated by the .js rather than hack the .js.

Sounds like a reasonable thing to do, but first it needs someone to post a patch in this thread that can be tested and applied.

roper.’s picture

Hi TR, thanks for the reply.

Unfortunately I don't think I can offer up a patch, but I appreciate the info!

TR’s picture

Version: 6.x-2.0 » 7.x-3.x-dev

Moving to 7.x-3.x

TR’s picture

Status: Active » Postponed

If anyone would like to see this put into Ubercart, please contribute a patch.