Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Option Type Feature v1.6 (for osc 2.2 MS2)


Guest

Recommended Posts

  • Replies 799
  • Created
  • Last Reply

Top Posters In This Topic

Hi

I'm trying to implement Spaw or Fckeditor in the contrib but w/o any success.

Did anybody code this to get the customization of a text from a customer.

I would like to allow the customer to write his own text with several choices of fonts, sizes... If possible, to add a picture.

Thanks for your help

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I have implemented the option type feature. It works well but I want to make the

"Text-Input-Field" (not Textarea) as a "must"-field. This means a customer

must fill out the Text field before adding to the shopping cart.

 

Has anyone an idea to implement this?

 

Thanks

 

Stephan

Link to comment
Share on other sites

Hi

Thanks to the author and anyone else who's worked on this contribution. I've had it installed and working for a long time. I have a problem with certain products as follows. We sell letters for kids bedroom doors etc. Customers can order letters and select the required letters using the text box field. However they must also choose the correct quantity of letters to be added to the cart.

 

Does anyone know how I can adjust the process of updating the cart with a product like this so it automatically updates the quantity added to the cart dependent on what letters are chosen?

 

e.g. someone types the name JOHN into the text area but leaves the quantity amount at 1, then selects add to cart. The system then automatically adds 4 letters instead of one.

 

Any help much appreciated.

 

Tim

Link to comment
Share on other sites

Hi i am having trouble with my admin invoice not showing my text attributes only giving me the :

 

i read earlier and found this code...The fix was posted by dracono

So basically, in application_top.php find

 

 

CODE

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

 

 

and replace with

 

 

CODE

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

 

 

This should now work ...

 

i hired a coder to help with this cotribution and here is what my code looks like...

 

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

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

 

}

 

everything shows just fine through the check out and i think the buyers email reciept, but i don't have the text i need to complete order, please help.

Link to comment
Share on other sites

I have been double checkng the forum for anything i missed, now i have added the "ETXT attribute to all products with the fill in text, so instead of a blank field showing on my invoice it give me TEXT instead of the text inputed. I even replaced the application top to only have the +++ statement. Yes i have done the sql file to "input into data. can someone please help! I have several product with this option!

Link to comment
Share on other sites

i was missing code in my check out process, still have my email showing "TEXT" any ideas?

 

I fixed this problem on mine by editing the payment module i was using.

Netbanx had a different checkout-process file, so i had to apply the edits to that.

 

######################

 

Seperate Question;

 

I had the problem of the values disappearing in the shopping cart, until i added the code below to fix the update_quantity function in includes/classes/shopping_cart.php

 

function update_quantity($products_id, $quantity = '', $attributes = '') {
global $customer_id;
if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..

$this->contents[$products_id]['qty'] = $quantity;
// update database
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");

if (is_array($attributes)) {
reset($attributes);
while (list($option, $value) = each($attributes)) {
// BOM - Options Catagories
$attr_value = NULL;
if ( !is_array($value) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
$attr_value = $value;
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
} elseif ( isset($attributes[$option]['t']) && !empty($attributes[$option]['t']) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
$attr_value = htmlspecialchars(stripslashes($attributes[$option]['t']), ENT_QUOTES);
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
} elseif ( isset($attributes[$option]['c']) ) {
$this->contents[$products_id]['attributes'][$option] = $value;
foreach ($value as $v) {
$attr_value = $v;
if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'");
}
}
// EOM - Options Catagories
}
}
}

 

This works, but now it does the opposite.

It Adds a blank text line whenever a product is updated.

Any ideas what needs to be changed to prevent that ?

Probably something to do with the foreach loop check ?

Link to comment
Share on other sites

Hi everyone, i have a weird issue that ive identified where in that everythign works apart from if i have TEXT field options on a product

 

With Text field options when a user clicks on Add to Cart the product doesnt get added, and the cart remains empty

 

If i remove the TEXT options and use dropdowns, radio buttons etc everythign works happily

 

All the fixes and patches ive read thru appart from being confusing dont seem to address this issue but rather address text based option issues in the cart when the cart is updated

 

 

anyone have any ideas what the problem could be?

Link to comment
Share on other sites

  • 2 weeks later...
Hi everyone, i have a weird issue that ive identified where in that everythign works apart from if i have TEXT field options on a product

 

With Text field options when a user clicks on Add to Cart the product doesnt get added, and the cart remains empty

 

If i remove the TEXT options and use dropdowns, radio buttons etc everythign works happily

 

All the fixes and patches ive read thru appart from being confusing dont seem to address this issue but rather address text based option issues in the cart when the cart is updated

 

 

anyone have any ideas what the problem could be?

 

i used to get that too, go through the manual install and double check with all the fixes, it's been a while so i ca't remember what fixed it , but i know i was missing something that i should have included...

Link to comment
Share on other sites

  • 1 month later...

hello everyone!

 

I have installed this contribution and have a problem. All the way through the shopping experience, the attributes are displayed properly (login, logout, change quantity, all these actions can be done without issue).

 

However, my confirmation email does not have the user-text attributes, and when i view the order packing list, the attributes are not displayed. Can someone give me some guidance or point me in the right direction please? thanks!

Link to comment
Share on other sites

  • 1 month later...

Hello everyone!

 

I have installed this contribution and have a problem. The attributes are displayed properly (login, logout, change quantity, all these actions can be done without issue).

 

However, my confirmation email does not have the user-text attributes, and when i view the order packing list, the attributes are not displayed. Can someone give me some guidance or point me in the right direction please?

 

Thanks !!

Link to comment
Share on other sites

Losing options on login

 

Hi,

 

I know this issue has been posted a number of times, but I haven't been able to find an answer in the forums.

 

Everything is working fine, but if a user is not logged in before adding products to the basket, the options are lost when they login during checkout.

 

Is there a solution available for this? It makes my shop unusable.

 

Any help would be appreciated.

 

Thanks

 

:rolleyes:

Link to comment
Share on other sites

  • 3 months later...

I'm sorry, but I have looked all through this posting and have not seen the answer.

I also do not think I am the only one with the problem, which is:

 

 

I have followed the instructions at http://www.oscommerce.com/community/contributions,160 and everything is close to working... But when I either click the UPDATE button or LOGIN, the text fields are lost. Has some one out there found the error in the code and fixed it?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

***** PREVIOUS POST *****

 

Hello,

This contrib works great for me except for one very important thing. When using a text or textarea options, the price doesn't get added to the shopping cart. If I change the option to be anything else (raido, checkbox, select) it works fine. I've looked through the most obvious areas and can't seem to find a problem. Can anyone tell me what I might have missed or point me in the right direction?

Thanks!

 

Fixed it. The problem was in the includes/local/configure.php file. My "define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0);" didn't match the option value in my database.

 

 

***** END PREVIOUS POST *****

 

 

 

Hello....

 

i'm having the same problem.... but can't figure it out.

(The value of TEXT is 0 in the database.)

 

Can somebody please tell me how to fix it?

Or what's causing this problem???

Help wil be very appreciated........ €€€€€??

 

 

Gr Nas

Edited by wervelweb
Link to comment
Share on other sites

  • 1 month later...

Hello,

 

I have implemented the option type feature. It works well but I want to make the

"Text-Input-Field" (not Textarea) as a "must"-field. This means a customer

must fill out the Text field before adding to the shopping cart.

 

Has anyone an idea to implement this?

 

Thanks

 

Stephan

 

I am also looking for a solution to the same problem. I need to make sure the option is created. If nothing is input in the text field then the option is not created in the cart and there is no record in the database. I need to force creation of the field in the cart somehow. I have spent hours and hours working on this trying to make this work. account_edit.php uses messageStack to create an error message. I have tried to apply the same logic to product_info.php but so far I have failed. I have forced an initial entry to 'tba' into the field but this could still be removed by the customer before they click the Add to Cart button and then the option would not be created. Can anyone provide a solution, or can anyone give me some additional clues on what happens when the 'Add To Cart' button is pressed. I am not managing to make total sense of it yet.

 

Thanks very much

 

Lee

Link to comment
Share on other sites

  • 1 month later...

Hello,

 

Was anyone able to add "Advanced search with products attributes..." contribution to "product_attributes_option_type_3.0 (updated for OsCommerce RC2a)"?

Im having problems with 1054 errors(only in advanced_search_result.php i think) when im trying to use this advanced search contribution, i did search the forum but all the fixes that are posted in here arent working for me. Could anyone help me with this please?

 

Thats the part of the code i think is causing this problem:

  // *********************************************************************************************************
 // *********************************************************************************************************
 // This is the accompanying code to the advanced_search.php that allows for products to be searched on their
 // attributes through a drop down list box, it was done by adam, if it helps you perhaps you can help me by donating through paypal, my
 // email address is: [email protected] so that I can make more contributions
 // If you have a look up near line 214 there is an additional from_str that includes product attributes in the from list
 $attributes_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "'");
 $option_value_selected = false;
 $products_stock_attributes_array = array();
 while ($attributes = tep_db_fetch_array($attributes_query)) {
 	if (isset($HTTP_GET_VARS[$attributes["products_options_id"]]) && !empty($HTTP_GET_VARS[$attributes["products_options_id"]]))
     	$option_value_selected = true;
 }
 // the above while loop is to check to see if any values were selected
 if ($option_value_selected == true){
 	$attributes_query2 = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "'");
 	while ($attributes2 = tep_db_fetch_array($attributes_query2)) {
 		if (isset($HTTP_GET_VARS[$attributes2["products_options_id"]]) && !empty($HTTP_GET_VARS[$attributes2["products_options_id"]])) {
		$str_selected_values = $str_selected_values . $HTTP_GET_VARS[$attributes2["products_options_id"]] . ','; 
   	}
 	}
 	$str_selected_values = substr($str_selected_values,0,strlen($str_selected_values) - 1);
 	$where_str .= "and pa.products_id = p.products_id and pa.options_values_id in (".$str_selected_values.")";
 	// end of accompanying code to advanced_search_result.php that accompanies advanced_search.php
 	// that will include all options_values_id that were selected
// *********************************************************************************************************
 	// *********************************************************************************************************

Link to comment
Share on other sites

Error im getting looks like this:

1054 - Unknown column 'pa.products_id' in 'where clause'

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and m.manufacturers_id = '1' and ((pd.products_name like '1%' or p.products_model like '1%' or m.manufacturers_name like '1%') )and pa.products_id = p.products_id and pa.options_values_id in (1)

 

And its showing when im trying to search using products attribution fields.

 

And this one whem im using original "Advanced search with products attributes..." files

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'p left join manufacturers m using(manufacturers_id), products_description pd lef' at line 1

select count(distinct p.products_id) as total from (products) p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c,products_attributes pa where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and m.manufacturers_id = '1'and pa.products_id = p.products_id and pa.options_values_id in (1)

Edited by flidais
Link to comment
Share on other sites

  • 4 months later...

For everybody who uses a mix of different option methods: by default the options are alphabetical sorted. But it mixes different option type...and that doesn't look nice...

 

I wanted to order by alphabet and option type, so I changed in product_info.php $product_options_name_query:

Originally (look for):

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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");

 

New (replace the original query):

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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_type, popt.products_options_name");

To be clear: I used release 3.0 of this add-on, the one for RC2a. So if you are still using ms2.2 or any other, it could be different.

Link to comment
Share on other sites

  • 2 months later...

I installed product_attributes_option_type_3.0 (updated for OsCommerce RC2a)

 

every thing seems to be ok but on the product info page

the attribute outputs as the regular dropdown

 

I did a check and the problem is with the product info page

(i used the file from the contribution and it worked but I want it to work with mine)

there are two problems

 

1.

if I use the original product info from the contribution it works but it has a flaw I want to fix -

it shows only the last option I inserted to an attribute

for example say you sell a guitar and the attribute is a guitar strap

if I insert a cheap strap and than inset a good one the productinfo shows only the good one

 

2.

my product info has option as images. for some reason it doesn't recieve the checkbox even if I don't use the option as images for the product

 

here is the code (if you see some gibrish its just some text in the site language):

 

 

<?php
/*
 $Id: product_info.php 1739 2007-12-20 00:52:16Z hpdl $

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

 Copyright (c) 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' 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,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}


// BOF Product Type Feature
/* DDB - 041031 - Form Field Progress Bar */
/***********************************************
* Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/
* Modified by Dynamic Drive for minor changes
* Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com
* Please keep this notice intact
***********************************************/
function textCounter(field,counter,maxlimit,linecounter) {
// text width//
var fieldWidth =  parseInt(field.offsetWidth);
var charcnt = field.value.length;        
// trim the extra text
if (charcnt > maxlimit) { 
	field.value = field.value.substring(0, maxlimit);
} else { 
// progress bar percentage
var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit) ;
document.getElementById(counter).style.width =  parseInt((fieldWidth*percentage)/100)+"px";
document.getElementById(counter).innerHTML="Limit: "+percentage+"%"
// color correction on style from CCFFF -> CC0000
setcolor(document.getElementById(counter),percentage,"background-color");
}
}
function setcolor(obj,percentage,prop){
obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)";
}
// EOF Product Type Feature
//-->
</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="2">
<!-- 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, 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 . "'");
   $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><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
		<td class="pageHeading"  style="color:#ef1717 ; "><?php echo "מספרי טלפון: 077-5020760, 03-5605876 </br>
		כתובת: אלנבי 94 תל אביב"; ?></td>

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

         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></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 width="200" class="pageHeading" align="right" valign="top"><?php echo "    מחיר: ". $products_price; ?></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>

       </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="javascript: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']), SMALL_IMAGE_WIDTH, SMALL_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>
             </td>
           </tr>
         </table>
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php

if (OPTIONS_AS_IMAGES_ENABLED == 'false'){
   $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
     // BOF Option Type Feature
     //$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_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment 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)) {
			//clr 030714 add case statement to check option type
       switch ($products_options_name['products_options_type']) {
         case PRODUCTS_OPTIONS_TYPE_TEXT:
           //CLR 030714 Add logic for text option
           $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
           $products_attribs_array = tep_db_fetch_array($products_attribs_query);
           $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'">  ' . $products_options_name['products_options_comment'] ;
           if ($products_attribs_array['options_values_price'] != '0') {
             $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')';
           }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo $tmp_html;  ?></td>
           </tr>
<?php
           break;

         case PRODUCTS_OPTIONS_TYPE_TEXTAREA:
           //CLR 030714 Add logic for text option
           $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
           $products_attribs_array = tep_db_fetch_array($products_attribs_query);
	$tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   wrap="soft" 
							   name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   rows=5 
							   id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea>
					<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
					<script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?>	<!-- DDB - 041031 - Form Field Progress Bar //-->
           <tr>
<?php
           if ($products_attribs_array['options_values_price'] != '0') {
?>
             <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td>
<?php       } else {
?>
             <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td>
<?php        }
?>
             <td class="main"><?php echo $tmp_html;  ?></td>
           </tr>
<?php
           break;

case PRODUCTS_OPTIONS_TYPE_RADIO:
	//CLR 030714 Add logic for radio buttons
	$tmp_html = '<table>';
	$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 = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");
	//$checked=true;
	// START vEDIT
	if(!isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])){
		$no_value = true;
	}
	// END vEDIT
	while ($products_options_array = tep_db_fetch_array($products_options_query)) {
		// START vEDIT
		if ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']] || $no_value) {
			echo 'true';
			$checked = true;
			$no_value = false;
		} else {
			echo 'false';
			$checked = false;
		}
		// END vEDIT
		$tmp_html .= '<tr><td class="main">';
		$tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked);
		//$checked = false;
		$tmp_html .= $products_options_array['products_options_values_name'] ;
		$tmp_html .=$products_options_name['products_options_comment'] ;
		if ($products_options_array['options_values_price'] != '0') {
			$tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
		}
		$tmp_html .= '</tr></td>';
	}
	$tmp_html .= '</table>';
	?>
	<tr>
	<td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
	<td class="main"><?php echo $tmp_html;  ?></td>
	</tr>
	<?php
break;

case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
	//CLR 030714 Add logic for checkboxes
	$products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
	$products_attribs_array = tep_db_fetch_array($products_attribs_query);
	// START vFIX
	$boxchecked = false;
	if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {					
		$boxchecked = true;
	}else {
		$boxchecked = false;	
	}
	// END vFIX 
	echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">';
	// START vFIX 
	//echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']);
	echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked);
	// END vFIX 
	echo $products_options_name['products_options_comment'] ;
	if ($products_attribs_array['options_values_price'] != '0') {
	echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
	}
	echo '</td></tr>';
break;


         default:
           //clr 030714 default is select list
           //clr 030714 reset selected_attribute variable
           $selected_attribute = false;

     // EOF Option Type Feature 
       $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 
               // BOF Option Type Feature
               //echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute);
               echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array,   $selected_attribute) . $products_options_name['products_options_comment'];
               // EOF Option Type Feature
               ?></td>
           </tr>
<?php
       // BOF Option Type Feature
       } // ends the switch clause
       // EOF Option Type Feature
     } 
  ?>
         </table>
<?php
   }

//Options as Images. Add the curly bracket as shown on the next line
}
?>

<?php
//Options as Images. This whole php clause needs to be added
if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php'); 

?>
       </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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="pageHeading" align="left" valign="top"><?php echo $products_price; ?></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>
    <?php include(DIR_WS_MODULES . FILENAME_RELATED_PRODUCTS); ?>
 <tr>
       <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="2">
<!-- 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

  • 4 months later...

Hello:

I was having a problem with the product attributes. The customers_basket_attributes table got never inserted with records even when I added products with different attributes into the shopping cart. It only added to customers_basket table, while completely ignoring the attributes. I have just manually installed V3.0 of Option Type Feature on oscommerce RC2a, hoping that it will address the issue. But it does not. Why is this happening? I am suspecting attributes features is not set, but have no idea how to fix it... Thanks in advance...

Link to comment
Share on other sites

Hi all, I have been searching through this thread and can't seem to find an answer to my issue (people asking but no answer).

 

I am wanting the main price to change when the customer selects an attribute that has a cost applied to it so they know the exact price whilst on product_info.php instead of having to put the products in the cart.

 

If anyone has done this or knows how to do this with this contribution I would love to find out. I had this functionality before installing this contribution so would like to get this functionality back.

 

Thanks.

Link to comment
Share on other sites

  • 1 year later...

Hi,

 

I tried some things I read on the fourty pages but none of them worked.

 

I have the problem with special characters like "&" "(" ")" "+" that they get lost when I want to edit a product from out of the shoping cart. Customer inputs like "this & that" get lost, infact all the customer inputs get lost as soon as there is one of these special characters.

I guess there is some trick to mask these characters so that the do not interfere with the code.

 

If somebody has found a solution for this issue would be great. Likewise I will share if I figure out something by myself.

 

 

Sorry wrong post should be in Option Types V2...

Edited by FridayNight
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...