Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If you manually create an order in the admin and add a product kit to the order that contains shippable products, none of the order products get the shippable flag set. Thus you cannot package or ship orders that contain a product kit. If the order consists of only the product kit, you won't even see the tabs for packaging or shipping.
Issue mentioned over here: http://www.ubercart.org/forum/support/18736/product_kits_not_shippable. CJ's fix worked for me, patch attached.
Comment | File | Size | Author |
---|---|---|---|
uc_product_kit_package.patch | 611 bytes | stockliasteroid | |
Comments
Comment #1
longwaveCommitted.
Comment #2
wjaspers CreditAttribution: wjaspers commentedFor 7.x-3.x-dev, the correct line number is 1021 where this needs to be added.
Wanted to add: in my testing that the shippable value isn't handled correctly. 0 is treated as FALSE when its pulled from the database, and PDO freaks out when you try to save a kit. But, 1 is treated like an integer, and saves just fine.
The patch above could be corrected by changing:
$kit_product->data['shippable'] = $product->shippable;
to
$kit_product->data['shippable'] = (int)$product->shippable;
NOTE: This would only work correctly in a PHP5 enabled Drupal instance, as it utilizes type-juggling (see: http://www.php.net/manual/en/language.types.integer.php#language.types.i...).
Comment #3
longwaveThanks, will look into this when I get a chance. D7 requires PHP5 anyway, so that's not a problem (and even Ubercart 2.x for D6 requires PHP5)
Comment #4
wjaspers CreditAttribution: wjaspers commentedThought it was worth mentioning for folks that have a hybrid Apache2 instance: PHP4/Apache2 core with mod_php5 running on fastcgi. (Older CentOS instances with mass virtual hosting can be configured this way).
As for type-casting, this probably isn't the best place to cast the value--but in our situation provides a fast solution. The source of the problem is more likely to reside in uc_product. When I have time I'll look a little further into it.
Comment #5
longwaveCommitted.
Comment #7
simonswiss CreditAttribution: simonswiss commentedI am sorry to re-open this but i still get the error after applying the patch, and adding the (int) as mentionned in #2.
By the way i am not shipping ANY of my products and i have disabled the shipping modules, but i still get these errors.. Any idea why?
Simon
Comment #8
longwaveWhat error messages are you seeing, and on what pages?
Comment #9
wjaspers CreditAttribution: wjaspers commentedWhat version of PHP are you running?
Comment #10
simonswiss CreditAttribution: simonswiss commentedHere's the error message:
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'shippable' at row 1: UPDATE {uc_products} SET model=:db_update_placeholder_0, list_price=:db_update_placeholder_1, cost=:db_update_placeholder_2, sell_price=:db_update_placeholder_3, weight=:db_update_placeholder_4, weight_units=:db_update_placeholder_5, default_qty=:db_update_placeholder_6, ordering=:db_update_placeholder_7, shippable=:db_update_placeholder_8 WHERE ( (vid = :db_condition_placeholder_0) ); Array ( [:db_update_placeholder_0] => Swiss Alps Retreat / Swiss Raft Activity - Sion / Tandem Flight - Star Paragliding [:db_update_placeholder_1] => 160 [:db_update_placeholder_2] => 0 [:db_update_placeholder_3] => 263 [:db_update_placeholder_4] => 0 [:db_update_placeholder_5] => kg [:db_update_placeholder_6] => 0 [:db_update_placeholder_7] => 0 [:db_update_placeholder_8] => [:db_condition_placeholder_0] => 57 ) in uc_product_kit_update() (line 311 of /home/clients/websites/w_shpic/public_html/shpic/sites/all/modules/ubercart/uc_product_kit/uc_product_kit.module).
The website encountered an unexpected error. Please try again later.
Regarding PHP version, I am using 5.2.13
Thanks for your help,
Simon
Comment #11
simonswiss CreditAttribution: simonswiss commentedPS: this error is more related to http://drupal.org/node/1166870 but i have been redirected to this thread in my searches for an answer..
Sorry if i re-opened the wrong issue.
Comment #12
simonswiss CreditAttribution: simonswiss commentedstill the error - http://drupal.org/node/1106478 leads to this thread. Seems like it fixed other user's problem, but i'm still stuck with the error.
PS: i'm using the latest version of ubercart - Ubercart 7.x-3.x-dev (2011-Jun-25)
Comment #13
simonswiss CreditAttribution: simonswiss commentedi noticed something. I have the shipping and shipping quotes modules disabled, however in content types --> manage display there is still the "weight" field. Not size, just weight. This field doesn't exist in the "manage fields" tab.
Could that be that a field did not get removed when uninstalling the shipping module?
I cannot find anything on the database in phpmyadmin...
Simon
Comment #14
wjaspers CreditAttribution: wjaspers commentedThe shipping information stays on the Node edit form regardless if you have a shipping module enabled.
Comment #15
simonswiss CreditAttribution: simonswiss commentedok so that's not the issue then. Hmmm, this is pretty much the only hurdle that prevents me from going live with the store, pretty annoying!
Comment #16
wjaspers CreditAttribution: wjaspers commentedTry changing the (int) line to
$kit_product->data['shippable'] = isset($product->shippable) ? $product->shippable : 0;
This way, if it's anticipating a value, and one isn't provided, it can fall back on the product not being shippable.
Comment #17
simonswiss CreditAttribution: simonswiss commentedI tried to change the line line
with
but the error is still here.
Just to clarify, did i edit the right line? this is line 974 in uc_product_kit.module
However the error message mentions the line 313 for the error, where i get this:
(line 313 is ->execute(); ), it is the function
uc_product_kit_update(&$node)
here's the whole code for this function:If instead of saving a product kit i click preview, i get the following errors:
Comment #18
caseyc CreditAttribution: caseyc commented@simonswiss, found this post while debugging my own issue in d6. If the shippable flag isn't getting set, I discovered that you have to add it a certain way.
Here's the code that works for me:
Notice that after I set the attributes in the attribute array, the uc_art_add_item() has $nid as the first argument.
If you leave that out, shippable isn't set correctly.
Good luck!
Comment #19
TR CreditAttribution: TR commentedMoving to "Product kit" component.
Comment #20
dgtlmoon CreditAttribution: dgtlmoon commented[deleted] - sorry, it was an AJAX implementation that was causing my issue
Comment #21
longwaveAs far as I can tell this was actually fixed in #5. There is a separate issue when previewing product kits, which is open at #1348052: Errors when trying to preview new or updated product kit