Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Options - Price Update


MrStatic

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
Link to comment
Share on other sites

  • 1 month later...

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
Link to comment
Share on other sites

  • 10 months later...
  • 4 weeks later...

#

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:

Link to comment
Share on other sites

  • 11 months later...

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

Link to comment
Share on other sites

  • 11 months later...

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?

Link to comment
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.

Link to comment
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

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