Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

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?

 

 

If the site has no other contributions installed then the best thing to do is to upload all the files and overwrite the existing ones. This is the fastest, easiest and best way to install :D It literally takes 5 minutes :)

 

After that you need to run the enclosed SQL script on your database. From that point you should have a perfectly working Separate Price installed.

 

Once you reach that point then you should update your SPP install by going to the contributions section and downloading the 4.11 release. It has minor bugfixes I believe.

 

I'm using the 4.1 release Found Here as the example. Go into the New Installations directory and then upload the entire catalog directory to your site. If it asks about overwriting - that's OK.

 

Then open the spcc_V41_install.sql file and run that script on your database. Make sure you are running the osCommerce 2.2 Milestone 2 release as this won't work on other versions.

 

The best way to go is to do one thing at a time and when you feel the site is solid back it up with FTP as well as backing up the database before making other changes. This is what I do and it saves me a LOT of time.

 

That way if it doesn't work or turns out to be too much of a challenge for me I can easily put it back the way it was - while staying one step ahead :D

 

If you need help understanding how to use it check the above link or look at the Pictorial Overview of Separate Pricing folder as it contains the same docs. They are there to show you how to use it so that you can get a handle on what it does :)

 

Hope this helps B)

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

Link to comment
Share on other sites

ok, found a slightly larger problem now also. NONE of my products will display. When you click on any catagory, it gives the following error:

 

Parse error: parse error, unexpected T_CASE in /home/XXhomeXX/public_html/catalog/includes/modules/product_listing.php on line 192

 

 

common problem?

Link to comment
Share on other sites

marvin- the newer version that Jan posted at http://www.oscommerce.com/community/contri...+member+pricing contains everything needed for 4.1.1 from a new install(at least i hope so, for thats what I used).

 

im sure that would be easier instead of d/l 4.0, then doing the upgrade to 4.1.1

 

it mentions the 4.1 release, but it isnt listed on the contributions page.

Link to comment
Share on other sites

That's because the 4.1 release contains the HTML docs and when I uploaded them to the contribution section they bounced it because it required approval due it's massive 500k size. I guess they were worried that it would clog the Internet :P

The problem is that they never reviewed and released it. Had they had someone to actually review it they would have - but they didn't.

 

I don't know about the 4.11 release because I stopped working with Jan on the docs at the time of the 4.1 release so I'm not familiar with the current ones :blink: The reason why I was talking about the 4.1 release is because this is the one that Camarilladee was talking about using.

 

So, Camarilladee, if you're listening it would be easier for you to use the latest release and just follow the same basic procedures - upload the full catalog directory and run the SQL install script :thumbsup:

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

Link to comment
Share on other sites

ok, found a slightly larger problem now also. NONE of my products will display. When you click on any catagory, it gives the following error:

 

Parse error: parse error, unexpected T_CASE in /home/XXhomeXX/public_html/catalog/includes/modules/product_listing.php on line 192

common problem?

 

got this issue fixed. Somehow compare and merge missed something in this file the first time through.......had alittle extra code in the file. Took it out and viewing the products is now ok.

 

....just hoping that somebody can PLEASE help with my SQL error. :thumbsup:

Link to comment
Share on other sites

....just hoping that somebody can PLEASE help with my SQL error.  :thumbsup:

Actually, that has nothing to do with SPPC and everything with the mysql version of your server. The "-20" in the limit is illegal now and that gives the error. See for a fix this bug report on the osC website.

Link to comment
Share on other sites

Actually, that has nothing to do with SPPC and everything with the mysql version of your server. The "-20" in the limit is illegal now and that gives the error. See for a fix this bug report on the osC website.

 

THANK YOUUUUUUUUU :D

 

worked nicely. Guess it was an existing "problem" that I just now noticed.

 

 

Jan, you know off the top of your head what all I would need to change to relabel "company tax id #" on all forms in the store and admin section to another name?

Link to comment
Share on other sites

any more info on this feature?

 

You have to set your email in catalog\includes\languages\english\login.php file, search the line where it's begin with define('SPPC_TOGGLE_LOGIN_PASSWORD', and put your email. When you log with your account, you gonna have the choice to login in the grouop price you want. Is that enough easy ? :thumbsup:

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

A little question for you JanZ about the setting for the email admin who can choose the group price when he login. Can we put another email for the other admin of the online store ? If not, it's a suggestion you can do, what do you think about this ? :o

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

You have to set your email in catalog\includes\languages\english\login.php file, search the line  where it's begin with define('SPPC_TOGGLE_LOGIN_PASSWORD', and put your email. When you log with your account, you gonna have the choice to login in the grouop price you want. Is that enough easy ?  :thumbsup:

 

well, i changed the email addy of my personal test account i have on my store to match the email addy in the login.php file(just a different email address of our store).....then tried logging in. Nothing was different. I didnt get a choice to change which group I was viewing.

 

So, im obviously still in need of assistance.

Link to comment
Share on other sites

nevermind, got it. I forgot to change the address in the login.php file during the second install attempt. Thanks everybody for the help, everything seems to be working ok!

 

thanks to Jan for all the work on the contribution!

Link to comment
Share on other sites

Can we put another email for the other admin of the online store ?

The snippet of code you should look at is around line 166 in address_book_proces.php:

      $alert_email_text = "Please note that " . $firstname . " " . $lastname . " of the company: " . $company . " has added a tax id number to his account information.";
     tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'Tax id number added', $alert_email_text, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
     }
// EOF Separate Pricing Per Customer: alert shop owner of account created by a company

If you want another email address then that of the store owner you change it here, or if you want an extra one, you can add another "tep_mail(name_of_person_to_send_extra_email, email_address_of_that_person, 'Subject', $alert_email_text, from_email_name, from_email_address);".

Link to comment
Share on other sites

also, in this post:

 

http://www.oscommerce.com/forums/index.php?sho...40entry556240

 

it mentions: "To make testing easier for the Site Administrator you can now log-in and choose what group you want to be a part of. This is used for tesing and only the Admin can do it."

 

any more info on this feature?

 

a nother more then stupid question is...

how can i log in with different groups!?

 

greetz john

Link to comment
Share on other sites

idea for an addition to this contribution:

 

should add the ability to make a percentage discount to a customer group. If a price isnt specifically entered for a product, it still gets the set percentage discount(if one has been set).

Link to comment
Share on other sites

If you want another email address then that of the store owner you change it here, or if you want an extra one, you can add another "tep_mail(name_of_person_to_send_extra_email, email_address_of_that_person, 'Subject', $alert_email_text, from_email_name, from_email_address);".

 

Thank you to have answered me but it is not what I want to say. What I want to do is to be able to add another person of being able when it log on the site while entering its email and password to be able to choose the group (retail, wholesale etc) like the admin. So I want two person to be able to choose the group when they log on the website.

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

What I want to do is to be able to add another person of being able when it log on the site while entering its email and password to be able to choose the group (retail, wholesale etc) like the admin. So I want two person to be able to choose the group when they log on the website.
OK, so I didn't get your question right. That should be simple too: define a second email address in includes/languages/english/login.php e.g. SPPC_TOGGLE_LOGIN_PASSWORD2 and have the code look for that one too in catalog/login.php:

// BOF Separate Pricing Per Customer: choice for logging in under any customer_group_id
// note that tax rates depend on your registered address!
if ($_GET['skip'] != 'true' && ($_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD || $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD2 ) ) {
  $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");

I think that should work.

Link to comment
Share on other sites

Thank you for your answer JanZ. You are not far JanZ, the code does not generate any error. The first email goes well for all the groups, but the second email does not work (SPPC_TOGGLE_LOGIN_PASSWORD2 ), when we log with the second (SPPC_TOGGLE_LOGIN_PASSWORD2 ), we see the page which says to choose the group of price but when we choose a group, it gives us only the group which is associated to this user. If the user has the price wholesale, he will see only Whosale even if he chooses the retail group.

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

the second email does not work (SPPC_TOGGLE_LOGIN_PASSWORD2 ), when we log with the second (SPPC_TOGGLE_LOGIN_PASSWORD2 ), we see the page which says to choose the group of price but when we choose a group, it gives us only the group which is associated to this user. 
You are right, there is another spot where we have to do this trick, around line 82

	// BOF Separate Pricing per Customer
if ($_GET['skip'] == 'true' && ( $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD ||  $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD2 ) && isset($_POST['new_customers_group_id']))  {
$sppc_customer_group_id = $_POST['new_customers_group_id'];

That should do it I think.

Link to comment
Share on other sites

Excellent JanZ, it work with no problem. Thank's. :thumbsup:

 

Thank you very much.

 

So here we go if anybody want to add extra email :

 

How to add extra user to be able to choose the group price

======================================

 

The Site Administrator can logs in and have a choice to login

with the group price he want. It enables you to choose under

what group you wish to log-in. This is useful for troubleshooting

or just to see the different pricing groups in action. You can

set the email address of the administrator's account in the

catalog\includes\languages\english\login.php file.

 

But how to add extra user to be able to do that ?

 

Here how to do it :

===================

 

You have to modify just 2 files to do it:

 

open catalog\login.php file

 

Search the line :

 

if ($_GET['skip'] != 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD ) {

 

replace it by :

 

if ($_GET['skip'] != 'true' && ($_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD || $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD2 ) ) {

 

Search the line :

 

if ($_GET['skip'] == 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD && isset($_POST['new_customers_group_id'])) {

 

replace it by :

 

if ($_GET['skip'] == 'true' && ( $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD || $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD2 ) && isset($_POST['new_customers_group_id'])) {

 

open catalog\includes\languages\english\login.php file

 

Add at the end just before ?> :

 

// BOF Separate Pricing Per Customer

// define another email address that can change customer_group_id on login

define('SPPC_TOGGLE_LOGIN_PASSWORD2', '[email protected]');

// EOF Separate Pricing Per Customer

 

All the credit goes to JanZ

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Hi Folks

 

Sorry in advance if I missed something, but after installing this contrib I am getting errors while trying to view the product listing in the store frontend.

 

I've set up a fresh MS2.2 install to test this contrib, and therefore only copied the changed / new files from this contrib over to the catalog directory and executed the SQL-statements by feeding phpmyadmin with the sql-file from the contrib. That's all that I have done.

 

Now, when trying to see a product listing for a category, e.g. "Hardware -> Graphics Cards", the following error occurs:

 

1146 - Table 'osCommerce.specials_retail_prices' doesn't exist

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

[TEP STOP]

 

After taking a quick glance at the tables, I can see, that the table "specials_retail_prices" actually is missing, as is the table "products_group_prices_cg_", which is defined in database_tables.php.

 

Can somebody tell me how they should look like, so I can create them manually, please?

 

 

Thx & greetz

 

Bran

Edited by Bran
Link to comment
Share on other sites

1146 - Table 'osCommerce.specials_retail_prices' doesn't exist
Go to the advanced search page and look for a product using a from/to price. If you are not logged-in or logged-in as a retail customer the table will be created automagically. You shouldn't have a problem after that.
Link to comment
Share on other sites

Now, when trying to see a product listing for a category, e.g. "Hardware -> Graphics Cards", the following error occurs:

 

1146 - Table 'osCommerce.specials_retail_prices' doesn't exist

 

Do you download the full release of the SPPC 4.1 ? Because all the thing needed is in that. The full contrib can be found HERE.

John

--------------------

osCommerce 2.3.4 Bootstrap Edge

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