Doesn't look like the selected attributes are ever being writing into the cart. I have a product for sale with 2 different attributes, each with their own price. I have the following in my cart when going through the related create node form with an attribute selected:
a:4:{s:3:"nid";s:2:"55";s:17:"node_checkout_nid";i:63;s:9:"shippable";s:1:"0";s:6:"module";s:10:"uc_product";}
To double check, I un-related said product from a node type and just added one to my cart with the same attribute selected. That entry resulted in the following:
a:4:{s:10:"attributes";a:1:{i:1;s:1:"1";}s:9:"shippable";s:1:"0";s:4:"type";s:7:"product";s:6:"module";s:10:"uc_product";}
I've looked around to see if I can fix it, but I'm very new to coding drupal mods and I can't figure this one out... maybe attributes are just not supported in this dev release?
Comment | File | Size | Author |
---|---|---|---|
#25 | uc_node_checkout_1444596-24.patch | 1.68 KB | GemQueen |
#21 | phperrors-1444596-21.patch | 741 bytes | VanD |
#8 | Add_Attribute_Screenshot.png | 227.68 KB | swati.karande |
#6 | uc_node_checkout_1444596.patch | 923 bytes | swati.karande |
Comments
Comment #1
luca_cracco CreditAttribution: luca_cracco commentedI'm not sure but maybe the problem is here:
line 709 of uc_node_checkout.module
i changed:
Comment #2
stewart.adam CreditAttribution: stewart.adam commentedThis is correct, it looks like in Ubercart 3 the hook was renamed to hook_uc_add_to_cart_data().
Comment #3
robomalo CreditAttribution: robomalo commentedConfirmed. This should be an easy fix for the maintainer.
Comment #4
designmonger CreditAttribution: designmonger commentedI have added the changes as above an still not getting it to work, receiving errors as well. Any ideas? Here are the warnings
Comment #5
designmonger CreditAttribution: designmonger commentedActually, the above error isn't correct - here is the error I have been receiving:
Comment #6
swati.karande CreditAttribution: swati.karande commentedFor me its working fine and for above warnings and notices I have attached patch.
Comment #7
designmonger CreditAttribution: designmonger commentedThanks for the patch, however I am still seeing the warnings and the attributes are not being added to the cart still. What version of Ubercart are you using? I have tried using Ubercart 7.x-3.2 and Ubercart 7.x-3.x-dev with the same result. Any help would be appreciated greatly.
Comment #8
swati.karande CreditAttribution: swati.karande commentedHi,
I am using Ubercart 7.x-3.2 and UC Node Checkout 7.x-2.x-dev version.
One reason for attributes are not being added because after creating attributes for specific product you need to select the attributes you want to add. They are not automatically added after creating attributes.
If this is not the reason can you please explain steps you follow to add attributes so I can replicate that issue.
I have attached screenshot.
I hope it will help you!
Comment #9
green_eye55 CreditAttribution: green_eye55 commentedSame issue here. I am using Ubercart 7.x-3.2 and UC Node Checkout 7.x-2.x-dev version. The patch #6 doesn't work for me. The warnings are still the same. Changing the attributes display type didn't help. The product itself has no price and needs the attributes to get a value.
Edit: Even a product without any attributes causes this error!
Comment #10
neptunethemes CreditAttribution: neptunethemes commentedAny update on this? The module currently doesn't work with attributes at all as far as I can tell - I'm getting the same warnings about uc_attribute_alter_form and they're not being added to the cart. I wish I could contribute to the solution but my php skills are lacking to say the least.
Comment #11
stadulis66 CreditAttribution: stadulis66 commentedHas anybody made any progress on this? - I am still getting the same errors. I am using Node Checkout with UC Attributes and they do not want to play nice. Cheers Michael
Warning: Missing argument 2 for _uc_attribute_alter_form(), called in /home/public_html/sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 390 and defined in _uc_attribute_alter_form() (line 1273 of /home/public_html/sites/all/modules/ubercart/uc_attribute/uc_attribute.module).
Warning: Missing argument 3 for _uc_attribute_alter_form(), called in /home/public_html/sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 390 and defined in _uc_attribute_alter_form() (line 1273 of /home/public_html/sites/all/modules/ubercart/uc_attribute/uc_attribute.module).
www.digitalworkhorse.com/
Comment #12
schmook CreditAttribution: schmook commentedThanks everyone for your time and effort!
I get these errors simply enabling uc_attribute.module. This looks to be an issue with a change in _uc_attribute_alter_form() from Ubercart 6 to 7 by looking at this: http://drupalcontrib.org/api/drupal/contributions!ubercart!uc_attribute!...
In 6 just needed a product passed _uc_attribute_alter_form($product)
But in 7 it's looking for a form ID and Boolean for AJAX _uc_attribute_alter_form($id, &$product, $use_ajax)
I tried an arbitrary form ID and Boolean, but got the white screen of death. Any idea what _uc_attribute_alter_form() is looking for in regards to a Form ID?
Thanks again!
Comment #13
schmook CreditAttribution: schmook commentedI was able to get the errors to go away by changing line 390:
$attributes = _uc_attribute_alter_form(node_load($product_nid));
to:
$attributes = _uc_attribute_alter_form($form['#form_id'], node_load($product_nid), FALSE);
I don't think it solves the problem completely.
Comment #14
stadulis66 CreditAttribution: stadulis66 commentedHi schmook - I did what you did in #13 above, but am now getting the error
Fatal error: Call to a member function fetch() on a non-object in /home/public_html/sites/all/modules/uc_node_checkout/uc_node_checkout.module on line 1142
Did you make any other changes to the uc_node_checkout_module? Or to the attributes module?
Thanks, Michael
Comment #15
schmook CreditAttribution: schmook commented@stadulis66 nothing else was changed. All that did was to quell the error message when looking at nodes that have a single product associated with Node Checkout. I'm not 100% sure that $form['#form_id'] is the correct 'form id'!
I am trying to get multiple products to be sold by a single node type and can't seem to get the views portion of Node Checkout to work; so I tried attributes. And got errors there, which led me to poke around.
Do we know what version of Ubercart this module is compatible with?? The .info file just lists:
dependencies[] = uc_cart
IMHO seems like we may be dealing with Ubercart 2 function calls in Ubercart 3? Maybe?
Comment #16
mr.andrey CreditAttribution: mr.andrey commentedsubscribing...
Comment #17
stadulis66 CreditAttribution: stadulis66 commentedGood Question - Does anyone one know what version of Ubercart Node Checkout is compatible with?
Comment #18
stadulis66 CreditAttribution: stadulis66 commentedThis page indicates node checkout has been released for Ubercart 3.0 http://www.ubercart.org/docs/user/30484/uc_node_checkout
But is is still a Dev version.
Comment #19
schmook CreditAttribution: schmook commentedI believe the module is looking for Views 2 api? I will post a separate issue.
Comment #20
lexle CreditAttribution: lexle commentedHi Micheal,
I have fixed this bug for your site. I think the solution for #13 is correct, however the $id param is $product_nid.
And here is my fix:
Change:
//it's for Drupal 6 (i think)
To:
//it's for Drupal 7
However, to add attributes when you check out, i have to make:
Change:
To:
Besides, you have to enable settings on this module for the product (Video Promotion).
Thanks and best regards,
Lex
Comment #21
VanD CreditAttribution: VanD commentedRemoved PHP errors and warnings. PHP throws a strict warning if using suggestions from #13 and #20 which has been resolved as well.
Comment #22
idenev CreditAttribution: idenev commented@stadulis66 in #14. I have the same error after applying the latest patch.
The way to fix it was to change:
to:
After that, everything worked just fine.
Comment #23
spyderpie CreditAttribution: spyderpie commentedsubscribing, I can't get this module to work either and was wondering if the patches would be applied soon ...
Peace and thanks,
Julie
Comment #24
GemQueen CreditAttribution: GemQueen commentedAfter trying a bunch of different suggestions and fixes, I finally got this module work with attributes. I've attached a patch that combines all of the fixes above into one patch. oops screwed up file upload - see #25
Comment #25
GemQueen CreditAttribution: GemQueen commentedAfter trying a bunch of different suggestions and fixes, I finally got this to work. I've attached a patch that combines several fixes from other threads
Comment #26
bisonbleu CreditAttribution: bisonbleu commentedJust ran into this issue (when a node is associated to a product via uc_node_checkout, both product attribute and price are deleted from the cart). @GemQueen's patch fixes this, hooray!