Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 14 votes

Seperate Pricing Per Customer v3.5


5884 replies to this topic

#5881 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 27 April 2012, 05:10

Anyone using "Category Box Enhancement", version 1.1?

Well, if you are then use the code snippet below to make it work with Hide Categories & Products. Just replace the code from the instructions for catalog/includes/boxes/categories.php.

Line 14
// BOF SPPC hide categories from groups for "Category Box Enhancement", version 1.1
    global $tree, $categories_string, $cPath_array, $customer_group_id, $languages_id;
// EOF SPPC hide categories from groups

Line 74
// BOF SPPC hide categories from groups for "Category Box Enhancement", version 1.1
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = " . (int)$parent_id . $catstatus . " and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0 order by sort_order, cd.categories_name");
// EOF SPPC hide categories from groups

FYI - This is for an install on RC2a.

#5882 greasemonkey

  • Community Member
  • 53 posts
  • Real Name:Scott
  • Gender:Male

Posted 27 April 2012, 14:30

I have just installed SPPC 4.2 and QPBPP on my cart. 2.2 MS2.... Everything is going well so far, however when testing I'm having a strange issue... and I'm hoping someone can point me in the right direction;

When logged in as a "wholesale" customer and viewing products by category or by manufacture the correct customer group pricing is NOTdisplayed. "Wholesale" = customer group "1"... It displays as "retail" (customer group "0").

Pricing is correct in product_info...

Correct pricing is being added to the shopping_cart...

What makes this strange is; AFTER a product has been added to the shopping cart and then you go back to view by category or manufacture that same product (only the product added to the shopping cart) price IS now displaying correctly for the customer group (wholesale = customer group 1).

I have gone back and re-checked with Araxis Merge;

index.php
includes\modules\product_listing.php
inclueds\boxes\categories.php

Everything "seems" to be correct... Although I'm not a coder...

Is this something in priceformatter.php maybe? Or somewhere else? Any hints would be greatly appreciated... I did go through almost all 300 pages of this discussion and couldn't find anything... Sorry in advance if I missed it.

#5883 greasemonkey

  • Community Member
  • 53 posts
  • Real Name:Scott
  • Gender:Male

Posted 29 April 2012, 11:31

Still looking... if anyone has a suggestion. I've added

echo '<pre>';print_r($_SESSION);echo '</pre>';

To index.php and to make sure the customer group is ok... it seems to be (results below).

Array
(
    [cart] => shoppingCart Object
	    (
		    [contents] => Array
			    (
				    [2957] => Array
					    (
						    [qty] => 1
						    [discount_categories_id] =>
					    )
			    )
		    [total] => 4.02
		    [weight] => 0.1
		    [cartID] =>
		    [content_type] =>
		    [cg_id] => 1
	    )
    [language] => english
    [languages_id] => 1
    [currency] => CAD
    [navigation] => navigationHistory Object
	    (
		    [path] => Array
			    (
				    [0] => Array
					    (
						    [page] => index.php
						    [mode] => NONSSL
						    [get] => Array
							    (
								    [osCsid] => e1bb3e89290d1a26e65ca0366e9c58ef
							    )
						    [post] => Array
							    (
							    )
					    )
				    [1] => Array
					    (
						    [page] => index.php
						    [mode] => NONSSL
						    [get] => Array
							    (
								    [cPath] => 196
							    )
						    [post] => Array
							    (
							    )
					    )
			    )
		    [snapshot] => Array
			    (
			    )
	    )
    [wishList] => wishlist Object
	    (
		    [wishID] =>
	    )
    [customer_id] => 6891
    [customer_default_address_id] => 8019
    [customer_first_name] => Lisa
    [sppc_customer_group_id] => 1
    [sppc_customer_group_show_tax] => 0
    [sppc_customer_group_tax_exempt] => 0
    [customer_country_id] => 38
    [customer_zone_id] => 74
)



#5884 greasemonkey

  • Community Member
  • 53 posts
  • Real Name:Scott
  • Gender:Male

Posted 29 April 2012, 14:39

Found it... Finally... in includes\modules\product_listing.php the query to select pricing for
if ($customer_group_id != '0') {
I believe this means "anybody but customer group "0" (again I'm not a coder...so I'm guessing).

Was modified for QPBPP to
$pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "' and customers_group_price != null");

When changed back to the orginal SPPC code

$pg_query = tep_db_query("select pg.products_id, customers_group_price as price from " . TABLE_PRODUCTS_GROUPS . " pg where products_id in (" . implode(',', $list_of_prdct_ids) . ") and pg.customers_group_id = '" . $customer_group_id . "'");

It seems to work perfectly... or at least how I expected...

#5885 geomilli

  • Community Member
  • 31 posts
  • Real Name:George Milligan
  • Gender:Male
  • Location:Danbury, Connecticut USA

Posted 29 April 2012, 19:43

In my post #5878,

Quote

Also, if you link to two categories for one product the products_new.php displays two of that same product on the page. My code is modified to be in columns, integrated for Ezier New Fields, SPPC and HP&C, Wishlist and a database name "products_namebreak" that I have created for display formatting so it's funky.

I have come up with a better explanation... If you link a product from one category to another, the product_id is identical. When you view products_new.php it will show the duplicated id's IE products from both categories because of this link. I don't want that. >_< This problem is also in featured_products.php, assuming an identical result.

To prove that the code in my quote was not an issue, I started with a fresh install of osC and added SPPC and HP&C. The scenario is the same on product_new.php. I made a new category called "Our Favorites" and then linked the product Unreal Tournament to it. The product then appears in two places when product_new.php is displayed.

Any ideas or fixes that I am not aware of? I have read through most of this forum and searched crazily, to no avail. However, I haven't stopped yet. :blink: