Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PLEASE HELP!!! - Prices Not Showing


moonlitsun

Recommended Posts

:ph34r: Unfortunately, some modifications to our site have rendered a complete INABILITY to show product option prices when viewing the product listing page of an item. Please see an example here:

 

http://dropshipdirect.com/warehouse/produc...products_id=136

 

Oddly enough, when you add an option to the shopping cart, the shopping cart DOES update both the item description and price adjustment. However, the prices themselves are not showing up as they should on the product listing page within the option boxes.

 

The only reason I can imagine this may have happened is because of a modification we made to this page: B2BSuite. This mod is a combination of a few contributions, including Separate Price per customer (which lets you set group pricing for every individual item...i.e. wholesale and retail) and "log-in to view prices." In this instance, we have disabled login to view prices, but do have the separate pricing per customer running (which is critical to our operation).

 

Following is a snippet of the relevant code within catalog/product_info.php:

 

 

?>
        <table border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
          </tr>
<?php
    $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']);
    //B2BSuite START
  if ($products_options_values['options_values_price'] != '0') 
           {
     $option_price_display  =  ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($product_info_values['products_tax_class_id'])) .') ';
          if (PRICES_LOGGED_IN == 'false') {
  $option_price_display_d = $option_price_display;
   }
 if ((PRICES_LOGGED_IN == 'true') && (!tep_session_is_registered('customer_id'))) {
  $option_price_display_d = '';
 }  else  {
  $option_price_display_d = $option_price_display;
 }
          $products_options_array[sizeof($products_options_array)-1]['text'] .= $option_price_display_d;
 //B2BSuite END
        }
      }

      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>
<?php

 

As you can see, the B2BSuite may have modified some of the content so as to have interrupted the product option prices showing up on the product listing. Furthermore, separate pricing per customer isnt relevant to an item option...but only to the main price of the product itself (hope this makes sense).

 

ANYONE's feedback on the above code is GREATLY appreciated. Since we're adding alot of technology and custom-build products, product options with previewed pricing is of great value to us. :unsure:

 

Thanks so much in advance for your help! :rolleyes:

 

BTW ... I am using OSCOMMERCE 2.2 MS2 (latest official release)

Carpe Carp: Seize the Fish.

Link to comment
Share on other sites

If you have seaprate price per customer - but don't "force login" then what is the DEFAULT price? Zero? I think part of B2B has a fuction that "force login" to view prices???

 

I would remove B2B and just add the single contribution you needed -special prices per customer.

Link to comment
Share on other sites

Jason,

 

Matt (iinetworks), another member in this forum, was able to help with the code adjustment. Seems B2BSuite was messing with the $ field names. ACK! Thank God he was able to rename them correctly without losing the B2B mod itself altogether.

 

Thanks again for your input.

 

-Codi

Carpe Carp: Seize the Fish.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...