Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Wishlist 3.0 Support Thread


dblake

Recommended Posts

Well it sounds like the query for the product name is only working on the wishlist page? Or that product page? Nobody else seemed to have that problem so I suggest you look over your files and the installation instructions again to make sure you didn't mess something up.

Link to comment
Share on other sites

I found the solution, in the wishlist.php i made a typo... :blush:

 

 

Somebody knows how to fix it with sts, i found something but that didn't work

In sts_display_output.php

Below "Create custom boxes" (around row 228);

CODE 

$template['wishlistbox'] = strip_unwanted_tags($sts_block['wishlistbox'], 'wishlistbox');


Below Display HTML -> "Print column right stuff" (around row 313);

CODE 

echo $sts_block['wishlistbox'];


In column_right.php or column_left.php (doesnt matter)

CODE 

if($wishList->count_wishlist() != '0') {
require(DIR_WS_BOXES . 'wishlist.php');
}\0\0

// STS: ADD
$sts_block_name = 'wishlistbox';
require(STS_RESTART_CAPTURE);
// STS: EOADD


In your template

CODE 

$wishlistbox

 

If i look to my sts_display_output.php in only see +- 50 rows

Link to comment
Share on other sites

How I integrated wish list into my STS 4.2 store = added the following code to /includes/modules/sts_inc/sts_user_code.php

 

this is a link in my header:

$sts->template['wishlink'] = '<a href=' . tep_href_link(FILENAME_WISHLIST, '', 'SSL') . ' class="headerNavigation"> wish list</a>';

I then call it into my template with $wishlink

 

I originally displayed it as a box:

$sts->start_capture();
require(DIR_WS_BOXES . 'wishlist.php');
$sts->stop_capture('wishlist', 'box');

I called it into my template with $wishlist

 

hope this helps!

Edited by demarah
Link to comment
Share on other sites

I just installed Wishlist 3.5d and I thought everything is working correctly. The only questions I have is when someone buys a product from the wishlist is it suppose to be removed? Right now everything works with no errors - It's just when someone buys something it does not get removed from the list. Did I not insall it correctly ?

Link to comment
Share on other sites

Dennis,

 

You did a great job with this Contributions and I just wanted to thanks you for all your time you have invested in this Contribution :) It's people like you that make the open source community so great!

 

Ok so I un-installed this contribution (Wishlist 3.5d) and tried again and I still am getting the same result. The result is that when a product is purchased from the wish list it does not get removed from the wish list.

 

If anyone wants to see for themselves you can view mine:

http://www.littlebabybirdrock.com/wishlist...php?public_id=2

 

Couple of things that I should mention.

 

1) I do have Ultimate SEO URLs by Chemo installed maybe that is why it is not working correctly. Does anyone know if that would conflict.

 

2) In firefox wishlist_public.php worked but in IE and Safari when I hit "Add TO Cart" I would go to an 405 Error saying the "Post Method was Not Allowed" I read in another forum to change this line:

 

if(!isset($_GET['public_id'])) {

 

to this line:

 

if(!isset($_GET['public_id']) && !isset($HTTP_POST_VARS['add_wishprod'])) {

 

After doing that the 405 Error went away Now that works :)

 

3) Once I made the above change wishlist_public.php it made the wishlist_public.php in the apple Safari browser display this error:

Fatal error: Call to a member function on a non-object in /home/littleba/public_html/includes/column_right.php on line 15

 

What is weird is that non of my other browsers did this. So I went ahead and commented out the code in column_right.php so I don't have to see the error.

 

So now the only problem I am having is getting the product to remove from the wishlist once it is purchased.

 

-Brian

 

I just installed Wishlist 3.5d and I thought everything is working correctly. The only questions I have is when someone buys a product from the wishlist is it suppose to be removed? Right now everything works with no errors - It's just when someone buys something it does not get removed from the list. Did I not insall it correctly ?
Link to comment
Share on other sites

Hey Brian,

 

I love the different browser testing as I do the same, just I dont have a mac :P. Anyway the code on column_right.php (If I remember correctly, been a while) is to display the box when contents are present in the wishlist? Is this correct. Prolly looks like something $wishLIst->count_contents... or something like that. Doesn't make sense why the "browser" would mess with server side coding... One suggestion would be to change all instances of "$wishList" to $wishlist. Notice the non cap 'L'. I would of thought older versions of PHP would conflict like this, but who knows?

 

Now onto removing the product:

The code that removes the products from the wishlist when something is bought is on ...hmmm... checkout_process.php. Wow haven't used osc in over a year :). Its down towards the bottom where the products are removed from the shopping cart. Maybe $wishList->remove() ? or clear()?

 

For debugging install chemo's debug contribution. And no his SEO url's should not conflict.

 

Let me know,

Dennis

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

I just installed Wishlist 3.5 and unfortunately I just get a blank page when I click on Add to wishlist or My wishlist in the top menu (that's where I added the link). If I click Back after I add the product to my wishlist, I do get the message that the product has been added to my wishlist. Also, I've been using the column controller, so I have no Right colum in my store (so I need to see the wishlist.php to see the products in the wishlist). I know a blank page can mean something as tiny as a "punctuation error" (can't think of the proper name right now LOL), but my store is now running on a server where register globals is off, so I just wanted to check if this could be what's causing it before I start going through everything again. Any ideas??

 

TIA!

 

This mod seems perfect for me, so I'm anxious to get it to work! :)

Link to comment
Share on other sites

I downloaded the 3.5 pack again and this time it's working! I only have one slight problem, and that is when I try to e-mail my wishlist to someone, I get the error message that I have to write in at least one name and e-mail. Any ideas on this one??

 

After going back and forth and back and forth between 2.4 and 3.5 over the last 4 days, I'm so happy to have made it this far LOL

Link to comment
Share on other sites

Hi fist off this is one of those must haves for OSC. Thanks to every one that put this together.

I?m trying to add the ?Add to Wish list? to the product reviews under the Add to cart but I can?t seem to get it to work. I know it is after

 

echo '<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now') . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a></p>';

 

In the product_reviews_info.php

 

Any help would be appreciated. Thanks

Also is there a way to add qualities to the wish list? Like if someone wanted 5 widgets instead of just one. So that the person that is looking at the wish list knows they need 5.

Keep up the good work and thanks

Link to comment
Share on other sites

Installed the Wishlist - works fine, except for the Email to Friends function.

 

No matter what email address I put in the Email Address fields, I get a "Please enter a valid email address" message. Email is working on the server and in osCommerce, so it doesn't appear to be a server issue.

 

 

Anyone have athought as to what's up?

 

:'(

Link to comment
Share on other sites

Installed the Wishlist - works fine, except for the Email to Friends function.

 

No matter what email address I put in the Email Address fields, I get a "Please enter a valid email address" message. Email is working on the server and in osCommerce, so it doesn't appear to be a server issue.

Anyone have athought as to what's up?

 

:'(

 

bump

Link to comment
Share on other sites

Sorry Booker, cant help you there. I've even entered fake email addresses and they slipped by.

 

However, i have a problem. It's in the column_right.php. no matter waht i do, i cannot get it to work. Right now, i've just got the line commented out, and everything's working fine, but if i turn that comment off, i get this

 

Fatal error: Call to undefined function: count_wishlist() 
in /home/content/F/a/i/Faird/html/catalog/includes/column_right.php on line 15

 

I'm using this peice of code, it's right, right? i had to remove the Capitol L's of course

 

if($wishlist->count_wishlist() != '0') { require(DIR_WS_BOXES . 'wishlist.php'); }

 

Everything else works good. I'm not even sure what this is supposed to do when it's working right.

I'm pretty sure i've installed all the extra a, b, c, d, updates and everything, but maybe i missed one. They're so unorganized.

Edited by SeanB

My website's address is in My Profile, since it's not allowed to be in my signature.

Link to comment
Share on other sites

Hello,

 

I just installed Wishlist 3.5 and unfortunately I just get a blank page when I click on Add to wishlist or My wishlist in the top menu (that's where I added the link). If I click Back after I add the product to my wishlist, I do get the message that the product has been added to my wishlist. Also, I've been using the column controller, so I have no Right colum in my store (so I need to see the wishlist.php to see the products in the wishlist). I know a blank page can mean something as tiny as a "punctuation error" (can't think of the proper name right now LOL), but my store is now running on a server where register globals is off, so I just wanted to check if this could be what's causing it before I start going through everything again. Any ideas??

 

TIA!

 

This mod seems perfect for me, so I'm anxious to get it to work! :)

 

 

I am getting this error too, and getting really frustrated. Did you ever find a solution?

Link to comment
Share on other sites

I am getting this error too, and getting really frustrated. Did you ever find a solution?

 

 

Just to clarify - I am getting a blank page when I add to wishlist - here is an example:

 

http://www.tss-radio.com/product_info-2.php?products_id=237

 

I have a bunch of contributions installed, and some custom code of my own, but I think I followed the directions without too much variation. Can somebody please take a look and help me out?

 

Thanks,

Sean

 

 

and here is my product_info:

 

<?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);

$is_mm_pcc_vn = false;

// BOF HAUTU

 

if (isset($HTTP_GET_VARS['products_id']) && tep_not_null($HTTP_GET_VARS['products_id'])) {

$HTTP_GET_VARS['products_id'] = tep_db_prepare_input($HTTP_GET_VARS['products_id']);

} elseif (isset($HTTP_POST_VARS['products_id']) && tep_not_null($HTTP_POST_VARS['products_id'])) {

$HTTP_GET_VARS['products_id'] = (int)$HTTP_POST_VARS['products_id'];

}

if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

/*

if (isset($HTTP_POST_VARS['action']) && $HTTP_POST_VARS['action'] == 'refresh3') {

$HTTP_GET_VARS['products_id'] = (int)$HTTP_POST_VARS['products_id'];

} */

//if (isset($HTTP_POST_VARS['mm_pcc_vn']) && tep_not_null($HTTP_POST_VARS['mm_pcc_vn'])) {

if (isset($HTTP_POST_VARS['mm_pcc_vn'])) {

$is_mm_pcc_vn = true;

}

 

$process = false;

if (isset($HTTP_POST_VARS['action']) && $HTTP_POST_VARS['action'] == 'process') $process = true;

 

$option_posted = array();

 

if (isset($HTTP_POST_VARS['manufacturer']) && tep_not_null($HTTP_POST_VARS['manufacturer'])) {

$option_posted[OPTION_ID_MANUFACTURER] = $HTTP_POST_VARS['manufacturer'];

if (strstr(OPTION_ID_MANUFACTURER, TEXT_PREFIX)) {

$manu = tep_db_prepare_input($HTTP_POST_VARS['manufacturer']);

} else {

$manu = tep_get_option_value_name((int)$HTTP_POST_VARS['manufacturer']);

}

}

 

if (isset($HTTP_POST_VARS['year']) && tep_not_null($HTTP_POST_VARS['year'])) {

 

$option_posted[OPTION_ID_YEAR] = $HTTP_POST_VARS['year'];

 

if (strstr(OPTION_ID_YEAR, TEXT_PREFIX)) {

$year = tep_db_prepare_input($HTTP_POST_VARS['year']);

} else {

$year = tep_get_option_value_name((int)$HTTP_POST_VARS['year']);

}

}

 

if ($process) {

$error = false;

 

if (isset($HTTP_POST_VARS['manufacturer']) && !tep_not_null($HTTP_POST_VARS['manufacturer'])) {

$error = true;

$messageStack->add('product_info', 'Please select a manufacturer.');

}

if (isset($HTTP_POST_VARS['year']) && !tep_not_null($HTTP_POST_VARS['year'])) {

$error = true;

$messageStack->add('product_info', 'Please select a year made.');

}

 

if (isset($HTTP_POST_VARS['id']) && is_array($HTTP_POST_VARS['id'])) {

reset($HTTP_POST_VARS['id']);

while (list($key, $val) = each($HTTP_POST_VARS['id'])) {

if (tep_get_option_name($key) == OPTION_COLOR_CODE) {

if (!tep_not_null($val)) {

$error = true;

$messageStack->add('product_info', 'Please select a color for this product.');

}

$val_check = tep_check_color_code($manu, $year, tep_db_prepare_input($val));

if (!$val_check && !$error) {

$error = true;

$messageStack->add('product_info', $val . ' color code is not exist in our list.');

}

}

if ($is_mm_pcc_vn == true) {

if (tep_get_option_name($key) == OPTION_MODEL_MANUFATURER || tep_get_option_name($key) == OPTION_PAINT_COLOR_CODE) {

if (!tep_not_null($val)) {

$error = true;

$messageStack->add('product_info', 'Please enter values for '.OPTION_MODEL_MANUFATURER.' and '.OPTION_PAINT_COLOR_CODE.'.');

}

}

}

$option_posted[$key] = $val;

}

}

 

if (!$error) {

reset($option_posted);

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $option_posted))+1, $option_posted);

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

}

}

}

// EOF HAUTU

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

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

<script src="jsfuncs.js">

</script>

<?php

// BOF: WebMakers.com Changed: Header Tag Controller v2.4.5

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

?>

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

<?php

}

// EOF: WebMakers.com Changed: Header Tag Controller v2.4.5

?>

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

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

</head>

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

<!-- header //-->

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

<!-- header_eof //-->

 

<!-- body // -->

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

<tr>

<!-- body_text //-->

<?php

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

//multimage

$product_info = tep_db_fetch_array($product_info_query);

?>

 

<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', 'products_id')) . 'action=goto'), 'post', 'enctype="multipart/form-data"') . tep_draw_hidden_field('action', 'process'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<table cellspacing=0 cellpadding=0>

<tr><td background=images/mm31.gif width=513 height=35>

<table cellspacing=0 cellpadding=0>

<tr><td height=10></td></tr>

<tr><td class=fp> <H1>    <?php echo substr($product_info['products_name'],0,47) ?></H1></td></tr>

<tr><td height=2></td></tr>

</table>

</td></tr>

<tr>

<td class=bg3 align=center>

<table cellspacing=0 cellpadding=0>

<tr><td height=1 bgcolor=#BBBBBB width=473></td></tr>

<tr><td height=9 bgcolor=#ffffff width=473></td></tr>

</table>

 

<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, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

//multimages

// removed here

 

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 ($product_info['products_price'] < 0) {

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

} else if ($product_info['products_price'] < $product_info['products_map']) {

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

} else 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(($product_info['products_price'] == 0) || ($product_info['products_price'] == -0.99)) {

$products_price = 'Product not available yet';

}

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'];

}

//$products_id = $product_info['products_id'];

 

 

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED

if(tep_session_is_registered('wishlist_id')) {

?>

<tr>

<td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td>

</tr>

<?php

tep_session_unregister('wishlist_id');

}

 

 

 

// BOF HAUTU

if ($messageStack->size('product_info') > 0) {

?>

<tr><td><table cellspacing=0 cellpadding=0>

<td><?php echo $messageStack->output('product_info'); ?></td>

</tr>

<tr>

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

</tr>

<?php

}

// EOF HAUTU

?>

 

 

 

<?php// echo $products_price; ?>

 

<?php

if ($product_info['products_price'] >= 25) {

echo ('<tr><td colspan="2" align="right" class="smallText"><b>Free shipping (USA only)</b></td></tr>');

}else{

echo ('<tr><td colspan="2" align="right" class="smallText"><b>Free shipping when part of a $25 purchase (USA only)</b></td></tr>');

}

?>

<tr><td height=5 colspan=4></td></tr>

<tr><td width=128 valign=middle align=center>

<?php

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

?>

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

<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_pop']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image_pop'], $product_info['products_name'], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

 

<br><br>

<?php

//affiliate build a link begin

if (tep_session_is_registered('affiliate_id')) {

?>

<?php echo '<a href="' . tep_href_link(FILENAME_AFFILIATE_BANNERS_BUILD, 'individual_banner_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('includes/languages/english/images/buttons/button_affiliate_build_a_link.gif', 'Make a link') . ' </a>'; ?><?php

}

//affiliate build a link begin

?>

 

</td>

</tr>

</table>

<?php

}

?>

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

<td><img src=images/m49.gif width=1 height=106></td>

<td width=10>                 </td>

<td width=273 valign=top>

<table cellspacing=0 cellpadding=0>

 

<tr><td class=tx2 colspan=2><?php echo $products_name; ?></td></tr>

<tr><td height=16 colspan=2></td></tr>

<!-- <tr><td class=tx colspan=2><b>Item #:</b>  <?php //echo $products_id; ?></td></tr> -->

<tr><td class=tx colspan=2>

<?php

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

echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']));

else

// echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']));

?>

</td></tr>

<tr><td height=13 colspan=2></td></tr>

<tr><td class=tx><b>Item Price: </b>  <span class=tx3><?php echo $products_price; ?></span>    <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']); ?>

<?php

if($product_info['products_price'] > 0){

echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_BUY_NOW);

}

else if ($product_info['products_price'] < 0){

if ($product_info['products_price'] == -0.99){

echo '<BR><BR><A HREF="emailus.php?products_id=' . $product_info['products_id'] . '">Click here to join the notification list for this product</A>';

} else {

echo '<BR><BR><A HREF="emailus.php?products_id=' . $product_info['products_id'] . '">Click here to join the notification list for this product</A>';

}

}

else {

echo '<BR><BR><A HREF="emailus.php?products_id=' . $product_info['products_id'] . '">Click here to join the notification list for this product</A>';

}

if($product_info['preorder']>0 && $product_info['products_price'] > 0){

echo '<BR><BR>To pre-order this item using your credit card, add it to your cart and proceed to checkout (you will not be charged). Or, if you aren\'t ready to reserve yours yet, <A HREF="emailus.php?products_id=' . $product_info['products_id'] . '">click here to join the notification list for this product</A>';

}

?></td></tr>

 

<?php

if ( (($product_info['rebate'])>0) && ($product_info['products_price'] <> 0) ){

echo '<Tr><td class=tx><b>After $' . $product_info['rebate'] . ' mail-in rebate: </b><span class=tx3>';

//$tmp = $product_info['products_price'] - $product_info['rebate'];

if (($new_price_2 = tep_get_products_special_price($product_info['products_id'])) && (($product_info['products_price'])>0) ) {

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

}else{

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

}

echo $tmp;

echo '</span></td></tr>';

echo '<tr><td class= tx>Rebate requires a subscription to US SIRIUS service, linked to a US address. <A HREF="' . tep_href_link("rebate") . '">(Click here for more rebate information)</A> </td></tr>';

}

 

?>

 

<tr><td align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></td></tr>

 

 

<?php

if($product_info['product_manual_pdf']) {

?>

<tr valign=center><td><IMG SRC="images/adobe.gif"><A HREF="images/<?php echo $product_info['product_manual_pdf']; ?>"><?php echo $product_info['products_name'] . ' manual (PDF)'?> </A></td></tr>

<?php } ?>

</table>

</td></tr>

 

<tr><td height=10 colspan=4></td></tr>

<tr><td background=images/m46.gif width=432 height=1 colspan=4></td></tr>

<tr><td height=10 colspan=4></td></tr>

 

<tr><td colspan=4 class=tx8 style="padding-left:15px">Description

 

<?php

$is_faq_query = tep_db_query("SELECT count(product_id) as num_faq FROM " . TABLE_FAQ . " WHERE $query visible='1' and $query language='$language' and product_id = '" . $HTTP_GET_VARS['products_id'] ."' group BY product_id");

$res = tep_db_fetch_array($is_faq_query);

if((int)$res['num_faq'] > 0){

echo '| <a class="product_nav" href="' . tep_href_link('product_faq.php', tep_get_all_get_params()) . '"> FAQ </a>';

}

?>

 

<?php

if((int)$product_info['install_instructions'] > 0){

echo '| <a class="product_nav" href="' . tep_href_link('product_install.php', tep_get_all_get_params()) . '"> Install Instructions </a>';

}

?>

 

</td></tr>

<tr><td height=10></td></tr>

<tr><td colspan=4 width=407 style="padding-left:15px" class="frontpagestuff">

<H2><?php echo $product_info['products_name']; ?> Description</H2>

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

<BR><BR><center>

<!-- start bundle At the beginning of Bundle Mod Addition 21.01.2005-->

<?php if (tep_not_null($product_info['products_bundle'])) {

?>

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

<tr class="infoBoxContents">

<td>

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

<tr>

 

<td class="main" colspan="3">

 

<?php

 

if ($product_info['products_bundle'] == "yes") {

$products_bundle = $product_info['products_bundle'];

 

echo TEXT_PRODUCTS_BY_BUNDLE . "</td></tr>";

$bundle_query = tep_db_query(" SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price, p.products_image

FROM products p

INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd

ON p.products_id=pd.products_id

INNER JOIN " . TABLE_PRODUCTS_BUNDLES . " pb

ON pb.subproduct_id=pd.products_id

WHERE pb.bundle_id = " . $HTTP_GET_VARS['products_id'] . " and language_id = '" . (int)$languages_id . "'");

while ($bundle_data = tep_db_fetch_array($bundle_query)) {

//if ($bundle_data['products_bundle'] == "yes") {

if(0>1) {

// uncomment the following line to display subproduct qty

echo "<br>» <b>" . $bundle_data['subproduct_qty'] . " x " . $bundle_data['products_name'] . "</b>";

echo "<br>» <b> " . $bundle_data['products_name'] . "</b>";

$bundle_query_nested = tep_db_query(" SELECT pd.products_name, pb.*, p.products_bundle, p.products_id, p.products_price

FROM products p

INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd

ON p.products_id=pd.products_id

INNER JOIN " . TABLE_PRODUCTS_BUNDLES . " pb

ON pb.subproduct_id=pd.products_id

WHERE pb.bundle_id = " . $bundle_data['products_id'] . " and language_id = '" . (int)$languages_id . "'");

 

 

while ($bundle_data_nested = tep_db_fetch_array($bundle_query_nested)) {

// uncomment the following line to display subproduct qty

/* echo "<br><i>     " . $bundle_data_nested['subproduct_qty'] . " x " . $bundle_data_nested['products_name'] . "</i>";

echo "<br><i>     " . $bundle_data_nested['products_name'] . "</i>";

$bundle_sum += $bundle_data_nested['products_price']*$bundle_data_nested['subproduct_qty'];*/

}

} else {

// uncomment the following line to display subproduct qty

echo "<tr><td class=main valign=top>" ;

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $bundle_data['products_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $bundle_data['products_image'], $bundle_data['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="1" vspace="1"') . '</a>' ;

echo "</td><td class=main >» <b>" . $bundle_data['subproduct_qty'] . " x " . $bundle_data['products_name'] . '</b>   </td><td align = right class=main><b>  ' . $currencies->display_price(abs($bundle_data['products_price']), tep_get_tax_rate($product_info['products_tax_class_id'])) . "</b></td></tr>";

//echo "<br>» <b> " . $bundle_data['products_name'] . "</b>";

$bundle_sum += abs($bundle_data['products_price']*$bundle_data['subproduct_qty']);

}

}

$bundle_saving = abs($bundle_sum) - abs($product_info['products_price']);

 

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

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

// comment out the following line to hide the "saving" text

//if($bundle_saving < 0){

//echo "<tr><td colspan=3 class=main><p><b>" . TEXT_RATE_COSTS . ' ' . $bundle_sum . '</b></td></tr><tr><td class=main colspan=3><font color="red"><b>' . TEXT_IT_SAVE . ' ' . $bundle_saving . '</font></b>';

//}

}

 

?>

 

</td>

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

</tr>

 

</table></td>

</tr>

 

</table>

<?php

}

?>

<!-- end bundle End of Bundle Mod Addition 21.01.2005-->

</center>

</td></tr>

 

<tr><td height=10></td></tr>

</table>

 

 

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

 

</td>

</tr>

 

<tr><td><img src=images/m34.gif width=513 height=6></td></tr>

</table>

 

</form></td>

<!-- body_text_eof //-->

</tr>

</table>

<?php include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); //include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); ?>

<!-- body_eof //-->

 

<!-- footer //-->

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

<!-- footer_eof //-->

<br>

</body>

</html>

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

 

 

 

and here is my application_top:

 

<?php

/*

$Id: application_top.php,v 1.280 2003/07/12 09:38:07 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

// start the timer for the page parse time log

define('PAGE_PARSE_START_TIME', microtime());

 

// CLR 020605 defines needed for Product Option Type feature

define('PRODUCTS_OPTIONS_TYPE_SELECT', 0);

define('PRODUCTS_OPTIONS_TYPE_TEXT', 1);

define('PRODUCTS_OPTIONS_TYPE_RADIO', 2);

define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3);

define('PRODUCTS_OPTIONS_TYPE_TEXTAREA', 4); // DDB - 041107 - add textarea field

define('TEXT_PREFIX', 'txt_');

define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES

 

// set the level of error reporting

error_reporting(E_ALL & ~E_NOTICE);

 

// check if register_globals is enabled.

// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.

if (function_exists('ini_get')) {

ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');

}

 

// Set the local configuration parameters - mainly for developers

if (file_exists('includes/local/configure.php')) include('includes/local/configure.php');

 

// include server parameters

require('includes/configure.php');

 

if (strlen(DB_SERVER) < 1) {

if (is_dir('install')) {

header('Location: install/index.php');

}

}

 

// define the project version

define('PROJECT_VERSION', 'osCommerce 2.2-MS2');

 

// set the type of request (secure or not)

$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

 

if ($request_type != 'SSL') {

$env_hostname = strtolower(getenv('HTTP_HOST'));

if ($env_hostname == 'colormatchantenna.sslpowered.com') {

$request_type = 'SSL';

} else {

$request_type = 'NONSSL';

}

}

/*

if (isset($HTTP_SERVER_VARS['HTTPS']) || strtolower($HTTP_SERVER_VARS['HTTPS']) == 'on') {

echo 'https_on';

}*/

// set php_self in the local scope

if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];

 

if ($request_type == 'NONSSL') {

define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);

} else {

define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);

}

 

// HAUTU

$attributes_functions[] = array('name' => 'Color code', 'funtion' => 'tep_get_colors');

//$color_function_fields = array('Manufacturer', 'Year');

define('OPTION_MANUFATURER', 'Manufacturer');

define('OPTION_YEAR', 'Year');

define('OPTION_COLOR_CODE', 'Color code');

define('OPTION_COLOR_DESCRIPTION', 'Color description');

define('OPTION_FIELD_MANUFACTURER', 'manufacturer');

define('OPTION_FIELD_YEAR', 'year');

define('OPTION_ID_MANUFACTURER', '7');

define('OPTION_ID_YEAR', '8');

define('OPTION_ID_COLOR_DESCRIPTION', '10');

 

// HAUTU BOF- OSCommerce - add options / attributes

define('OPTION_MM_PCC_VN_CHECKBOX', 'Color matched to your car');

define('OPTION_MODEL_MANUFATURER', 'Model and manufacturer');

define('OPTION_PAINT_COLOR_CODE', 'Paint color code');

define('OPTION_VIN_NUMBER', 'VIN number (optional)');

// HAUTU EOF- OSCommerce - add options / attributes

 

// include the list of project filenames

require(DIR_WS_INCLUDES . 'filenames.php');

 

// include the list of project database tables

require(DIR_WS_INCLUDES . 'database_tables.php');

 

// customization for the design layout

define('BOX_WIDTH', 200); // how wide the boxes should be in pixels (default: 125)

 

// include the database functions

require(DIR_WS_FUNCTIONS . 'database.php');

 

// make a connection to the database... now

tep_db_connect() or die('Unable to connect to database server!');

 

// set the application parameters

$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

while ($configuration = tep_db_fetch_array($configuration_query)) {

define($configuration['cfgKey'], $configuration['cfgValue']);

}

 

// if gzip_compression is enabled, start to buffer the output

if ( (GZIP_COMPRESSION == 'true') && ($ext_zlib_loaded = extension_loaded('zlib')) && (PHP_VERSION >= '4') ) {

if (($ini_zlib_output_compression = (int)ini_get('zlib.output_compression')) < 1) {

if (PHP_VERSION >= '4.0.4') {

ob_start('ob_gzhandler');

} else {

include(DIR_WS_FUNCTIONS . 'gzip_compression.php');

ob_start();

ob_implicit_flush();

}

} else {

ini_set('zlib.output_compression_level', GZIP_LEVEL);

}

}

 

// set the HTTP GET parameters manually if search_engine_friendly_urls is enabled

if (SEARCH_ENGINE_FRIENDLY_URLS == 'true') {

if (strlen(getenv('PATH_INFO')) > 1) {

$GET_array = array();

$PHP_SELF = str_replace(getenv('PATH_INFO'), '', $PHP_SELF);

$vars = explode('/', substr(getenv('PATH_INFO'), 1));

for ($i=0, $n=sizeof($vars); $i<$n; $i++) {

if (strpos($vars[$i], '[]')) {

$GET_array[substr($vars[$i], 0, -2)][] = $vars[$i+1];

} else {

$HTTP_GET_VARS[$vars[$i]] = $vars[$i+1];

}

$i++;

}

 

if (sizeof($GET_array) > 0) {

while (list($key, $value) = each($GET_array)) {

$HTTP_GET_VARS[$key] = $value;

}

}

}

}

 

// define general functions used application-wide

require(DIR_WS_FUNCTIONS . 'general.php');

require(DIR_WS_FUNCTIONS . 'html_output.php');

 

// set the cookie domain

$cookie_domain = (($request_type == 'NONSSL') ? HTTP_COOKIE_DOMAIN : HTTPS_COOKIE_DOMAIN);

$cookie_path = (($request_type == 'NONSSL') ? HTTP_COOKIE_PATH : HTTPS_COOKIE_PATH);

 

// include cache functions if enabled

if (USE_CACHE == 'true') include(DIR_WS_FUNCTIONS . 'cache.php');

 

// include shopping cart class

require(DIR_WS_CLASSES . 'shopping_cart.php');

require(DIR_WS_CLASSES . 'wishlist.php');

// include navigation history class

require(DIR_WS_CLASSES . 'navigation_history.php');

 

// some code to solve compatibility issues

require(DIR_WS_FUNCTIONS . 'compatibility.php');

 

// check if sessions are supported, otherwise use the php3 compatible session class

if (!function_exists('session_start')) {

define('PHP_SESSION_NAME', 'osCsid');

define('PHP_SESSION_PATH', $cookie_path);

define('PHP_SESSION_DOMAIN', $cookie_domain);

define('PHP_SESSION_SAVE_PATH', SESSION_WRITE_DIRECTORY);

 

include(DIR_WS_CLASSES . 'sessions.php');

}

 

// define how the session functions will be used

require(DIR_WS_FUNCTIONS . 'sessions.php');

 

// set the session name and save path

tep_session_name('osCsid');

tep_session_save_path(SESSION_WRITE_DIRECTORY);

 

// set the session cookie parameters

if (function_exists('session_set_cookie_params')) {

session_set_cookie_params(0, $cookie_path, $cookie_domain);

} elseif (function_exists('ini_set')) {

ini_set('session.cookie_lifetime', '0');

ini_set('session.cookie_path', $cookie_path);

ini_set('session.cookie_domain', $cookie_domain);

}

 

// set the session ID if it exists

if (isset($HTTP_POST_VARS[tep_session_name()])) {

tep_session_id($HTTP_POST_VARS[tep_session_name()]);

} elseif ( ($request_type == 'SSL') && isset($HTTP_GET_VARS[tep_session_name()]) ) {

tep_session_id($HTTP_GET_VARS[tep_session_name()]);

}

 

// start the session

$session_started = false;

if (SESSION_FORCE_COOKIE_USE == 'True') {

tep_setcookie('cookie_test', 'please_accept_for_session', time()+60*60*24*30, $cookie_path, $cookie_domain);

 

if (isset($HTTP_COOKIE_VARS['cookie_test'])) {

tep_session_start();

$session_started = true;

}

} elseif (SESSION_BLOCK_SPIDERS == 'True') {

$user_agent = strtolower(getenv('HTTP_USER_AGENT'));

$spider_flag = false;

 

if (tep_not_null($user_agent)) {

$spiders = file(DIR_WS_INCLUDES . 'spiders.txt');

 

for ($i=0, $n=sizeof($spiders); $i<$n; $i++) {

if (tep_not_null($spiders[$i])) {

if (is_integer(strpos($user_agent, trim($spiders[$i])))) {

$spider_flag = true;

break;

}

}

}

}

 

if ($spider_flag == false) {

tep_session_start();

$session_started = true;

}

} else {

tep_session_start();

$session_started = true;

}

 

// set SID once, even if empty

$SID = (defined('SID') ? SID : '');

 

// verify the ssl_session_id if the feature is enabled

if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) {

$ssl_session_id = getenv('SSL_SESSION_ID');

if (!tep_session_is_registered('SSL_SESSION_ID')) {

$SESSION_SSL_ID = $ssl_session_id;

tep_session_register('SESSION_SSL_ID');

}

 

if ($SESSION_SSL_ID != $ssl_session_id) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_SSL_CHECK));

}

}

 

// verify the browser user agent if the feature is enabled

if (SESSION_CHECK_USER_AGENT == 'True') {

$http_user_agent = getenv('HTTP_USER_AGENT');

if (!tep_session_is_registered('SESSION_USER_AGENT')) {

$SESSION_USER_AGENT = $http_user_agent;

tep_session_register('SESSION_USER_AGENT');

}

 

if ($SESSION_USER_AGENT != $http_user_agent) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

}

 

// verify the IP address if the feature is enabled

if (SESSION_CHECK_IP_ADDRESS == 'True') {

$ip_address = tep_get_ip_address();

if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {

$SESSION_IP_ADDRESS = $ip_address;

tep_session_register('SESSION_IP_ADDRESS');

}

 

if ($SESSION_IP_ADDRESS != $ip_address) {

tep_session_destroy();

tep_redirect(tep_href_link(FILENAME_LOGIN));

}

}

 

// create the shopping cart & fix the cart if necesary

if (tep_session_is_registered('cart') && is_object($cart)) {

if (PHP_VERSION < 4) {

$broken_cart = $cart;

$cart = new shoppingCart;

$cart->unserialize($broken_cart);

}

} else {

tep_session_register('cart');

$cart = new shoppingCart;

}

 

// include currencies class and create an instance

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

// include the mail classes

require(DIR_WS_CLASSES . 'mime.php');

require(DIR_WS_CLASSES . 'email.php');

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

 

//begin SEO*****************************************************************************

****

include_once(DIR_WS_CLASSES . 'seo.class.php');

$seo_urls = new SEO_URL($languages_id);

 

// END SEO*****************************************************************************

**

 

 

// currency

if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {

if (!tep_session_is_registered('currency')) tep_session_register('currency');

 

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

if (!$currency = tep_currency_exists($HTTP_GET_VARS['currency'])) $currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

} else {

$currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? LANGUAGE_CURRENCY : DEFAULT_CURRENCY;

}

}

 

// navigation history

if (tep_session_is_registered('navigation')) {

if (PHP_VERSION < 4) {

$broken_navigation = $navigation;

$navigation = new navigationHistory;

$navigation->unserialize($broken_navigation);

}

} else {

tep_session_register('navigation');

$navigation = new navigationHistory;

}

$navigation->add_current_page();

 

 

// wishlist data

if(!tep_session_is_registered('wishlist')) {

tep_session_register('wishlist');

$wishList = new wishlist;

}

 

//Wishlist actions (must be before shopping cart actions)

if(isset($HTTP_POST_VARS['wishlist_x'])) {

if(isset($HTTP_POST_VARS['products_id'])) {

if(isset($HTTP_POST_VARS['id'])) {

$attributes_id = $HTTP_POST_VARS['id'];

tep_session_register('attributes_id');

}

$wishlist_id = $HTTP_POST_VARS['products_id'];

tep_session_register('wishlist_id');

}

tep_redirect(tep_href_link(FILENAME_WISHLIST));

}

 

 

 

 

 

 

 

 

 

// Shopping cart actions

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

// redirect the customer to a friendly cookie-must-be-enabled page if cookies are disabled

if ($session_started == false) {

tep_redirect(tep_href_link(FILENAME_COOKIE_USAGE));

}

 

//REPLACED BY SEO************************************************

//if (DISPLAY_CART == 'true') {

// $goto = FILENAME_SHOPPING_CART;

// $parameters = array('action', 'cPath', 'products_id', 'pid');

//} else {

// $goto = basename($PHP_SELF);

// if ($HTTP_GET_VARS['action'] == 'buy_now') {

// $parameters = array('action', 'pid', 'products_id');

// } else {

// $parameters = array('action', 'pid');

// }

//}

 

// BEGIN SEO****************************************************

 

if (DISPLAY_CART == 'true') {

$goto = FILENAME_SHOPPING_CART;

$parameters = array('action', 'cPath', 'products_id', 'pid', 'cName', 'pName');

} else {

$goto = basename($PHP_SELF);

if ($HTTP_GET_VARS['action'] == 'buy_now') {

$parameters = array('action', 'pid', 'products_id', 'pName');

} else {

$parameters = array('action', 'pid');

}

}

//END SEO*********************************************************

 

switch ($HTTP_GET_VARS['action']) {

// customer wants to update the product quantity in their shopping cart

case 'update_product' : for ($i=0, $n=sizeof($HTTP_POST_VARS['products_id']); $i<$n; $i++) {

if (in_array($HTTP_POST_VARS['products_id'][$i], (is_array($HTTP_POST_VARS['cart_delete']) ? $HTTP_POST_VARS['cart_delete'] : array()))) {

$cart->remove($HTTP_POST_VARS['products_id'][$i]);

} else {

if (PHP_VERSION < 4) {

// if PHP3, make correction for lack of multidimensional array.

reset($HTTP_POST_VARS);

while (list($key, $value) = each($HTTP_POST_VARS)) {

if (is_array($value)) {

while (list($key2, $value2) = each($value)) {

if (ereg ("(.*)\]\[(.*)", $key2, $var)) {

$id2[$var[1]][$var[2]] = $value2;

}

}

}

}

$attributes = ($id2[$HTTP_POST_VARS['products_id'][$i]]) ? $id2[$HTTP_POST_VARS['products_id'][$i]] : '';

} else {

$attributes = ($HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]]) ? $HTTP_POST_VARS['id'][$HTTP_POST_VARS['products_id'][$i]] : '';

}

$cart->add_cart($HTTP_POST_VARS['products_id'][$i], $HTTP_POST_VARS['cart_quantity'][$i], $attributes, false);

}

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

// performed by the 'buy now' button in product listings and review page

//case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

// if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

// tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

// } else {

// $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

// }

// }

// tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

// break;

// REPLACED BY SEO*****************************************************************************

****

case 'buy_now' : if (isset($HTTP_GET_VARS['products_id'])) {

//Wishlist 2.0.1 Modification

if (tep_session_is_registered('customer_id')) { /*tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id"); */}

// End Wishlist 2.0.1 Modification

if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));

} else {

$cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);

}

}

if ( (defined('SEO_URLS') && SEO_URLS == 'true') && (defined('SEO_URLS_TYPE') && SEO_URLS_TYPE == 'Rewrite') ){

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

$cPath_array = tep_parse_category_path($cPath);

$cPath = implode('_', $cPath_array);

tep_redirect(tep_href_link($goto, 'cPath=' . $cPath . '&' . tep_get_all_get_params($parameters)));

} else {

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

}

break;

// END SEO ********************************************************************************

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

case 'notify' : if (tep_session_is_registered('customer_id')) {

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

$notify = $HTTP_GET_VARS['products_id'];

} elseif (isset($HTTP_GET_VARS['notify'])) {

$notify = $HTTP_GET_VARS['notify'];

} elseif (isset($HTTP_POST_VARS['notify'])) {

$notify = $HTTP_POST_VARS['notify'];

} else {

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

}

if (!is_array($notify)) $notify = array($notify);

for ($i=0, $n=sizeof($notify); $i<$n; $i++) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $notify[$i] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

if ($check['count'] < 1) {

tep_db_query("insert into " . TABLE_PRODUCTS_NOTIFICATIONS . " (products_id, customers_id, date_added) values ('" . $notify[$i] . "', '" . $customer_id . "', now())");

}

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'notify'))));

} else {

$navigation->set_snapshot();

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

break;

case 'notify_remove' : if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['products_id'])) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

$check = tep_db_fetch_array($check_query);

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

tep_db_query("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . $HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");

}

tep_redirect(tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action'))));

} else {

$navigation->set_snapshot();

Link to comment
Share on other sites

Hi All,

 

 

Love the contribution. One quick thing... when I add the products of my wishlist to my cart, I would love to remove them from my wishlist and add an attribute to them. The attribute would be inda like 'Product name - From Wishlist' in the shopping cart. Has anyone done this or any idea how to do it? Other than that... I love it.

 

 

Thanks for any help.

 

 

PS: Whoa... long post above!

Edited by langer
Link to comment
Share on other sites

Sean, I am using firefox and when I click add to wishlist, it just adds to shopping cart. You have some code messed up somewhere. I didnt look at your posted code sorry... Side note, if your getting blank pages then I suggest turning error checking on for php.

 

John, please be more specific. The wishlist contribution does not remove the item from your wishlist until you purchase it. If you wanted to change the name of the item and add "From Wishlist" to the product name, you could just do a check to see if this product is in your wishlist and have the name changed if it is. That's the cheap way of doing it, let me explain. If you add a product from the wishlist to your cart it would show "Added from wishlist" -- BUT -- if you added the product from the product page and the product was also in your wishlist, it would say the same thing. So in "theory" it wasn't added from the wishlist. Making sense? I would do like I suggested and just add in "A wishlist item" or something like that. Good Luck

 

Dennis

Link to comment
Share on other sites

Sorry Booker, cant help you there. I've even entered fake email addresses and they slipped by.

 

However, i have a problem. It's in the column_right.php. no matter waht i do, i cannot get it to work. Right now, i've just got the line commented out, and everything's working fine, but if i turn that comment off, i get this

 

Fatal error: Call to undefined function: count_wishlist() 
in /home/content/F/a/i/Faird/html/catalog/includes/column_right.php on line 15

 

I'm using this peice of code, it's right, right? i had to remove the Capitol L's of course

 

if($wishlist->count_wishlist() != '0') { require(DIR_WS_BOXES . 'wishlist.php'); }

 

Everything else works good. I'm not even sure what this is supposed to do when it's working right.

I'm pretty sure i've installed all the extra a, b, c, d, updates and everything, but maybe i missed one. They're so unorganized.

 

did we ever get an answer to this, I am about ready to just go in and remove this as it is now holding up production on other contribs that I need to install.

 

thanks,

shawn

If it was easy, anyone could do it!

Link to comment
Share on other sites

Apparently your missing the count_wishlist function. Get it added to the wishlist class. No idea how its missing from the latest files (or if it is).

 

 

and I do that how? I not completely new to this, but new enough that I dont understand what your talking about.

If it was easy, anyone could do it!

Link to comment
Share on other sites

here is the error:

 

Fatal error: Call to a member function on a non-object in /home/lotions2/public_html/osCommerce/catalog/includes/column_right.php on line 15

 

and here is the code for the file column_right

 

 

<?php

/*

$Id: column_right.php,v 1.17 2003/06/09 22:06:41 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require(DIR_WS_BOXES . 'shopping_cart.php');

 

if($wishlist->count_wishlist() > '0') {

require(DIR_WS_BOXES . 'wishlist.php');

}

 

if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');

 

if (tep_session_is_registered('customer_id')) include(DIR_WS_BOXES . 'order_history.php');

 

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

if (tep_session_is_registered('customer_id')) {

$check_query = tep_db_query("select count(*) as count from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "' and global_product_notifications = '1'");

$check = tep_db_fetch_array($check_query);

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

include(DIR_WS_BOXES . 'best_sellers_scroll.php');

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'product_notifications.php');

}

} else {

include(DIR_WS_BOXES . 'best_sellers_scroll.php');

}

 

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

if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) include(DIR_WS_BOXES . 'tell_a_friend.php');

} else {

include(DIR_WS_BOXES . 'specials.php');

}

 

require(DIR_WS_BOXES . 'reviews.php');

 

if (substr(basename($PHP_SELF), 0, 8) != 'checkout') {

include(DIR_WS_BOXES . 'languages.php');

include(DIR_WS_BOXES . 'currencies.php');

}

?>

 

PLEASE HELP!!!

If it was easy, anyone could do it!

Link to comment
Share on other sites

and I am also getting this error:

 

Fatal error: Cannot instantiate non-existent class: wishlist in /home/lotions2/public_html/osCommerce/catalog/includes/application_top.php on line 316

 

 

and this one as well

 

Fatal error: Call to a member function on a non-object in /home/lotions2/public_html/osCommerce/catalog/wishlist.php on line 18

If it was easy, anyone could do it!

Link to comment
Share on other sites

Hi, i might have cool idea for the wishlist...

 

when you have some items in your shoppingcart that are not on stock, it ain't possible to check out. so you have to remove the items from your cart to checkout, it would be cool if there was a button to add it to the wishlist. So that the item automaticly moves from your shoppingcart into your wishlist.

I think it would aprove the wishlist contri a lot. B)

 

I'am not such a php king to realize it...

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