Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Ok, I now found the problem... I had to add customers_groups.php to the admin_files-table...

INSERT INTO `admin_files` ( `admin_files_id` , `admin_files_name` , `admin_files_is_boxes` , `admin_files_to_boxes` , `admin_groups_id` ) 
VALUES ('', 'customers_groups.php', '1', '0', '1');

I don't understand why this wasn't in the i sppc_v41_install.sql, doesn't everyone have to do this? Or is admin_files a osMax-only table?

Edited by Fegis
Link to comment
Share on other sites

Or is admin_files a osMax-only table?
Sounds like it. This is totally new to me. I guess in osC it is handled by defines in the file database_tables:

 

catalog\admin\includes\database_tables.php

**ADD**
// BOF Separate Pricing per Customer
 define('TABLE_PRODUCTS_GROUPS', 'products_groups');
 define('TABLE_CUSTOMERS_GROUPS', 'customers_groups');
// EOF Separate Pricing per Customer

Link to comment
Share on other sites

On behalf of JanZ I would like to announce Quantity Price Breaks for Separate Pricing Per Customer

 

http://www.oscommerce.com/community/contributions,3039

 

This is a SPPC add-on that:

1) Allows quantity based pricing per product per customer group

2) Allow the ability to sell a product inlots of # quantity only

 

Once again JanZ has put his time and effort into helping the OScommerce community (especially all us SPPC users). Many Thanks!

 

Hi, I'm newbie when it comes to shopping cart and oscommerce. This contribution works great. THanks for doing such a great job. I installed:

 

Quantity Price Breaks for Separate Pricing Per Customer v1.0.1

Separate Pricing Per Customer v.4.1 on a fresh install.

 

The problem I run into is product attributes. Here's some background info:

Product at regular price: $4.00

Purchase 5+ price: $3.60 (10% discount)

 

This same product has 4 different size attributes sold at different prices:

original size: $4.00

size 1: +$0.75

size 2: +$2.25

size 3: +$5.00

 

I noticed that when I purchased more than 5 in larger sizes (stated in attributes), the quantity price break kicks in but the dollar amount is not correct.

For example:

 

I purchase 10 items of size 3:

 

price came out to be 10 * (3.60 + 5.00) = $86.00

Price should be 10 * [(4.00 + 5.00)*0.9] = $81.00

 

Problem is that the 10% discount is only on the price of the original size but not on the overall price of the bigger sizes. Is there a fix for this bug? Can someone point me to where in the code I could fix this? It would be great if I can display the actual price in the attribute drop down menu instead of the price difference for larger size.

 

Thanks in advance!

Link to comment
Share on other sites

price came out to be 10 * (3.60 + 5.00) = $86.00

Price should be 10 * [(4.00 + 5.00)*0.9] = $81.00

 

Problem is that the 10% discount is only on the price of the original size but not on the overall price of the bigger sizes. Is there a fix for this bug?

Actually, that is correct behavior of the code but alas not the behavior you would like.

 

Trouble is that you need customer group dependent attribute prices ... and that contribution doesn't exist yet, unfortunately.

Link to comment
Share on other sites

hey guys, im currently working at modding my files to try out this contribution. Could somebody give me a quick "how-to" on the following step:

 

Run the spcc_v41_install.sql database installation file on your MySQL database.

 

Ive never had to deal with my SQL database before. Thanks in advance!

Link to comment
Share on other sites

also, does the customer HAVE to enter a tax ID number using this mod?

No.

Can the tax ID # field be eliminated all together?
I think it shouldn't raise any errors. You would have to comment out the relevant code in the create_account.php page to not show it.
Link to comment
Share on other sites

would commenting out the code in the create_account.php page cause any errors with the contribution?

 

...and thanks for the fast reply and your work on this contribution.

 

Im almost afraid to try this out. After editing soooo many files, im bound to have made a mistake somewhere.

Link to comment
Share on other sites

OK, this is big time Off Topic--but my encounters with the participants of this thread have been the most productive in my young osC life, so I thought I'd ask here.

 

I'm working on my first osC production site and, thanks largely to some great help from some of you, things are going well.

 

Now I'm to the point of deciding how best to address the confusing (to me) subject of SSL and having a secure site.

 

Can someone direct me to some explanatory documentation about this subject? I have a lot of specific questions, but I won't burden the list with them. I'm hoping there is, somewhere, some explanation of exactly how to go about having a secure osC store.

 

Thanks in advance. Feel free to reply with a private message, as my question has nothing specifically to do with SPPC.

 

Mike

Mike in Key West

Link to comment
Share on other sites

That question was asked in the general forum not so long ago. I think that thread will give you all the answers.

 

Jan- Just to verify....i dont upload the "sppc_v41_install" file within phpmyadmin, but instead open it(im guessing with wordpad?) then paste line by line into the "Run SQL query/queries on database" section and press "GO" after each line?

 

Also, this in no way will erase anything else such as settings or customers that are currently in the database and being used in my already operational storefront?

 

THANKS for your help!

Link to comment
Share on other sites

Just to verify....i dont upload the "sppc_v41_install" file within phpmyadmin, but instead open it(im guessing with wordpad?) then paste line by line into the "Run SQL query/queries on database" section and press "GO" after each line?
I only used phpMyAdmin a couple of times, so I can't tell you where exactly all the buttons are, but you can run a query and choose a button to select an sql file on your own hard disk (that gets uploaded then before it is run). The other way is indeed open the sql file in Wordpad, select all, copy and paste that in the appropriate window in phpAdmin. DO NOT run it line by line...

 

Also, this in no way will erase anything else such as settings or customers that are currently in the database and being used in my already operational storefront?
No, but it is always best to do a backup of the database before you do something like this. You never know...
Link to comment
Share on other sites

I'm reading through this and preparing to install 4.1 (after a back up of my database of course!) and as I'm going through and beginning to edit the pages I'm noticing that it seems it's asking me to add lines of code which already seem to be there.

 

I'm wondering if someone went through and added code to some of the pages already. I'm not sure how doubling up on the code will effect this if I try to run it so I'm figuring its better to ask now and be safe rather than sorry later.

 

I appriciate your help!

Edited by Camarilladee
Link to comment
Share on other sites

That's a good question. When I wrote the install docs I purposely included some small amounts of pre-existing text for simplicities sake.

 

In some files there are sections where every second line has been changed for about 20 lines. In that case I chose to simplify the install directions rather then to create 20 different steps.

 

The install directions are accurate and my recommendation is that you do exactly as they say. This way the contrib will work fine - provided you haven't missed any steps.

 

If this is a new osCommerce install then the preferred method is to upload the files and run the SQL script. If you have a heavily modded site then the best way is using a Compare & Merge utility. The Compare & Merge utility will highlight all code differences so that you can see exactly what has been changed and then ascertain if it will cause problems with pre-existing contributions.

 

Using a Compare & Merge utility will also enable you to add the least amount of code although the 'extra' code replaced in the small number of files was not (to my knowledge) code of any significance. By & large the instructions are replacing only the needed code.

 

Anyway, the install docs do cover most of this but the bottom line is that you should follow the instructions exactly and not depend on the //BOF and //EOF line makers because I believe in one file they were not 100% dead on - although the instructions are :thumbsup: because I used a Compare & Merge utility to create them.

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

I'm reading through this and preparing to install 4.1 (after a back up of my database of course!) and as I'm going through and beginning to edit the pages I'm noticing that it seems it's asking me to add lines of code which already seem to be there.

 

I'm wondering if someone went through and added code to some of the pages already.  I'm not sure how doubling up on the code will effect this if I try to run it so I'm figuring its better to ask now and be safe rather than sorry later.

 

I appriciate your help!

It sound like you are trying to install over an old version of SPPC or on a osMAX-system.

I've been through the latter last week and it's a bit tricky sometimes... And depending on which version it is maybee I can help, if it now is osMAX

Link to comment
Share on other sites

Im almost afraid to try this out. After editing soooo many files, im bound to have made a mistake somewhere.

 

 

just as i figured, my whole store got messed up.....worse of all i didnt even see any changes due to this mod.

 

guess ill try again using the compare and change program. Hopefully my full site backup works tonight. :'(

Link to comment
Share on other sites

duno if i overlooked something...

i cant find a solution for

 

checkout_confirmation.php

Sub-Total: 10.00EUR

Pauschale Versandkosten (): 5.00EUR

16% MwSt: 1.60EUR

Total: 16.60EUR

 

i have set the customer group to show price without tax but in my checkout_confirmation.php tax is still added to the 10.00EUR

 

greetz john

Link to comment
Share on other sites

i have set the customer group to show price without tax but in my checkout_confirmation.php tax is still added to the 10.00EUR
That is correct (typically needed for the US where prices are shown without tax, but sales tax is still added).

What you want is the "tax exempt" I guess. That is another setting.

Link to comment
Share on other sites

Having trouble with specials...

 

Hi, my specials are all working fine but not on the main page where they should show under my main text area, I'm getting the following error : I have 3 different specials for 3 different user groups. In the specials, the same product appears three times, with retail price crossed out and for the new prices I have defined for all groups.

 

Giving the following (not logged into site):

 

Item: Item 1 Item 1 Item 1

Old Price: 15 15 15

New Price: 5 7 13

 

For obvious reasons it should only see Item1 once with New price depending on person who is logged in.

 

Second problem I'm getting, When I login as wholesaler, on the specials page, I'm getting the Public price crossed out with under the wholesaler price. And I would like to see the wholesaler old price crossed out and the new wholesaler price under it.

 

Any help or advice would be appreciated.

Maybe this info has already been given concerning this issue, I have searched but not found the answer, If you have seen it though, don't waste your time giving me a solution, please let me know it's there and I'll spend more time searching.

 

Thanx in advance.

Link to comment
Share on other sites

That is correct (typically needed for the US where prices are shown without tax, but sales tax is still added).

What you want is the "tax exempt" I guess. That is another setting.

 

sorry, yes it was "tax exempt"... stupid thing of me to ask :blush:

it was still showing up even if i logged out and in again. i have some cache hings installed so that was giving me the prob...

 

greetz john

Link to comment
Share on other sites

Matthew,

For obvious reasons it should only see Item1 once with New price depending on person who is logged in.

Are you sure you are using sppc 4.1.1? It sounds like the bug in 4.1 that was fixed (see this post).

 

Second problem I'm getting, When I login as wholesaler, on the specials page, I'm getting the Public price crossed out with under the wholesaler price. And I would like to see the wholesaler old price crossed out and the new wholesaler price under it.

There is a bugfix mentioned in the changelog_v411.txt in sppc4.1.1 for the specials page. Perhaps that could be it?

Edited by JanZ
Link to comment
Share on other sites

Hi, thanx for your help

 

That solved the problem... I was using the correct version, but I must of made an error when pasting the code from the install file. Sorry to have been a bother

 

Now I have on my website mainpage, a box in which I display a certain amount of specials and I'm getting the error I mentionned above that I had on my specials page before. Here is the code :

 

   global $customer_id;
         $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");
         $customer_group = tep_db_fetch_array($customer_group_query);
         $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $default_specials['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");
         if ( $customer_group['customers_group_id'] != 0)
           if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))
               $default_specials['specials_new_products_price']= $customer_group_price['customers_group_price'];

 

Can someone see an error as to why It would be showing three times Item1?

 

Thanx again.

Link to comment
Share on other sites

Can someone see an error as to why It would be showing three times Item1?
In there, there is no error (although it is using the ancient sppc3.5 code ($customer_group_id is a session variable now, no need to query it using the customer_id). The problem is earlier, in the query that gets the specials price for a product_id(s). To that query should be added something like "AND customers_group_id = '".$customer_group_id."' because in the table specials there can be more than one entry which have that product_id (in your case three, one for each customer group).
Link to comment
Share on other sites

If this is a new osCommerce install then the preferred method is to upload the files and run the SQL script. 

 

Hey Marvin,

 

Okay... the site I'm putting this on has no other mods and is all but a nice shiny new version of OSC. So, I should just edit as the "new install" instructions say, upload the files and that's that?

 

Thanks so much for your help!

 

*big hugs* :P

Edited by Camarilladee
Link to comment
Share on other sites

compare and merge= goodness

no doubt

 

well, now i got things looking normal after installing the mod....except some SQL glitches. In the admin page when trying to view SPECIALS, REVIEWS, or if I click on ORDERS for any customers that havnt actually placed an order....i get the following:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select reviews_id, products_id, date_added, last_modified, reviews_rating from reviews order by date_added DESC limit -20, 20

 

[TEP STOP]

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select p.products_id, pd.products_name, p.products_price, s.specials_id, s.customers_group_id, s.specials_new_products_price, s.specials_date_added, s.specials_last_modified, s.expires_date, s.date_status_change, s.status from products p, specials s, products_description pd where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = s.products_id order by pd.products_name limit -20, 20

 

[TEP STOP]

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.customers_id = '49' and o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by orders_id DESC limit -20, 20

 

[TEP STOP]

 

Any help? I hope im nearing the finish line with this install...with your help :thumbsup:

 

 

Also, isnt there a special thing for the admin to log in and check out the different customer groups? Where is that located?

 

Thanks in advance!!

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.

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...