Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Combining MSRP and Minimum Advertised Price Contribution


kdawg62

Recommended Posts

Trying to install both the msrp and minium advertised price contributions.

 

Everything went smooth except on the product_info.php page

 

I'm having trouble combining the two so that when the price of the item is below the 'map' price it will not display the saved percentage and simply display the add to cart text.

 

the MSRP contributions has me do this.

 

6. In catalog/product_info.php starting from the top and moving down,

Find:

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

and change it to read:

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_msrp, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

Find:

 

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));

}

 

and change it to read:

 

$products_price = '<table class="PriceList" border="0" width="100%" cellspacing="0" cellpadding="0">';

$new_price = tep_get_products_special_price($product_info['products_id']);

if ($product_info['products_msrp'] > $product_info['products_price'])

$products_price .= '<tr><td>' . TEXT_PRODUCTS_MSRP . '</td><td class="oldPrice" align="right">' . $currencies->display_price($product_info['products_msrp'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';

$products_price .= '<tr><td>' . TEXT_PRODUCTS_OUR_PRICE . '</td>';

if ($new_price != '')

{$products_price .= '<td class="oldPrice"';}

else

{$products_price .= '<td';}

$products_price .= ' align=right>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';

if ($new_price != '')

{$products_price .= '<tr class="productSpecialPrice"><td>' . TEXT_PRODUCTS_SALE . '</td><td align=right>' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';}

if ($product_info['products_msrp'] > $product_info['products_price'])

{if ($new_price != '')

{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . ' (' . ceil((($product_info['products_msrp'] - $new_price) / $product_info['products_msrp']) * 100) . '% )</td></tr>';}

else

{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . ' (' . ceil((($product_info['products_msrp'] - $product_info['products_price']) / $product_info['products_msrp']) * 100) . '% )</td></tr>';}}

else

{if ($new_price != '')

{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . ' (' . ceil((($product_info['products_price'] - $new_price) / $product_info['products_price']) * 100) . '% )</td></tr>';}}

$products_price .= '</table>';

 

Find:

 

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

 

and change it to read:

 

<td align="right" valign="top"><?php echo $products_price; ?></td>

 

 

 

 

 

The 'MAP' Contribution has me doing this.

 

3.8) product_info.php

 

1. Added p.products_map to line 72

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_map, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

 

2. Changed Line 72 to(same as 3.4 step 2):

 

if ($product_info['products_price'] < $product_info['products_map']) { $products_price = $currencies->display_price($product_info['products_map'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '<BR>' . MAP_WARNING;

} else if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

 

 

 

I can't seem to get it right combining the two together to have it display what i need. I am hoping an expert could look at that and see the best way to combine the lines.

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.

Guest
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...