Jump to content
Sign in to follow this  
MrStatic

Options - Price Update

Recommended Posts

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('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</br>';
}
$field .= '</td></tr></table>';

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

return $field;
 }

 

Any help would be appreciated.

Edited by MrStatic

Share this post


Link to post
Share on other sites

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('"' => '"', '\'' => ''', '<' => '<', '>' => '>')) . '</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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#

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:

 

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×