First of all its great module. i am making a site at http://www.goflamingo.co
the problem i am facing is when i add any room to cart to book, it shows price 0.0 i dont know how to figure it out. Please help at earliest.

Another problem occurs when i hit checkout. I have attached screenshot for both. Please help.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tanay_lakhani’s picture

also if i refresh the page, that checkout page is displayed properly, but total is 0.0 only.

tanay_lakhani’s picture

I have fixed error on cart page about not showing total in cart table.

Please put this code in hotel_booking.ubercart.inc file:

function hotel_booking_uc_cart_display($item) {
+if ($item->module == 'hotel_booking') {
+ $data = $item->data;
+ $item->price = $data['total'];
+ if (($type = variable_get('hotel_booking_payment_type', 0)) &&
+ ($rate = variable_get('hotel_booking_payment_rate'))) {
+ $item->full_price = $item->price;
+ switch ($type) {
+ case 1:
+ $item->price = $rate;
+ break;
+ case 2:
+ $item->price = $data['total'] * ($rate / 100);
+ }
+ }
+ }
$node = node_load($item->nid);
$element = array();

tanay_lakhani’s picture

please help me with the second error which i am getting on checkout page.

i have made a few changes in order to get this working. but in vain. i made the following changes.

in hotel_booking.ubercart.inc file:

i changed the following code:

/**
* Implements hook_order_pane().
*/
function hotel_booking_uc_order_pane($item, $element, $panes) {
$element = array();
if ($item->module == 'hotel_booking') {
$data = $item->data;
$item->price = $data['total'];
if (($type = variable_get('hotel_booking_payment_type', 0)) &&
($rate = variable_get('hotel_booking_payment_rate'))) {
$item->full_price = $item->price;
switch ($type) {
case 1:
$item->price = $rate;
break;
case 2:
$item->price = $data['total'] * ($rate / 100);
}
}
}
$element['#total'] = $item->price;
$panes[] = array(
'id' => 'hotel_booking',
'callback' => 'hotel_booking_booking_pane',
'title' => t('Booking Details'),
'desc' => t('Display details of room bookings.'),
'class' => 'abs-left',
'weight' => 5,
'show' => array('view', 'customer'),
);
if (variable_get('hotel_booking_reward_prompt', '')) {
$panes[] = array(
'id' => 'reward_membership',
'callback' => 'hotel_booking_pane_rewards',
'title' => t('Reward Membership'),
'weight' => 5,
'show' => array('view', 'customer'),
);
}

return $element;

return $panes;

}

and in uc_order.module file, i changed:

$item = array();
$element = array();
$total = $element['#total'];

if ($order === FALSE) {
return $total;
}

if ($products_only) {
return $total;
}

$total += uc_line_items_calculate($order);

foreach (module_implements('uc_order') as $module) {
$function = $module . '_uc_order';
// $order must be passed by reference.
if (function_exists($function) && ($value = $function('total', $order, NULL))) {
$total += $value;
}
}
return $total;
}

attaching a screenshot of error with this stuff. please help

larowlan’s picture

Hi
The module hasn't been updated to reflect changes in the date module and ubercart.
I've not had time to do it.
There is an issue in the issue queue regarding 366 days when booking 1 - you need the patches from that issue first.
Can you install devel module and run this at /devel/php - paste the output of the 'data' array for a hotel product.

dsm(uc_cart_get_contents());

Lee

tanay_lakhani’s picture

hey lee, thanx for the response. i have applied all the patches to make the module usable. i have everything in place now except only 1 said error or checkout page. I have solved 366 days bug + cant remove from cart etc. let me try with devel code you provided.

thanx.

Tanay

tanay_lakhani’s picture

i executed from devel php block on checkout page

i got following result:
... (Array, 1 element)
9 (Object) stdClass
cart_item_id (String, 1 characters ) 9
cart_id (String, 1 characters ) 1
nid (String, 2 characters ) 26
qty (String, 1 characters ) 1
changed (String, 10 characters ) 1330982195
data (Array, 7 elements)
vid (String, 2 characters ) 26
uid (String, 1 characters ) 1
title (String, 10 characters ) Delux Room
log (String, 0 characters )
status (String, 1 characters ) 1
comment (String, 1 characters ) 0
promote (String, 1 characters ) 0
sticky (String, 1 characters ) 0
ds_switch (String, 0 characters )
type (String, 15 characters ) hotel_room_type
language (String, 3 characters ) und
created (String, 10 characters ) 1330933527
tnid (String, 1 characters ) 0
translate (String, 1 characters ) 0
revision_timestamp (String, 10 characters ) 1330982195
revision_uid (String, 1 characters ) 1
capacity (String, 1 characters ) 2
hbrid (String, 1 characters ) 1
hbrmid (String, 1 characters ) 0
smoking (String, 1 characters ) 1
minimum_occupancy (String, 1 characters ) 1
default_available (String, 1 characters ) 6
model (String, 2 characters ) DR
from_rate (String, 6 characters ) 70.000
next_available (String, 19 characters ) 2012-03-24 00:00:00
next_available_object (Object) DateObject
next_available_formatted (String, 18 characters ) 03/24/2012 - 00:00
weight_units (Boolean) FALSE
shippable (Boolean) FALSE
weight (Boolean) FALSE
cost (Boolean) FALSE
sell_price (Boolean) FALSE
body (Array, 1 element)
uc_product_image (Array, 1 element)
field_room_features (Array, 1 element)
rdf_mapping (Array, 0 elements)
attributes (Array, 1 element)
name (String, 5 characters ) arham
picture (String, 1 characters ) 0
variant (Boolean) TRUE
module (String, 13 characters ) hotel_booking
order (Object) UcOrder
order_id (Integer) 0
uid (String, 1 characters ) 1
order_status (String, 11 characters ) in_checkout
order_total (Integer) 0
primary_email (String, 17 characters ) info@arhamweb.com
delivery_first_name (String, 0 characters )
delivery_last_name (String, 0 characters )
delivery_phone (String, 0 characters )
delivery_company (String, 0 characters )
delivery_street1 (String, 0 characters )
delivery_street2 (String, 0 characters )
delivery_city (String, 0 characters )
delivery_zone (Integer) 0
delivery_postal_code (String, 0 characters )
delivery_country (String, 3 characters ) 356
billing_first_name (String, 0 characters )
billing_last_name (String, 0 characters )
billing_phone (String, 0 characters )
billing_company (String, 0 characters )
billing_street1 (String, 0 characters )
billing_street2 (String, 0 characters )
billing_city (String, 0 characters )
billing_zone (Integer) 0
billing_postal_code (String, 0 characters )
billing_country (String, 3 characters ) 356
products (Array, 0 elements)
line_items (Array, 0 elements)
payment_method (String, 0 characters )
data (Array, 0 elements)
created (Integer) 1332484001
modified (Integer) 1332484001
currency (String, 3 characters ) INR
entity_view_prepared (Boolean) TRUE
price (Float) 7000

thus price is called from cart.. but subtotal is 0.0

what should i do?

tanay_lakhani’s picture

hey lee, if possible can u take ftp access and set this thing up? If possible please give me a mail at tanay_lakhani@yahoo.com for any kind of deal to fix this bug. Thanks a lot.

larowlan’s picture

Status: Active » Postponed (maintainer needs more info)

Your cart item is missing the data needed by the module to calculate the price.
Please remove all items from your cart (either from /cart or by flushing the uc_cart_products table) and try again.

tanay_lakhani’s picture

FileSize
219.87 KB

hi lee,

good to hear again from you. please help me on the bug. attached a screenshot. i tried flushing out. but no luck.

tanay_lakhani’s picture

Status: Postponed (maintainer needs more info) » Active
larowlan’s picture

Status: Active » Fixed

I've made some changes in the dev version.
Please give the drupal.org packaging script 24hrs to create a new dev release and try again.

tanay_lakhani’s picture

thank you so much... ll check it out.

tanay_lakhani’s picture

Status: Fixed » Active
FileSize
129.99 KB

i have upgraded module to new dev version..
but when i am trying to create a page, on saving it, getting PDOException error.. attaching screenshot.
whats the solution?
Thank you.

larowlan’s picture

Edit the table hotel_booking_room_types using phpmyadmin or command line and make the 'from_rate' field precision/scale larger to accommodate your prices

pucc’s picture

Hi, I have just installed the dev version beacuse the beta one's gave me the same errors that are reported in this post..but when I enable the module I get this error:
FieldException: Attempt to create field name uc_product_image which already exists, although it is inactive. in field_create_field()
what am I supposed to do?
Thank you

tanay_lakhani’s picture

hey lee,

error continues i.e. initial error of price 0.0 on cart page and checkout page..

tanay_lakhani’s picture

i also tried on fresh drupal 7 installation.. you can find this fresh installation at http://goflam.arhamsoftech.com/node/2

brynmoorhouse1994’s picture

I am also having this problem.
Notice: Undefined property: stdClass::$price in hotel_booking_uc_cart_display() (line 110 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/uc_hotel/hotel_booking/hotel_booking.ubercart.inc).
And if I click checkout anyway I get the following:

Notice: Undefined property: stdClass::$price in hotel_booking_uc_cart_display() (line 110 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/uc_hotel/hotel_booking/hotel_booking.ubercart.inc).
Notice: Undefined index: qty in uc_cart_view_form_submit() (line 907 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/ubercart/uc_cart/uc_cart.module).
Notice: Undefined index: qty in uc_cart_update_item_object() (line 1516 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/ubercart/uc_cart/uc_cart.module).
Notice: Undefined property: stdClass::$price in uc_order_get_total() (line 1532 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/ubercart/uc_order/uc_order.module).
Notice: Undefined property: stdClass::$price in uc_order_get_total() (line 1532 of /home/hathers1/public_html/othersites/casaclara/sites/all/modules/ubercart/uc_order/uc_order.module).
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1: INSERT INTO {uc_order_products} (order_id, nid, title, model, qty, cost, weight, weight_units, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => 4 [:db_insert_placeholder_1] => 1 [:db_insert_placeholder_2] => Casa Clara [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => kg [:db_insert_placeholder_8] => a:7:{s:6:"module";s:13:"hotel_booking";s:6:"prices";a:365:{i:0;s:7:"250.000";i:1;s:7:"250.000";i:2;s:7:"250.000";i:3;s:7:"250.000";i:4;s:7:"250.000";i:5;s:7:"250.000";i:6;s:7:"250.000";i:7;s:7:"250.000";i:8;s:7:"250.000";i:9;s:7:"250.000";i:10;s:7:"250.000";i:11;s:7:"250.000";i:12;s:7:"250.000";i:13;s:7:"250.000";i:14;s:7:"250.000";i:15;s:7:"250.000";i:16;s:7:"250.000";i:17;s:7:"250.000";i:18;s:7:"250.000";i:19;s:7:"250.000";i:20;s:7:"250.000";i:21;s:7:"250.000";i:22;s:7:"250.000";i:23;s:7:"250.000";i:24;s:7:"250.000";i:25;s:7:"250.000";i:26;s:7:"250.000";i:27;s:7:"250.000";i:28;s:7:"250.000";i:29;s:7:"250.000";i:30;s:7:"250.000";i:31;s:7:"250.000";i:32;s:7:"250.000";i:33;s:7:"250.000";i:34;s:7:"250.000";i:35;s:7:"250.000";i:36;s:7:"250.000";i:37;s:7:"250.000";i:38;s:7:"250.000";i:39;s:7:"250.000";i:40;s:7:"250.000";i:41;s:7:"250.000";i:42;s:7:"250.000";i:43;s:7:"250.000";i:44;s:7:"250.000";i:45;s:7:"250.000";i:46;s:7:"250.000";i:47;s:7:"250.000";i:48;s:7:"250.000";i:49;s:7:"250.000";i:50;s:7:"250.000";i:51;s:7:"250.000";i:52;s:7:"250.000";i:53;s:7:"250.000";i:54;s:7:"250.000";i:55;s:7:"250.000";i:56;s:7:"250.000";i:57;s:7:"250.000";i:58;s:7:"250.000";i:59;s:7:"250.000";i:60;s:7:"250.000";i:61;s:7:"250.000";i:62;s:7:"250.000";i:63;s:7:"250.000";i:64;s:7:"350.000";i:65;s:7:"350.000";i:66;s:7:"350.000";i:67;s:7:"350.000";i:68;s:7:"350.000";i:69;s:7:"350.000";i:70;s:7:"350.000";i:71;s:7:"350.000";i:72;s:7:"350.000";i:73;s:7:"350.000";i:74;s:7:"350.000";i:75;s:7:"350.000";i:76;s:7:"350.000";i:77;s:7:"350.000";i:78;s:7:"350.000";i:79;s:7:"350.000";i:80;s:7:"350.000";i:81;s:7:"350.000";i:82;s:7:"350.000";i:83;s:7:"350.000";i:84;s:7:"350.000";i:85;s:7:"350.000";i:86;s:7:"350.000";i:87;s:7:"350.000";i:88;s:7:"350.000";i:89;s:7:"350.000";i:90;s:7:"350.000";i:91;s:7:"350.000";i:92;s:7:"350.000";i:93;s:7:"350.000";i:94;s:7:"350.000";i:95;s:7:"350.000";i:96;s:7:"350.000";i:97;s:7:"350.000";i:98;s:7:"350.000";i:99;s:7:"350.000";i:100;s:7:"350.000";i:101;s:7:"350.000";i:102;s:7:"350.000";i:103;s:7:"350.000";i:104;s:7:"350.000";i:105;s:7:"350.000";i:106;s:7:"350.000";i:107;s:7:"350.000";i:108;s:7:"350.000";i:109;s:7:"350.000";i:110;s:7:"350.000";i:111;s:7:"350.000";i:112;s:7:"350.000";i:113;s:7:"350.000";i:114;s:7:"350.000";i:115;s:7:"350.000";i:116;s:7:"350.000";i:117;s:7:"350.000";i:118;s:7:"350.000";i:119;s:7:"350.000";i:120;s:7:"350.000";i:121;s:7:"350.000";i:122;s:7:"350.000";i:123;s:7:"350.000";i:124;s:7:"350.000";i:125;s:7:"350.000";i:126;s:7:"350.000";i:127;s:7:"350.000";i:128;s:7:"350.000";i:129;s:7:"350.000";i:130;s:7:"350.000";i:131;s:7:"350.000";i:132;s:7:"350.000";i:133;s:7:"350.000";i:134;s:7:"350.000";i:135;s:7:"350.000";i:136;s:7:"350.000";i:137;s:7:"350.000";i:138;s:7:"350.000";i:139;s:7:"350.000";i:140;s:7:"350.000";i:141;s:7:"350.000";i:142;s:7:"350.000";i:143;s:7:"350.000";i:144;s:7:"350.000";i:145;s:7:"350.000";i:146;s:7:"350.000";i:147;s:7:"350.000";i:148;s:7:"350.000";i:149;s:7:"350.000";i:150;s:7:"350.000";i:151;s:7:"350.000";i:152;s:7:"350.000";i:153;s:7:"350.000";i:154;s:7:"350.000";i:155;s:7:"350.000";i:156;s:7:"350.000";i:157;s:7:"350.000";i:158;s:7:"350.000";i:159;s:7:"350.000";i:160;s:7:"350.000";i:161;s:7:"350.000";i:162;s:7:"350.000";i:163;s:7:"350.000";i:164;s:7:"350.000";i:165;s:7:"350.000";i:166;s:7:"350.000";i:167;s:7:"350.000";i:168;s:7:"350.000";i:169;s:7:"350.000";i:170;s:7:"350.000";i:171;s:7:"350.000";i:172;s:7:"350.000";i:173;s:7:"350.000";i:174;s:7:"350.000";i:175;s:7:"350.000";i:176;s:7:"350.000";i:177;s:7:"350.000";i:178;s:7:"350.000";i:179;s:7:"350.000";i:180;s:7:"350.000";i:181;s:7:"350.000";i:182;s:7:"350.000";i:183;s:7:"350.000";i:184;s:7:"350.000";i:185;s:7:"350.000";i:186;s:7:"250.000";i:187;s:7:"250.000";i:188;s:7:"250.000";i:189;s:7:"250.000";i:190;s:7:"250.000";i:191;s:7:"250.000";i:192;s:7:"250.000";i:193;s:7:"250.000";i:194;s:7:"250.000";i:195;s:7:"250.000";i:196;s:7:"250.000";i:197;s:7:"250.000";i:198;s:7:"250.000";i:199;s:7:"250.000";i:200;s:7:"250.000";i:201;s:7:"250.000";i:202;s:7:"250.000";i:203;s:7:"250.000";i:204;s:7:"250.000";i:205;s:7:"250.000";i:206;s:7:"250.000";i:207;s:7:"250.000";i:208;s:7:"250.000";i:209;s:7:"250.000";i:210;s:7:"250.000";i:211;s:7:"250.000";i:212;s:7:"250.000";i:213;s:7:"250.000";i:214;s:7:"250.000";i:215;s:7:"250.000";i:216;s:7:"250.000";i:217;s:7:"250.000";i:218;s:7:"250.000";i:219;s:7:"250.000";i:220;s:7:"250.000";i:221;s:7:"250.000";i:222;s:7:"250.000";i:223;s:7:"250.000";i:224;s:7:"250.000";i:225;s:7:"250.000";i:226;s:7:"250.000";i:227;s:7:"250.000";i:228;s:7:"250.000";i:229;s:7:"250.000";i:230;s:7:"250.000";i:231;s:7:"250.000";i:232;s:7:"250.000";i:233;s:7:"250.000";i:234;s:7:"250.000";i:235;s:7:"250.000";i:236;s:7:"250.000";i:237;s:7:"250.000";i:238;s:7:"250.000";i:239;s:7:"250.000";i:240;s:7:"250.000";i:241;s:7:"250.000";i:242;s:7:"250.000";i:243;s:7:"250.000";i:244;s:7:"250.000";i:245;s:7:"250.000";i:246;s:7:"250.000";i:247;s:7:"250.000";i:248;s:7:"250.000";i:249;s:7:"250.000";i:250;s:7:"250.000";i:251;s:7:"250.000";i:252;s:7:"250.000";i:253;s:7:"250.000";i:254;s:7:"250.000";i:255;s:7:"250.000";i:256;s:7:"250.000";i:257;s:7:"250.000";i:258;s:7:"250.000";i:259;s:7:"250.000";i:260;s:7:"250.000";i:261;s:7:"250.000";i:262;s:7:"250.000";i:263;s:7:"250.000";i:264;s:7:"250.000";i:265;s:7:"250.000";i:266;s:7:"250.000";i:267;s:7:"250.000";i:268;s:7:"250.000";i:269;s:7:"250.000";i:270;s:7:"250.000";i:271;s:7:"250.000";i:272;s:7:"250.000";i:273;s:7:"250.000";i:274;s:7:"250.000";i:275;s:7:"250.000";i:276;s:7:"250.000";i:277;s:7:"250.000";i:278;s:7:"250.000";i:279;s:7:"250.000";i:280;s:7:"250.000";i:281;s:7:"250.000";i:282;s:7:"250.000";i:283;s:7:"250.000";i:284;s:7:"250.000";i:285;s:7:"250.000";i:286;s:7:"250.000";i:287;s:7:"250.000";i:288;s:7:"250.000";i:289;s:7:"250.000";i:290;s:7:"250.000";i:291;s:7:"250.000";i:292;s:7:"250.000";i:293;s:7:"250.000";i:294;s:7:"250.000";i:295;s:7:"250.000";i:296;s:7:"250.000";i:297;s:7:"250.000";i:298;s:7:"250.000";i:299;s:7:"250.000";i:300;s:7:"250.000";i:301;s:7:"250.000";i:302;s:7:"250.000";i:303;s:7:"250.000";i:304;s:7:"250.000";i:305;s:7:"250.000";i:306;s:7:"250.000";i:307;s:7:"250.000";i:308;s:7:"250.000";i:309;s:7:"250.000";i:310;s:7:"250.000";i:311;s:7:"250.000";i:312;s:7:"250.000";i:313;s:7:"250.000";i:314;s:7:"250.000";i:315;s:7:"250.000";i:316;s:7:"250.000";i:317;s:7:"250.000";i:318;s:7:"250.000";i:319;s:7:"250.000";i:320;s:7:"250.000";i:321;s:7:"250.000";i:322;s:7:"250.000";i:323;s:7:"250.000";i:324;s:7:"250.000";i:325;s:7:"250.000";i:326;s:7:"250.000";i:327;s:7:"250.000";i:328;s:7:"250.000";i:329;s:7:"250.000";i:330;s:7:"250.000";i:331;s:7:"250.000";i:332;s:7:"250.000";i:333;s:7:"250.000";i:334;s:7:"250.000";i:335;s:7:"250.000";i:336;s:7:"250.000";i:337;s:7:"250.000";i:338;s:7:"250.000";i:339;s:7:"250.000";i:340;s:7:"250.000";i:341;s:7:"250.000";i:342;s:7:"250.000";i:343;s:7:"250.000";i:344;s:7:"250.000";i:345;s:7:"250.000";i:346;s:7:"250.000";i:347;s:7:"250.000";i:348;s:7:"250.000";i:349;s:7:"250.000";i:350;s:7:"250.000";i:351;s:7:"250.000";i:352;s:7:"250.000";i:353;s:7:"250.000";i:354;s:7:"250.000";i:355;s:7:"250.000";i:356;s:7:"250.000";i:357;s:7:"250.000";i:358;s:7:"250.000";i:359;s:7:"250.000";i:360;s:7:"250.000";i:361;s:7:"250.000";i:362;s:7:"250.000";i:363;s:7:"250.000";i:364;s:7:"250.000";}s:6:"nights";a:365:{i:0;s:19:"2012-03-01 00:00:00";i:1;s:19:"2012-03-02 00:00:00";i:2;s:19:"2012-03-03 00:00:00";i:3;s:19:"2012-03-04 00:00:00";i:4;s:19:"2012-03-05 00:00:00";i:5;s:19:"2012-03-06 00:00:00";i:6;s:19:"2012-03-07 00:00:00";i:7;s:19:"2012-03-08 00:00:00";i:8;s:19:"2012-03-09 00:00:00";i:9;s:19:"2012-03-10 00:00:00";i:10;s:19:"2012-03-11 00:00:00";i:11;s:19:"2012-03-12 00:00:00";i:12;s:19:"2012-03-13 00:00:00";i:13;s:19:"2012-03-14 00:00:00";i:14;s:19:"2012-03-15 00:00:00";i:15;s:19:"2012-03-16 00:00:00";i:16;s:19:"2012-03-17 00:00:00";i:17;s:19:"2012-03-18 00:00:00";i:18;s:19:"2012-03-19 00:00:00";i:19;s:19:"2012-03-20 00:00:00";i:20;s:19:"2012-03-21 00:00:00";i:21;s:19:"2012-03-22 00:00:00";i:22;s:19:"2012-03-23 00:00:00";i:23;s:19:"2012-03-24 00:00:00";i:24;s:19:"2012-03-25 00:00:00";i:25;s:19:"2012-03-26 00:00:00";i:26;s:19:"2012-03-27 00:00:00";i:27;s:19:"2012-03-28 00:00:00";i:28;s:19:"2012-03-29 00:00:00";i:29;s:19:"2012-03-30 00:00:00";i:30;s:19:"2012-03-31 00:00:00";i:31;s:19:"2012-04-01 00:00:00";i:32;s:19:"2012-04-02 00:00:00";i:33;s:19:"2012-04-03 00:00:00";i:34;s:19:"2012-04-04 00:00:00";i:35;s:19:"2012-04-05 00:00:00";i:36;s:19:"2012-04-06 00:00:00";i:37;s:19:"2012-04-07 00:00:00";i:38;s:19:"2012-04-08 00:00:00";i:39;s:19:"2012-04-09 00:00:00";i:40;s:19:"2012-04-10 00:00:00";i:41;s:19:"2012-04-11 00:00:00";i:42;s:19:"2012-04-12 00:00:00";i:43;s:19:"2012-04-13 00:00:00";i:44;s:19:"2012-04-14 00:00:00";i:45;s:19:"2012-04-15 00:00:00";i:46;s:19:"2012-04-16 00:00:00";i:47;s:19:"2012-04-17 00:00:00";i:48;s:19:"2012-04-18 00:00:00";i:49;s:19:"2012-04-19 00:00:00";i:50;s:19:"2012-04-20 00:00:00";i:51;s:19:"2012-04-21 00:00:00";i:52;s:19:"2012-04-22 00:00:00";i:53;s:19:"2012-04-23 00:00:00";i:54;s:19:"2012-04-24 00:00:00";i:55;s:19:"2012-04-25 00:00:00";i:56;s:19:"2012-04-26 00:00:00";i:57;s:19:"2012-04-27 00:00:00";i:58;s:19:"2012-04-28 00:00:00";i:59;s:19:"2012-04-29 00:00:00";i:60;s:19:"2012-04-30 00:00:00";i:61;s:19:"2012-05-01 00:00:00";i:62;s:19:"2012-05-02 00:00:00";i:63;s:19:"2012-05-03 00:00:00";i:64;s:19:"2012-05-04 00:00:00";i:65;s:19:"2012-05-05 00:00:00";i:66;s:19:"2012-05-06 00:00:00";i:67;s:19:"2012-05-07 00:00:00";i:68;s:19:"2012-05-08 00:00:00";i:69;s:19:"2012-05-09 00:00:00";i:70;s:19:"2012-05-10 00:00:00";i:71;s:19:"2012-05-11 00:00:00";i:72;s:19:"2012-05-12 00:00:00";i:73;s:19:"2012-05-13 00:00:00";i:74;s:19:"2012-05-14 00:00:00";i:75;s:19:"2012-05-15 00:00:00";i:76;s:19:"2012-05-16 00:00:00";i:77;s:19:"2012-05-17 00:00:00";i:78;s:19:"2012-05-18 00:00:00";i:79;s:19:"2012-05-19 00:00:00";i:80;s:19:"2012-05-20 00:00:00";i:81;s:19:"2012-05-21 00:00:00";i:82;s:19:"2012-05-22 00:00:00";i:83;s:19:"2012-05-23 00:00:00";i:84;s:19:"2012-05-24 00:00:00";i:85;s:19:"2012-05-25 00:00:00";i:86;s:19:"2012-05-26 00:00:00";i:87;s:19:"2012-05-27 00:00:00";i:88;s:19:"2012-05-28 00:00:00";i:89;s:19:"2012-05-29 00:00:00";i:90;s:19:"2012-05-30 00:00:00";i:91;s:19:"2012-05-31 00:00:00";i:92;s:19:"2012-06-01 00:00:00";i:93;s:19:"2012-06-02 00:00:00";i:94;s:19:"2012-06-03 00:00:00";i:95;s:19:"2012-06-04 00:00:00";i:96;s:19:"2012-06-05 00:00:00";i:97;s:19:"2012-06-06 00:00:00";i:98;s:19:"2012-06-07 00:00:00";i:99;s:19:"2012-06-08 00:00:00";i:100;s:19:"2012-06-09 00:00:00";i:101;s:19:"2012-06-10 00:00:00";i:102;s:19:"2012-06-11 00:00:00";i:103;s:19:"2012-06-12 00:00:00";i:104;s:19:"2012-06-13 00:00:00";i:105;s:19:"2012-06-14 00:00:00";i:106;s:19:"2012-06-15 00:00:00";i:107;s:19:"2012-06-16 00:00:00";i:108;s:19:"2012-06-17 00:00:00";i:109;s:19:"2012-06-18 00:00:00";i:110;s:19:"2012-06-19 00:00:00";i:111;s:19:"2012-06-20 00:00:00";i:112;s:19:"2012-06-21 00:00:00";i:113;s:19:"2012-06-22 00:00:00";i:114;s:19:"2012-06-23 00:00:00";i:115;s:19:"2012-06-24 00:00:00";i:116;s:19:"2012-06-25 00:00:00";i:117;s:19:"2012-06-26 00:00:00";i:118;s:19:"2012-06-27 00:00:00";i:119;s:19:"2012-06-28 00:00:00";i:120;s:19:"2012-06-29 00:00:00";i:121;s:19:"2012-06-30 00:00:00";i:122;s:19:"2012-07-01 00:00:00";i:123;s:19:"2012-07-02 00:00:00";i:124;s:19:"2012-07-03 00:00:00";i:125;s:19:"2012-07-04 00:00:00";i:126;s:19:"2012-07-05 00:00:00";i:127;s:19:"2012-07-06 00:00:00";i:128;s:19:"2012-07-07 00:00:00";i:129;s:19:"2012-07-08 00:00:00";i:130;s:19:"2012-07-09 00:00:00";i:131;s:19:"2012-07-10 00:00:00";i:132;s:19:"2012-07-11 00:00:00";i:133;s:19:"2012-07-12 00:00:00";i:134;s:19:"2012-07-13 00:00:00";i:135;s:19:"2012-07-14 00:00:00";i:136;s:19:"2012-07-15 00:00:00";i:137;s:19:"2012-07-16 00:00:00";i:138;s:19:"2012-07-17 00:00:00";i:139;s:19:"2012-07-18 00:00:00";i:140;s:19:"2012-07-19 00:00:00";i:141;s:19:"2012-07-20 00:00:00";i:142;s:19:"2012-07-21 00:00:00";i:143;s:19:"2012-07-22 00:00:00";i:144;s:19:"2012-07-23 00:00:00";i:145;s:19:"2012-07-24 00:00:00";i:146;s:19:"2012-07-25 00:00:00";i:147;s:19:"2012-07-26 00:00:00";i:148;s:19:"2012-07-27 00:00:00";i:149;s:19:"2012-07-28 00:00:00";i:150;s:19:"2012-07-29 00:00:00";i:151;s:19:"2012-07-30 00:00:00";i:152;s:19:"2012-07-31 00:00:00";i:153;s:19:"2012-08-01 00:00:00";i:154;s:19:"2012-08-02 00:00:00";i:155;s:19:"2012-08-03 00:00:00";i:156;s:19:"2012-08-04 00:00:00";i:157;s:19:"2012-08-05 00:00:00";i:158;s:19:"2012-08-06 00:00:00";i:159;s:19:"2012-08-07 00:00:00";i:160;s:19:"2012-08-08 00:00:00";i:161;s:19:"2012-08-09 00:00:00";i:162;s:19:"2012-08-10 00:00:00";i:163;s:19:"2012-08-11 00:00:00";i:164;s:19:"2012-08-12 00:00:00";i:165;s:19:"2012-08-13 00:00:00";i:166;s:19:"2012-08-14 00:00:00";i:167;s:19:"2012-08-15 00:00:00";i:168;s:19:"2012-08-16 00:00:00";i:169;s:19:"2012-08-17 00:00:00";i:170;s:19:"2012-08-18 00:00:00";i:171;s:19:"2012-08-19 00:00:00";i:172;s:19:"2012-08-20 00:00:00";i:173;s:19:"2012-08-21 00:00:00";i:174;s:19:"2012-08-22 00:00:00";i:175;s:19:"2012-08-23 00:00:00";i:176;s:19:"2012-08-24 00:00:00";i:177;s:19:"2012-08-25 00:00:00";i:178;s:19:"2012-08-26 00:00:00";i:179;s:19:"2012-08-27 00:00:00";i:180;s:19:"2012-08-28 00:00:00";i:181;s:19:"2012-08-29 00:00:00";i:182;s:19:"2012-08-30 00:00:00";i:183;s:19:"2012-08-31 00:00:00";i:184;s:19:"2012-09-01 00:00:00";i:185;s:19:"2012-09-02 00:00:00";i:186;s:19:"2012-09-03 00:00:00";i:187;s:19:"2012-09-04 00:00:00";i:188;s:19:"2012-09-05 00:00:00";i:189;s:19:"2012-09-06 00:00:00";i:190;s:19:"2012-09-07 00:00:00";i:191;s:19:"2012-09-08 00:00:00";i:192;s:19:"2012-09-09 00:00:00";i:193;s:19:"2012-09-10 00:00:00";i:194;s:19:"2012-09-11 00:00:00";i:195;s:19:"2012-09-12 00:00:00";i:196;s:19:"2012-09-13 00:00:00";i:197;s:19:"2012-09-14 00:00:00";i:198;s:19:"2012-09-15 00:00:00";i:199;s:19:"2012-09-16 00:00:00";i:200;s:19:"2012-09-17 00:00:00";i:201;s:19:"2012-09-18 00:00:00";i:202;s:19:"2012-09-19 00:00:00";i:203;s:19:"2012-09-20 00:00:00";i:204;s:19:"2012-09-21 00:00:00";i:205;s:19:"2012-09-22 00:00:00";i:206;s:19:"2012-09-23 00:00:00";i:207;s:19:"2012-09-24 00:00:00";i:208;s:19:"2012-09-25 00:00:00";i:209;s:19:"2012-09-26 00:00:00";i:210;s:19:"2012-09-27 00:00:00";i:211;s:19:"2012-09-28 00:00:00";i:212;s:19:"2012-09-29 00:00:00";i:213;s:19:"2012-09-30 00:00:00";i:214;s:19:"2012-10-01 00:00:00";i:215;s:19:"2012-10-02 00:00:00";i:216;s:19:"2012-10-03 00:00:00";i:217;s:19:"2012-10-04 00:00:00";i:218;s:19:"2012-10-05 00:00:00";i:219;s:19:"2012-10-06 00:00:00";i:220;s:19:"2012-10-07 00:00:00";i:221;s:19:"2012-10-08 00:00:00";i:222;s:19:"2012-10-09 00:00:00";i:223;s:19:"2012-10-10 00:00:00";i:224;s:19:"2012-10-11 00:00:00";i:225;s:19:"2012-10-12 00:00:00";i:226;s:19:"2012-10-13 00:00:00";i:227;s:19:"2012-10-14 00:00:00";i:228;s:19:"2012-10-15 00:00:00";i:229;s:19:"2012-10-16 00:00:00";i:230;s:19:"2012-10-17 00:00:00";i:231;s:19:"2012-10-18 00:00:00";i:232;s:19:"2012-10-19 00:00:00";i:233;s:19:"2012-10-20 00:00:00";i:234;s:19:"2012-10-21 00:00:00";i:235;s:19:"2012-10-22 00:00:00";i:236;s:19:"2012-10-23 00:00:00";i:237;s:19:"2012-10-24 00:00:00";i:238;s:19:"2012-10-25 00:00:00";i:239;s:19:"2012-10-26 00:00:00";i:240;s:19:"2012-10-27 00:00:00";i:241;s:19:"2012-10-28 00:00:00";i:242;s:19:"2012-10-29 00:00:00";i:243;s:19:"2012-10-30 00:00:00";i:244;s:19:"2012-10-31 00:00:00";i:245;s:19:"2012-11-01 00:00:00";i:246;s:19:"2012-11-02 00:00:00";i:247;s:19:"2012-11-03 00:00:00";i:248;s:19:"2012-11-04 00:00:00";i:249;s:19:"2012-11-05 00:00:00";i:250;s:19:"2012-11-06 00:00:00";i:251;s:19:"2012-11-07 00:00:00";i:252;s:19:"2012-11-08 00:00:00";i:253;s:19:"2012-11-09 00:00:00";i:254;s:19:"2012-11-10 00:00:00";i:255;s:19:"2012-11-11 00:00:00";i:256;s:19:"2012-11-12 00:00:00";i:257;s:19:"2012-11-13 00:00:00";i:258;s:19:"2012-11-14 00:00:00";i:259;s:19:"2012-11-15 00:00:00";i:260;s:19:"2012-11-16 00:00:00";i:261;s:19:"2012-11-17 00:00:00";i:262;s:19:"2012-11-18 00:00:00";i:263;s:19:"2012-11-19 00:00:00";i:264;s:19:"2012-11-20 00:00:00";i:265;s:19:"2012-11-21 00:00:00";i:266;s:19:"2012-11-22 00:00:00";i:267;s:19:"2012-11-23 00:00:00";i:268;s:19:"2012-11-24 00:00:00";i:269;s:19:"2012-11-25 00:00:00";i:270;s:19:"2012-11-26 00:00:00";i:271;s:19:"2012-11-27 00:00:00";i:272;s:19:"2012-11-28 00:00:00";i:273;s:19:"2012-11-29 00:00:00";i:274;s:19:"2012-11-30 00:00:00";i:275;s:19:"2012-12-01 00:00:00";i:276;s:19:"2012-12-02 00:00:00";i:277;s:19:"2012-12-03 00:00:00";i:278;s:19:"2012-12-04 00:00:00";i:279;s:19:"2012-12-05 00:00:00";i:280;s:19:"2012-12-06 00:00:00";i:281;s:19:"2012-12-07 00:00:00";i:282;s:19:"2012-12-08 00:00:00";i:283;s:19:"2012-12-09 00:00:00";i:284;s:19:"2012-12-10 00:00:00";i:285;s:19:"2012-12-11 00:00:00";i:286;s:19:"2012-12-12 00:00:00";i:287;s:19:"2012-12-13 00:00:00";i:288;s:19:"2012-12-14 00:00:00";i:289;s:19:"2012-12-15 00:00:00";i:290;s:19:"2012-12-16 00:00:00";i:291;s:19:"2012-12-17 00:00:00";i:292;s:19:"2012-12-18 00:00:00";i:293;s:19:"2012-12-19 00:00:00";i:294;s:19:"2012-12-20 00:00:00";i:295;s:19:"2012-12-21 00:00:00";i:296;s:19:"2012-12-22 00:00:00";i:297;s:19:"2012-12-23 00:00:00";i:298;s:19:"2012-12-24 00:00:00";i:299;s:19:"2012-12-25 00:00:00";i:300;s:19:"2012-12-26 00:00:00";i:301;s:19:"2012-12-27 00:00:00";i:302;s:19:"2012-12-28 00:00:00";i:303;s:19:"2012-12-29 00:00:00";i:304;s:19:"2012-12-30 00:00:00";i:305;s:19:"2012-12-31 00:00:00";i:306;s:19:"2013-01-01 00:00:00";i:307;s:19:"2013-01-02 00:00:00";i:308;s:19:"2013-01-03 00:00:00";i:309;s:19:"2013-01-04 00:00:00";i:310;s:19:"2013-01-05 00:00:00";i:311;s:19:"2013-01-06 00:00:00";i:312;s:19:"2013-01-07 00:00:00";i:313;s:19:"2013-01-08 00:00:00";i:314;s:19:"2013-01-09 00:00:00";i:315;s:19:"2013-01-10 00:00:00";i:316;s:19:"2013-01-11 00:00:00";i:317;s:19:"2013-01-12 00:00:00";i:318;s:19:"2013-01-13 00:00:00";i:319;s:19:"2013-01-14 00:00:00";i:320;s:19:"2013-01-15 00:00:00";i:321;s:19:"2013-01-16 00:00:00";i:322;s:19:"2013-01-17 00:00:00";i:323;s:19:"2013-01-18 00:00:00";i:324;s:19:"2013-01-19 00:00:00";i:325;s:19:"2013-01-20 00:00:00";i:326;s:19:"2013-01-21 00:00:00";i:327;s:19:"2013-01-22 00:00:00";i:328;s:19:"2013-01-23 00:00:00";i:329;s:19:"2013-01-24 00:00:00";i:330;s:19:"2013-01-25 00:00:00";i:331;s:19:"2013-01-26 00:00:00";i:332;s:19:"2013-01-27 00:00:00";i:333;s:19:"2013-01-28 00:00:00";i:334;s:19:"2013-01-29 00:00:00";i:335;s:19:"2013-01-30 00:00:00";i:336;s:19:"2013-01-31 00:00:00";i:337;s:19:"2013-02-01 00:00:00";i:338;s:19:"2013-02-02 00:00:00";i:339;s:19:"2013-02-03 00:00:00";i:340;s:19:"2013-02-04 00:00:00";i:341;s:19:"2013-02-05 00:00:00";i:342;s:19:"2013-02-06 00:00:00";i:343;s:19:"2013-02-07 00:00:00";i:344;s:19:"2013-02-08 00:00:00";i:345;s:19:"2013-02-09 00:00:00";i:346;s:19:"2013-02-10 00:00:00";i:347;s:19:"2013-02-11 00:00:00";i:348;s:19:"2013-02-12 00:00:00";i:349;s:19:"2013-02-13 00:00:00";i:350;s:19:"2013-02-14 00:00:00";i:351;s:19:"2013-02-15 00:00:00";i:352;s:19:"2013-02-16 00:00:00";i:353;s:19:"2013-02-17 00:00:00";i:354;s:19:"2013-02-18 00:00:00";i:355;s:19:"2013-02-19 00:00:00";i:356;s:19:"2013-02-20 00:00:00";i:357;s:19:"2013-02-21 00:00:00";i:358;s:19:"2013-02-22 00:00:00";i:359;s:19:"2013-02-23 00:00:00";i:360;s:19:"2013-02-24 00:00:00";i:361;s:19:"2013-02-25 00:00:00";i:362;s:19:"2013-02-26 00:00:00";i:363;s:19:"2013-02-27 00:00:00";i:364;s:19:"2013-02-28 00:00:00";}s:5:"total";d:103450;s:6:"adults";s:1:"2";s:8:"children";s:1:"0";s:9:"shippable";b:0;} ) in drupal_write_record() (line 6975 of /home/hathers1/public_html/othersites/casaclara/includes/common.inc).

I only selected three days, but it put in 365. It also shows my total as £0.00. And I cannot remove it from my cart.

tanay_lakhani’s picture

@brynmoor

regarding your bugs of can not remove from cart and 365 days.. u need to apply patches. These issues are very well addressed by the module developer and community. You can find them just above download link on the main page. And that bug for amount 0.0, we are still working on it.

pucc’s picture

Hello,
I can't the dispaly the check out page because I receive this 2 errors that u had too:
Notice: Undefined property: stdClass::$price in uc_order_get_total() (line 1532 of C:\xampp\htdocs\drupal-7.7\modules\ubercart\uc_order\uc_order.module).
Notice: Undefined property: stdClass::$price in uc_order_get_total() (line 1532 of C:\xampp\htdocs\drupal-7.7\modules\ubercart\uc_order\uc_order.module).
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1: INSERT INTO {uc_order_products} (order_id, nid, title, model, qty, cost, weight, weight_units, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => 3 [:db_insert_placeholder_1] => 23 [:db_insert_placeholder_2] => Stanza base [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => kg [:db_insert_placeholder_8] => a:7:{s:6:"module";s:13:"hotel_booking";s:6:"prices";a:3:{i:0;s:6:"80.000";i:1;s:6:"80.000";i:2;s:6:"80.000";}s:6:"nights";a:3:{i:0;s:19:"2012-04-17 00:00:00";i:1;s:19:"2012-04-18 00:00:00";i:2;s:19:"2012-04-19 00:00:00";}s:5:"total";d:240;s:6:"adults";s:1:"2";s:8:"children";s:1:"0";s:9:"shippable";b:0;} ) in drupal_write_record() (line 6861 of C:\xampp\htdocs\drupal-7.7\includes\common.inc).

I've also tried with flushing the uc_cart_products table but nothing changed..can u help me?
I know that the first error is something that u're fixing..but I'd like to solve the second one's in order to access the check out page..

pucc’s picture

news???do u solved the problem?

brynmoorhouse1994’s picture

Hi,
I have all the updated patches installed.

pucc’s picture

Please put this in ubercart/uc_order/uc_order.module

function uc_order_product_save($order_id, $product) {
......

else {
$units = db_query("SELECT weight_units FROM {node} AS n JOIN {uc_products} AS p ON n.vid = p.vid WHERE n.nid = :nid", array(':nid' => $product->nid))->fetchField();
$product->weight_units = empty($units) ? variable_get('uc_weight_unit', 'lb') : $units;
}
}
+ if(empty($product->cost)) $product->cost = 0; //this line handle the db exception
return drupal_write_record('uc_order_products', $product, $key);
}

function uc_order_get_total($order, $products_only = FALSE) {
$total = 0;

if ($order === FALSE) {
return $total;
}

if (is_array($order->products)) {
foreach ($order->products as $product) {
$qty = $product->qty ? $product->qty : 1;
- $total += $product->price * $qty;
+ $total += $product->sell_price * $qty; //this line display the total in the cart contents on the check out page
}
}

and put this code in hotel_booking.ubercart.inc file (the same as the tanay_lakhani one's except the if that gives me an error when all is patched):

function hotel_booking_uc_cart_display($item) {
//this code shows the order's subtotal in the cart
+ $data = $item->data;
+ $item->price = $data['total'];
+ if (($type = variable_get('hotel_booking_payment_type', 0)) &&
+ ($rate = variable_get('hotel_booking_payment_rate'))) {
+ $item->full_price = $item->price;
+ switch ($type) {
+ case 1:
+ $item->price = $rate;
+ break;
+ case 2:
+ $item->price = $data['total'] * ($rate / 100);
+ }
+ }

$node = node_load($item->nid);
$element = array();

pucc’s picture

Assigned: tanay_lakhani » pucc
Status: Active » Fixed
tanay_lakhani’s picture

Assigned: pucc » tanay_lakhani
FileSize
60.94 KB

i had taken a paid help to fix this. u just need to change this file uc_order.module under ubercart/order

download the attached file. change the extension to uc_order.module and upload.
cheers!!

larowlan’s picture

Assigned: tanay_lakhani » Unassigned
Status: Fixed » Needs work

DO NOT DOWNLOAD THE FILE ABOVE.
You should not hack contributed modules as you won't be able to apply updates (including security) when new versions are released.
If uc_order needs to be changed to get this to work you should contribute a patch to ubercart so the change persists across versions.

tanay_lakhani’s picture

Ok. I dont know how to create a patch for it. Can you roll a patch?

pucc’s picture

By the way...is it working for you with paypal?If it is can u tell me which version of ubercart are you using?I'm using the 3.1 with paypal sandbox but all my orders are always in pending..I opened an ubercart issue for that..but if it's working for you with an ubercart version please tell me which one it is and I'll download it because I've to finish my site asap..thank u..

tanay_lakhani’s picture

which error are you getting?

pucc’s picture

my orders stuck in pending..maybe it's a problem that is only related to paypal sandbox..but if u tell me that all works for you..could u please tell me which version of ubercart and drupal are you using?I'm running drupal 7.11 and ubercart 3.1..

tanay_lakhani’s picture

i am having problem with the paypal. It was working very fine. But when you posted about the error, and i checked, it showed some error. i was using IT ON live server. trying to figure it out.

attaching the screenshot of error. can you find out the solution.
you may create a test purchase of room http://goflamingo.co/content/test-room

write test in all the checkout fields

tanay_lakhani’s picture

@pucc: switch back to ubercart 3.0 version.

i am using drupal 7.12 and ubercart 3.0, and every thing seems to be working fine.

@larrowlan: i was still facing the problem of price 0.0 when i updated ubercart. please roll the patch from my above order.txt file.

pucc’s picture

@tanay_lakhani
I've updated my drupal version to 7.13 and I went to the live site..same result as the previous one..so I've downloaded ubercart 3.0 but the problem still remains the same...maybe I'm doing something wrong with the settings..
so I'll tell u what I'm doing:
- set the basic settings of hotel booking
- add a base rate
- add a room type
- set the basic settings in store (email address and street and the symbol that has to be displayed near the amount..in my case €)
- set the language (add italian)
- set the payment method (Paypal WPS->currency format EUR login page IT full payment at checkout and the email)
I've also tried to set a free shipping quotes and free taxes...(previously I haven't enabled this submodules)
same result...

maybe I'm missing something?
could you tell me which sub-modules You have enabled and if I have to do something more in order to make the payment work?
I'm receiving the ipn but not the watchdog messages that tell me that all is fine or that all is wrong..
Thank u in advance for your help.
Lidia

bala.d’s picture

FileSize
153.61 KB

Getting the error on the cart Submit

As instructed above, I followed all the patches and all the errors vanished at the cart page and when I submit the cart to checkout, I encounter the following error:

Notice: Undefined index: qty in uc_cart_view_form_submit() (line 712 of C:\xampp\htdocs\bookers\sites\all\modules\contrib\ubercart\uc_cart\uc_cart.module).
Notice: Undefined index: qty in uc_cart_update_item_object() (line 1243 of C:\xampp\htdocs\bookers\sites\all\modules\contrib\ubercart\uc_cart\uc_cart.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation:

Any Suggestions pls...

bala.d’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev

Now I got rid of my error...

I have applied the patch on hotel_booking_uc_cart_display() in hotel_booking.ubercart.inc for the qty section.

Simply replaced the below lines

$element['qty'] = array(
'#type' => 'markup',
'#markup' => 1,
'#default_value' => 1 //this is to stop the ubercart errors
);

to

$element['qty'] = array(
'#type' => 'value',
'#value' => 1,
'#default_value' => 1, //this is to stop the ubercart errors
'display'=>
array(
'#type' => 'markup',
'#markup' => 1,
),
);

This proceeded to the checkout page and after the succesfull order creation, I got an warning and that got solved in the below link:
http://drupal.org/node/1406894

Now my booking system works good.

enomertens’s picture

FileSize
65.59 KB

Hi all,

I tried solution #36 and http://drupal.org/node/1406894

But still not working... also tried to replace the ubercart core uc_order.module with the code from #25

Still not working. I can't remove items from my cart and still price= 0.00€

Getting following error:
Notice: Undefined property: stdClass::$price in hotel_booking_uc_cart_display() (line 111 of .../sites/all/modules/uc_hotel/hotel_booking/hotel_booking.ubercart.inc).

Any solution?

Kind regards

Eno Mertens

zeezhao’s picture

I am getting same error as in #36 - using lastest dev for uc_hotel & ubercart-7.x. Patch suggested above did not resolve. Please has anyone got solution? Thanks.

ykyuen’s picture

For:

Notice: Undefined property: stdClass::$price in hotel_booking_uc_cart_display() (line 111 of .../sites/all/modules/uc_hotel/hotel_booking/hotel_booking.ubercart.inc).

The above error occurs because the Hotel Room Type content type actually is not a Ubercart product. The total amount is stored in $item->data['total'] but not $item->price.

To fix it

function hotel_booking_uc_cart_display($item) {
  $node = node_load($item->nid);
  $element = array();
  $element['nid'] = array('#type' => 'value', '#value' => $node->nid);
  $element['module'] = array('#type' => 'value', '#value' => 'hotel_booking');
  $element['remove'] = array('#type' => 'checkbox');

  $title = check_plain($item->title);
  $title .= ' ('. count($item->data['nights']) . t(' Nights, ');
  $title .= format_plural($item->data['adults'], '1 Adult', '@count Adults');
  $title .= format_plural($item->data['children'], ', 1 Child', ', @count Children');
  $title .= ')';
  $element['title'] = array(
    '#markup' => node_access('view', $node) ? l($title, 'node/'. $node->nid) : check_plain($item->title),
  );

  /************* FIX ***************/
  $item->price = $item->data['total']; // Set the $item->price
  /************* FIX ***************/
  
  $element['#total'] = $item->price;
  $element['data'] = array('#type' => 'value', '#value' => serialize($item->data));
  $element['qty'] = array(
    '#type' => 'value',
    '#value' => 1,
    '#default_value' => 1, //this is to stop the ubercart errors
    'display'=>
    array(
      '#type' => 'markup',
      '#markup' => 1,
    ),
  );
...

But you will need to fix another problem in the checkout page. Due to the same reason, ubercart could not find the price field so it will throw another error.

Notice: Undefined property: stdClass::$price in uc_order_get_total() (line 1535 of /var/www/cliftons/sites/all/modules/ubercart/uc_order/uc_order.module).

To temporary fix the problem, we need to modify uc_order.module. I will try to create an issue on ubercart about this problem.

/**
 * Calculates an order's total.
 */
function uc_order_get_total($order, $products_only = FALSE) {
  $total = 0;

  if ($order === FALSE) {
    return $total;
  }

  if (is_array($order->products)) {
    foreach ($order->products as $product) {
      $qty = $product->qty ? $product->qty : 1;
      //$total += $product->price * $qty; // Set $product price if it is not set
      if (isset($product->price)) {
        $total += $product->price * $qty;
      } elseif (isset($product->data['total'])) {
        $total += $product->data['total'] * $qty;
      }
    }
  }

  if ($products_only) {
    return $total;
  }

  $total += uc_line_items_calculate($order);

  foreach (module_implements('uc_order') as $module) {
    $function = $module . '_uc_order';
    // $order must be passed by reference.
    if (function_exists($function) && ($value = $function('total', $order, NULL)) && is_numeric($value)) {
      $total += $value;
    }
  }

  return $total;
}

Then you will find another problem

DOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1: INSERT INTO {uc_order_products}

again, we need to modify uc_order.module.

/**
 * Entity API "save callback" for uc_order_product entity.
 *
 * Saves a product to an order.
 */
function uc_order_product_save($order_id, $product) {
  // Product kits, particularly, shouldn't actually be added to an order,
  // but instead they cause other products to be added.
  if (isset($product->skip_save) && $product->skip_save == TRUE) {
    return;
  }

  // Update if there is an order_product_id, insert if there isn't.
  $key = empty($product->order_product_id) ? array() : 'order_product_id';
  // @TODO order_id should be in the object by this point.
  $product->order_id = $order_id;
  if (empty($product->weight_units)) {
    if (empty($product->nid)) {
      $product->weight_units = variable_get('uc_weight_unit', 'lb');
    }
    else {
      $units = db_query("SELECT weight_units FROM {node} n JOIN {uc_products} p ON n.vid = p.vid WHERE n.nid = :nid", array(':nid' => $product->nid))->fetchField();
      $product->weight_units = empty($units) ? variable_get('uc_weight_unit', 'lb') : $units;
    }
  }

  if (empty($product->cost)) {
    $product->cost = 0; // Set $product->cost if it is not set.
  }
  return drupal_write_record('uc_order_products', $product, $key);
}
giupenni’s picture

Same problem in beta version...

twinsdz’s picture

Issue summary: View changes

Hi

Can somebody help me?

If I click the checkout button in the shopping cart I see sometimes this error:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1: INSERT INTO {uc_order_products} (order_id, nid, title, model, qty, cost, weight, weight_units, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => 40 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => Double room [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => kg [:db_insert_placeholder_8] => a:7:{s:6:"module";s:13:"hotel_booking";s:6:"prices";a:2:{i:0;s:6:"20.000";i:1;s:6:"20.000";}s:6:"nights";a:2:{i:0;s:19:"2014-05-05 00:00:00";i:1;s:19:"2014-05-06 00:00:00";}s:5:"total";d:40;s:6:"adults";s:1:"2";s:8:"children";s:1:"0";s:9:"shippable";b:0;} ) in drupal_write_record() (line 7194 of public_html/MYSITE/includes/common.inc).

or I go to the checkout page, but in the "Cart contents" form there is no product and the price is "Subtotal: €0.00". Also in the Payment method form I see

Subtotal: €0.00
Order total: €0.00

So nobody can pay for the booking because the price is 0.0.

Best regards

twinsdz’s picture

Hi

Can somebody help me?

If I click the checkout button in the shopping cart I see sometimes this error:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect decimal value: '' for column 'cost' at row 1: INSERT INTO {uc_order_products} (order_id, nid, title, model, qty, cost, weight, weight_units, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8); Array ( [:db_insert_placeholder_0] => 40 [:db_insert_placeholder_1] => 2 [:db_insert_placeholder_2] => Double room [:db_insert_placeholder_3] => 1 [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => 0 [:db_insert_placeholder_7] => kg [:db_insert_placeholder_8] => a:7:{s:6:"module";s:13:"hotel_booking";s:6:"prices";a:2:{i:0;s:6:"20.000";i:1;s:6:"20.000";}s:6:"nights";a:2:{i:0;s:19:"2014-05-05 00:00:00";i:1;s:19:"2014-05-06 00:00:00";}s:5:"total";d:40;s:6:"adults";s:1:"2";s:8:"children";s:1:"0";s:9:"shippable";b:0;} ) in drupal_write_record() (line 7194 of public_html/MYSITE/includes/common.inc).

or I go to the checkout page, but in the "Cart contents" form there is no product and the price is "Subtotal: €0.00". Also in the Payment method form I see

Subtotal: €0.00
Order total: €0.00

So nobody can pay for the booking because the price is 0.0.

Best regards