I think there should be a cost price field for product variation so that seller knows the cost price and their selling price for a variation. This also helps in creating the profit report for the sales. As discussed with Shawn McCabe and Bojan, this will be a trait so that admin may activate them as per their need.

Comments

sorabh.v6 created an issue. See original summary.

sorabh.v6’s picture

Status: Active » Needs review
gauravjeet’s picture

field_cost is a generic name and might be in use on sites. Anything new to this field might break existing functionality for cost. I suggest the field be name something that relates to the module from which it originates, something like field_commerce_cost, or commerce_cost

Anonymous’s picture

What about commerce_purchasing_price? This has a clear meaning and reflects the use case for this field. Generally is this field a good idea.

bojanz’s picture

The name should be just "cost". We don't prefix base fields nor fields added via traits.

sorabh.v6’s picture

@bojanz Okay, I'll change the name from field_cost to cost.

Thanks for the feedback.

sorabh.v6’s picture

Assigned: Unassigned » sorabh.v6
sorabh.v6’s picture

Assigned: sorabh.v6 » Unassigned
StatusFileSize
new1.82 KB
new1.05 KB

Field cost changed to cost. Please review.

travis-bradbury’s picture

I've played around with this here: https://www.drupal.org/project/commerce_cost

I want cost on order items too, since I want to know the profit of an item when it was sold, not profit based on whatever the current costs are.

The module currently does:

  • Cost field on products.
  • Cost field on order items.
  • Copy cost from the product to order items.
  • Resolve cost like the price resolver (default implementation uses the fields).

and a couple extras:

I think we can move the whole first list into core here if it's considered useful (or at least not harmful).

bojanz’s picture

Status: Needs review » Closed (won't fix)

Sounds like you have a decent contrib plan, making it unnecessary to partially solve the problem in Commerce itself.