Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

You can't know if the visitor is a wholesale customer until she is logged-in and you decide who is wholesale so what is the scenario for the retail customers then? Do you mean visitors who are not logged-in or do you actually have retail customers who buy from you (then they have to see prices, don't they)?

 

 

I already have the prices for logged in users only, so that isn't a problem.

 

I have two user groups "Wholesale" and "Retail", I wanna show a specific msg to all retailers(let's say " become a wholesaler"), and the wholesaler will be shown the correct price...

 

 

Hope it's much clearer now.. any help would be very much appreciated.

 

 

 

Thanks & Regards

Jack

Converge

Link to comment
Share on other sites

I wanna show a specific msg to all retailers(let's say " become a wholesaler"), and the wholesaler will be shown the correct price...
Like?

if ($customer_group_id == '0') {
echo 'whatever you like';
} else {
code for the price here;
}

Link to comment
Share on other sites

im hoping someone here can help me

i have installed this mod along with PWA. heres what i want to do:

If the customer signs up they become a "member" where they get discounted prices

if they PWA they are non members and pay the full price

Now i got that bit sorted however heres my problem, someone who visits my site will automaticaly get shown the members price rather than the normal one. What am i doing wrong please.

 

Well - if you are visiting and not signed in you would be customer group '0'. Once you are signed in then you are customer group '1' or '2' or whatever depending on how many customer groups you have.

 

So - if you only have non-members and members then you should have two groups:

0 = non-members

1 = members

 

Then, you go into your Admin->Catalog->Categories/Products and set the price for each group on each product. (When you click to "Edit" a product you should now see two price fields).

~Tracy
 

Link to comment
Share on other sites

Do you have any idea what I'm doing wrong?
Yes, you are doing strange things with the results of the master query. I was thinking along this line:

<?php
//BOF Separate Pricing Per Customer
global $sppc_customer_group_id;
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
}else{
$customer_group_id = $sppc_customer_group_id;
}


$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0");
 while ($_together_id = tep_db_fetch_array($master_query)) {
$together_id[] = $_together_id['products_id'];
 }



if (is_array($together_id)) {
include(DIR_WS_LANGUAGES . $language . '/2gether.php');
$show_money_savings = true; // show money savings
$show_percentage_savings = true; // show percentage savings
$show_original_prices = true; // show origibal prices of the products
?>
<tr>
<td>
<?php
$together_list_of_ids = implode(",", $together_id);

// should work if even there is only one result in $together_list_of_ids
$together_query = tep_db_query("select distinct product_1_id, product_2_id, discount, type from ". TABLE_2GETHER ."  where (product_1_id IN (" . $together_list_of_ids . ") or product_2_id IN (" . $together_list_of_ids . ")) and status = 1");
$num_together = tep_db_num_rows($together_query);
if ($num_together > 0) {
 while ($_record = tep_db_fetch_array($together_query)) {
 // there could be more than just one row!
 // store whatever need to be stored here
 }

Link to comment
Share on other sites

Ive been looking at the product_listing.php page and im not sure what order i should have put the sppc code in (would have been the same as the instructions) but there are other mods on that page so probably a conflict somewhere.
A few things that I think should be changed:

	// BOF Separate Pricing per Customer
$no_of_listings = tep_db_num_rows($listing_query);
// never know if it is a global already:
global $sppc_customer_group_id;
// global variable (session) $sppc_customer_group_id -> local variable customer_group_id

Further on:

		$list_box_contents[$cur_row][] = array('align' => $lc_align,
										   'params' => 'class="productListing-data"',
										   'text'  => $lc_text);
	$product_contents[] = $lc_text;	   
  }
// listing => listing[$x]
  $product_query = tep_db_query("select products_description  from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$listing[$x]['products_id'] . "' and language_id = '" . (int)1 . "'");
  $product = tep_db_fetch_array($product_query);
  $new_products['products_description'] = $product['products_description'];

Link to comment
Share on other sites

Yes, you are doing strange things with the results of the master query. I was thinking along this line:

 

Ahhh! So that's how it's done! :blush:

I can believe I was doing strange things with the results - I try but I don't always understand what it is I'm telling it to do - LOL I know what I WANT to tell it to do - it just doesn't always come out right :blush:

 

Thanks again! This will be chalked up to a major learning experience for me :)

~Tracy
 

Link to comment
Share on other sites

Please help anyone.

 

I'm trying to integrate SPPC 4.15 into my store. I have a few other contributions so i can't do a clean install. Other contributions. Paypal IPN, CCGV (trad), held orders, and a better USPS module.

 

I'm using Compare and Merge to modify my files. I modded all files necessary and uploaded and i get this error.

 

Parse error: syntax error, unexpected $end in /xxx/xxx/xxx/includes/functions/general.php on line 1351

 

 

 

In Merge and compare Line 1351 is the very last line but there is nothing on it. When i use a php editor to view it, it stops at line 1350 and there is no line 1351.

 

What am i doing wrong?

 

If i upload SPPC in it's raw state it works fine but then all my other contribs break (naturally) I'd like to get this working as soon as possible.

 

,mike

Link to comment
Share on other sites

Please help anyone.

 

I'm trying to integrate SPPC 4.15 into my store. I have a few other contributions so i can't do a clean install. Other contributions. Paypal IPN, CCGV (trad), held orders, and a better USPS module.

 

I'm using Compare and Merge to modify my files. I modded all files necessary and uploaded and i get this error.

 

Parse error: syntax error, unexpected $end in /xxx/xxx/xxx/includes/functions/general.php on line 1351

In Merge and compare Line 1351 is the very last line but there is nothing on it. When i use a php editor to view it, it stops at line 1350 and there is no line 1351.

 

What am i doing wrong?

 

If i upload SPPC in it's raw state it works fine but then all my other contribs break (naturally) I'd like to get this working as soon as possible.

 

,mike

 

The unexpected $end error has thrown me for a loop on many occasions - LOL Basically, it means that you either have an extra '}' or you are missing a '}' (typically it's been an extra one in my case - so a process has already been ended by the '}' and it doesn't understand what you are trying to end elsewhere in the document).

 

Double check your '}' in WinMerge and make sure you didn't add in an extra one when pasting code into the general.php file ;)

~Tracy
 

Link to comment
Share on other sites

The unexpected $end error has thrown me for a loop on many occasions - LOL Basically, it means that you either have an extra '}' or you are missing a '}' (typically it's been an extra one in my case - so a process has already been ended by the '}' and it doesn't understand what you are trying to end elsewhere in the document).

 

Double check your '}' in WinMerge and make sure you didn't add in an extra one when pasting code into the general.php file ;)

 

 

I came to the conclusion that compare and merge was adding thigns improperly so i manually edited the file but cutting and pasting and it fixed the general.php file. when i re-uploaded i got another } error on another file. Looks like i'm gonna have to do it manually for each file. oh well.

Link to comment
Share on other sites

when i re-uploaded i got another } error on another file. Looks like i'm gonna have to do it manually for each file.
I use jEdit most of the time. One (IMO) killer application is that if you put your cursor right after a parenthesis, it will give a line in the margin to where the other one is. If you have a function, the start and finish are obvious, so if there is one to many or short it will be clear which function has a problem.

Saved me a lot of hair-pulling.

I know TextWrangler and BBEdit (Mac software) also have that functionality, but you have to double click to get it to show the parent (never knew that till someone on the forum pointed that out).

Link to comment
Share on other sites

I use jEdit most of the time. One (IMO) killer application is that if you put your cursor right after a parenthesis, it will give a line in the margin to where the other one is. If you have a function, the start and finish are obvious, so if there is one to many or short it will be clear which function has a problem.

Saved me a lot of hair-pulling.

I know TextWrangler and BBEdit (Mac software) also have that functionality, but you have to double click to get it to show the parent (never knew that till someone on the forum pointed that out).

 

This is exactly what i ended up doing. I downloaded a program called php edit 2.0 and it had the same feature. Intead of merging i just manually did it. Now it's working great.

 

Thanks everyone!

Link to comment
Share on other sites

just wondering...

has anyone added support for the stock osC newsletter manager

allowing the sending of newsletters filtered by group?

Actually, I finished that many, many months ago and is waiting for inclusion in the next version (yeah, yeah, promises, promises). If you care to try it out, PM me an email address.
Link to comment
Share on other sites

Hello, I was wondering if anyone could point out to a complete newbie where he is going wrong.

 

I have a fresh install of osC - latest release

 

I'm trying to add SPPC 415

 

I am able to get the unmodified osC to work fine (using a godaddy hosting account as a test bed right now before trying it on my real store)

 

I can upload the SPPC catalog folder and replace the files in osC that it overwrites.

 

My problem is probably with the understanding of 'running' the spcc_v35_upgrade.sql (btw, is there a reason that this still says v35 instead of v415?)

 

godaddy has a version of phpmyadmin running on its sql server... i log into that fine, select the appropriate database (the only one i have running there) then open an sql window and paste in the contents of the spcc_v35_upgrade.sql file) and hit go.

 

I get this error:

Error

 

SQL query: Documentation

 

INSERT INTO customers_groups

SELECT DISTINCT c.customers_group_id, c.customers_group_name, '1', '0', '', ''

FROM customers c

GROUP BY customers_group_id;

 

MySQL said: Documentation

#1054 - Unknown column 'c.customers_group_id' in 'field list'

 

when i look at the catalog in my browser, I'm then seeing (where before I had the normal osC screen) only:

the osC header, and in the left column the categories and manufacturers boxes, followed by:

 

1054 - Unknown column 'customers_group_id' in 'where clause'

 

select specials_new_products_price from specials where products_id = '26' and status and customers_group_id = '0'

 

and the rest of the page is blank.... so it seems like the upgrade.sql is having an effect... just not the right one! (well, that or it is the modified files in the installation unable to find something.)

 

Can anyone point me in the right direction.... I've read through pages and pages in the forum and haven't seen anything that rings a bell for me.... it all sounds like it should go really easy on a fresh install... but it sure isn't.

 

Any help is greatly appreciated.... Brent

Link to comment
Share on other sites

I am able to get the unmodified osC to work fine (using a godaddy hosting account as a test bed right now before trying it on my real store)

 

I can upload the SPPC catalog folder and replace the files in osC that it overwrites.

 

My problem is probably with the understanding of 'running' the spcc_v35_upgrade.sql (btw, is there a reason that this still says v35 instead of v415?)

Ah, you should have used sppc_v41_install.sql that was in the directory new_installations... Now you have to compare the two and see what v41 has that v35 does not have and add that to your database.

 

Note that if you use MySQL5 the query in advanced_search.php is not working correct in 415. Somewhere in this thread there are instructions for updating the 4.11 version to a MySQL5 version.

Link to comment
Share on other sites

Ah, you should have used sppc_v41_install.sql that was in the directory new_installations... Now you have to compare the two and see what v41 has that v35 does not have and add that to your database.

 

Jan, thank you very much! :D

 

At least my problem was a tiny, self-inflicted one rather than a complete lack of understanding. :-) (Not that I understand too much about this yet!)

 

Luckily I had backed up the database prior to doing that... simply restored from the backup.... and ran the right script.... and now everything looks good.

 

Now I'm excited to get under the hood and see if I can make osC and sppc do what I want.

 

Thank you again for your help! I'll hope that someday once I gain experience with the product I can also help people.

 

Brent

Link to comment
Share on other sites

I was looking at version 2.0.1 of your Hide products from customer groups for SPPC, can that just be put in on top of the latest version of sppc?
Yes, that should work. Of course there is an sql file that should be run first, but then you just can replace the files with the one in the package.
Link to comment
Share on other sites

Error

 

SQL query: Documentation

 

INSERT INTO customers_groups

SELECT DISTINCT c.customers_group_id, c.customers_group_name, '1', '0', '', ''

FROM customers c

GROUP BY customers_group_id;

 

MySQL said: Documentation

#1054 - Unknown column 'c.customers_group_id' in 'field list'

 

 

1054 - Unknown column 'customers_group_id' in 'where clause'

 

select specials_new_products_price from specials where products_id = '26' and status and customers_group_id = '0'

 

 

The following post was big help for me...

 

http://www.oscommerce.com/forums/index.php?s=&...st&p=870367

 

 

Hope, it helps you too.

 

Regards,

 

Ralf

Link to comment
Share on other sites

I'm rebuilding my shop in a new test area on my hosts server because I didn't install MVS and Quantity Price Breaks at the beginning (a year ago). I was told that it was almost impossible to add it in now because I have over 112 contributions installed now. No one will take it on.(any takers?)

 

So, I started with the newest base osC store and dropped in MVSv1.1.

I made an excel spreadsheet that indicates with colour codes any files that will conflict with each other so I can just drop in as many files as I can and follow the path of least resistance during the rebuild process.

(Simplest order of contribution installations)

 

When dropping in SPPCv4.15 over MVSv1.1, there are 8 files that need to be installed manually, the rest just drop in.( I did this for every big contribution (13 of them) related to MVS, SPPC and Quantity Price Breaks per customer)

 

The problem is that the right files to choose in the SPPCv4.15 New Installations folders have not been explained (as far as I could tell). There are several versions of each file with the extensions "-SPPCv412" etc.

There is one file without these additional extensions that seems to be the same as the -SPPCv415 file as confirmed with my compare program.

 

Which files do I use in this package? My guess is the one without the extensions, but guessing can be dangerous.

 

Thanks,

RJ

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

I'm rebuilding my shop in a new test area on my hosts server because I didn't install MVS and Quantity Price Breaks at the beginning (a year ago). I was told that it was almost impossible to add it in now because I have over 112 contributions installed now.
Wow, that is a lot... I don't know about MVS but QPBPP (you will need the SPPC version, which is not that different in catalog code than the regular one) is pretty easy to install (in a default shop at least).
When dropping in SPPCv4.15 over MVSv1.1, there are 8 files that need to be installed manually, the rest just drop in.( I did this for every big contribution (13 of them) related to MVS, SPPC and Quantity Price Breaks per customer)

 

The problem is that the right files to choose in the SPPCv4.15 New Installations folders have not been explained (as far as I could tell). There are several versions of each file with the extensions "-SPPCv412" etc.

There is one file without these additional extensions that seems to be the same as the -SPPCv415 file as confirmed with my compare program.

 

Which files do I use in this package?

As far as I know you can safely use the v415 files, but check out the post that yofresh refers to for the MySQL5 changes needed on index and advanced_search pages. I believe the v415 works for the index, but certainly not for the advanced_search.php. Also the fix for categories as uploaded recently should be used (haven't downloaded it myself yet, but I know the issue that is referred to exists).

Link to comment
Share on other sites

Wow, that is a lot... I don't know about MVS but QPBPP (you will need the SPPC version, which is not that different in catalog code than the regular one) is pretty easy to install (in a default shop at least).

 

As far as I know you can safely use the v415 files, but check out the post that yofresh refers to for the MySQL5 changes needed on index and advanced_search pages. I believe the v415 works for the index, but certainly not for the advanced_search.php. Also the fix for categories as uploaded recently should be used (haven't downloaded it myself yet, but I know the issue that is referred to exists).

 

I didn't think it was allot until I counted them. I don't have anything to compare to because I started with zero knowledge of code work. My plan is to make the ultimate shop and then duplicate it for several online ecommerce ventures I have lined up already. I was a couple of contributions shy of the goal when I got stuck on these two.

 

However, I was questioning as to which exact file I should be installing.

Example: From the SPPCv415 catalog>admin folder, is it this one categories.php-SPPCv415 or is it this one categories.php?

 

Oh, and does anyone want to try and install MVS or QPBPP for SPPC(already installed) in my original store for a flat fee. Conditional on inspecting the handful of files I can't merge of course?

I like these mods, there fun! ...65 70 72 75 80 85 125+ contributions installed and counting...

 

Tools I'm using: OSC2.2 milestone2, Filezilla for FTP, PHP Designer 2007PE (nice), Araxis Merge 6.5 to compare files, XP(my box), Remote Server is shared Apache 1.3 Cpanel, CURL, and PHPmyAdmin through my hosts Cpanel to mess up the database.

Link to comment
Share on other sites

However, I was questioning as to which exact file I should be installing.

Example: From the SPPCv415 catalog>admin folder, is it this one categories.php-SPPCv415 or is it this one categories.php?

That happens to be a bad example since I don't like any of the copy code that was added. In general the file without an extension is the SPPC 4.1.1 version. Any other might be the same or contain a change from one of the other contributors. Best is to use the v415 file remembering what I mentioned about the MySQL5 queries on index.php and advanced_search.php.

 

Personally, I have this code in categories.php, case 'copy_to_confirm': around line 331:

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$dup_products_id . "', '" . (int)$categories_id . "')");
					// BOF Separate Pricing Per Customer originally 2006-04-26 by Infobroker
  $cg_price_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $products_id . "' order by customers_group_id");

// insert customer group prices in table products_groups when there are any for the copied product
if (tep_db_num_rows($cg_price_query) > 0) {
  while ( $cg_prices = tep_db_fetch_array($cg_price_query)) {
	tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (customers_group_id, customers_group_price, products_id) values ('" . (int)$cg_prices['customers_group_id'] . "', '" . tep_db_input($cg_prices['customers_group_price']) . "', '" . (int)$dup_products_id . "')");
  } // end while ( $cg_prices = tep_db_fetch_array($cg_price_query))
} // end if (tep_db_num_rows($cg_price_query) > 0)

// EOF Separate Pricing Per Customer originally 2006-04-26 by Infobroker
		$products_id = $dup_products_id;
	  }

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