Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Margin in prod. maintenance


Tom73

Recommended Posts

Posted

Hi,

 

I would like to see the margin in the product maintenance page.

 

I want to enter the purchase price and the sales price and when I save the product, and go back to edit the product, that the margin has been filled in.:

 

Purchase price (ex. vat)

Sales price (ex. vat)

Margin (%)

 

I know how create the new fields in the database and in categories.php but I don't know the coding on how to calculate the margin.

 

Regards,

 

Tom

Posted

Can anybody help me with this?

 

It's probably very simple, I want to calculate margin (against purch.price)

and put this in a database field.

 

1. I have made the margin field in the database

2. The formula is (salesprice-purchaseprice)/purchaseprice* 100

3. Now I just need to know how to code the formula and put it in the database field when the product is updated.

 

regards,

 

Tom

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...