Jump to content

g2777

Members
  • Content count

    39
  • Joined

  • Last visited

  • Days Won

    1

Reputation Activity

  1. Like
    g2777 got a reaction from bruyndoncx in Multiple Sales/Specials Per Product and osC 2.3.4 Bootstrap   
    I did it! Yay!

    Thank you so much for your help. I had a problem getting the SQL statement in 16b working to begin with but in the end It was simply so that you can select the products associated with a particular sale by using the drop down list. So I used this:
    $listing_sql = "select " . $select_column_list . " p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . (is_numeric($sale_id) ? "' and s.sale_id = '" . (int)$sale_id : "") . "' and s.status = '1'"; Basically just replace
    '" . (int)$languages_id . "' with
    '" . (int)$languages_id . (is_numeric($sale_id) ? "' and s.sale_id = '" . (int)$sale_id : "") . "' in the original statement.
     
    It works flawlessly as far as I can tell and I got to keep the sorting options.
     
    Thank you again; to both of you.
     
    Regards,
    Graham
  2. Like
    g2777 reacted to bruyndoncx in Multiple Sales/Specials Per Product and osC 2.3.4 Bootstrap   
    16a should be covered by the changes you made to product_listing
     
    16b
     
    just to get it to return the data for your sales, (you will loose the sorting options at this point, unless you figure out how to integrate it in detail)
    replace
       $listing_sql line in specials.php
    with (section 16c in instructions) - BUT change $specials_query_raw  into $listing_sql
      $specials_query_raw = "select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, (select * from (select products_id, specials_new_products_price, expires_date, sale_id, status, specials_date_added from " . TABLE_SPECIALS . " where status = 1 order by products_id, specials_new_products_price, expires_date) as t group by products_id) as s where p.products_status = '1' and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = " . (int)$languages_id . (is_numeric($sale_id) ? " and s.sale_id = " . (int)$sale_id : "") . " and s.status = '1' order by s.specials_date_added DESC";
     
    16c just apply as instructed
     
     
    18 find the random product line
    and replace with
            if ($random_product = tep_random_select("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price, s.expires_date from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, (select * from (select products_id, specials_new_products_price, expires_date, status, specials_date_added from " . TABLE_SPECIALS . " where status = 1 order by products_id, specials_new_products_price, expires_date) as t group by products_id) as s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' order by s.specials_date_added desc limit " . MAX_RANDOM_SELECT_SPECIALS)) {
              $expires = '';
              if ((DISPLAY_SALE_EXPIRATION_DATE == 'true') && ($random_product['expires_date'] != '') && ($random_product['expires_date'] != '0000-00-00 00:00:00')) {
                $expires = '<br /><small>' . TEXT_SALE_EXPIRES . tep_date_short($random_product['expires_date']);
                if (DISPLAY_SALE_EXPIRATION_TIME == 'true') $expires .= ' @ ' . substr($random_product['expires_date'], 11);
                $expires .= '</small>';
              }
     
     
     
    Find
        if ($this->group == 'boxes_footer') {  
    the previous line ends in '</span>';
    insert just before  $expires make sure to have $expires surrounded by dots
     
     
     
    As for these sql changes, they seem very resource intensive sql queries, I personally are not sure if this is the proper way to do this. If your site slows down, that is the first place to investigate
  3. Like
    g2777 reacted to burt in add on validation   
    This is not a good idea. Who is to say that 1 addon is better than another. If you are attempting to make a "loaded" version of osCommerce, then fork osCommerce on github and make the changes on there.
     
    Something in the future will be a rating system for addons.
×