Support from Acquia helps fund testing for Drupal Acquia logo

Comments

breitner’s picture

How can I change the date format to dd.mm.Y (Check-In Date, Checkout etc.)?
And the price is only $ (Dollar). How can I change the price to € (Euro)?

breitner’s picture

FileSize
129.21 KB

Sorry, here is a screenshot.

willvincent’s picture

Status: Active » Postponed

These are known issues that will be fixed in an upcoming version.

Please understand, this project was initially under a heavy time crunch which led to not-so-international-friendly code in several places.

But this is on the radar, and has been a todo item for a little while.

If you would like to help speed up the process, patch submissions are welcome. :)

breitner’s picture

How can I help you prepare the module for other languages?

Unfortunately I have not worked with CVS. Is there an easier way?

I can change all the relevant passages in the modules with t('xyz'). Then I can translate all text with poEdit, but then the changes are not in CVS?!

How can I help you?

willvincent’s picture

Most of the strings should be wrapped in the t() function already in places that aren't automatically run through it -- some of the menu stuff is automatically processed now, at least I believe that's the case..

If you'd like to work on string translation, you could post the resulting .po file here in the issue queue. As far as helping with the code, there is some excellent information (including a video how-to) on creating patches either through cvs or without cvs at http://drupal.org/patch.

That'd be the best option if you'd like to help with code cleanup and the like.

If you choose to help by writing some patches, please try to keep them specific to a particular issue, so for example, this issue is titled "First day of the week", so it would be good to post a patch to this issue queue that deals with changing the first day of the week from sunday to any other day.

Keeping patches focused to a single issue helps to evaluate them and determine if they solve the issue or introduce new issues, etc.

Another practice I like is naming the patch file in relation to the node id in the issue queue. So a patch for this issue might be FirstDayofWeek-625204.patch

szczym’s picture

Title: First day of the week » First day of the week
Component: Miscellaneous » Code

Subscribing, mixed currency, mixed date format and no way to change first day of the week are serous stoppers for adoption outside of Us and Australia

Let me know how i can help

szczym’s picture

Title: First day of the week » First day of the week, mixed currency, mixed date format
Category: feature » bug
willvincent’s picture

Details about how to help with this are outlined in comment #5

ingopingo’s picture

subscribing

sittard’s picture

FileSize
640 bytes
2.83 KB

The attached patches fix the issue with the currency being displayed only in dollars. The currency can now be set in the UberCart store administration > Store Configuration > Format Settings.

Note: The patch does not change the currency in the admin screens (that needs a bit more work).

Hope that helps!

willvincent’s picture

Category: bug » feature

Thank you for stepping forward to help with this sittard, it's refreshing to see a patch posted.

I took a quick look at the patches, will have to look a bit closer later today when I've got a few moments. I did notice one thing in the second patch. It's not accounting for instances where the currency sign comes after the number.

Rather than

if ($day_prices[$day_num]['rate']) {
  $output .='$'; // prefix monetary sign (this should be changed to a variable rather than hardcoded)
}
else {
  $output .=' '; // blank space to even out spacing of empty vs full dates.
}
$output .= (round($day_prices[$day_num]['rate']) > 0) ?  round($day_prices[$day_num]['rate']) .'</div></td>' : '</div></td>';

it should probably do something like this..

$output .= (round($day_prices[$day_num]['rate']) > 0) ?  $cur_sign_prefix . round($day_prices[$day_num]['rate']) . $cur_sign_suffix .'</div></td>' : '&nbsp;</div></td>';

And somewhere much earlier in the function outside of the loops define $cur_sign_prefix and $cur_sign_suffix something like this:

$cur_sign_prefix = (variable_get('uc_sign_after_amount', FALSE)) ? '' : variable_get('uc_currency_sign', '$');
$cur_sign_suffix = (variable_get('uc_sign_after_amount', FALSE)) ? variable_get('uc_currency_sign', '$') : '';

Or, I think this might be accounted for in the newer price handling functions of ubercart 2.x, but I've not had time to wrap my brain around the price api fully.. lol

sittard’s picture

FileSize
10.07 KB

I think your probably correct it may well need some more work to cater for currency suffixes. I noticed that the cart details panel also has the dollar hard coded so this second patch resolves that albeit with the same issue that you have identified.

Thanks.

sittard’s picture

FileSize
10.07 KB

Duplicate Post!

sittard’s picture

FileSize
10.51 KB

Oops I meant to upload this file! Shame you can't delete posts!

sittard’s picture

This version should allow the currency sign to be set in the UberCart store configuration and allows the currency sign to be displayed after the amount.

The function (uc_currency_format) takes care of most instances except in the calendar module when the number is being rounded (no decimals) and I've borrowed your suggestions from above to fix this.

sittard’s picture

FileSize
5.43 KB

This patch fixes the issue of hard coded currency symbols in the admin screens.

srobert72’s picture

Subscribe

houen’s picture

Subscribe

pobster’s picture

You could maintain the output using the Format Currency module.

Pobster

larowlan’s picture

Hi
Any currency issues have been resolved in version 2, they all go via Ubercart's uc_price function.
Day of the week still outstanding though.
LR

aem34’s picture

hello,

indeed day of week still an issue in order to get all calendars
beginning at "monday" instead of "sunday" if this is configured
in drupal administration for "Date".

is it for those kind of things, you're getting uc_hotel coupled with
"Date" module please ?

aem34’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
larowlan’s picture

There's no way to alter the first day of week on the calendars yet.
Happy to receive patches.

willvincent’s picture

I haven't looked at this code in a long time, nor do I have time to work on a patch for this, but to point someone in a good starting direction anyway...

The table header array is putting in day of week names in the order they appear from the php date('w') format, 0 = SUN through 6 = SAT.

This being the case, one should be able to add an admin setting to determine the start of the week (or maybe hook into that where it's already set somewhere else in the system) and then reorder the header array accordingly, and manipulate the row data accordingly as well.

It's likely going to be a fairly large patch, but shouldn't be an overly significant bit of coding. It occurs to me though that given the integration with views that's been added, it might be better to move the rendering of these calendars that direction as well and implement all of it as a views formatter. That, of course, would be a much more significant undertaking, but I think it might ultimately make it a bit more powerful, at least for a configuration standpoint.

romansta’s picture

Subscribing.

Olivier.b’s picture

here is a little hack to set monday as the first day of the week in calendars :

you have to edit hotel_booking.theme.inc

- on lines 201, 265 and 400, put the 'Sunday' line at the end of the array.

- on lines 215, 278 and 413 , add this code before the while

   if ($blank == 0) {
  	$blank = 6;
  }
  else {
  	$blank = $blank - 1;
  } 

it seems to work for me. i hope it will help waiting something nicer.

larowlan’s picture

Status: Postponed » Fixed

Anything in hotel_booking.theme.inc can be overriden with your theme.
Copy the function you want to modify to your theme's template.PHP and rename it appropriately.
Make your changes, flush the cache and you're done.

larowlan’s picture

removed duplicate

Status: Fixed » Closed (fixed)

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