Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help Installing ! please


xalex

Recommended Posts

Can some one please tell me how to install this ? Ive had a hard time doing so. I always get errors.

 

The instructions says to paste the code into : product_info.php ,

 

 

The original code :

 

$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_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 echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>

Edited by xalex
Link to comment
Share on other sites

And theses are the instructions :

 

 

-----------------------------------------------------------------

 

Was:

 

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'])) .') ';

}

 

 

is now:

 

 

 

$original_price = $product_info['products_price'];

$option_price = $products_options['options_values_price'];

if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract.

{

$show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0;

} else {

$show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0;

}

if ($products_options['options_values_price'] != '0') {

$products_options_array[sizeof($products_options_array)-1]['text'] .= ' ('

. $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';

}

}

-------------------------------------------------------------------------------------------------

 

 

 

Whats the proper way of doing this ? I get cofused with the braquets .

 

Thanks for any help !

Link to comment
Share on other sites

Hey, I did it just now ! It working !! :) Thanks anyway for the people that came and viewed my post !

 

:)

 

A small question :

 

Would i have any problems combining this mod with the STS simple template system contribution ? Is there any other better contribution than that one for modifing the way os comerce is dislayed ?

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