Jump to content
Sign in to follow this  
vpoma

Total B2B and "Specials on default.php"

Recommended Posts

Hi,

today I installed the "Total B2B" to my OSC MS2 2.2 succesfully.

Then I tried to modify my index.php moving the box Specials within the page over the box "New products for..." using the contribution "Specials on default.php"

 

...but now this contribution do not works becouse with Total B2B features installed now there isn't only a price for product ...but multiples price ..and these prices depend from user login.

 

Can anyone suggest me changes to make on "Specials on default.php" contribution to be compatible with Total B2b???

 

Thank you to everyone

 

Vince :(

Share this post


Link to post
Share on other sites
..and these prices depend from user login.

 

Vince  :(

I have this same problem with b2b ... specials don't show up in guest access. Anybody got a fix?

Share this post


Link to post
Share on other sites

Hello

 

I think, it's a little bit late for the two guys, but I found this thread when is was looking for a solution for specials on default page together with total B2B. Because I found no solution, I figured it out myself.

 

My solution is (just change the code of the default_specials.php):

 

<?php
/*
 $Id: default_specials.php,v 2.0 2003/06/13

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
if (!isset($customer_id)) $customer_id = 0;
 $customer_group = tep_get_customers_groups_id();
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and s.status = '1' and ((s.customers_id = '" . $customer_id . "' and s.customers_groups_id = '0') or (s.customers_id = '0' and s.customers_groups_id = '" . $customer_group . "') or (s.customers_id = '0' and s.customers_groups_id = '0')) order by s.specials_date_added DESC limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);

?>
<!-- default_specials //-->

 <tr>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
<?php
$info_box_contents = array();
 $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
 new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SPECIALS));

$info_box_contents = array();
 $row = 0;
 $col = 0;
 while ($default_specials = tep_db_fetch_array($new)) {
   $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);
$default_specials['products_price'] = tep_xppp_getproductprice($default_specials['products_id']); 
$default_specials['specials_new_products_price'] = tep_get_products_special_price($default_specials['products_id']);
$query_default_special_prices_hide = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " WHERE configuration_key = 'SPECIAL_PRICES_HIDE'");
   $query_default_special_prices_hide_result = tep_db_fetch_array($query_default_special_prices_hide);

   
            if ($query_default_special_prices_hide_result['configuration_value'] == 'true') {
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',             
                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><span class="productSpecialPrice">' . $currencies->display_price_nodiscount($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
            } else {
   $info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" width="33%" valign="top"',
            'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_id'], $default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price_nodiscount($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span>');
            }
$col ++;
   if ($col > 2) {
     $col = 0;
     $row ++;
   }
 }
 new contentBox($info_box_contents);
?>

<!-- default_specials_eof //-->

 

BoF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×