When added to cart, remove from cart, change status of an order, i have an error such as:

Recoverable fatal error: Argument 2 passed to commerce_availability_change_state() must be an instance of timestamp, array given, called in /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module on line 430 and defined w commerce_availability_change_state() (linia 379 z /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module).

Commerce 7.11
Availability Calendar: 7.x-4.1

CommentFileSizeAuthor
#3 product.JPG68.04 KBlamp5
#3 line item.JPG77.22 KBlamp5
#3 commerce availability.JPG37.75 KBlamp5

Comments

lamp5 created an issue. See original summary.

inakilz’s picture

Maybe you are not configuring correctly?

Remember that you need to add a datetime popup field in the line item associate to products and select this field it in the module administration page: admin/config/system/commerce-availability.

Check it, please.

lamp5’s picture

StatusFileSize
new37.75 KB
new77.22 KB
new68.04 KB

I think that all is ok. look at the screenshots.

I checked option "Include this field on Add to Cart forms for line items of this type. " in datatime popup field settings.

shasha_s’s picture

Drupal core 7.38
Commerce 7.11
Availability Calendars 7.x-5.4

Hi inakilz,

i have the same problem. checked the settings - everything like your how todo steps.

  • inakilz committed 0c280c3 on
    Issue #2549295 by inakilz: Fixed fatal error and some js errors
    
inakilz’s picture

I've fixed the error.

Configuration for the product variations field in the associate line item:
- Select "Add to cart form"
- In its format settings: uncheck "Display a textfield quantity widget on the add to cart form" and set "default quantity = 1" (The module only supports attaching a date range for each product variation).

Others settings:
- It's necessary to check "Include this field on Add to Cart forms for line items of this type. " option in datetime popup field settings in order to see the date selection.
- Jquery >= 1.7 is necessary.

When I have some time I'll try to write more documentation.

inakilz’s picture

Status: Active » Fixed
lamp5’s picture

inakilz,

Thx. Now the calendar works but not in order.
When i chose start date for example 21.08 and end date 26.08 and added to cart, it displays a warning

    Warning: DateTime::setTimestamp() expects parameter 1 to be long, array given in commerce_availability_check_buffer() (line 322 of /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module).
    Warning: DateTime::setTimestamp() expects parameter 1 to be long, array given in commerce_availability_check_buffer() (line 322 of /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module).
    Warning: date() expects parameter 2 to be long, array given in commerce_availability_get_from_to() (line 343 of /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module).
    Warning: date() expects parameter 2 to be long, array given in commerce_availability_get_from_to() (line 345 of /usr/local/www/localhost/sites/all/modules/commerce_availability/commerce_availability.module).

and i see on the calendar booked the first 5 days avaliable in this case from today (14.08) to 19.08.

lamp5’s picture

Status: Fixed » Needs review
inakilz’s picture

Hi lamp5,

The module provides a booking system for rent products for a specific date not a range of days. For example, a shop that offers an online service that provides designer dresses and accessories rentals for future events.

An example of shops that work with this business model:
https://www.renttherunway.com
https://www.24fab.com/

And how they work:
https://www.renttherunway.com/how_it_works
https://www.24fab.com/alquila-tu-look-en-solo-3-pasos

In the settings you can set a number of days marked as reserved for the following days to the current day and a margin of days to ship the product and bring it back.

  • inakilz committed 1e09541 on 7.x-1.x
    Issue #2549295 by inakilz: Avoids warning and adds a message to warn...
inakilz’s picture

Status: Needs review » Closed (works as designed)
inakilz’s picture

Status: Closed (works as designed) » Closed (fixed)