Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

frost77

Archived
  • Posts

    1
  • Joined

  • Last visited

Posts posted by frost77

  1. Hello!

     

    I have instaled new version of contribution and recived this error message:

     

    1066 - Not unique table/alias: 'pd'

     

    select count(distinct p.products_id) as total from (products p left join products_to_products_extra_fields p2pef on p.products_id=p2pef.products_id) left join manufacturers m on m.manufacturers_id=p.manufacturers_id, products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c, products_description pd, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%dualhead%' or p.products_model like '%dualhead%' or m.manufacturers_name like '%dualhead%' or p2pef.products_extra_fields_value like '%dualhead%' or pd.products_description like '%dualhead%') )

     

    I don't now what i'm doing wrong. Please help me.

    http://www.czekoladki.com

     

    I had the same problem. Comparing the old and new advanced_search_result.php files, there is an extra line which is not needed. If you remove this, it works. Here is how to find it:

     

    Open the advanced_search_result.php file from the contribution.

     

    Search for the following text:

     

    // START: Extra Fields Contribution

    // $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

    $from_str = "from (" . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " p2pef on p.products_id=p2pef.products_id) left join " . TABLE_MANUFACTURERS . " m on m.manufacturers_id=p.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

    // END: Extra Fields Contribution

     

     

     

    if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {

    if (!tep_session_is_registered('customer_country_id')) {

    $customer_country_id = STORE_COUNTRY;

    $customer_zone_id = STORE_ZONE;

    }

    $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";

    }

     

    $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

     

    The very last line adds tables to $from_str that are already there, so you can safely remove it. That is, erase the following:

     

    $from_str .= ", " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

     

    And resave. It should then work.

×
×
  • Create New...