I am using UberPOS's latest dev version and noticed that when I have a product with attributes, options and an adjustment SKU UberPOS always uses the base price of the product when it's added to an order. For example:
The product page is for a T shirt, it has an attribute of size and options of small, medium and large. The shirt itself has no price, small and medium are $10 and large is $12. When the SKU for any option is entered UberPOS has $0 (the price entered for the product page). I checked uc_order_products to confirm and sure enough UberPOS is adding the right product to the order (the attributes are visible in the data field), but the price is always pulled from the product page and not the options. I created an order through Ubercart to confirm the problem and when a product's option is added through UC, the correct price is entered into uc_order_products.
I've tried a few hacks to pull the price from uc_product_options instead of uc_order_products (by nid and oid) but I can't get it to return anything other than NULL. I was hoping someone else may have run into this problem since it seems like it would have likely come up before.
Any advice would be greatly appreciated.
Thanks
Comments
Comment #1
xl_cheese commentedI have an older version of uberpos installed. It seems to work fine for me.
I have a product with a product page price of 169. The 2XL size option is 15 more. When I add that sku to uberpos it rings up with the correct price of 184.
I know this doesn't help you, but you may try to install an older pos version.
Comment #2
coreywood commentedI'm seeing this in both the Dev and Alpha1 versions. An adjustment sku is entered but the option price is not added to the order, the base product's price is added instead.
Comment #3
coreywood commentedAnyone have any insight here at all? This seems like a very glaring bug. I've tried option pricing on a fresh install of Ubercart and Uberpos and I'm seeing the same problem. When an attribute's SKU is input the price from the base item is displayed and calculated, not the option/attribute price.
Comment #4
coreywood commentedI've solved part of my problem by creating a module that adds another tab to the product edit screen where I'm inputting my UPC and option price. Since these are stored in the same db table it was easier to get UberPOS to pull the option price instead of the base product price. The problem now is that while the correct option price is displaying next to the title of the product in the item list, the subtotal and total are still calculating the price off of the base product and not the option price... For some reason the math behind the total and subtotal are divorced from the prices being displayed in the item list.
I haven't been able to find the code behind the total and subtotal yet, I'm hoping someone can point me in the right direction so I can have the variables/query point to my option price in the db rather than the base price.
Thanks
Comment #5
coreywood commentedThis change turned out to be largely cosmetic, it didn't actually change the price of the item that got sent to uc_order_products so the total in uc_orders was still based off of the product's base price instead of the total of the options (which is why the subtotal, total, etc didn't change). The good news is that I found where I needed to set $product->price so it'd pull from my attribute/option rather than the product table. Here's how it did it:
First off, it's worth noting that all products in my store have attributes and prices so I didn't need to put an if statement in to check the presence of a price. This should be pretty easy to do if you require that logic. Secondly, I need UberPOS to pull a different price based on the $order->uid, so my code is wrapped in an if statement to check uid first and then pull the price accordingly. Again, this is something that can easily be removed if you don't need it.
Here's the code from uberpos.module inside the uberpos_add_product function:
Comment #6
cjd400 commentedsorry to ask dumb question - but struggling to work out what to do with this code. Does this replace all text in the uberpos_add_product function, or is it added to the existing code? if so where - can't get it to work - and i'm desparate for attribute skus to be picked up (a whole site hangs on it!)
cheers for your explanations and efforts
chris
Comment #7
cjd400 commentedcan anyone help with the above question plweease :)
Comment #8
xl_cheese commentedA few days ago this issue popped up on my install. I didn't change anything with UberPOS. I updated a copule of modules. Ubercart attribute calculations and dependant attributes. That seems to be the time I noticed this issue arise.