Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Product Options Module


Waza04

Recommended Posts

Written for osCommerce v2.2MS1/CVS

(not tested with other versions but, should

be compatible)

 

What this does is removes three boxes from the right column.

Notifications, Manufacturer, Reviews & Tell A Friend

 

Its just easier for the customer and to reduce clutter.

 

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

Link to comment
Share on other sites

added contrib to MS1 version - problem now however is that when I click on Tell A Friend - I am redirected to my shopping cart and the product that I wanted to tell a friend about is now added to my shopping cart...

 

 

HELP!

Link to comment
Share on other sites

Since I was posting this I decided to check the other boxes and see how they work:

 

The manufacturers link does not work - it redirects to default.php - it doesn't seem to be pulling the manufacture ID.

 

Reviews and Notifications work fine.

 

 

So sum that up =

 

 

Tell a Friend redirects to and adds product to shopping cart and

 

Manufacturers Box redirects back to default.php?manufacturers_id=

but does not include the manufacture id so the default.php page is what is displayed.

Link to comment
Share on other sites

just checking in again regarding the manufactures box and the tell a friend box that is moved to bottom of product info via your products options box

 

any updates on why the manufactures box is not recognizing an id? It actually isn't pulling anything when the box is listed on the product_info page either - example - manufacturer id 1 should show picture of shoe - but no picture is displayed -so the issue isn't on the click through - it sits with the actual box on the info page

 

 

any updates on the tell a friend not "telling a friend" as well??? :)

 

thanks!

Link to comment
Share on other sites

I've been digging into the code as well - thought I had the manufacture issue resolved myself but now I have a parse error

 

Parse error: parse error, unexpected $

 

in products_options.php

 

I thought it was just missing the db query

 

 

can you post what you did to make it work?

Link to comment
Share on other sites

Sure - For Manufactures To Work:

 

Find:

//Manufacturer String

  $manufacturer_info_string = '<div align="center">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</div>' .

                              '<table border="0" width="' . BOX_WIDTH . '" cellspacing="0" cellpadding="0">';

 if ($has_manufacturer_url == 'true') $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents"></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';

 $manufacturer_info_string .= '<br><tr><td valign="top" class="infoBoxContents"></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr></table>';

 

 

Replace With:

//Manufacturer String

   $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . $languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");

   if (tep_db_num_rows($manufacturer_query)) {

     $manufacturer = tep_db_fetch_array($manufacturer_query);

     $manufacturer_info_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

     if (tep_not_null($manufacturer['manufacturers_image'])) $manufacturer_info_string .= '<tr><td align="center" class="infoBoxContents" colspan="2">' . tep_image(DIR_WS_IMAGES . $manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</td></tr>';

     if (tep_not_null($manufacturer['manufacturers_url'])) $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">- </td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' . $manufacturer['manufacturers_id']) . '" target="_blank">' . sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';

     $manufacturer_info_string .= '<tr><td valign="top" class="infoBoxContents">- </td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">' . BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr>' .

                                  '</table>';

That should be it!!

 

Warren

Link to comment
Share on other sites

okay fixed the manufacturers on my end:

 

changed products_option.php page to read this:

 

 

<?php

/*

$Id: product_options.php, v1.0 2003/04/19 14:14:14 waza04_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce / Warren Ashcroft

 

Support:

[email protected]

[email protected] (MSN Messenger)

 

Paypal Donations:

[email protected]

 

Web:

http://www.ukcomputersystems.com/

 

Released under the GNU General Public License

*/

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

$manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name,

 

m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " .

 

TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id

 

= '" . $languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" .

 

(int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");

if (tep_db_num_rows($manufacturer_query)) {

$manufacturer = tep_db_fetch_array($manufacturer_query);

?>

 

<?php

//Manufacturer String

$manufacturer_info_string = '<div align="center">' . tep_image(DIR_WS_IMAGES .

 

$manufacturer['manufacturers_image'], $manufacturer['manufacturers_name']) . '</div>' .

'<table border="0" width="' . BOX_WIDTH . '" cellspacing="0"

 

cellpadding="0">';

if ($has_manufacturer_url == 'true') $manufacturer_info_string .= '<tr><td valign="top"

 

class="infoBoxContents"></td><td valign="top" class="infoBoxContents"><a href="' .

 

tep_href_link(FILENAME_REDIRECT, 'action=manufacturer&manufacturers_id=' .

 

$manufacturer['manufacturers_id'], 'NONSSL') . '" target="_blank">' .

 

sprintf(BOX_MANUFACTURER_INFO_HOMEPAGE, $manufacturer['manufacturers_name']) . '</a></td></tr>';

$manufacturer_info_string .= '<br><tr><td valign="top" class="infoBoxContents"></td><td

 

valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_DEFAULT,

 

'manufacturers_id=' . $manufacturer['manufacturers_id'], 'NONSSL') . '">' .

 

BOX_MANUFACTURER_INFO_OTHER_PRODUCTS . '</a></td></tr></table>';

 

 

// Reviews String

if ($HTTP_GET_VARS['products_id']) {

$reviews = '<table border="0" cellspacing="0" cellpadding="2"><tr><td

 

class="infoBoxContents"><p align="center"><a href="' .

 

tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id'],

 

'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'box_write_review.gif', IMAGE_BUTTON_WRITE_REVIEW) .

 

'</a></td><td class="infoBoxContents"><p align="center"><a href="' .

 

tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id'],

 

'NONSSL') . '">' . BOX_REVIEWS_WRITE_REVIEW .'</a></td></tr></table></td>';

}

 

 

// Notifacations String

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

$notif_text = '<table border="0" cellspacing="0" cellpadding="2"><tr><td

 

class="infoBoxContents"><p align="center"><a href="' . tep_href_link(basename($PHP_SELF),

 

tep_get_all_get_params(array('action')) . 'action=notify_remove', 'NONSSL') . '">' .

 

tep_image(DIR_WS_IMAGES . 'box_products_notifications_remove.gif',

 

IMAGE_BUTTON_REMOVE_NOTIFICATIONS) . '</a></td><td class="infoBoxContents"><p align="center"><a

 

href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) .

 

'action=notify_remove', 'NONSSL') . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE,

 

tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table></td>';

} else {

$notif_text = '<table border="0" cellspacing="0" cellpadding="2"><tr><td

 

class="infoBoxContents"><p align="center"><a href="' . tep_href_link(basename($PHP_SELF),

 

tep_get_all_get_params(array('action')) . 'action=notify', 'NONSSL') . '">' .

 

tep_image(DIR_WS_IMAGES . 'box_products_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) .

 

'</a></td><td class="infoBoxContents"><p align="center"><a href="' .

 

tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify',

 

'NONSSL') . '">' . sprintf(BOX_NOTIFICATIONS_NOTIFY,

 

tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a></td></tr></table></td>';

}

 

 

// Tell A Friend String

if (basename($PHP_SELF) != FILENAME_TELL_A_FRIEND) {

$hide = tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']);

$hide .= tep_hide_session_id();

$tell_friend = '<form name="tell_a_friend" method="get" action="' .

 

tep_href_link(FILENAME_TELL_A_FRIEND, '', 'NONSSL', false) . '"><div align="center">' .

 

tep_draw_input_field('send_to', '', 'size="10"') . ' ' .

 

tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . $hide . '</div><br><p

 

align="center">' . BOX_TELL_A_FRIEND_TEXT . '</td>';

}

 

//Draw Table

$box_table = '

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

<tr>

<td width="25%" class="infoBoxContents"></td>

<td width="25%" class="infoBoxContents"><center>' . BOX_TEXT_MANUFACTURER_INFO .

 

tep_draw_separator('pixel_trans.gif', '100%', '10') . '<br></td></center>

<td width="25%" class="infoBoxContents"><center>' . BOX_TEXT_WRITE_REVIEW .

 

tep_draw_separator('pixel_trans.gif', '100%', '10') . '<br></td></center>

<td width="25%" class="infoBoxContents"><center>' . BOX_TEXT_PRODUCT_NOTIFICATIONS .

 

tep_draw_separator('pixel_trans.gif', '100%', '10') . '<br></td></center>

<td width="25%" class="infoBoxContents"><center>' . BOX_TEXT_TELL_FRIEND .

 

tep_draw_separator('pixel_trans.gif', '100%', '10') . '<br></td></center>

</tr>

 

<tr>

<td width="25%" class="infoBoxContents">' . $manufacturer_info_string . '

<td width="25%" class="infoBoxContents">' . $reviews . '

<td width="25%" class="infoBoxContents">' . $notif_text . '

<td width="25%" class="infoBoxContents">' . $tell_friend . '

</tr>

 

</table>';

 

 

 

//Draw Box

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_PRODUCT_OPTIONS);

new contentBoxHeading($info_box_contents, true, false);

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => $box_table);

 

 

new infoBox($info_box_contents);

?>

 

<?php

}

}

?>

 

 

hope this is right and hope it helps someone else - simply copy and paste the code -

 

this is what I added at the top of the code under Release

 

 

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

$manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name,

 

m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " .

 

TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id

 

= '" . $languages_id . "'), " . TABLE_PRODUCTS . " p where p.products_id = '" .

 

(int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");

if (tep_db_num_rows($manufacturer_query)) {

$manufacturer = tep_db_fetch_array($manufacturer_query);

?>

 

<?php

 

then added this:

 

<?php

}

}

?>

 

 

at end of file

Link to comment
Share on other sites

  • 3 weeks later...

OK, Version 2 Is OUT NOW!!!

 

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

 

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

Product Options Module V2.0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- Fixes a few bugs regarding the tell a friend.

- Fixes a few bugs regarding the manufacturer.

 

(MAJOR - UPGRADE VERSION AVAILABLE)

 

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

Link to comment
Share on other sites

  • 4 weeks later...

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