Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

EZier New Fields


nrlatsha

Recommended Posts

  • Replies 303
  • Created
  • Last Reply

Top Posters In This Topic

Just to clarify. I went through steps 1-7 (I'm pretty sure I did every change...I'll check tonight) and I did not receive any errors. When I view product_info.php I see the normal price. I do not see anything like this:

 

Retail Price: $80.00

Your Price: $0.00

You Save: $80.00 (100%)

Status ? In Stock

 

When I'm in Admin, I see the added fields for EZier; however, I do not see anything on the product page to add a retail price. All I see is Products Price (Net): and Products Price (Gross):. Under My Store, I have "Products Price (Gross):" set to true. Did I miss anything? I do not have any other price or product contributions installed.

 

Please help.

Link to comment
Share on other sites

I figured out my error. Everything is working properly. For the longest time as I've been setting up the site I've been accessing the Admin function from http://www.mysite.com/admin. It appears that to make configuration updates, I really should be accessing the Admin function from http://www.mysite.com/catalog/admin. Correct?

Link to comment
Share on other sites

  • 2 weeks later...
I have successfully installed ezier new fields as well as using it with easy populate.

 

However, whent eh retail_price field is over $999 (iblieve) it shows ont eh website as $1 and a -88800% discount!

How can I change this?I checked the DB and the values is set to varchar64.

 

Hello, i am sorry for replying to this post to ask a question... but could you or anyone tell me (or point me in the right direction) how you get ezier to work with easy populate? i have been searching and trying for days and no luck....

Thanks

Edited by gilurv
Link to comment
Share on other sites

  • 7 months later...

Hello,

 

I have installed up to stage 19, and all is working fine except for the new products box. The code in the tutorial is vastly different from the code in the actual osC file.

 

It says

 

FIND (29):

 

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

$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=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

But i cannot find it in this file

 

<?php

/*

$Id: new_products.php 1806 2008-01-11 22:48:15Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- new_products //-->

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')));

 

new contentBoxHeading($info_box_contents);

 

if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, products_retail_price, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

} else {

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, products_retail_price, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

}

 

$row = 0;

$col = 0;

$info_box_contents = array();

while ($new_products = tep_db_fetch_array($new_products_query)) {

$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=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

$col ++;

if ($col > 2) {

$col = 0;

$row ++;

}

}

 

new contentBox($info_box_contents);

?>

<!-- new_products_eof //-->

 

 

I tried putting it in to the file, but it returned an error. I would be most grateful for help.

Link to comment
Share on other sites

  • 1 month later...

Hi guys, I have spent hours trying to resove the problem but i have now officially given up, I have just installed, EZ new fields and everything seems to work fine except the product info page... I just get half a page loaded and then im presuming where product_info.php is instructed to load eznewfields.php, it just says parse error on line 80 of eznewfields, its to do with the "}" brackets.... I have even tried the stock installation of my website and it still coming up!!! Can someone please help, im really stuck and I badly need this contribution, I will be very greatfull... Thanks

Link to comment
Share on other sites

  • 1 month later...

I read most of this thread looking for an answer but could not find it. I use this contribution and like it a lot, but I was wondering if the Percent saving could be displayed with decimals .... like 14.5% or 23.56% right now the percentage will only display 15% or 24%.

Link to comment
Share on other sites

  • 2 months later...

Hi, I keep getting this error when I go live and upload the store.. It works fine on a localhost, but on the live store I get this:

 

Fatal error: Call to undefined function: osc_ez() in ...public_html/includes/modules/ezier_new_fields.php on line 24

 

PLEASE SOMEONE HELP!!!!

Link to comment
Share on other sites

  • 3 weeks later...

I just installed and it almost works, when I change the product to "taxable item" it then takes the amount from the "Products Price (Gross):" field and puts it in the "your price" on the store? If I put it back to be non-taxable then it works fine.

 

any ideas?

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
Fist of all, thanks for your hard work on this great contribution.

 

I just installed the contribution and I think it works fine except one thing.

 

I changed includes/languages/english.php files

// EZier new fields
define('TEXT_PRODUCTS_RETAIL_PRICE_INFO', '<br>Retail Price: ');
define('TEXT_PRODUCTS_PRICE_INFOS', '<br><strong><font color="#827AE9">Your Price: ');
define('TEXT_PRODUCTS_SAVE_INFO', '<br><strong><font color=red>You Save: ');
define('TEXT_PRODUCTS_RETAIL_PRICE', 'Products Retail Price:');
//EZier new fields end

 

in order to make 'Your Price' look better.

 

But, the color of the product description text is also changed.

 

This is exactly I see on my product_info.php page.

 

 

Retail Price: $200

Your Price: $100

You Save: 50%

 

Regional Code: 2 (Japan, Europe, Middle East, South Africa).

Languages: English, Deutsch.

Subtitles: English, Deutsch, Spanish.

Audio: Dolby Surround 5.1.

Picture Format: 16:9 Wide-Screen.

Length: (approx) 114 minutes.

Other: Interactive Menus, Chapter Selection, Subtitles (more languages).

 

 

When I don't change english.php file, and set it as default(which is black color), the product description is black as well.

 

I followed your instruction and had no problem with that..

 

Except Step 5

===========
STEP 5
===========

catalog/admin/includes/languages/english/categories.php

ADD (Where ever you want)

// EZier new fields
define('TEXT_PRODUCTS_RETAIL_PRICE', 'Products Retail Price:');
//EZier new fields end

 

Because this code is already there from step 1.

 

 

Please, help me with this problem..

 

 

and I'm really happy to see the updated version of this contribution.

 

Thanks again.

 

 

Sorry for the late replies everyone, I was on vacation :)

 

I think everyone's questions can be answered with this:

 

catalog/product_info.php, look for:

 

	<?php  
 echo TEXT_PRODUCTS_RETAIL_PRICE_INFO . $retail; 
 echo TEXT_PRODUCTS_PRICE_INFO . $our; 
 echo TEXT_PRODUCTS_SAVE_INFO . $save . '%</font>'; }  
} else { ?>

 

If you change this area to the font/size you want like so:

 

	<?php  
 echo '<font size=3>' . TEXT_PRODUCTS_RETAIL_PRICE_INFO . '<s><font color = "#827AE9">' . $retail . '</s></font></font>'; 
 echo TEXT_PRODUCTS_PRICE_INFO . $our; 
 echo TEXT_PRODUCTS_SAVE_INFO . $save . '%</font>'; }  
} else { ?>

 

You can see from the above example, you can change whatever you like, or use your stylesheet. I modified retail price there...

 

 

minuteago - I'll take a look at that for the next release. I had planned on getting that out before I left, but ran out of time. Look for it in the next couple of weeks. Oh, and remove the part you added into the english file...

 

duvys - I'll take a look at adding something in there for no pic, but with all the picture contribs out there, it might prove difficult...

 

Hi,

 

I've just installed this contribution so many thanks for that.

 

I am trying to change the font size and colour as above but when i try the solution thats posted above I cannot find the code in my product_info.php to change.... I've also looked in a fresh install for this code and it isnt there either. I am running Osc MS2.

 

Can someone please help me wth this?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...
  • 5 weeks later...

Hello people

 

I guess I am not the only one with questions about this particular contribution. I figure there's more questions than answers here because this contribution is so old! It needs someone to take ownership of it again.... but I'm afraid my coding skills are basic so it won't be me.

 

QUESTION:

 

On products_info.php - I want to add the price at the top, next to the title:

 

<td class="pageHeading" align="right" valign="top">

<?php if ($product_info['products_retail_price'] != 0){

echo TEXT_PRODUCTS_RETAIL_PRICE_INFO . '<s>' . $products_retail_price . '</s>'; ?>

<?php echo $products_price; ?></td>

 

does anyone know how to add the fields like this:

 

WONDERFUL FLUFFY COAT: retail price: 89.99 our price: 45.00 save: 44.99

 

 

Any suggestions?

 

Thanks

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...

Hi All,

 

I am using this with STS and also Column listings I couldn't find the code to fix the display so I worked it around myself. Probably not the neatest but it does the trick.

 

Hopefully it will be useful for someone else!

Backup first - this is /includes/modules/product_listing.php

 

 

<?php
/*
$Id: product_listing.php,v 1.44 2003/06/09 22:49:43 hpdl Exp $
*/

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

$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') ) {
    $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) {
  $listing_query = tep_db_query($listing_split->sql_query);

  $row = 0;
  $column = 0;
  while ($listing = tep_db_fetch_array($listing_query)) {

    $product_contents = array();

    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">RETAIL PRICE: <S>' . $currencies->display_price($listing['products_retail_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>';
} 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 = 'OUR PRICE: <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 = 'OUR PRICE: ' . $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">YOU SAVE: ' . $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;
      }
      $product_contents[] = $lc_text;

    }
    $lc_text = implode('<br>', $product_contents);
    $list_box_contents[$row][$column] = array('align' => 'center',
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
    $column ++;
    if ($column >= 3) {
      $row ++;
      $column = 0;
    }
  }

  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

  • 2 months later...

Hello,

 

I've just installed the contrib.

 

Just one support needed i've different code in catalog/includes/modules/new_products.php

2 changes required as per the install instructions.

 

1st one is ok for me.

 

but this part is different in my modules file

 

FIND (29):

$new_products['products_name'] = tep_get_products_name($new_products['products_id']);
$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=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

REPLACE WITH:

if ((NEW_FIELDS_WHATS_NEW == 'true') && ($new_products['products_retail_price'] != 0)) {
$whats_new_retail_price = $currencies->display_price($new_products['products_retail_price'], tep_get_tax_rate($new_products['products_tax_class_id']));
$retail = '</a><style=main><s>'. TEXT_PRODUCTS_RETAIL_PRICE_INFO . $currencies->display_price($new_products['products_retail_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</s>';
} else {
$retail = '';
}
$new_products['products_name'] = tep_get_products_name($new_products['products_id']);
$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=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO,'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $retail . TEXT_PRODUCTS_PRICE_INFO . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

 

 

 

here's my catalog/includes/modules/new_products.php FILE

 

<?php
/*
 $Id: new_products.php,v 1.34 2005/11/01 22:49:58 hpdl Exp $
  ========================================
  OSCOMMERCE NEW_PRODUCTS MODULE MODIFIED
  ========================================

  (c)2008 SeftonB

  Portions Copyright (c) 2003 osCommerce
  http://www.oscommerce.com

  This software is released under the
  GNU General Public License. A copy of
  the license is bundled with this
  package.

  No warranty is provided on the open
  source version of this software.

  ========================================
  ========================================
*/
?>
<!-- new_products //-->
<?php

 if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) {
   $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 } else {
   $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
 }

 $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($new_products = tep_db_fetch_array($new_products_query)) {
 $new_products['products_name'] = tep_get_products_name($new_products['products_id']);
$new_products['products_name'] = substr($new_products['products_name'], 0, 35);
$sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$new_products['products_id'].' && language_id='.(int)$languages_id;
$description_query = tep_db_query($sql);
$description = mysql_fetch_array($description_query, MYSQL_ASSOC);
$description['products_description'] = strip_tags($description['products_description']);
$description['products_description'] = substr($description['products_description'], 0, 90);
$desc_len = strlen($description['products_description']);
if($desc_len != 0){
 $description['products_description'][$desc_len-1] = '.';
$description['products_description'][$desc_len-2] = '.';
$description['products_description'][$desc_len-3] = '.';
}


 if ($col == 0){
 	if($new_products['products_image'])
$info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" cellspacing="0" width="50%" valign="top" bgcolor="#ffffff" ',                                          'text' => '<table width="100%"  border="0" cellspacing="0" cellpadding="10"  cellpadding="0">
 <tr>
   <td class="smallText">
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>
<table width="100%" border="0" cellspacing="2" cellpadding="2"  >

</table>
</td>
<td >
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">
<div class="hp-products-name">' . $new_products['products_name'] . '</div></a>	
<p class="smallText">'.$description['products_description']. '</p>
<div class="hp-price">'. $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</div>
</td></tr>
</table>');

}else{
	if($new_products['products_image'])
	$info_box_contents[$row][$col] = array('align' => 'center',
                                          'params' => 'class="smallText" cellspacing="0" width="50%" valign="top" bgcolor="#ffffff" ',
                                          'text' => '<table width="100%"  border="0" cellspacing="0" cellpadding="10"  cellpadding="0">
 <tr>
   <td class="smallText">
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>
<table width="100%" border="0" cellspacing="2" cellpadding="2"  >
 <tr>
   <td class="smalltext" >
</td>
 </tr>
</table>
</td>
<td >
<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">
<div class="hp-products-name">' . $new_products['products_name'] . '</div></a>	
<p class="smallText">'.$description['products_description']. '</p>
<div class="hp-price">'. $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])).'</div>
</td></tr>
</table>');
}

   $col ++;
   if ($col > 1) {
     $col = 0;
     $row ++;
  if ($row > 1)
     break;
   }
 }

 new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

Link to comment
Share on other sites

  • 1 month later...

Just had a quick glance thru here and fell pretty dum asking this question after what you guys have been doing with this contrib.

 

Any how I have installled the contrib (seems at earlier stage) but have strikethrough issues, below is what I am getting:

 

Retail Price: £44.95

Your Price: £40.95You

Save: £4.00

 

Instead Of what I presume should be

 

Retail Price: £44.95

Your Price: £40.95

You Save: £4.00

 

Sorry for the basic question, but how do I modify this?

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

  • 1 year later...

I have just added this contributin, version 5, and all is working well. My store has been highly modded. I wanted the prices to appear where the price is normally. Here is the code as it appears on my site. I do also have headertags seo installed, but it should work if you remove the <h2> </h2>

 

<td valign="top"><h1><?php echo $img_new_product . $products_name; ?></h1></td>

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

<td align="left" valign="top"><h2><?php if ($product_info['products_retail_price'] !=0){include(DIR_WS_MODULES . 'ezier_new_fields.php'); } else {echo $products_price;} ?></h2></td>

 

I hope this of some use to someone

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

  • 4 months later...

hello. i am trying show retail_price at admin/invoice.php an i haven't managed.

i have tryed to pull it from the products table as i do with other fields. and drom the orders table as normal proce does.

any ideas?

the perfect would be to show retail, list, & special price.

Thanks in advace

Link to comment
Share on other sites

  • 5 months later...

Ezier New Fields (ENF) and Separate Price Per Customer (SPPC) - product_listing_col.php

 

Todd from post 263 had supplied some good information about installing ENF and SPPC together, however the problem I was experiencing with ENF after installing SPPC was exactly what was described by Todd. The symptoms are ENF works on the advanced_search_result.php but not on pages generated from the index.php. If that's the case then you missed something (like I did).

 

I am a relative noob at PHP and if you are too, here is how the pages lead to each other. Once I realized that, it took me 2 minutes to fix the index.php and correct the display using product_listing_col.php.

 

Product Listing - index.php hands off to product_listing_col.php

Perform a Search - advanced_search_results.php hands off to product_listing_col.php

 

advanced_search_result.php calls all the variables again and works if the index page does not. That is because you forgot to add the p.products_retail_price of ENF back into the index.php. Every line in the code below calls tmp_pp.products_price and needs p.products_retail_price added after it. EX: tmp_pp.products_price, p.products_retail_price,

 

// show the products of a specified manufacturer
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
// BOF Separate Pricing Per Customer
if ($status_product_prices_table == true) { // ok in mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_retail_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd , " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";		
} else { // either retail or no need to get correct special prices -- changed for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_retail_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) { // ok in mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_retail_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";	
} else { // either retail or no need to get correct special prices -- changed for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_retail_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
} // end else { // either retail...
// EOF Separate Pricing Per Customer
  }
} else {
// show the products in a given categorie
  if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory;  
// BOF Separate Pricing Per Customer
	if ($status_product_prices_table == true) { // ok for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_retail_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";	
	} else { // either retail or no need to get correct special prices -- ok in mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_retail_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} // end else { // either retail...
// EOF Separate Pricing Per Customer
  } else {
// We show them all
// BOF Separate Pricing Per Customer --last query changed for mysql 5 compatibility
	if ($status_product_prices_table == true) {
// original, no need to change for mysql 5
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_retail_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . $product_prices_table . " as tmp_pp using(products_id), " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
	} else { // either retail or no need to get correct special prices -- changed for mysql 5
	$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_retail_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS_RETAIL_PRICES . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
  } // end else { // either retail...
// EOF Separate Pricing per Customer
  }
}

 

Hope that helps! I have clearly defined the issue above so future NOOBS can Google this sucker and know how simple the problem is. (w00t)

Edited by geomilli
Link to comment
Share on other sites

  • 7 months later...

Had a quick look but may of missed it, but dont think has been asked on here yet!

 

I have installed the contribution and it works fine, however i have obviously made a error somewhere as:

 

When i edit the catalogue price, ir changes fine, I click on preview and the change is shown, however when i click update the changed price has reverted back to what it was before i changed it?

 

Think thats clear enough....lol

 

Ricardo

Complete Newbie On The Learn - Not A Programmer

But Learning As I Go

Link to comment
Share on other sites

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

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