Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Jan- I tried that code out. Worked fine when logged in regular account, but when I logged in under another group I got the following where the adds usually are:

I simply replaced my thumbads.php with your code. Did I need to alter any other files also? Thanks

Right, a mistake. Find this:

 if ($customer_group_id != '0') {
   $group_price_query = tep_db_query("select products_id, IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id) where p.products_id in ". $string_of_ids ." AND pg.customers_group_id= '" . $customer_group_id . "'");

and add "p." in front of products_id and you should be fine:

 

 if ($customer_group_id != '0') {
   $group_price_query = tep_db_query("select p.products_id, IF(pg.customers_group_price IS NOT NULL,pg.customers_group_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_GROUPS . " pg using (products_id) where p.products_id in ". $string_of_ids ." AND pg.customers_group_id= '" . $customer_group_id . "'");

Link to comment
Share on other sites

seems to be working like a charm.... ill further run it through its paces later this week, and hopefully find no glitches. Thanks alot, i didnt think I would ever see it working.....so I took the prices totally out of the thumbads after I installed. This is MUCH nicer looking. Thank you again, your my PHP hero :thumbsup:

Link to comment
Share on other sites

Hi,

 

Can your solution also apply to stores that don't use seperate pricing....., I'm using the $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $. I have the same problem with the description being 1/2/3 lines and the buy it now buttom that is places right under the description.

 

In the hope you can help me out, I pasted my product_listing_col.php below:

<?php

/*

  -- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet

 

  $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

  Copyright © 2002 osCommerce

 

  Released under the GNU General Public License

*/

?>

<!-- product_listing_col //-->

<?php

 

  DEFINE('PRODUCT_LIST_COL_NUM',3);

 

  $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 

  if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {

?>

  <table border="0" width="100%" cellspacing="0" cellpadding="2">

    <tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

      <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

    </tr>

  </table>

<?php

  }

 

  $info_box_contents = array();

 

  if ($listing_split->number_of_rows > 0) {

 

$row = 0;

$col = 0;

 

    $listing = tep_db_query($listing_split->sql_query);

    while ($listing_values = tep_db_fetch_array($listing)) {

 

      $listing_values['products_name'] = tep_get_products_name($listing_values['products_id']);

 

      $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

 

      if ($listing_values['specials_new_products_price']) {

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

  } else {

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

      }

 

      if (PRODUCT_LIST_BUY_NOW) {

        $lc_text .= '<br><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> ';     

      }

 

      $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="bottom"',

                                          'text' => $lc_text);

 

      $col ++;

      if ($col > PRODUCT_LIST_COL_NUM-1) {

        $col = 0;

        $row ++;

      }

    }

 

    new contentBox($info_box_contents);

 

  } else {

 

    $info_box_contents = array();

 

    $info_box_contents[0] = array('params' => 'class="productListing-odd"');

    $info_box_contents[0][] = array('params' => 'class="productListing-data"',

                                  'text' => TEXT_NO_PRODUCTS);

 

    new contentBox($info_box_contents);

 

  }

 

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

  ?>

  <table width="100%">

  <tr>

    <td class="smallText" ><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

      <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

  </table>

<?php

  }

?>

 

Is it possible to use your solution, and how do I do that? (I'm not a star with php)

 

Denice

Link to comment
Share on other sites

Hi,

 

Can your solution also apply to stores that don't use seperate pricing....., I'm using the $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $. I have the same problem with the description being 1/2/3 lines and the buy it now buttom that is places right under the description.

 

In the hope you can help me out, I pasted my product_listing_col.php below:

Is it possible to use your solution, and how do I do that? (I'm not a star with php)

 

Denice

Solved it (I think)

 

Thank you for the solution, I've been looking for it for ages :D

Link to comment
Share on other sites

Solved it (I think)

This is how I think it could be solved ;)

<?php
/*
 -- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet
 -- Changed 2005/07/12 to fill out rows and put the buy now buttons in a separate table row 

 $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

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

 Released under the GNU General Public License
*/
?>
<!-- product_listing_col //-->
<?php

 DEFINE('PRODUCT_LIST_COL_NUM',3);
 // change width = "33%" if you use another number than 3 in (around) lines 62, 67, 84

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
 <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
   </tr>
 </table>
<?php
 }

 $info_box_contents = array();

 if ($listing_split->number_of_rows > 0) {

$row = 0;
$col = 0;
$counter = 1;

   $listing = tep_db_query($listing_split->sql_query);
   $no_of_listings = tep_db_num_rows($listing);
   while ($listing_values = tep_db_fetch_array($listing)) {

  if (!isset($listing_values['products_name'])) { // normally this is already set, then no need
   // to spend another query getting it
     $listing_values['products_name']  = tep_get_products_name($listing_values['products_id']);
  }

     $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

     if ($listing_values['specials_new_products_price']) {
       $lc_text .= ' <s>' .  $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> ';
 } else {
       $lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' <br>';
     }

     if (PRODUCT_LIST_BUY_NOW) {
   $buy_now_button_array[] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','sort')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> '; 
     }
// changed valign from bottom to top, to get the pictures aligned
     $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',
                                         'text' => $lc_text);
// if we reached the last of the products, make sure the row of table cells is filled with empty cells if needed
     if ($counter == $no_of_listings ) {
        for ($i = $col + 1; $i < PRODUCT_LIST_COL_NUM; $i++) {
   $info_box_contents[$row][$i] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="bottom"',
                                         'text' => '?');
        }
     }
       
     $col ++;
     $counter++;
     if (($col > PRODUCT_LIST_COL_NUM-1) || ($counter -1) == $no_of_listings) {
       $col = 0;
       $row ++;
  // make sure all table cells per row with buy_now buttons are there and filled with a space
     for ($n = sizeof($buy_now_button_array); $n < PRODUCT_LIST_COL_NUM; $n++) {
   $buy_now_button_array[] = "?";
     }

      foreach ($buy_now_button_array as $column1 => $lc_text1) {
    $info_box_contents[$row][$column1] = array('align' => 'center',
                                              'params' => 'class="smallText" width="33%" valign="bottom" style="padding-top: 5px;"',
                                              'text'  => $lc_text1);
           // added a little padding to the button
    }
    unset($buy_now_button_array);
    $column = 0;
    $row ++;
     }
   }

   new contentBox($info_box_contents);

 } else {

   $info_box_contents = array();

   $info_box_contents[0] = array('params' => 'class="productListing-odd"');
   $info_box_contents[0][] = array('params' => 'class="productListing-data"',
                                 'text' => TEXT_NO_PRODUCTS);

   new contentBox($info_box_contents);

 }

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
 ?>
 <table width="100%">
 <tr>
   <td class="smallText" ><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
 </table>
<?php
 }
?>

Link to comment
Share on other sites

This is how I think it could be solved ;)

<?php
/*
 -- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet
 -- Changed 2005/07/12 to fill out rows and put the buy now buttons in a separate table row 

 $Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

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

 Released under the GNU General Public License
*/
?>
<!-- product_listing_col //-->
<?php

 DEFINE('PRODUCT_LIST_COL_NUM',3);
 // change width = "33%" if you use another number than 3 in (around) lines 62, 67, 84

 $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

 if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
 <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
   </tr>
 </table>
<?php
 }

 $info_box_contents = array();

 if ($listing_split->number_of_rows > 0) {

$row = 0;
$col = 0;
$counter = 1;

   $listing = tep_db_query($listing_split->sql_query);
   $no_of_listings = tep_db_num_rows($listing);
   while ($listing_values = tep_db_fetch_array($listing)) {

  if (!isset($listing_values['products_name'])) { // normally this is already set, then no need
   // to spend another query getting it
     $listing_values['products_name']  = tep_get_products_name($listing_values['products_id']);
  }

     $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

     if ($listing_values['specials_new_products_price']) {
       $lc_text .= ' <s>' .  $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> ';
 } else {
       $lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' <br>';
     }

     if (PRODUCT_LIST_BUY_NOW) {
   $buy_now_button_array[] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','sort')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> '; 
     }
// changed valign from bottom to top, to get the pictures aligned
     $info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',
                                         'text' => $lc_text);
// if we reached the last of the products, make sure the row of table cells is filled with empty cells if needed
     if ($counter == $no_of_listings ) {
        for ($i = $col + 1; $i < PRODUCT_LIST_COL_NUM; $i++) {
   $info_box_contents[$row][$i] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="bottom"',
                                         'text' => ' ');
        }
     }
       
     $col ++;
     $counter++;
     if (($col > PRODUCT_LIST_COL_NUM-1) || ($counter -1) == $no_of_listings) {
       $col = 0;
       $row ++;
  // make sure all table cells per row with buy_now buttons are there and filled with a space
     for ($n = sizeof($buy_now_button_array); $n < PRODUCT_LIST_COL_NUM; $n++) {
   $buy_now_button_array[] = " ";
     }

      foreach ($buy_now_button_array as $column1 => $lc_text1) {
    $info_box_contents[$row][$column1] = array('align' => 'center',
                                              'params' => 'class="smallText" width="33%" valign="bottom" style="padding-top: 5px;"',
                                              'text'  => $lc_text1);
           // added a little padding to the button
    }
    unset($buy_now_button_array);
    $column = 0;
    $row ++;
     }
   }

   new contentBox($info_box_contents);

 } else {

   $info_box_contents = array();

   $info_box_contents[0] = array('params' => 'class="productListing-odd"');
   $info_box_contents[0][] = array('params' => 'class="productListing-data"',
                                 'text' => TEXT_NO_PRODUCTS);

   new contentBox($info_box_contents);

 }

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
 ?>
 <table width="100%">
 <tr>
   <td class="smallText" ><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
     <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
 </tr>
 </table>
<?php
 }
?>

 

 

Thank you for making that for me, I copied it right away, it looks great, I already figured out that I didn't solve anything :'( :'(

 

Can I ask 1 time more your help, I'm was trying to incorporate the ezier new fields into my product_listen_col.php, but after messing up my sql and 15 hours later I have to acknowledge that I will never learn it ( really frustating)

 

The contrib ezier new fields comes with a regular products_listing.php

$list_box_contents = array();

 

  for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

    switch ($column_list[$col]) {

      case 'PRODUCT_LIST_MODEL':

        $lc_text = TABLE_HEADING_MODEL;

        $lc_align = '';

        break;

      case 'PRODUCT_LIST_NAME':

        $lc_text = TABLE_HEADING_PRODUCTS;

        $lc_align = '';

        break;

      case 'PRODUCT_LIST_MANUFACTURER':

$lc_text = TABLE_HEADING_MANUFACTURER;

$lc_align = '';

break;

// EZier New Fields added

case 'PRODUCT_LIST_RETAIL_PRICE':

$lc_text = TABLE_HEADING_RETAIL_PRICE;

$lc_align = 'right';

break;

// End EZier New Fields added

case 'PRODUCT_LIST_PRICE':

$lc_text = TABLE_HEADING_PRICE;

$lc_align = 'right';

break;

// EZier New Fields added

case 'PRODUCT_LIST_SAVE':

$lc_text = TABLE_HEADING_SAVE;

$lc_align = 'right';

break;

// End EZier New Fields added

case 'PRODUCT_LIST_QUANTITY':

$lc_text = TABLE_HEADING_QUANTITY;

$lc_align = 'right';

break;

      case 'PRODUCT_LIST_WEIGHT':

        $lc_text = TABLE_HEADING_WEIGHT;

        $lc_align = 'right';

        break;

      case 'PRODUCT_LIST_IMAGE':

        $lc_text = TABLE_HEADING_IMAGE;

        $lc_align = 'center';

        break;

      case 'PRODUCT_LIST_BUY_NOW':

        $lc_text = TABLE_HEADING_BUY_NOW;

        $lc_align = 'center';

        break;

    }

 

    if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') && ($column_list[$col] != 'PRODUCT_LIST_SAVE') ) {

      $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text);

    }

 

    $list_box_contents[0][] = array('align' => $lc_align,

                                    'params' => 'class="productListing-heading"',

                                    'text' => ' ' . $lc_text . ' ');

  }

 

  if ($listing_split->number_of_rows > 0) {

    $rows = 0;

    $listing_query = tep_db_query($listing_split->sql_query);

    while ($listing = tep_db_fetch_array($listing_query)) {

      $rows++;

 

      if (($rows/2) == floor($rows/2)) {

        $list_box_contents[] = array('params' => 'class="productListing-even"');

      } else {

        $list_box_contents[] = array('params' => 'class="productListing-odd"');

      }

 

      $cur_row = sizeof($list_box_contents) - 1;

 

      for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {

        $lc_align = '';

 

        switch ($column_list[$col]) {

          case 'PRODUCT_LIST_MODEL':

            $lc_align = '';

            $lc_text = ' ' . $listing['products_model'] . ' ';

            break;

          case 'PRODUCT_LIST_NAME':

            $lc_align = '';

            if (isset($HTTP_GET_VARS['manufacturers_id'])) {

              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

            } else {

              $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

            }

            break;

          case 'PRODUCT_LIST_MANUFACTURER':

$lc_align = '';

$lc_text = ' <a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a> ';

break;

// EZier New Fields added

case 'PRODUCT_LIST_RETAIL_PRICE':

$lc_align = 'right';

if ((tep_not_null($listing['products_retail_price'])) && ($listing['products_retail_price']) > 0) {

$lc_text = '<font color="#55508a">' . $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id']));

} else {

$lc_text = ' ';

}

break;

// End EZier New Fields added

case 'PRODUCT_LIST_PRICE':

$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 {

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

}

break;

// EZier New Fields added

case 'PRODUCT_LIST_SAVE':

$lc_align = 'right';

if ((tep_not_null($listing['products_retail_price'])) && ($listing['products_retail_price']) > 0) {

$lc_save = round(100 - (( $listing['products_price'] / $listing['products_retail_price'] ) * 100 ));

$lc_text = '<font color="red"> ' . $lc_save . '% </font>';

} else {

$lc_text = ' ';

}

break;

// End EZier New Fields added

case 'PRODUCT_LIST_QUANTITY':

$lc_align = 'right';

$lc_text = ' ' . $listing['products_quantity'] . ' ';

break;

          case 'PRODUCT_LIST_WEIGHT':

            $lc_align = 'right';

            $lc_text = ' ' . $listing['products_weight'] . ' ';

            break;

          case 'PRODUCT_LIST_IMAGE':

            $lc_align = 'center';

            if (isset($HTTP_GET_VARS['manufacturers_id'])) {

              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

            } else {

              $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> ';

            }

            break;

          case 'PRODUCT_LIST_BUY_NOW':

            $lc_align = 'center';

            $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';

            break;

        }

 

        $list_box_contents[$cur_row][] = array('align' => $lc_align,

                                              'params' => 'class="productListing-data"',

                                              'text'  => $lc_text);

      }

    }

 

    new productListingBox($list_box_contents);

  } else {

    $list_box_contents = array();

 

    $list_box_contents[0] = array('params' => 'class="productListing-odd"');

    $list_box_contents[0][] = array('params' => 'class="productListing-data"',

                                  'text' => TEXT_NO_PRODUCTS);

 

    new productListingBox($list_box_contents);

  }

 

  if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {

?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

  <tr>

    <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>

    <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

  </tr>

</table>

<?php

  }

?>

Link to comment
Share on other sites

Thank you for making that for me, I copied it right away, it looks great,  I already figured out that I didn't solve anything :'(  :'(

 

Can I ask  1 time more your help, I'm was trying to incorporate the ezier new fields into my product_listen_col.php, but after messing up my sql and 15 hours later I have to acknowledge that I will never learn it ( really frustating)

 

The contrib ezier new fields comes with a regular products_listing.php

 

After pasting the product_listening.Php in my previous answer I wanted a preview but after that I could not add anything anymore.

 

So I have to to it like this, thank you again for helping me, and I hope you can help me again.

 

Denice

Link to comment
Share on other sites

When you set the price column to show in the product listing, it correctly shows the right pricing level. However I have set up my site with a lot of other contributions and custom code. I need a way to only show the pricing column if a user is logged in. Anyone have a solution?

 

Aaron

Link to comment
Share on other sites

This is a great contribution and my install went without a hitch. Everything was fine until I actually tried to enter a price I had a problem.

 

I created a group named Wholesale.

 

I then went to the catalog and opened one of the products.

 

In the new box for entering the price for the wholesale group I entered the price.

 

The box beside the entry was checked. I clicked on Preview and then Update.

 

I then checked the item in the store while logged in as a Wholesale group member but the price still showed the original retail price.

 

In Admin, I went back to the product and the box where I had entered the price eariler was blank.

 

Just for fun I tried entering it with the check box blank as well as checked with no effect.

 

Any idea what is wrong?

 

This is a relatively new install of the latest version of OSC. The only changes to any of the files were for a template for the store appearance. No other contributions had been installed.

 

Thanks in advance for your help.

Link to comment
Share on other sites

Denice,

So I have to to it like this, thank you again for helping me, and I hope you can help me again.

I suppose you want to add the retail price and your price and something like "You save: x%". If you have added product_list_price to the sql queries that feed that product listing, it is more a matter of how you want to format the HTML than anything else.

 

For example just adding a few lines of code to the code above should show you something, that you will have to tweak to the formatting (HTML) you like:

 

    $listing = tep_db_query($listing_split->sql_query);
   $no_of_listings = tep_db_num_rows($listing);
   while ($listing_values = tep_db_fetch_array($listing)) {

  if (!isset($listing_values['products_name'])) { // normally this is already set, then no need
   // to spend another query getting it
     $listing_values['products_name']  = tep_get_products_name($listing_values['products_id']);
  }

     $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

     if ($listing_values['specials_new_products_price']) {
       $lc_text .= ' <s>' .  $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span><br>';
 } else {
       $lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '<br>';
     } 
// begin code for ez new fields
     if (isset($listing_values['products_retail_price']) && tep_not_null($listing_values['products_retail_price']) && $listing_values['products_retail_price'] > 0) {
$lc_text .= '<span style="color:#55508a;">Retail price: ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])). '</span>?<br>';       
  $lc_save = round(100 - (( $listing_values['products_retail_price'] / $listing_values['products_retail_price'] ) * 100 ));
  $lc_text .= 'You save: <span style="color:red"> ' . $lc_save . '% </span><br>';      
     }
// end code for ez new fields      
     if (PRODUCT_LIST_BUY_NOW) {
   $buy_now_button_array[] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','sort')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> '; 
     }
// changed valign from bottom to top, to get the pictures aligned

Link to comment
Share on other sites

I then checked the item in the store while logged in as a Wholesale group member but the price still showed the original retail price.

 

In Admin, I went back to the product and the box where I had entered the price eariler was blank. 

 

Just for fun I tried entering it with the check box blank as well as checked with no effect.

 

Any idea what is wrong?

No, I have no clue. This should work for you as it works for many others. Did you do the install on the admin/categories.php file yourself or did you just use the file from the package? Anyway, save your categories.php under another name and use the one from the contribution if you haven't done that already. That at least should make sure whether it is an install error (we are all humans are we?) or something else.

 

When you start editing the product, the check boxes should be in the checked state by default. So if you open the page and the boxes are unchecked, something is wrong already.

 

Check also what you see in the source code of the page when doing a preview. The group_prices should be there as hidden input (close to the bottom of the page). Example:

<input type="hidden" name="products_status" value="1"><input type="hidden" name="products_date_available" value="0000-00-00"><input type="hidden" name="manufacturers_id" value="4"><input type="hidden" name="products_name[1]" value="Die Hard With A Vengeance"><input type="hidden" name="products_name[2]" value="Stirb Langsam - Jetzt Erst Recht"><input type="hidden" name="products_name[3]" value="Die Hard With A Vengeance"><input type="hidden" name="products_tax_class_id" value="1"><input type="hidden" name="products_price" value="39.9900"><input type="hidden" name="products_price_gross" value="42.7893"><input type="hidden" name="sppcoption[1]" value="sppcoption[1]"><input type="hidden" name="sppcoption[6]" value="sppcoption[6]"><input type="hidden" name="sppcoption[7]" value="sppcoption[7]"><input type="hidden" name="sppcprice[1]" value="31.9920"><input type="hidden" name="sppcprice[6]" value="13.3333"><input type="hidden" name="sppcprice[7]"><input type="hidden" name="products_description[1]" value="Regional Code: 2.... etcetera

If that doesn't look alright either (the checkboxes are the sppcoption[#] ones) it gives some more info to go on.

Link to comment
Share on other sites

Denice,

I suppose you want to add the retail price and your price and something like "You save: x%". If you have added product_list_price to the sql queries that feed that product listing, it is more a matter of how you want to format the HTML than anything else.

 

For example just adding a few lines of code to the code above should show you something, that you will have to tweak to the formatting (HTML) you like:

 

    $listing = tep_db_query($listing_split->sql_query);
   $no_of_listings = tep_db_num_rows($listing);
   while ($listing_values = tep_db_fetch_array($listing)) {

  if (!isset($listing_values['products_name'])) { // normally this is already set, then no need
   // to spend another query getting it
     $listing_values['products_name']  = tep_get_products_name($listing_values['products_id']);
  }

     $lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

     if ($listing_values['specials_new_products_price']) {
       $lc_text .= ' <s>' .  $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span><br>';
 } else {
       $lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '<br>';
     } 
// begin code for ez new fields
     if (isset($listing_values['products_retail_price']) && tep_not_null($listing_values['products_retail_price']) && $listing_values['products_retail_price'] > 0) {
$lc_text .= '<span style="color:#55508a;">Retail price: ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])). '</span> <br>';       
  $lc_save = round(100 - (( $listing_values['products_retail_price'] / $listing_values['products_retail_price'] ) * 100 ));
  $lc_text .= 'You save: <span style="color:red"> ' . $lc_save . '% </span><br>';      
     }
// end code for ez new fields      
     if (PRODUCT_LIST_BUY_NOW) {
   $buy_now_button_array[] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','sort')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> '; 
     }
// changed valign from bottom to top, to get the pictures aligned

 

 

Hi Jan,

 

I don't Know if your dutch the name looks dutch, so I will first say it in dutch, Harstikke bedankt dat je het me gecodeerd hebt, echt heel tof van je :thumbsup:

 

If your not dutch I will say it in English, 10000x Thanks, Really great that you did that for me :thumbsup:

 

Echter op de een of andere manier pakt het niet in colum listing, wel in de gewone listing, ik heb wel een probleem met allebei te zien te krijgen in sts maar die heb ik ff uitgezet om te controleren en het komt dus wel tevoorschijn in listing met sts uit en niet in colum.

 

Nogmaal heel erg bedankt

Again, Thank you

Link to comment
Share on other sites

Denice,

I don't Know if your dutch the name looks dutch, so I will first say it in dutch, Harstikke bedankt dat je het me gecodeerd hebt, echt heel tof van je
Thanks, and you are right, I'm Dutch.
Echter op de een of andere manier pakt het niet in colum listing, wel in de gewone listing, ik heb wel een probleem met allebei te zien te krijgen in sts maar die heb ik ff uitgezet om te controleren en het komt dus wel tevoorschijn in listing met sts uit en niet in colum.

I don't get it. I thought you could only use one kind of product_listing on the index page (the one from modules/product_listing.php or product_listing_col.php). How come you use two? Or do you wanted to switch from the one you use now to the "regular" column listing?

Link to comment
Share on other sites

Hi Jan,

 

I don't Know if your dutch the name looks dutch, so I will first say it in dutch, Harstikke bedankt dat je het me gecodeerd hebt, echt heel tof van je :thumbsup:

 

If your not dutch I will say it in English, 10000x Thanks, Really great that you did that for me :thumbsup:

 

Echter op de een of andere manier pakt het niet in colum listing, wel in de gewone listing, ik heb wel een probleem met allebei te zien te krijgen in sts maar die heb ik ff uitgezet om te controleren en het komt dus wel tevoorschijn in listing met sts uit en niet in colum.

 

Nogmaal heel erg bedankt

Again, Thank you

 

Saw to late that I forgot the translate a part in english, here it goes;

 

However somehow the colum_listing is not working with ezier fields, the normal listing is, I'm using sts and have a conflict with the contrib but when I turn it of it is working with the listing.php and not with the colum.listing.php.

 

Again, thank you

Link to comment
Share on other sites

Denice,

Thanks, and you are right, I'm Dutch.

 

I don't get it. I thought you could only use one kind of product_listing on the index page (the one from modules/product_listing.php or product_listing_col.php). How come you use two? Or do you wanted to switch from the one you use now to the "regular" column listing?

In sts you have the ability to check if it is a problem with the coding or with the sts with an on and off switch.

 

BUT I would like to use the product_listing_col.php, but its trowing me a curve :angry:

Its the last part of my adjustments (where did I hear that before :D ), but sts_user_code and sts_product_info together with the ezier new field en de product_listing_colum are driving me bananas.

 

I'm trying to get close to the look of ice.com (yeah, right) but I will die trying

 

Denice

Link to comment
Share on other sites

BUT I would like to use the product_listing_col.php, but its trowing me a curve
What goes wrong then?
I'm trying to get close to the look of ice.com (yeah, right) but I will die trying
Looks nice, but it means even more <tr> which in itself wouldn't be impossible. Pull the same trick more than once ;)
Link to comment
Share on other sites

What goes wrong then?

Looks nice, but it means even more <tr> which in itself wouldn't be impossible. Pull the same trick more than once ;)

 

It is not calling the field retailprice, JT Price, and You Save%, I tought this was a error with sts but after switchen it out, it was still not showing. I than looked if it worked with "normal" listing.php and than it shows (still sts switched off)

 

with sts switch on it also works but in the sts_user_code I have to put a code so that the save% and Retailprice will show. You can see it partly working in the "New Products in....." on the frontpage.

Link to comment
Share on other sites

It is not calling the field retailprice, JT Price, and You Save%, I tought this was a error with sts but after switchen it out, it was still not showing. I than looked if it worked with "normal" listing.php and than it shows (still sts switched off)

 

with sts switch on it also works but in the sts_user_code I have to put a code so that the save% and Retailprice will show. You can see it partly working in the "New Products in....." on the frontpage.

 

 

YESSSSSSSSSSSSSS, Got it

 

Nou nog even op zijn nederlands, man wat een opluchting, ik weet niet of je in america zit of nederland maar echt dit is een biertje waard, pffffffffffffffffffffffff

Link to comment
Share on other sites

I downloaded the latest recover carts contribution (211) and I can tell you it does not tie in with SPPC (but is not really broken by it either). It does mention in step 9 of the install instructions that you should copy the function tep_get_products_special_price from catalog/includes/functions/general.php to catalog/admin/includes/functions/general.php. Since tep_get_products_special_price is customer_group aware and you will get strange results (if not errors) in the admin section if you don't, I would highly recommend doing that.

 

For getting the prices recover cart sales only looks at retail pricing. So wholesale customers will have the wrong prices shown (and will skew the total) in admin/recover_cart_sales.php.

Janz, Yep - that's what I was talking about. It would be nice to be able to recover the cart costs of different types of buyers in their pricing someday.

 

Carol

Link to comment
Share on other sites

Janz, Yep - that's what I was talking about.  It would be nice to be able to recover the cart costs of different types of buyers in their pricing someday.

 

Also, has anyone tried this contrib with the Multiple Vendors Contrib?  Together, they would do most my work for me and keep track of it... I've got the multi customer groups working... I don't really want to break it to see if the multi vendor contrib would work with it.  But if someone else has it working that would be great!  :D

 

Carol

Link to comment
Share on other sites

Jan- Im attempting to add a contribution to my SPPC mod'ed store and would love your opinion on something.

 

its the country-state selector contribution:

http://www.oscommerce.com/community/contributions,2028

 

It ties into a couple forms that SPPC uses(for the "company tax id field", and im slightly nervous to incorporate it. Heres one example of a part of the install that im concerned about:

in the /catalog/address_book_process.php file:

Line 191

 

Replace:

 

  if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {

 

with:

 

// +Country-State Selector

}

 

  if ($refresh) {

    // Recreate $entry from post values collected above

    $entry = array(

      'entry_firstname' => $firstname,

      'entry_lastname' => $lastname,

      'entry_street_address' => $street_address,

      'entry_postcode' => $postcode,

      'entry_city' => $city,

      'entry_state' => "",

      'entry_zone_id' => (int)0,

      'entry_country_id' => (int)$country);

    if (ACCOUNT_GENDER == 'true') $entry['entry_gender'] = $gender;

    if (ACCOUNT_COMPANY == 'true') $entry['entry_company'] = $company;

    if (ACCOUNT_SUBURB == 'true') $entry['entry_suburb'] = $suburb;

    }

  else

// -Country-State Selector

  if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {

 

SPPC already added a line right after the last line of the above code.

// BOF Separate Pricing Per Customer
if (isset($HTTP_GET_VARS['edit']) && is_numeric($HTTP_GET_VARS['edit'])) {
  $entry_query = tep_db_query("select entry_gender, entry_company, entry_company_tax_id, entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_zone_id, entry_country_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$HTTP_GET_VARS['edit'] . "'");
// EOF Separate Pricing Per Customer

 

Now I realize the state-country code is before the one line and the SPPC code is after it and they dont overlap, but will the state-country code itself screw up SPPC? I was told to add "'entry_company_tax_id' => $company_tax_id," into the state-country code for that example above to display the company tax id box on the page.......but is it THAT simple? Theres a couple other places where the two contributions may clash.....I just picked one to see what you thought about the whole thing. Thanks a ton for any advise.

Link to comment
Share on other sites

Bob,

SPPC already added a line right after the last line of the above code.
Actually, changed that line to reflect the addition of the tax id number: entry_company_tax_id.
Now I realize the state-country code is before the one line and the SPPC code is after it and they dont overlap, but will the state-country code itself screw up SPPC?
No.
I was told to add "'entry_company_tax_id' => $company_tax_id," into the state-country code for that example above to display the company tax id box on the page.......but is it THAT simple?
Yes, it is that simple. What that does is fill the tax id number field again with what the new customer just typed in. If you don't, the page is refreshed and he/she has to type it in again. Not customer friendly ;).

It would be more in line with the rest of the code to use:

if (ACCOUNT_COMPANY == 'true') $entry['entry_company_tax_id'] = $company_tax_id;

but that is nitpicking.

Link to comment
Share on other sites

Hi Janz

 

You send the code bellow for the product_listing_col.php without SPPC for the right alignment.

 

<?php
/*
?-- Changed 11/10/03 for v 2.2 MS2 - Randy Pertiet
?-- Changed 2005/07/12 to fill out rows and put the buy now buttons in a separate table row 

?$Id: product_listing_col.php,v 1.00 2002/05/06 20:28:07 icw_ Exp $

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

?Released under the GNU General Public License
*/
?>
<!-- product_listing_col //-->
<?php

?DEFINE('PRODUCT_LIST_COL_NUM',3);
?// change width = "33%" if you use another number than 3 in (around) lines 62, 67, 84

?$listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

?if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) {
?>
?<table border="0" width="100%" cellspacing="0" cellpadding="2">
? ?<tr><td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
? ? ?<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
? ?</tr>
?</table>
<?php
?}

?$info_box_contents = array();

?if ($listing_split->number_of_rows > 0) {

$row = 0;
$col = 0;
$counter = 1;

? ?$listing = tep_db_query($listing_split->sql_query);
? ?$no_of_listings = tep_db_num_rows($listing);
? ?while ($listing_values = tep_db_fetch_array($listing)) {

? if (!isset($listing_values['products_name'])) { // normally this is already set, then no need
? ?// to spend another query getting it
? ? ?$listing_values['products_name'] ?= tep_get_products_name($listing_values['products_id']);
? }

? ? ?$lc_text= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing_values['products_image'], $listing_values['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing_values['products_id']) . '">' . $listing_values['products_name'] . '</a><br>';

? ? ?if ($listing_values['specials_new_products_price']) {
? ? ? ?$lc_text .= ' <s>' . ?$currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing_values['specials_new_products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . '</span> ';
?} else {
? ? ? ?$lc_text .= ' ' . $currencies->display_price($listing_values['products_price'], tep_get_tax_rate($listing_values['products_tax_class_id'])) . ' <br>';
? ? ?}

? ? ?if (PRODUCT_LIST_BUY_NOW) {
? ?$buy_now_button_array[] = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action','sort')) . 'action=buy_now&products_id=' . $listing_values['products_id'], 'NONSSL') . '">' . tep_image_button('button_buy_now.gif', TEXT_BUY . $listing_values['products_name'] . TEXT_NOW) . '</a> '; 
? ? ?}
// changed valign from bottom to top, to get the pictures aligned
? ? ?$info_box_contents[$row][$col] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="top"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => $lc_text);
// if we reached the last of the products, make sure the row of table cells is filled with empty cells if needed
? ? ?if ($counter == $no_of_listings ) {
? ? ? ? for ($i = $col + 1; $i < PRODUCT_LIST_COL_NUM; $i++) {
? ?$info_box_contents[$row][$i] = array('align' => 'center', 'params' => 'class="smallText" width="33%" valign="bottom"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => '?');
? ? ? ? }
? ? ?}
? ? ? ?
? ? ?$col ++;
? ? ?$counter++;
? ? ?if (($col > PRODUCT_LIST_COL_NUM-1) || ($counter -1) == $no_of_listings) {
? ? ? ?$col = 0;
? ? ? ?$row ++;
? // make sure all table cells per row with buy_now buttons are there and filled with a space
? ? ?for ($n = sizeof($buy_now_button_array); $n < PRODUCT_LIST_COL_NUM; $n++) {
? ?$buy_now_button_array[] = "?";
? ? ?}

? ? ? foreach ($buy_now_button_array as $column1 => $lc_text1) {
? ? $info_box_contents[$row][$column1] = array('align' => 'center',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'params' => 'class="smallText" width="33%" valign="bottom" style="padding-top: 5px;"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' ?=> $lc_text1);
? ? ? ? ? ?// added a little padding to the button
? ? }
? ? unset($buy_now_button_array);
? ? $column = 0;
? ? $row ++;
? ? ?}
? ?}

? ?new contentBox($info_box_contents);

?} else {

? ?$info_box_contents = array();

? ?$info_box_contents[0] = array('params' => 'class="productListing-odd"');
? ?$info_box_contents[0][] = array('params' => 'class="productListing-data"',
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?'text' => TEXT_NO_PRODUCTS);

? ?new contentBox($info_box_contents);

?}

if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) {
??>
?<table width="100%">
?<tr>
? ?<td class="smallText" ><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
? ? ?<td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>
?</tr>
?</table>
<?php
?}
?>

 

If we want the same thing for the SPPC version for the good aligment, what is the code you use ? TIA. :thumbsup:

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Jeep,

If we want the same thing for the SPPC version for the good aligment, what is the code you use ? TIA.  :thumbsup:

Getting a bit late for me, so I might not be thinking straight ;) but I think it was post 1122 on the previous page.

 

If you confirm this one works correct, feel free to add it to the contribution as an improved upon version.

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