Jump to content


Corporate Sponsors


Latest News: (loading..)

weaver

Member Since 28 May 2004
Offline Last Active Jun 07 2011, 19:55
-----

Posts I've Made

In Topic: Seperate Pricing Per Customer v3.5

07 June 2011, 19:55

View PostJohnAtYM, on 07 June 2011, 07:21, said:

Actually, SPPC changes to specials.php should have given you this query:
  $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 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " 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 . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "' order by s.specials_date_added DESC";
which doesn't refer to categories and wouldn't have given you a problem. Either you have installed another add-on that modified specials.php or you applied changes from the wrong file. Either way, as long as it works now it doesn't really matter!

Yes indeed I have other contributions installed such as SPPC_Price_Break. I really carefully double checked this change was necessary. But everything is now ok ant that is the main thing. Thanks again for help...:)

In Topic: Seperate Pricing Per Customer v3.5

05 June 2011, 18:24

View PostJohnAtYM, on 31 May 2011, 09:49, said:

You need to change reviews.php as well, replace
  $reviews_query_raw = "select r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
// EOF Separate Pricing Per Customer, Hide products and categories from groups
  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
with
  $reviews_query_raw = "select distinct r.reviews_id, left(rd.reviews_text, 100) as reviews_text, r.reviews_rating, r.date_added, p.products_id, pd.products_name, p.products_image, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = r.products_id and r.reviews_id = rd.reviews_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and rd.languages_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by r.reviews_id DESC";
  $reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS, 'p.products_id');
// EOF Separate Pricing Per Customer, Hide products and categories from groups

NB I have moved the // EOF comment one line down after the splitPageResults instantiation, so make sure you don't end up with two of these lines.

The front page modules don't need changing; products_listing module lists products in a specific category, new_products already has distinct in the queries.

However, includes/modules/also_purchased_products.php needs
    $orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups
changing to
    $orders_query = tep_db_query("select distinct p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED); 
// EOF Separate Pricing Per Customer, Hide products and categories from groups
I don't have the data on hand to test either of these, so let me know if/when you've checked them out.


Hi!

Thank you and sorry for my little delayed response. Everything seems to be working fine now as I can see...:)

In addition, also specials.php had to be changed similar way so query is:

$specials_query_raw = "select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image, s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_SPECIALS . " s, " . TABLE_CATEGORIES . " c where p2c.categories_id = c.categories_id and p.products_status = '1' and p.products_quantity > 0 and p.products_id = p2c.products_id and s.products_id = p.products_id and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and s.customers_group_id = '" . (int)$customer_group_id . "'";

and(the line which originally caused difficulties for me)

from

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);

to

$specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS, 'p.products_id');

Yes, I kow there isn't Hide products changes there but still it needs this fix...

In Topic: Seperate Pricing Per Customer v3.5

30 May 2011, 11:59

View PostJohnAtYM, on 29 May 2011, 19:03, said:

My guess would be it's a problem with the implementation of the add-on you're using to link products rather than the Hide Products changes, which only add a couple of ...and find in set... clauses to the end of the select. I don't see how this would make anything appear twice, but if you post the query I'll have a look.

If it occurs in specials it's definitely not a problem with Hide Products, which doesn't change the specials processing.


Thanks,there can be something wrong with the implementation but I can't figure out what it is. Otherwise it works fine.


Here is my slightly altered query:

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = pd.products_id and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) < '" . NEW_PRODUCT_DAYS . "' and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by p.products_date_added DESC, pd.products_name";


Here under is the basic query from "Hide products from customer groups for SPPC"?

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by p.products_date_added DESC, pd.products_name";

Both of these queries return multiple linked products for me in the New products page.

But if i use the basic query for SPPC it works perfectly in that respect. Ofcourse hiding doesn't work then.

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";
$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

In Topic: Seperate Pricing Per Customer v3.5

29 May 2011, 09:32

Hi!

Do somebody know how can I prevent linked products showing in products_new.php when using also contribution "Hide products from customer groups for SPPC"? The problem seems to be related to changed queries of that contribution. Problem may occur in other listings too(specials, reviews).
So it don't look nice when same product is multiple times in those pages...:)