Since mid July, I have been writing a module for use with Gallery2. I've been writing the module for a client who wants to use Gallery2 for displaying images that would be bought by an end user. My client is embedding Gallery2 into Drupal and wants to use Ubercart as the cart module in Drupal for handling the sales transactions.
In the module I've written there is an 'Add to cart' button the end user can press to add a specific image with attributes to the cart.
Before I had written the module, I asked here which function I should call to add an item to the cart and Ryan answered that I should call 'uc_cart_add_item'. Now that I have the module almost complete, I realize I have a problem with that function.
The function 'uc_cart_add_item' expects the caller to pass a node-id. In Gallery2, there are no node-ids only entity-ids. I was considering possibly creating a temporary node-id every time an end user bought a product, but I'm not really familiar with Drupal and am not sure if that is the right approach or how I would go about creating the temporary node-id.
I assume the developers here are more familiar with the way Drupal works than I am so I thought I would come and ask for some help solving this problem.
Is there a way for me to pass information about an image to the cart without having a node-id? Or, is there a way for me to create a node-id each time I want to add an item to the cart? If I create a new node when I add an item to the cart, will that node become visible as a page somewhere on the commerce site?