Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

JanZ,

 

After a short hiatus, I'm back working on my site still trying to get SPPC to work with my MultiStores.

 

I'm still trying to get the customer group update issue worked out from the admin side. I can choose a customer, change the customer group, hit update and see the change on the screen. If I open my database at that point, the change was not sent there. If I go back and select the customers again, the update is not shown in the customer list.

 

This is what I previously posted and your reply. As far as I can tell, my register globals are on. I don't know a darn thing about the register globals so if there is an issue or incompatibility here I don't have a clue. Any ideas?

 

Joanne

 

 

QUOTE(reelwild @ Mar 27 2007, 12:45 AM) *

 

I've noticed that when I try to change the customer group in the admin panel, the group does not change. I've rechecked my file but don't see where the problem may be. Any assistance would be appreciated.

 

Strange, looks fine to me. You don't happen to have a register_globals problem do you?

Otherwise change the $HTTP_POST_VARS for SPPC specific variables to $_POST ones like in the top of the file:

 

CODE

// BOF Separate Pricing per Customer

$customers_group_id = tep_db_prepare_input($HTTP_POST_VARS['customers_group_id']);

to:

 

CODE

// BOF Separate Pricing per Customer

$customers_group_id = tep_db_prepare_input($_POST['customers_group_id']);

 

In that case you should also change the $listing on line 1246 (in your file) to a $_GET like:

 

CODE

<?php // BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer

switch ($_GET['listing']) {

Link to comment
Share on other sites

just wondering why my create account page doesn't have the company name, tax number input as per the description at the very top of this post?

 

I have updated to version 4.11 now

 

Ilan

Edited by iperez_genius
Link to comment
Share on other sites

just wondering why my create account page doesn't have the company name, tax number input as per the description at the very top of this post?

Did you set Company to true in admin->Configuration->Customer Details?

Link to comment
Share on other sites

I can choose a customer, change the customer group, hit update and see the change on the screen.

So the update has been sent to the database and can be retrieved...

If I open my database at that point, the change was not sent there. If I go back and select the customers again, the update is not shown in the customer list.

This appears to contradict each other. Without pouring over the code there is really nothing I can say about it. Are all customers in one table or has each store its own table?

Link to comment
Share on other sites

I can't seem to get the tax exempt feature to work. I've read all I can about it in this thread, but nothing answers my question. I'm logged in as a tax exempt customer and here is my php session info (or whatever you call it):

 

 [sppc_customer_group_id] => 1
[sppc_customer_group_show_tax] => 0
[sppc_customer_group_tax_exempt] => 1

 

So it appears that everything is working correctly on the session end. Any ideas?

Link to comment
Share on other sites

I can't seem to get the tax exempt feature to work. I've read all I can about it in this thread, but nothing answers my question. I'm logged in as a tax exempt customer and here is my php session info (or whatever you call it):

 

 [sppc_customer_group_id] => 1
[sppc_customer_group_show_tax] => 0
[sppc_customer_group_tax_exempt] => 1

 

So it appears that everything is working correctly on the session end. Any ideas?

Perhaps you use Chemo's tax class contribution? Otherwise take a look at tep_get_tax_rate and tep_get_tax_description in includes/functions/general.php because if I remember correctly that is the only place it comes in action.

Link to comment
Share on other sites

I am looking for a way to simply add a new field to a user's profile that would represent a percentage they have off of the entire inventory. In a previous shopping cart I built the field was named 'Discount Percentage'. So in the end if I enter 55 into this field from that point forward when the user logs into the shop they will see all of the prices discounted 55% off. I don't want to control this with groups because during negotiations we may come up with a really specific number (lets say 67%).

 

Could somebody please let me know if this has been done before? There were a couple posts where people asked about this, but they were never answered directly about this.

 

Thank you in advance for any help you can provide.

Link to comment
Share on other sites

I am looking for a way to simply add a new field to a user's profile that would represent a percentage they have off of the entire inventory. In a previous shopping cart I built the field was named 'Discount Percentage'. So in the end if I enter 55 into this field from that point forward when the user logs into the shop they will see all of the prices discounted 55% off. I don't want to control this with groups because during negotiations we may come up with a really specific number (lets say 67%).

SPPC can't do it that way. You would need the group. You could easily add all prices to the database with a single query, so that is not the point.

Perhaps you are better off with a simpler contribution that works with the order total. That way prices shown are full prices but when you go to checkout you get the discounted prices.

Link to comment
Share on other sites

Perhaps you use Chemo's tax class contribution? Otherwise take a look at tep_get_tax_rate and tep_get_tax_description in includes/functions/general.php because if I remember correctly that is the only place it comes in action.

 

I'm not using Chemo's tax class contribution. I checkoed out two functions you suggested and they're the same as the ones in a default OSC install. So what's next? Thanks for you help so far.

Link to comment
Share on other sites

I checkoed out two functions you suggested and they're the same as the ones in a default OSC install.

They are not supposed to be the same, they are changed for the sppc tax exempt feature.

Link to comment
Share on other sites

They are not supposed to be the same, they are changed for the sppc tax exempt feature.

Do I need to download the 'Enable or disable tax for different customers Version 1.2' package and install it? I was under the impression that the newer versions of SPPC had this integrated, but I am probably wrong.

Link to comment
Share on other sites

SPPC can't do it that way. You would need the group. You could easily add all prices to the database with a single query, so that is not the point.

Perhaps you are better off with a simpler contribution that works with the order total. That way prices shown are full prices but when you go to checkout you get the discounted prices.

 

Thank you for this confirmation. I had a feeling that this was the situation, and I didn't want to go through the installation of this mod if I wasn't sure. I am quite surprised that this isn't more common though.

 

Thanks again.

Link to comment
Share on other sites

Do I need to download the 'Enable or disable tax for different customers Version 1.2' package and install it? I was under the impression that the newer versions of SPPC had this integrated, but I am probably wrong.

Nope, the changes are described in the new_install_directions.txt, about half way down for the file catalog\includes\functions\general.php. Of course you can find them back in the changed file that comes with the package.

Link to comment
Share on other sites

Nope, the changes are described in the new_install_directions.txt, about half way down for the file catalog\includes\functions\general.php. Of course you can find them back in the changed file that comes with the package.

Thanks so much. Strangely enough, I had done just 1 of the 3 edits in general.php. Oh well, it's fixed and working perfectly now thanks to your help! :)

Link to comment
Share on other sites

i seem to have having some trouble integrating easy populate with SPPC.

 

regardless of which version of easy populate i use , none of the complete exported tabl files have fields for SPPC (v_customer_price_1 etc:)

 

I have gone through the easy populate.php file and uncommented the SPPC lines (v_customer_price_1 etc:) .

 

However one thing i found unusual is that in my OsCommerce product_groups table my fields are customer_group_price_1 not customer_price_1 like it is in the easy populate file )

 

If anybody has gotten SPPC working nicely with easypopulate any help would be greatly appreciated ( i have done alot of searching on the forum and could not find anythign as yet to help me )

 

cheers

Link to comment
Share on other sites

JanZ,

 

I apologize, I wasn't clear about this. If I am inside the oscommerce ADMIN section, and trying to change the customer group, I can change the value, hit update and see the change on the screen right away. At the same time, I have the actual database table open in another program. The value is not being passed to the table at all and is not being updated into the database table. If I go back to the oscommerce ADMIN, choose customers again, the value was not updated.

 

There is another table customer_info that deals with what store they belong to so I don't think there is a conflict there. Any ideas?

 

Joanne

 

I can choose a customer, change the customer group, hit update and see the change on the screen.

 

So the update has been sent to the database and can be retrieved...

 

This appears to contradict each other. Without pouring over the code there is really nothing I can say about it. Are all customers in one table or has each store its own table?

Link to comment
Share on other sites

Me neither. This is such a general error that is impossible to answer. Basically it means that in the code you are asking for the results of a query, but the query itself hasn't been executed. Try a file comparison program to see where the missing query might be (maybe stuck in an if/else part that isn't executed?).

 

I gave up on this for a bit and just got back to it. I found the problem and it works fine now. I added the mod using the written directions the first two times I did it, this last time I did it using the directions, then used my compare program to check that against the enclosed categories.php file. (Where I assumed the problem was). I found two discrpencies in the written directions.

 

After following the directions this piece of code is what the directions give me. In mine it's around line 1372

[if (isset($HTTP_GET_VARS['search'])) { // changed for Price Break 1.11.3
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
} else { // changed for Price Break 1.11.3
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

 

 

This is what it should be:

if (isset($HTTP_GET_VARS['search'])) {
  $search = tep_db_prepare_input($HTTP_GET_VARS['search']);

  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name");
} else {
  $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name");

 

 

The other section of code from the directions was this around line: 1406

if (isset($HTTP_GET_VARS['search'])) {
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
} else {
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

 

and it should be this:

if (isset($HTTP_GET_VARS['search'])) { // changed for Price Break 1.11.3
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
} else { // changed for Price Break 1.11.3
  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

 

Like I said, it's just the categories.php directions that are not correct. If will work if you use the enclosed categories.php that is in the contribution.

 

Sorry if this isn't making any sense. Trying to do this on 36 hrs no sleep. :'(

Edited by candleman

Currently running 76 contibutions.

Link to comment
Share on other sites

The woes continue with Qty price breask per customer for SPPC. I got as far as testing it and something going on in the shopping cart. It all appears correctly on the product info page. When you click on the add to cart button it gets added to the cart with the correct price, but the carts total is double what is in the cart.

 

IE

 

1 - 0.60 item in the cart

Sub-total : 0.60

Cart total: 1.20

 

Then I refresh the page

 

1- .60 item in cart

sub-total: 1.80

cart total: 2.40

 

Refesh the page or even leave the page and come back

 

1 - .60 item in the cart

sub-total: 3.00

Cart total: 3.60

 

See a pattern here? I can completly remove everything from the cart and as soon as I place something else in it, it adds to the old total. doesn't matter if I had a price break set on it or not.

 

I did a file compare if the shopping cart class in the contrib and the one I have and found no difference except for the other mods I have installed.

 

Not sure what to check.

Currently running 76 contibutions.

Link to comment
Share on other sites

The woes continue with Qty price breask per customer for SPPC. I got as far as testing it and something going on in the shopping cart. It all appears correctly on the product info page. When you click on the add to cart button it gets added to the cart with the correct price, but the carts total is double what is in the cart.

 

IE

 

1 - 0.60 item in the cart

Sub-total : 0.60

Cart total: 1.20

 

Then I refresh the page

 

1- .60 item in cart

sub-total: 1.80

cart total: 2.40

 

Refesh the page or even leave the page and come back

Very creative, if you would ask me how to implement that I wouldn't be able to tell you.

I did a file compare if the shopping cart class in the contrib and the one I have and found no difference except for the other mods I have installed.

 

Not sure what to check.

As far as I know those actions are controlled by two files: the class shopping_cart.php and includes/application_top.php. I wouldn't know where your error/conflict with other contributions is.
Link to comment
Share on other sites

Hi there. I've installed the SPPC contribution, and have been really impressed with it. It does absolutely everything I could possibly need. So a huge thankyou to those of you who wrote it!

 

I have just one problem... I need my store to show Retail prices including tax by default, and for a Guest visitor, it does this perfectly. However, when that guest logs in, the prices change to Retail, excluding tax. The settings for the Retail customer group are to "Show prices with tax", and the Retail group is not tax exempt. So as far as I can tell, all settings are correct.

 

I've Echoed the $sppc_customer_group_show_tax variable, and it's definitely set to 1.

 

I've searched through the code, and traced the process right through until the product_listing.php page calls the tep_get_tax_rate() function, which is just as per the contribution file.

 

 

Can anyone suggest where I should look next, please? What could be causing this problem? :huh:

Link to comment
Share on other sites

Can anyone suggest where I should look next, please? What could be causing this problem?

Everything looks like it should indeed. Perhaps that customer has an address outside the particular tax zone?

Link to comment
Share on other sites

The old MySQL 5 problem :D

 

Trying to sort by price the products of a category:

1054 - Unknown column 'p.manufacturers_id' in 'on clause'

select  count(p.products_id) as total from products_description pd left join  products_group_prices_cg_2 as tmp_pp using(products_id) left join  manufacturers m on p.manufacturers_id = m.manufacturers_id,  products_to_categories p2c, products p where p.products_status = '1'  and p.products_id = p2c.products_id and pd.products_id =  p2c.products_id and pd.language_id = '3' and p2c.categories_id = '19'

 

Any search:

1066 - Not unique table/alias: 'pd'

select  count(distinct p.products_id) as total from products p left join  manufacturers m using(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 = '3' and  p.products_id = p2c.products_id and p2c.categories_id = c.categories_id  and ((pd.products_name like '%lap%' or p.products_model like '%lap%' or  m.manufacturers_name like '%lap%') )

 

I know this is all because of SPPC not being compatible with MySQL5 and that this has been known for months. I've found some clues and tips around the forum and made some fixes on my own but the problem is endless!

 

The big question is, besides downgrading to MySQL4 and since this problem is so old, is there a definitive solution yet? Somewhere to find all the required code changes? A thread? Some 'magic' setting in MySQL server?

 

If not, I think it is time to start working on a contribution. Perhaps we can team up?

 

Thank you!

Edited by raindogmx
Link to comment
Share on other sites

Everything looks like it should indeed. Perhaps that customer has an address outside the particular tax zone?

:thumbsup: JanZ, you're brilliant. I spent hours banging my head against the wall trying to solve this one!

 

While you're at it, perhaps you could tell me one more thing... If you configure osCommerce to display prices excluding tax, is there any point in the checkout process where it gives the customer an all-inclusive total?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...