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

Thx Noel much appreciated, nice contribution first time using it works great 1 minor issue which I seem to have is the this:

 

littleproblem.gif

 

How do I get rid of this plz anyone any ideas. :unsure:

Link to comment
Share on other sites

j0ker -Thats my laziness there... I didn't use the currencies class to define that symbol. I'll work on that while looking over the things for minuteago...

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

minuteago -I think I had that at one point in time, unless I had it in my head... I'll take a look at that too...

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

No hurry, I only posted to let you know this isnt a working site yet, I only setup to test this contribution for future and use with my new infobox's.

 

sts.gif

 

I am now working on the centre boxs, much harder for me as I am not a coder, but I have one question, this image has the prices to the left of the product details but also main price to the right as normal how do I get shut of this and rely on your contrib to give prices.

 

littleproblem.gif

Link to comment
Share on other sites

I hope I am not being a problem child, but here is another question, on the image below I have alignment problem where is this sorted is it product_info.php? I dont want to mess it up.

alignment.gif.

 

Also I have another problem since install, just noticed when I dont assign the new features to a product my product details are all centered in the page like this:

 

centre.gif

 

Any thoughts

Link to comment
Share on other sites

joker - easiest way to do that is so:

 

LOOK FOR:

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

 

And comment that entire part out, like so:

/*    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   } */

 

That should get rid of it.

 

********************************

 

Everyone who is eagerly anticipating the update may have to wait a little longer. I noticed some gross discrepancies on this mod. :o I'm not going to tell you what they are, but if you find them, I'll give you a cookie. :) Because of these mistakes, I'll need to rewrite a large part of the code (again) to get it to work (right). I'll probably have to introduce an EZ_new_fields function in the process.

 

Due to these unforeseen delays, the projected release time may be tomorrow night* (I can hear the collective sigh of EZ New Field-ians in my head right now).

 

I apologize for any inconvenience this may have caused.

 

Noel

 

*NOTE: EZ New Fields coder reserves the right to push this to a further release date for any reason he wants (read: sleep and/or food and/or general laziness)

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

j0ker - I will take a look at that also...

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

joker - easiest way to do that is so:

 

LOOK FOR:

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
? ? ?$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
? ?} else {
? ? ?$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
? ?}

 

And comment that entire part out, like so:

/* ? ?if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
? ? ?$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
? ?} else {
? ? ?$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
? ?} */

 

That should get rid of it.

:unsure: Noel, what file do I edit excuse if I dont know, but I am not php savvy to see from the code where it is located.

 

Regarding other issues no probs, u have bigger fish to fry by the sound of things.

Link to comment
Share on other sites

j0ker - catalog/product_info.php

 

Sorry, it seems second nature to me now that I forget I was new once and didn't know where to look for things too...

Edited by nrlatsha

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

Edit post never works, anyway I have done that fix thx it gets shut of that right corner price thx, but I have another problem nothing to do with that edit.

All my prices have gone except new products front page weird, am looking through admin but I havnt changed anything really in there.

 

Curious happenings afoot my friends.

Link to comment
Share on other sites

Guys,

 

Is it possible to display product's options not in a drop down menu, but somehting like this:

 

 

Hard Drive 60gb --> $99 (box here to pick a quantity) (box here to add to shp cart)

Hard Drive 80gb --->$129 (box here to pick a quantity) (box here to add to shp cart)

 

instead of drop down menu to choose the sizes.

 

Thanks.

Link to comment
Share on other sites

I found another bug(?) here..

 

On the admin page, I input those variables.

 

Tax Class: Taxable Goods

Products Retail Price: 24.95

Products Price (Net): 13.25

Products Price (Gross): 14.3928(this field is automatically filled as soon as I fill the Net field)

 

But the problem is the way it displays.

 

Retail Price: $24

Your Price: $13

You Save: $11.7 (47%)

 

 

It should be

 

Retail Price: $24

Your Price: $13.25

You Save: $11.75 (47%)

 

 

How do I fix this problem?

Link to comment
Share on other sites

I think this is probably to do with the tax decimal place and price decimal places set in admin these are nothin to do with the contrib, I dont think.

 

admin>configuration>tax decimal places is one of them

 

I think the other one is the currency decimal setting.

 

Try this...

Link to comment
Share on other sites

While I tried to modify the product_info.php, I found some difficulties.

 

I want All 'retail price', 'our price', and 'save x%' to be located in the middle of the product_info.php. (Not right next to the product picture)

 

I want these 3 lines to located inside the box which I made underneath the product picture.

 

If I copy and paste the code you provided, it won't work...

I think I need add/delete some tags such as </td>, </tr>, or </table>

 

Can you tell me an easy instruction which explains how to move those 3 lines wherever I want.. ?

Link to comment
Share on other sites

I found another bug(?) here..

 

On the admin page, I input those variables.

 

Tax Class:  Taxable Goods

Products Retail Price:  24.95

Products Price (Net):    13.25

Products Price (Gross): 14.3928(this field is automatically filled as soon as I fill the Net field)

 

But the problem is the way it displays.

 

Retail Price: $24

Your Price: $13

You Save: $11.7 (47%)

 

 

It should be

 

Retail Price: $24

Your Price: $13.25

You Save: $11.75 (47%) 

 

 

How do I fix this problem?

Minuteago - CONGRATS! you found one of the problems I saw the other day! If I had cookies emabled, I'd tell you to go to my site: www.nabcomdiamonds.com and grab yourself a cookie, but I don't. So, I've talked to some friends over at Am@zon and they said you can visit them to claim your cookie! j/k But yeah, that was one of them, stripping the decimals off the other 2 displays and another involves using the currency class for the output...

 

But:

But the problem is the way it displays.

 

Retail Price: $24

Your Price: $13

You Save: $11.7 (47%)

 

 

It should be

 

Retail Price: $24

Your Price: $13.25

You Save: $11.75 (47%) 

 

Should look like:

Retail Price: $24.95
Your Price: $13.25
You Save: $11.75 (47%)

 

OR

 

Retail Price: $24
Your Price: $13
You Save: $11 (47%)

 

Depending on the way you set the decimals in admin

 

And your other questions:

 

For changing manufacturers field to model #

 

catalog/products_new.php

 

LOOK FOR:

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_retail_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

CHANGE TO:

  $products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_retail_price, p.products_model,  p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

LOOK FOR:

 <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . $retail . '<br>Your Price ' . $products_price; ?></td>

 

CHANGE TO:

<td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br>' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br>' . TEXT_MANUFACTURER . ' ' . $products_new['products_model'] . $retail . '<br>Your Price ' . $products_price; ?></td>

 

And

 

Another thing I really want to modify is the color on product_info.php

 

CODE 

 

echo TEXT_PRODUCTS_SAVE_INFO . '$' . $save2 . ' (' . $save . '%)</font>'; 

 

I tried to add '<font size=4 font color = "red" font face="Tahoma">' . between echo and TEXT, but I don't know what to add at the end..

If I don't add something at the end, all my description text will be changed like

TEXT_PRODUCTS_SAVE_INFO(in this case red.)

 

if you go into catalog/includes/languages/english/english.php and look for:

 

define('TEXT_PRODUCTS_SAVE_INFO', '<br><font color=red>You Save: ');

 

You'll see thats the start of the coloring for a variable $save2. Now, if you want to change it, just modify that line in english.php to add your new stuff, ie.: <font size=4 font color = "red" font face="Tahoma">, the </font> at the end of the line will close the tags for you.

 

Your last question will be addressed in the next version. (Shhh, don't tell anyone I'm working on it or remind them I said it would be out a couple of days ago ;) We'll keep that between us. )

 

jjanguda - I hate when software companies do this, but I'm not a software company, so wait until the upgrade to 5.0 comes out later tonight. Based on your info (and probably a better practice) I'm making this into a module that needs called from product_info.php, so you can put it anywhere now... Cool huh?

 

j0ker - could you clarify the prices disappearing problem, I'm not sure I understand.

 

HAKAPAT - Question #1: Anything is possible :P But this is the wrong thread to be asking on, do a search on the forum for that.

Question #2: I'm sure it is, but at this point, I don't support easy populate. I know there's a contrib that shows you how to add things to easy populate, but I don't use it myself...

 

Everyone - I think I got to everyone, didn't I? If not, put it here again...

 

Now, the next release is growing, and because its another major overhaul, I have to release it as 5.0. That should be tonight, or early morning <disclaimer></disclaimer>

 

I've had a couple requests for where to send donations also, so I posted a button here, I'll post another later, but here is good for now...

 

Donate here

 

Whew, what a post! I gotta get back to work on the upgrade here...

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

When you go to yoursite/index.php?cPath=numbers,

 

you can only see product name, model number, price, and buy now button.

 

How can I add retail price betwwen model number and price..?

 

Except that page, all have retail, our price shown.

 

 

great contribution ..no matter how many time I think of it...

 

Amazied~!!!

Link to comment
Share on other sites

New Version just released:

******************************

 

EZier New Fields 5.0

 

******************************

 

Get it here: http://www.oscommerce.com/community/contributions,1310

 

I fixed everything I missed before, yay!

 

And, I changed everything again, yay!

 

New functions, modules, you name it, its here!

 

Change notes: 5 July 04:22:59

(1) Changed everything, again.

(2) Function created to take care of decimal replacements

(3) Turned into module you include in products_info.php, so you can choose where you want this to show.

(4) Updated results listing alignment

(5) Updated products_new.php to remove the extra space and only show if retail

(6) Updated boxes to only show if retail price is set.

(7) Cooler instructions

(8) Updated output to include currencies class (I missed some before)

 

In a nutshell, everything is different, for upgrade purposes, I'd use a file compare utility. There's just too much for a separate upgrade document. You'll be glad you did though... :D

 

It took me alot longer than I anticipated to get this out, but I think everyone will be happy with it, for now... I already found a dead link :(

 

donate.gif

 

And I got the button to work! :D

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

jjanguda - I'm not sure what you're talking about with that link, is it a different contrib? When I type that in a default setup, it just shows the categories and the whats new for X month box.

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

When you go to yoursite/index.php?cPath=numbers,

 

you can only see product name, model number, price, and buy now button.

 

How can I add retail price betwwen model number and price..?

 

Except that page, all have retail, our price shown.

 

 

I guess what he tries to say is this..

 

On the "Let's See What We Have Here" page, there's a box shown some of the products with its product name, price, and a buy now button. This doesn't have a retail price on it..

 

When you click "Action" under DVD Movies menu, you will see what he means.

 

That's something I want to know...

Link to comment
Share on other sites

I think I may know what you mean, but we'll see. Did you guys go into admin->configuration->product listing and set the display order? You can move the new fields around to where you want them.

 

Does this answer the question?

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

Link to comment
Share on other sites

Would you please help? i use ezy field as you can see in the code, I can't not fix the alignment here is the problem

everything is fine first

the problem is when going through the shopping cart bundle u will see bundle + one product right

it doesn't show up the bundle + one product and the footer is left may be you take a look at the code please

it is pretty hard for me, i am jsp programmer new anyway thanks.

==============

<?php

/*

$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where (p.products_status = '1' or (p.products_status='0' and p.products_bundle_status='1')) and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script language="javascript"><!--

function popupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

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

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php

if ($product_check['total'] < 1) {

?>

<tr>

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<?php

} else {

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

 

$product_info = tep_db_fetch_array($product_info_query);

 

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

 

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

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

} else {

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

}

 

if (tep_not_null($product_info['products_model'])) {

$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';

} else {

$products_name = $product_info['products_name'];

}

?>

<tr>

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

<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

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

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td class="main">

<?php

if (tep_not_null($product_info['products_image'])) {

?>

<table border="0" cellspacing="0" cellpadding="2" align="right">

<tr>

<td align="center" class="smallText">

<script language="javascript"><!--

document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info[

'products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

<?php

 

// Begin EZier new fields contrib (Noel Latsha)

 

if ($product_info['products_retail_price'] != 0)

{

// Get the retail price & clean up the decimal places

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

$strlen = strlen($retail);

if (NEW_FIELDS_DECIMAL == 0) { ($strlen = ($strlen - 3)); } // Set the decimal places

if (NEW_FIELDS_DECIMAL == 1) { ($strlen = ($strlen - 1)); } // We don't need em here

$retail = substr(($currencies->display_price($product_info['products_retail_price'],tep_get_tax_rate($product_info['products_tax_class_id']))),0,$strlen) ;

 

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

{ // If there is a special ... Special Overrides customer discount...

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

$save = ((($our) / ($product_info['products_retail_price'])) * 100);

$save2 = ($product_info['products_retail_price'] - $our);

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

$strlen = strlen($our);

if (NEW_FIELDS_DECIMAL == 0) { ($strlen = ($strlen - 3)); } // Set the decimal places

if (NEW_FIELDS_DECIMAL == 1) { ($strlen = ($strlen - 1)); } // We don't need em here

$our = substr(($currencies->display_price($new_price,tep_get_tax_rate($product_info['products_tax_class_id']))),0,$strlen);

}

 

if (((strstr($customer_discount, "-") != 0) && ((tep_get_products_special_price($product_info['products_id'])) == null)))

{ // If there isn't a special, but still a customer discount... We'll need those decimals....

$our = ($product_info['products_price']);

$our = $our - $our * abs($customer_discount) / 100;

$save = ((($our) / ($product_info['products_retail_price'])) * 100);

$save2 = ($product_info['products_retail_price'] - $our);

$our = ($currencies->display_price_nodiscount($our,tep_get_tax_rate($product_info['products_tax_class_id'])));

} // End cust discount

 

if ((strstr($customer_discount, "-") == 0) && ((tep_get_products_special_price($product_info['products_id'])) == null))

{ // Just a regular price

$our = ($product_info['products_price']);

$save = ((($our) / ($product_info['products_retail_price'])) * 100);

$save2 = ($product_info['products_retail_price'] - $our);

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

$strlen = strlen($our);

if (NEW_FIELDS_DECIMAL == 0) { ($strlen = ($strlen - 3)); } // Set the decimal places

if (NEW_FIELDS_DECIMAL == 1) { ($strlen = ($strlen - 1)); } // We don't need em here

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

} // End of regular price

 

$save = (100 - $save);

$save = round($save); ?>

</td>

</tr>

</table>

<?php

echo TEXT_PRODUCTS_RETAIL_PRICE_INFO . '<s>' . $retail . '</s>';

echo TEXT_PRODUCTS_PRICE_INFO . $our;

// Uncomment the line that you want below, and comment our the default option if you like, description is to the right

// echo TEXT_PRODUCTS_SAVE_INFO . '$' . $save2 . '</font>'; //This line is price shown

// echo TEXT_PRODUCTS_SAVE_INFO . $save . '%</font>'; //This line is % shown

echo TEXT_PRODUCTS_SAVE_INFO . '$' . $save2 . ' (' . $save . '%)</font>'; //This line is % and price together

}

} else { ?>

</td>

</tr>

</table>

<?php

}

// End EZier new fields contrib (Noel Latsha)

 

?>

<p><?php echo stripslashes($product_info['products_description']); ?></p>

<?php

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

$products_attributes = tep_db_fetch_array($products_attributes_query);

if ($products_attributes['total'] > 0) {

?>

<table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>

</tr>

<?php

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {

$products_options_array = array();

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

while ($products_options = tep_db_fetch_array($products_options_query)) {

$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

 

if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {

$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];

} else {

$selected_attribute = false;

}

?>

<tr>

<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

}

?>

</table>

<?php

}

?>

</td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php require(DIR_WS_MODULES . FILENAME_ADDITIONAL_IMAGES); ?>

</td>

</tr>

<?php

$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

$reviews = tep_db_fetch_array($reviews_query);

if ($reviews['count'] > 0) {

?>

<tr>

<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if (tep_not_null($product_info['products_url'])) {

?>

<tr>

<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>

</tr>

<?php

} else {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

</tr>

<?php

}

?>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

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

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>

<td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php // BOF: This is the buy_two_module and if there is a wording in the beginning of the produkt model text then

 

// this will not appear because it makes no sense to bundle a bundle and so on...

 

if (BUY_TWO_YES_NO == 'yes') {

 

 

 

if (ereg('^'.BUY_TWO_BUNDLE_MODEL_NAMING.'_', $product_info['products_model'])) {

 

// echo 'TEST this is a bundle';

 

} else {

 

 

 

include(DIR_WS_MODULES . 'buy_two_module.php');

 

 

 

}

 

} else {

 

}

 

// buy_two_module EOF

?>

</td>

<td>

 

<?php

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

}

?>

</td>

</tr>

</table></form></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

beosz - This is hard for me to look at because I don't have the bundle contrib installed, so I can't tell where the problem lies. The only advise I can give you is to upgrade to 5.0. That version uses these new fields inside a module and you can place it whereever you want it to go. I'm hoping it'll take care of any alignment problems people may have.

 

Sorry I couldn't be of more assistance.

 

Noel

9 times out of 10 its a PEBCAK Error (Problem exists between chair and keyboard)

 

Replace that and you're fine...

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