Greetings,

Both commerce_price and commerce_saleprice are displaying the same amount which is the data in the commerce_saleprice field. Can somebody help me troubleshoot this? Thanks!

Comments

AndyF’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

Sorry it's tough to answer/understand the question as it stands. What have you done, what happened, what were you expecting to happen?

pyxio’s picture

Hi

The commerce module by default has the commerce_price field. This module adds a new field commerce_saleprice. So for example, If I have a price $100 as the official retail price in the commerce_price field and I add a sale price of $50 into the commerce_saleprice field and then look at the node display, I see original price $50 and sale price $50. I was hoping to see price $100 with sale price $50 on the node display. I hope this makes more sense now. Cheers, Kevin

AndyF’s picture

Status: Postponed (maintainer needs more info) » Fixed

I was hoping to see price $100 with sale price $50 on the node display.

You'd like to see both prices on the product display (like with the full price crossed out and sale price after)?

Commerce doesn't use the value in the commerce_price field directly - it first uses the Rules system to trigger an event to determine the effective price, which is useful for things like discounts, taxes, etc. See this link for more details.

What my module does is integrate with that system, so that if the On sale field is set to true, then the base price is changed from what's in commerce_price to what's in commerce_sale_price. Note this has nothing to do with display. The commerce_sale_price field will normally be hidden, and you use an appropriately configured price formatter to display the price. If you Google drupal commerce price formatter you get some hits - this module should play nicely with any price formatter.

HTH

pyxio’s picture

Thank you for the explanation. It is very clear to me now. So, in order to get both prices displayed would I need to use a preprocess function? Cheers, Kevin

AndyF’s picture

No, nothing that complex, you just need a price formatter. Something like Commerce Price Savings Formatter.

pyxio’s picture

Absolutely perfect. Thanks so much AndyF!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.