If i add a booking to my cart, the first time i see it the price shown is that of the ROOMS-BASIC-BOOKING product - ie $1.00. After refreshing or stepping to checkout, the correct price is displayed.

Is this expected behaviour? or have i missed a step?

seems like a rule isn't triggering at the right time.

any help appreciated!

David

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sibiru’s picture

I have same problem too, actually when using another currency it will be back to $1 again

nightonfire’s picture

I think i fixed the issue. This sets the price of the item before it hits the page. I am not sure this was the right way to change the price but it does the job.
This is my first time creating a patch. Let me know what I should fix for next time. I hope this helps.

nightonfire’s picture

Status: Active » Needs review
nightonfire’s picture

Status: Needs review » Needs work

I just realized this didn't really fix the problem as the shopping cart total didn't change. I am still looking into it.

nightonfire’s picture

Status: Needs work » Needs review
FileSize
673 bytes

New patch that I am much more satisfied with. This triggers the rule to recalculate prices after creating the line item so that when it gets to displaying the cart the price has already been calculated.

ronald_istos’s picture

Status: Needs review » Postponed (maintainer needs more info)

can't really reproduce this. Could you provide more info about environment and check against latest dev.

nightonfire’s picture

Status: Postponed (maintainer needs more info) » Needs review

I just did a fresh install of Drupal installed the latest dev of rooms and installed the latest (not dev) version of all the dependencies. Then created a unit type 'test' with 2 adults and 0 children and a price of 120. Then I created a unit called 'test unit' with all the default options. I searched for a room at /booking and clicked book. On the /bookings page it lists the room at $1 on refresh it changes to $120.

Thank you for your quick response time :)

ronald_istos’s picture

Hm - that's interesting. Must be an environment issue because I can't recreate this. What is your stack like (Linux, PHP, etc)?

nightonfire’s picture

I am running linux (cent os) and PHP 5.3.23
if you want I can pm you a login to my dev site

ronald_istos’s picture

FileSize
719 bytes

Hi - could you try the attached patch. Essentially the same solution but done just before we place the line_item in the cart after the rooms_create_line_item function.

nightonfire’s picture

I am very confused. Your patch did not work. However your invoke rule line before the return (where I had it) works fine. I applied the patch twice because I was so confused. It didn't work both times.

ronald_istos’s picture

Hm - confusing indeed - in terms of code sequence it is essentially the same thing. I am concerned about adding this to the codebase without having been able to re-create or understand the reasons behind it. At least we know that you have a solution to move forward for now (your patch) and will revisit this after the 1.1 release (landing sometime today)

ronald_istos’s picture

Hi - I just came across this error on a local install and the issue was really that the user did not have the "Access Checkout" permission. Might be worth checking this in your install as well.

chrbak’s picture

Hello, I can confirm the same problem too.

I used a fresh install of Commerce Kickstart 7.x-2.14 (with demo profile) and Rooms 7.x-1.1 (running on a linux OS server with PHP 5.4.26). Following the steps like @nightonfire describes (#7) when I place a book to cart the price is 1€.

The "Access Checkout" is already checked by the Kickstart profile but the problem still remains. I don't know if there is some kind of conflict with the Kickstart profile?

The provided patch (#5) from @nightonfire did the work but the calculated price from display fields (admin/commerce/config/product-variation-types/rooms-product/display/product_in_cart) still shows the wrong price.

nightonfire’s picture

I have been using administrator accounts to test this issue so they all have access to the cart. I tried enabling the "Access Checkout" permission for all users and it does not change anything for me.

Marvine’s picture

Same issue here.

1$ dollar display instead of the right price during the buying process.

  • Commit 21ac567 on master, 7.x-1.x by plopesc:
    Issue #2224019 by nightonfire, ronald_istos | david.a.king: Room added...

  • Commit 21ac567 on master, 7.x-1.x by plopesc:
    Issue #2224019 by nightonfire, ronald_istos | david.a.king: Room added...
ronald_istos’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

mbhaney’s picture

I am having this $1 price until refreshing booking cart issue. Using rooms 1.2 on Drupal 7.28 with commerce 1.9 (all latest as of 6/5/14).

How do I apply the patch listed above (#10), or is the patch already in the rooms 1.2 code?

Is there something in the commerce module that could cause this?

Thanks,

Bret

nightonfire’s picture

I am having the same problem with rooms 1.2 as well. The new version did not fix it.

I don't know if I should create a new issue or reopen this one.

Marvine’s picture

In fact, same as nightonfire.

On bookings page "Review your reservation" the price is not calculated for the field "total". I have just the price for one night.

I have to refresh the page (F5) to see the good price.

Marvine’s picture

Do you know if the last version of the module ( 7.x-1.3) fix this issue ?

(FYI) this link is dead : https://www.drupal.org/project/rooms_packages

nightonfire’s picture

Status: Closed (fixed) » Needs work

No 1.3 did not fix it for me I still had to use the patch from #5. I am going to re-open this issue hopefully we can get this fixed.

Marvine’s picture

@nightonfire : Thanks. Your patch works for me.

mubiesam’s picture

@nightonfire: Thanks for your patch, but while trying to apply the patch, got an error...
Undefined property: stdClass::$body_label in patch_manager_form() (../sites/all/modules/patch_manager/patch_manager.module line 115)

plopesc’s picture

Status: Needs work » Needs review
FileSize
811 bytes

Hello,
Attaching new patch version.
Hope this fix all the price issues.

Sorry for the inconvenience.

  • plopesc committed f36d686 on master
    Issue #2224019 by nightonfire, ronald_istos | david.a.king: Room added...

  • plopesc committed f36d686 on master
    Issue #2224019 by nightonfire, ronald_istos | david.a.king: Room added...
mubiesam’s picture

patch #28 works for me, thanks

LonitaD’s picture

I had the same issue. Patch #28 works for me.

dorys’s picture

Priority: Normal » Major

I need to re-open this issue.

I currently have this issue using Rooms 7.x-1.3+17-dev which already includes the #28 patch. This is super urgent as the client's site is live.

I thoroughly tested on my test server which is hosted by hostmonster.com. I moved the site to Network Solutions and went live last Wednesday. All worked well up until last night. The site was not firing confirmation emails to the guests and I found that the Emogrifier.php file was not being seen in the library so I fixed that.

Now, the price in the shopping cart is incorrect. It is showing the price from the Product:ROOMS-BASIC-BOOKING which I have set to $0.00. I even tried changing the price to $100.00 but then the shopping cart shows $100.00.

No amount of refreshing or clearing the cache is fixing this.

EDIT: I decided to re-upload all the modules from my dev site to the live site and now the checkout is showing the correct price. I wish I could understand what the heck happened so I don't repeat it.

Anonymous’s picture

I think I've narrowed this down for anyone having this issue, even with the patch.

There appears to be a slight incompatibility with Commerce and Rules 2.8 which prevents prices from being properly calculated when the cart is refreshed.

I believe its related to https://www.drupal.org/node/2324587, which delays processing events until after Rules' hook_init runs. Commerce is getting the order ready before Rules has a chance to run its hook_init which means it won't process Commerce's 'commerce_product_calculate_sell_price' event and Rooms never gets a chance to update the price on the cart item.

With Rules 2.8, I'm forcing rules_event_invocation_enabled() in rules.module (at the bottom) to default $invocation_enabled to TRUE (line 1679). Quick and dirty fix.

Downgraded to 2.7 and I'm no longer seeing this issue.

EDIT: I don't think there'd be an issue with the current stable release of commerce kickstart because it ships with Rules 2.7.

dorys’s picture

@mhazy - you just saved me from thinking I was crazy. I recently updated to Rules 2.8. When I re-uploaded the modules from my dev site back to the live site I inadvertently down graded to Rules 2.7. THANK YOU.

Will you be adding this to the Rules Issues queue?

phanosd’s picture

@mhazy thank you for this! Threw 2 days down the gutter trying to figure out what I broke on my site. Forgot that we updated the Rules module

ITWest-jg’s picture

Had same issue.

Rolling back to rules 2.7 and applying patch #28 works for me - THANK YOU!!

f4o’s picture

@mhazy - thank your for sharing this conflict. I'm using Rooms 1.4 and rolling back to Rules 2.7 solved this issue. No patch needed.

ronald_istos’s picture

For anyone coming to this issue because they are seeing it with the latest version of Rooms. This is an issue with Rules 2.8 and Commerce. If you have Rules 2.8 please roll back to 2.7 or look here #2324587: Rules might be triggered too early in the bootstrap

ronald_istos’s picture

Status: Needs review » Closed (fixed)
GiorgosK’s picture

its fixed on 18th of February as per
#2324587: Rules might be triggered too early in the bootstrap
so upgrading to the latest dev version also fixes this

Cheviot’s picture

GiorgosK,
Using the latest dev version I still have the same problem. I'm using Rules 2.7, cleansed the cache, did a cron run, but it is still wrong.

I'm rather new to Drupal, especially Rooms, though I'm catching up quickly, this error goes beyond my current knowledge but I need to get it solved for a demo to a client.

In the Logs there are no errors, as far I can see, related to Rooms

Hope this can be fixed

GiorgosK’s picture

@Cheviot
you need to use the latest dev of RULES
but according to reports above 2.7 rules should also work

Skin’s picture

Confirmed: upgrading to the latest dev version of rules( 7.x-2.8+2-dev (2015-Feb-18) ) fixes this, no patch needed.

Cheviot’s picture

Added Rules 2.7 latest Dev, now I have £1 on the cart but empty bookings cart and empty shopping card (I use kickstart), tried Rules 2.8, same results.

I noticed that the room has not been added to the list in admin/rooms/bookings, it is visible in the kickstart manage order list and has the correct value (50,- to pay in advance) but the quantity remain persistent zero. I found it with the status 'pending' and quantity = 0. I can change this from 0 to 1, set it manually to 'checkout' but when I do an actual checkout via /bookings as buyer then I get "The maximum quantity available for Rooms Basic Booking is 0." - image and rules log added -

The cart showed SKU=Rooms-Basic-Booking, quantity is 1 and £1,-

I looks to me a rules issue, but what? And where should increase "Rooms Basic Booking" to get to the next step? All rooms are available (calendar is only 'green', nothing indicates rooms are unavailable). Of course cache cleansed and did a cron after any setting change and version changes, no any improvement. I think that in the booking menu rooms are found (so is available), then the room is parsed but as 'zero availability' and drops to pending instead of checkout, setting it manually to 1 then creates a conflict because the source has somewhere a 'zero' against the room (btw all rooms created in admin/rooms/units give the same result).

Hope this helps homing in to a solution.

Cheviot’s picture

@GiorgosK
I discovered that disabling "Commerce Simple Stock" and "Commerce Simple Stock Management" makes it possible to see the Rooms and Kickstart checkcout cart contents (items goes into checkout status as expected). It seems "Commerce Simple Stock" reserves 1 item in a wrong scenario, the availability of a room on date x to y - always one room of course as there are no 2 rooms '12' available on the same date - becomes 0. Next Rooms cannot process because the order (rules) with zero rooms and goes into "pending" (note the value of the room in kickstart order is 50.00, but items and total is 0).

Something need to change to make Rooms work with "Commerce Simple Stock" which is needed for the kickstart shop side.

On the Rooms Checkout (/bookings) see now:
Booking for Economy Doubles (1 Night; Arrival: 19-03-2015 Departure: 20-03-2015) £50.00 remove £50.00 (line items from Rooms)
Sample 1 16.00 remove 16.00 (line item from shop in Kickstart)
Order total £66.00 (works fine)

On the Kickstart checkout (/cart) I see

SKU: ROOMS-BASIC-BOOKING
Title:Rooms Basic Booking £1.00
Status: Active
View product (which text only)
------
SKU:sample1 £16.00
Status:Active
View Product (linked to product and works as expected)

The kickstart line items seen in kickstart checkout are wrong. Maybe we should never use kickstart checkout at all and replace the checkout notice with the basked with Rooms-Checkout to avoid someone getting confused ending up in kickstart-checkout?

Now I'm back to the £1.00 problem on the add to cart notice showing SKU:ROOMS-BASIC-BOOKING etc rather than "Economy Doubles" reserved at £50.00
I'm using rules 2.7 dev, going to try 2.8 as suggested by Skin, Maybe they are kickstart line items rather than Rooms... no idea yet.

Hope this may help others who have troubles when having C. Simple Stock in use, disable if you do not need it.

scadaddle’s picture

Having the same problems. Keeps using a percentage of the price on the product type rather than the individual room. Also it does not take into account the number of nights stayed.

Rooms checkout settings -> Payment deposit settings -> Guests must pay 25% of the full booking price at checkout to secure booking.
The rooms module or one of its sub modules, then updates the pricing rule: Store->Configuration->Product Price Rules - Rooms deposit payment.

The action for Rooms deposit payment rule is now set to Multiply the unit price by some amount.
Parameter: Line item: [commerce_line_item], Amount: 0.25

The problem is that the value of the line item is not correct.

If I modify the rule and insert an action before the Multiply the unit price by some amount action:
Actions
Add an amount to the unit price commerce-line-item:rooms-booked-price
then everything works.

What am I missing? Why is this value not already set as the line item?
Thanks for any help.

renee_nistler’s picture

Status: Closed (fixed) » Active
renee_nistler’s picture

Hello
I am also having this problem. I am using Rooms version = "7.x-1.3" with Rules version = "7.x-2.7".
When I use the Search Availability date fields I get rooms results with accurate BASE PRICE that is for all dates specified. However, when I click BOOK THIS, I am taken to the confirmation page where the PRICE is $1.00. I need the PRICE to reflect the BASE PRICE that was provided on the search availability result.

Any help you can provide is greatly appreciated as I have a client going live in 2 weeks.
Thanks much
Renee

renee_nistler’s picture

Hello
I am also having this problem. I am using Rooms version = "7.x-1.3" with Rules version = "7.x-2.7".
When I use the Search Availability date fields I get rooms results with accurate BASE PRICE that is for all dates specified. However, when I click BOOK THIS, I am taken to the confirmation page where the PRICE is $1.00. I need the PRICE to reflect the BASE PRICE that was provided on the search availability result.

Any help you can provide is greatly appreciated as I have a client going live in 2 weeks.
Thanks much
Renee

plopesc’s picture

Version: 7.x-1.0 » 7.x-1.4
Status: Active » Fixed

This is already fixed in 7.x-1.4

renee_nistler’s picture

FileSize
475.02 KB

Hello plopesc,
Our primary environment is running Rooms 7.x-1.4 and Rules 7.x-2.8. We created the additional environment with previous versions to see if problem would resolve as this email string indicated. It did not. We still have the issue in both environments.

Please see attached (RoomsSupport.pdf) with screenshots from our 7.x-1.4 Rooms and Rules 7.x-2.8 environment.

1) We looked at the rooms_booking_manager_price_apply function which appears to be setting the $line_item value. It looks like it is setting it to the commerce_unit_price which I think is the $1.00 configured on the product page.
2) We also noticed that in the database table commerce_product lists STANDARD with TYPE of 'rooms_product', but in commerce_product_type table there is not a row for 'rooms_product'. Is this expected?
3) Ive attached a pdf below = commerce.pdf in attempt to understand how these entities are related...can you review and fill in the blanks for us? I am not sure if we are configured correctly.

Can you point us to the code or tell us how the line_item price is being calculated?

Thanks
Renee

scadaddle’s picture

Updated rooms and rules.

As #23 Marvine said

On bookings page "Review your reservation" the price is not calculated for the field "total". I have just the price for one night.
I have to refresh the page (F5) to see the good price.

We have rooms 1.4, rules 2.9.

This still occurs on Windows 7 using WAMP. You must hit F5 and refresh.
It works correctly on Ubuntu using LAMP.

The wamp version has apache 2.4.2

scadaddle’s picture

My above #53 talks about Rooms checkout settings only. Allow bookings based on a deposit.

If Allow bookings based on a deposit is checked.
Fixed amount deposit works on LAMP and not WAMP unless refreshed.
Percentage deposit does NOT work on either environment.
Takes a percentage of the $1 ROOMS-BASIC-BOOKING price.
It should take a percentage of the total cost to stay for all nights.

If Allow bookings based on a deposit is not checked.
It should display total cost to stay for all nights.
Instead is shows the $1 ROOMS-BASIC-BOOKING price.

Hope this is clear.

renee_nistler’s picture

FileSize
94.13 KB

Additional graphic for post #52

renee_nistler’s picture

Status: Fixed » Active
scadaddle’s picture

#51 plsec I noticed that you closed this.
It is not fixed in rooms 1.4

mubiesam’s picture

Me too...I upgraded to 1.4, but still got the same issue...

plopesc’s picture

Did you test it using Rooms 7.x-1.4 and Rules 7.x-2.7?
I just tested this environment in a fresh install and worked.
Maybe you're adding some rules related functionality that creates a conflict with Rooms.

I did not test it against Rules 7.x-2.9, but there is a known bug with 7.x-2.8

Regards

renee_nistler’s picture

FileSize
81.59 KB

Good Morning.
I just updated to rooms 7.x-1.4 on an environment that is running Rules 7.x-2.7.
I still have the same problem. Upon clicking BOOK THIS the price on the checkout form is $1.00. Remains at $1.00 even after refresh.
I am attaching a copy of the Rules configured. I have not changed or added any additional Rules.

Could this be environment related? What is your local environment?
Could this be related to jquery version?
Can you explain what configuration of Product Types, Products and Product Line Items should be?

Thanks for your help
Renee

renee_nistler’s picture

Hello plopesc,
Thanks. We downloaded a fresh install of Rooms and Rules and you are correct, it did work. In comparing that environment with our development environment, we found that the PRODUCT configuration was different in our THEME (Weebpal Aloha). Weebpal configured their SKU as 'STANDARD' but the rooms-booking-manager.module has hardcoded logic in the rooms_booking_manager_price_apply function that references a specific SKU (see below). Once we change the PRODUCT configuration in our theme, the correct room price shows up on the booking confirmation/checkout screens.

Thanks for your help and please pass on findings to others who have this problem.

function rooms_booking_manager_price_apply($line_item) {
if ($line_item->type == 'rooms_booking') {
if ($item = field_get_items('commerce_line_item', $line_item, 'commerce_product')) {
$product = commerce_product_load($item[0]['product_id']);
if ($product->sku != 'ROOMS-BASIC-BOOKING') {
return;
}
}

Renee

scadaddle’s picture

#61 renee_nistler -
that worked for me.
We had change the value of the product->sku.

This works on rooms 1.4 with rules 2.9.

#59 plopesc - thanks for reposting that it worked with fresh install.
with #61 getting it to work. we also got it to work.

Thanks everyone.

plopesc’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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

Würden’s picture

I am on the newest versions of Rules 2.9, Rooms 1.7 and Commerce 7.x-1.11 and I still have this issue.
I tried all solutions so far suggested in this thread including updating permissions, adding the rules invoke and change product SKU back and forth but nothing seems to work.

Removing line 1195 in rooms_booking_manager.module:
// Refresh line items price and redirect to bookings page.
commerce_cart_order_refresh(commerce_cart_order_load($user->uid));

Seems to fix the problem for me.

Kalpesh Popat’s picture

#61 renee_nistler -
your solution solved my case - wasted 2 days on it !