Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show the price with tax in Specials (Admin section)


Huroman

Recommended Posts

Hi people, i realized that osC shows the prices into Admin without tax but my client really want to see the prices with the tax included.

 

I've been searching around some time with no luck.

 

Actually, my problem is just in the Specials Module, i want to show it with the tax included.

 

The store has already activated the option to show the final price with tax, but this is just in front page.

 

Any ideas?

 

Thank you in advance.

Link to comment
Share on other sites

Well, after compare 2 "specials.php" i could make it, ok, just the half that i want but i coming to achieve it.

 

In specials.php (admin) search

 

$products_price = $new_special_insert['products_price'];
	  $specials_price = ($products_price - (($specials_price / 100) * $products_price));

 

around the line 38 and insert this after that:

 

    //BoF Specials Tax Inclusive - part 1/2 *** with variation *** Comment out and change to e
    } else if (substr($specials_price, -1) == 'e') {
	  // else if (substr($specials_price, -1) == 'i') {
	  //$new_special_insert_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	  //$new_special_insert = tep_db_fetch_array($new_special_insert_query);
	  //$tax_rate = tep_get_tax_rate($new_special_insert['products_tax_class_id']);
	  // $specials_price = ($specials_price/(($tax_rate/100)+1));
    //EoF Specials Tax Inclusive - part 1/2
    }		
    //BoF Specials Tax Inclusive - part 1/2 a *** with variation ***
    else { // take out conditional so that applies to all options not excluded by above and make inc tax by default
	  $new_special_insert_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	  $new_special_insert = tep_db_fetch_array($new_special_insert_query);
	  $tax_rate = tep_get_tax_rate($new_special_insert['products_tax_class_id']);
	  $specials_price = ($specials_price/(($tax_rate/100)+1));
    //EoF Specials Tax Inclusive - part 1/2 a *** with variation ***

 

The 2nd one, search this around the line 79:

 

$new_special_update = tep_db_fetch_array($new_special_update_query);
	  $tax_rate = tep_get_tax_rate($new_special_update['products_tax_class_id']);
	  $specials_price = ($specials_price/(($tax_rate/100)+1));
}

 

and insert after, this code:

 

//EoF Specials Tax Inclusive - part 2/2
    //BoF Specials Tax Inclusive - part 2/2  *** Variation ***
    /* Replaced this line
	 if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));
    */
    //by these
    if (substr($specials_price, -1) == '%') {
	 $specials_price = ($products_price - (($specials_price / 100) * $products_price));
    }
	  else if (substr($specials_price, -1) == 'e') {
	  // else if (substr($specials_price, -1) == 'i') { // which was the original check
	  $new_special_update_query = tep_db_query("select p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " .
								  TABLE_SPECIALS ." s where s.products_id=p.products_id and s.specials_id = '" . $specials_id . "'");
	  $new_special_update = tep_db_fetch_array($new_special_update_query);
	  $tax_rate = tep_get_tax_rate($new_special_update['products_tax_class_id']);
	  $specials_price = ($specials_price/(($tax_rate/100)+1));
    } else // addition: make the variation the default
    {
	  $new_special_update_query = tep_db_query("select p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " .
								  TABLE_SPECIALS ." s where s.products_id=p.products_id and s.specials_id = '" . $specials_id . "'");
	  $new_special_update = tep_db_fetch_array($new_special_update_query);
	  $tax_rate = tep_get_tax_rate($new_special_update['products_tax_class_id']);
	  $specials_price = ($specials_price/(($tax_rate/100)+1));
    }
    //EoF Specials Tax Inclusive - part 2/2  *** Variation ***

 

With this, you can insert the promotion price with the tax. The bad thing is that, after been inserted, the price will be shown without tax but in Front Page will be showed with it.

 

I know, i have to show the price with tax in Specials but at least, i could let my client insert the price with tax.

 

If you know how to show the price with tax, please, drop the lines here.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...