Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Minimum Advertised Price contribution with discount per category help please


Recommended Posts

Was manually installing the Minimum Advertised Price contribution and near the end I have run into an issue with one of my other modifications. The person who helped me set up the site is now in Afghanistan and .php is not my thing. I have a vendor who has a new MAP policy in effect January 1st and I am trying to get in compliance a.s.a.p.


In the instructions at this point is where I came acoss my discount by category modification.

3.6) includes/modules/product_listing.php
 1. Change This:
	   	 $lc_align = 'right';
			if (tep_not_null($listing['specials_new_products_price'])) {
  To This:
	 	   $lc_align = 'right';
			if ($listing['products_price'] < $listing['products_map'])
	   	   $lc_text = ' ' . MAP_WARNING;
			else if (tep_not_null($listing['specials_new_products_price'])) {


I basically need to have the site show retail when an item is searched and when the customer views the item detail or adds it to the cart they see the discount price. Both would be cool but add to cart is enough.


Here is the relevant code from my file:



 if (($current_category_id == NULL) && ($temp_category_id != $listing[categories_id])) {
#get the discount for this category
#echo 'listing:', $listing[categories_id];
$discount_sql = "SELECT amount FROM discount WHERE category_id = '$listing[categories_id]' LIMIT 1";
$discount_query = tep_db_query($discount_sql);
$discount = mysql_fetch_array($discount_query);  
$temp_category_id = $listing[categories_id];
#echo 'xx: ', $listing;

		$lc_align = 'right';
		if (tep_not_null($listing['specials_new_products_price'])) {
		  $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';
		} else {
# if there has been a discount found for this category, display the 'retail price' and 'our price';
if (($discount[amount] != NULL) && ($discount[amount] != '0')) {  
			$lc_text = ' Retail Price:' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' <br>';
   $lc_text .= ' Our Price:' . $currencies->display_price_w_discount($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']), $discount[amount]) . ' ';
else {
 $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' <br>';


Thanks in advance for any help you can offer. Let me know if you need any files etc.


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...