Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

hi,

Admin cost price with margin or markup (this addon will show margin in %, but the margin result will not write into table PRODUCTS

I like to show (product sale - product cost price = product margin), the real $product margin--->
p.products_price - p.products_price_cost = p.products_margins

 $product_query = tep_db_query("select pd.*, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_price_cost, p.products_margins, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_gtin from products p, products_description pd where p.products_id = '" . (int)$_GET['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

And found  Product Cost/Margins Mod 1.0 and modified it, instead of showing %,

 

function updateMargin2() {
  var grossValue2 = document.forms["new_product"].products_price.value;
  var costValue2 = document.forms["new_product"].products_price_cost.value;
	 marginValue2 = (grossValue2 - costValue2);
 
  document.getElementById('products_margins').innerHTML = marginValue;
}

function updateMargin2() I modified above not correct I think as it is still not show the margin, and how to update the margin into SQL table?

Can someone please help to resolve this issue?

Many thanks!  Lyn

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...