Jump to content



Latest News: (loading..)

- - - - -

Options - Price Update


  • Please log in to reply
7 replies to this topic

#1   MrStatic

MrStatic
  • Members
  • 4 posts
  • Real Name:Joe

Posted 20 October 2008 - 09:48 PM

Ok so this mod works but it does not for me. I use a mod I found here to change my attributes to radio buttons. Now I use a different function. So this line
Search For:
  <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id']
	. ']', $products_options_array, $selected_attribute); ?></td>

Change to:
<!-- Attrib price update  //-->
<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, "onchange='showPrice(this.form);showPrice1(this.form);'");?></td>
<!-- Proyecto Icaro (Fin Modificado) //-->
Won't work for me. If I use that code but change the function no price shows, I have tried to just hard code the onchange part into the function itself but no go. The function is

  function tep_draw_radio_menu($name, $values, $default = '', $parameters = '', $required = false) {
	$field ='<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">';   
	if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

	for ($i=0, $n=sizeof($values); $i<$n; $i++) {
	  $value = tep_output_string($values[$i]['id']);
	  $field .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
		if ($i == 0) $field .= ' checked';

	  $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</br>';
	}
	$field .= '</td></tr></table>';

	if ($required == true) $field .= TEXT_FIELD_REQUIRED;

	return $field;
  }

Any help would be appreciated.

Edited by MrStatic, 20 October 2008 - 09:49 PM.


#2   luxactor

luxactor
  • Members
  • 6 posts
  • Real Name:Luxactor

Posted 08 December 2008 - 06:09 PM

I have the some problem...

I'm using the the Radio Button selection for product attributes contribution and want to update the price - Options - Price Update works perfectly, but only for list boxes.


"Radio Button selection for product attributes" makes only two changes:
edit catalog/includes/functions/html_output.php 
add this new function tep_draw_radio_menu

add this in somewhere before the final ?>

////
// Output a form radio menu for product info page maniac101
  function tep_draw_radio_menu($name, $values, $default = '', $parameters = '', $required = false) {
	$field ='<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">';   
	if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

	for ($i=0, $n=sizeof($values); $i<$n; $i++) {
	  $value = tep_output_string($values[$i]['id']);
	  $field .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
		if ($i == 0) $field .= ' checked';

	  $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => ''', '<' => '&lt;', '>' => '&gt;')) . '</br>';
	}
	$field .= '</td></tr></table>';

	if ($required == true) $field .= TEXT_FIELD_REQUIRED;

	return $field;
  }

////

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

open and edit catalog/product_info.php

find:


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


replace with:

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

Only the tep_draw_radio_menu in product_info.php, but there must be a problem with reading values from radio buttons with JS. And I don't know how to fix it... :(

Edited by luxactor, 08 December 2008 - 06:11 PM.


#3   dentalstrategy

dentalstrategy
  • Members
  • 7 posts
  • Real Name:Frank Kaiser

Posted 20 October 2009 - 12:58 PM

Hi, did you guys find out how to make this work?

Options Price Update + Radio Button selection for product attributes.

Any news, solution?

I'm in the same situation...

Thanks

#4   jay-kay

jay-kay
  • Members
  • 5 posts
  • Real Name:Jürgen Kahle
  • Gender:Male
  • Location:Germany

Posted 12 November 2009 - 11:38 AM

#
How to make work Option Types v2 togehter with  Options Price Update

Due to german rules for online trade i have to update the price of an article after someone has changed some options.

In my shop to be builded i have 2 different options
1.) simple dropdown - e.g. do you want the cards sold to be printet on one side or on both - an Options Price Update will immediatele change the total price due to the amount stated in database
2.) dropdown with picture - e.g. do you want the imprint in black only or do you want to add some red or green. The colours are shown in an example-text as soon as you pick them from an dropdownlist. but in that case the price will not be updatet - or worse, it will change to zero - 0,00 EUR. (thats too cheap :( )

As i already learned, the first case is handled in the product_info.php, the second in the module option_types.php.

The only change i made in this module was in the line 167 as follows:

Quote

$ImageSelector_Dropdown = '<select name="' . $Image_Dropdown_ID .'" onchange="document.getElementById(\'ImageSelect' . $product_info['products_id'] . '\').innerHTML=ImageText'.$product_info['products_id'].'[this.selectedIndex];showPrice(this.form);showPrice1(this.form);">' . $Image_Dropdown[$product_info['products_id']] . '</select> ' . $ProdOpt_Comment;

without that - price will be always that of default option, after changing, an option with no addiditonal price will work correctly, with an extra price it will change to zero

what can be the reason? :blink:

#5   FedericoG

FedericoG
  • Members
  • 7 posts
  • Real Name:Federico
  • Gender:Male
  • Location:Italia (Italy)

Posted 20 October 2010 - 09:50 AM

Hi everyone,

I've installed this contrib on a fresh osCommerce installation and it worked fine. But I cannot make the contrib work with the STS (Simple Template System). I would like to know if there is someone else having the same problem and if someone has resolved it.

Thank you and have a nice day

#6   NimaP

NimaP
  • Members
  • 142 posts
  • Real Name:wdwad
  • Gender:Male

Posted 06 October 2011 - 10:34 PM

Hi,

I installed this contribution and it seems to work fine. However initially before I select anything from the options drop down, it won't show a price. Is there any way to change this so it shows the base price?

#7   NimaP

NimaP
  • Members
  • 142 posts
  • Real Name:wdwad
  • Gender:Male

Posted 13 October 2011 - 05:32 PM

Okay i checked and this only occurs in firefox (i'm running 7.01). This contribution works great in IE9 and Chrome. Please help me show the standard price on first page load.

#8   NimaP

NimaP
  • Members
  • 142 posts
  • Real Name:wdwad
  • Gender:Male

Posted 19 October 2011 - 08:27 PM

another question i have is regarding the prices in my dropdown. is it possible to remove the +$99.99 and still have this contribution work?

i was thinking if we just white out the price, then it will work and the customer won't see the number.

thank you