Hi,

I'm helping paulgrimshaw get his shop up and running with the uberpos module. He also wants to use your module.

To display prices on the screen I'm calling uc_price which lets price handlers act on the price. This works with the uc_vat module. However, after a quick look at uc price per role it looks like prices are only modified on nodeapi.

Is there any way we could get a price handler or am I missing something?

Thanks

Comments

techypaul’s picture

Subs.

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

It probably could be implemented as a price handler, but as this module only affects the base price of products, setting it on hook_nodeapi op 'load' for product nodes should work in all cases that I'm aware of? Are there any use cases you're seeing where the price is not being set correctly?

slip’s picture

Status: Postponed (maintainer needs more info) » Active

UberPOS is basically a way for a shop admin to edit an order through a point-of-sales interface. So, when a product is added to an order node_load is called. So I'm thinking uc_price_per_role must be using the shop owner's ($user) roles to calculate the price. However, we need it to calculate the price based off of the customer's uid.

That's my quick-look analysis at least.

Not sure what the best solution is but it seems like the price handler did the trick when we made UberPOS work with uc_vat.

longwave’s picture

You'd still need to pass the $account object along to uc_price_per_role somehow, which it currently doesn't support - how would you do that from node_load() alone? Or are you calling uc_price() somewhere that it could be passed in as part of the context?

The 5.x version features a block which lets an admin user select from the available roles and uses this to override all product pricing, perhaps porting this feature forward to 6.x would be useful to you?

slip’s picture

"Or are you calling uc_price() somewhere that it could be passed in as part of the context?"

That's what I've been doing.

"You'd still need to pass the $account object along to uc_price_per_role somehow, which it currently doesn't support - how would you do that from node_load() alone?"

I suppose we could also use session_save_session() and then switch over to the other user before loading the node, although I think I'd like to avoid that. But maybe that's what we should do.

"The 5.x version features a block which lets an admin user select from the available roles and uses this to override all product pricing, perhaps porting this feature forward to 6.x would be useful to you?"

The goal of this is for everything to be automated and fast to make the cashiers' live easier, so I think that might make things a bit too much work for Paul and his minions :).