Jump to content


Corporate Sponsors


Latest News: (loading..)

burt

Member Since 09 Sep 2002
Offline Last Active Yesterday, 12:32
****-

Issues I've Posted

    Missing Modules

    Posted 1 Apr 2011

    I see only payment module, no others;

    http://imagebin.org/146043

    http://imagebin.org/146044

    Hardcoded language in shopping_cart.php

    Posted 11 Feb 2011

    $products_name .= '<br /><br />' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . '&nbsp;&nbsp;&nbsp;or <a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&action=remove_product') . '">remove</a>';
    

    Change to:

    $products_name .= '<br /><br />' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . '&nbsp;&nbsp;&nbsp;' . sprintf(TEXT_REMOVE, $products[$i]['id']);
    

    And also:

    Add new language define to /includes/languages/english/shopping_cart.php

    define('TEXT_REMOVE', 'or <a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'products_id=%s&action=remove_product') . '">remove</a>');
    

    Change the language define for each language that you have at your shop. "or" and "remove".

    Multiple Image PopUP - feature change

    Posted 8 Nov 2010

    The new multiple images system is nice.

    I noticed that any product with just 1 image (the main image) uses the old style js popup box, whereas any product with multiple images uses the newer jquery goodness.

    I changed my product_info.php like this;

    <?php
    /*
      $Id$
    
      osCommerce, Open Source E-Commerce Solutions
      http://www.oscommerce.com
    
      Copyright (c) 2010 osCommerce
    
      Released under the GNU General Public License
    */
    
      require('includes/application_top.php');
    
      require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
    
      $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
      $product_check = tep_db_fetch_array($product_check_query);
    
      require(DIR_WS_INCLUDES . 'template_top.php');
    
      if ($product_check['total'] < 1) {
    ?>
    
    <div class="contentContainer">
      <div class="contentText">
        <?php echo TEXT_PRODUCT_NOT_FOUND; ?>
      </div>
    
      <div style="float: right;">
        <?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?>
      </div>
    </div>
    
    <?php
      } else {
        $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
        $product_info = tep_db_fetch_array($product_info_query);
    
        tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
    
        if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
          $products_price = '<del>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</del> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
        } else {
          $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
        }
    
        if (tep_not_null($product_info['products_model'])) {
          $products_name = $product_info['products_name'] . '<br /><span class="smallText">[' . $product_info['products_model'] . ']</span>';
        } else {
          $products_name = $product_info['products_name'];
        }
    ?>
    
    <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
    
    <div>
      <h1 style="float: right;"><?php echo $products_price; ?></h1>
      <h1><?php echo $products_name; ?></h1>
    </div>
    
    <div class="contentContainer">
      <div class="contentText">
    
    <?php
        if (tep_not_null($product_info['products_image'])) {
          $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");
    
    ?>
    
        <div id="piGal" style="float: right;">
          <ul>
    
    <?php
          if (tep_db_num_rows($pi_query) > 0) {
            $pi_counter = 0;
    
            while ($pi = tep_db_fetch_array($pi_query)) {
              $pi_counter++;
    
              $pi_entry = '        <li><a href="';
    
              if (tep_not_null($pi['htmlcontent'])) {
                $pi_entry .= '#piGalimg_' . $pi_counter;
              } else {
                $pi_entry .= tep_href_link(DIR_WS_IMAGES . $pi['image']);
              }
    
              $pi_entry .= '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $pi['image']) . '</a></li>';
    
              if (tep_not_null($pi['htmlcontent'])) {
                $pi_entry .= '<div style="display: none;"><div id="piGalimg_' . $pi_counter . '">' . $pi['htmlcontent'] . '</div></div>';
              }
    
              $pi_entry .= '</li>';
    
              echo $pi_entry;
            }
          }
          else {
              echo '<li><a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) .  '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . $product_info['products_image']) . '</a></li>';
          }
    ?>
    
          </ul>
        </div>
    <?php
        }
    ?>
    
    <script type="text/javascript">
    $("#piGal a[rel^='fancybox']").fancybox({
      cyclic: true
    });
    
    <?php
    if ($pi_counter) {
        ?>
    $('#piGal ul').bxGallery({
      maxwidth: 300,
      maxheight: 200,
      thumbwidth: 75,
      thumbcontainer: 300
    });
    <?php
    }
    ?>
    </script>
    
    <?php echo stripslashes($product_info['products_description']); ?>
    
    <?php
        $products_attributes_query = tep_db_query("select count(*) as total 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 . "'");
        $products_attributes = tep_db_fetch_array($products_attributes_query);
        if ($products_attributes['total'] > 0) {
    ?>
    
        <p><?php echo TEXT_PRODUCT_OPTIONS; ?></p>
    
        <p>
    <?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']);
              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 (is_string($HTTP_GET_VARS['products_id']) && 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;
            }
    ?>
          <b><?php echo $products_options_name['products_options_name'] . ':'; ?></b><br /><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?><br />
    <?php
          }
    ?>
        </p>
    
    <?php
        }
    ?>
    
        <div style="clear: both;"></div>
    
    <?php
        if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
    ?>
    
        <p style="text-align: center;"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></p>
    
    <?php
        }
    
        $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and reviews_status = 1");
        $reviews = tep_db_fetch_array($reviews_query);
    ?>
    
        <br />
    
        <div>
          <div style="float: right;"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></div>
    
          <?php echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?>
        </div>
    
    <?php
        if ((USE_CACHE == 'true') && empty($SID)) {
          echo tep_cache_also_purchased(3600);
        } else {
          include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
        }
    ?>
    
      </div>
    </div>
    
    </form>
    
    <?php
      }
    
      require(DIR_WS_INCLUDES . 'template_bottom.php');
      require(DIR_WS_INCLUDES . 'application_bottom.php');
    ?>
    

    Now I have jquery for both multiples and singles. If single, then the bxgallery does not show (as that would be pointless).

    Error Catch needed - or complete removal ? product_reviews.php

    Posted 27 Oct 2010

    Notice: Undefined index: products_id in \product_reviews.php on line 15

    Warning: Cannot modify header information - headers already sent by (output started at \product_reviews.php:15) in \includes\functions\general.php on line 45

    Error catch needed in case this page is accessed without $_GET['products_id']

    Thinking out loud;
    Is product_reviews.php even required? The functionality is basically "reviews.php" (small change required in here to deal with it), and the "product_reviews_info.php" contains the review. Seems like a redundant file. Thoughts?

    Unwanted inline style - account.php

    Posted 25 Oct 2010

    In 3 places;

    <ul style="list-style-image: url(<?php echo DIR_WS_IMAGES . 'arrow_green.gif'; ?>); margin: 0;">

    maybe;

    <ul class="list">

    and

    .list {
        list-style-image: url(images/arrow_green.gif);
        margin: 0;
    }