开发者

Programmatically apply a discount price in product list

开发者 https://www.devze.com 2023-04-11 03:19 出处:网络
I would like to programmatically display a discounted price on the product list/page so that each customer as a personal price shown based on a customer attribute (like gender for instance, and of cou

I would like to programmatically display a discounted price on the product list/page so that each customer as a personal price shown based on a customer attribute (like gender for instance, and of course let it be assigned as new price for the user session) but I can't see a viable option via the magento catalog price rules involving customer attributes other than the assigned group.

I'm using the group to do different kind of discounts and categorization of the customers, so the path of "split the customers on the gender" (or similar) is not an option unfortunately, since I can't assign more than 1 group per customer.

At the moment I was thi开发者_如何学JAVAnking about setting up a custom observer to check for calls to the price generation and then let it consider my customer attributes when calculating the price.

Is that possible? if so, any pointers about? Would you suggest something different?

Thanks a lot to everyone for your time.


As I was thinking before, I solved my issue creating a custom module with an observer looking for catalog_product_get_final_price calls, getting the customer details from the current customer session.

It works great, I just need to let it display the correct price in the catalog product list, but is minimal, as the price seems to be calculated correctly inside the product page and the cart

0

精彩评论

暂无评论...
验证码 换一张
取 消