Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

The reason why I want to know where the SQL statement is for inserting customers_group_ra is because: for some reason, the database will automatically insert a "0" (zero) into the database when a customer updates his/her address book without inputing any number into the company ID field. whenever there is something (including a "0") in the tax_id field, the red light will appear. i just want to add an "IF" statement to exclude the condition where the company ID is "0" so that the red light won't turn on.

 

I just found out the relevant code after I read the codes from texmaxx. I changed the following in address_book_process.php:

 

From:

 

// BOF Separate Pricing Per Customer: alert shop owner of tax id number added to an account

if (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id)) {

 

To:

 

// BOF Separate Pricing Per Customer: alert shop owner of tax id number added to an account

if (ACCOUNT_COMPANY == 'true' && tep_not_null($company_tax_id) && $company_tax_id !== '0') {

Link to comment
Share on other sites

JanZ, regarding the new SPPC you uploaded (2.0)...

 

i have SPPC 103a AND HPPC installed... i should be able to just compare and add the new code to all the relevent files correct?? The readme said something regarding HPPC but it wasn't clear to me. Just making sure i dont need to uninstall the Hide Product Per Customer contrib first...

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Just making sure i dont need to uninstall the Hide Product Per Customer contrib first...
There should be an upgrade...txt or update....txt in the package that will tell you how to upgrade from 103a to 2.0.0.
Link to comment
Share on other sites

How can i limit "new products" ? there is a knowledge base article on it but it doesn't seem to be applicable after a SPPC/HPPC installation... i have way too many products in my "new products" section (like if i add 1858 products in one day... they are all in there)

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Move the taxnumber to table customers.

Changes in 3 files:

create_account.php

address_book_process.php

admin/customers.php

....

Your tax_id is moved to table customers.

 

Texmaxx, you do not know how much i appreciate your codes! THANK YOU THANK YOU THANK YOU THANK YOU VERY MUCH!

Link to comment
Share on other sites

Not sure if this has been asked before .. i was reading through the many pages but not seen an answer to this.

 

On the new customer screen when the customer is filling out his details. Is there a way to show the groups that the customer can register for. Like "Retail" being default and a pull down menu or something that shows the other groups and then the customer chooses that group and registers with it. After that when the group is anything but Retail an email is sent to the admin to notify of non-default registration.

 

How do i do this please?

Link to comment
Share on other sites

Not sure if this has been asked before .. i was reading through the many pages but not seen an answer to this.
Your memory is very short. You replied to the post that contained exactly that code (page 124, June 20, 2006). The code goes in create_account.php by the way.
Link to comment
Share on other sites

How can i limit "new products" ?
What about using featured products instead of the new products module and products_new page? You can find the SPPC versions of those pages in this thread (somewhere ;) ).
Link to comment
Share on other sites

I just uploaded version 2.0.0 of the Hide Products [and categories] from customer groups for SPPC contribution, a co-production texmaxx and me. As the name implies it now enables hiding of complete categories with products, an improved admin and more code against "hacking" clients.

 

 

Hello JanZ - I really do admire your work on the SPPC contribution.

 

Regarding the hide groups modification, I'm having a problem with the product_info.php page.

Basically all clicked products that transfer to product_info.php are returning a blank "product not found" error.

 

The products show up fine elsewhere - in the new products page and all the index.php options.

But when you click the product to see the details you get that blank page.

I guess its mistakenly "hiding" the product for some reason?

 

Anyway, I have tried installing a totally new oscommerce 2.2MS2 (November update).

Installing the latest SPPC by over-writing oscommerce originals.

 

At this point SPPC works fine - as you would expect.

 

I then over wrote the installation with your "Hide Products" modification files.

 

That seems to work fine - except the product_info never shows a product - they all return "product not found!"

 

I'm stepping through the code but wonder if you could check it out as well?

Simply by installing SPPC over a virgin OSC then over writing with your mod should I think show up the problem I see.

Link to comment
Share on other sites

That seems to work fine - except the product_info never shows a product - they all return "product not found!"
Sh*t, sorry. You are right. In that file there is one line missing (after $product_check_query):

  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
// this line is missing in the file:
  $product_check = tep_db_fetch_array($product_check_query);
  // EOF Separate Pricing Per Customer, hide products and categories from groups

Link to comment
Share on other sites

Sh*t, sorry. You are right. In that file there is one line missing (after $product_check_query):

  $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c using(products_id) left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and find_in_set('".$customer_group_id."', products_hide_from_groups) = 0 and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
// this line is missing in the file:
  $product_check = tep_db_fetch_array($product_check_query);
  // EOF Separate Pricing Per Customer, hide products and categories from groups

 

 

LOL you just beat me to it of course!

 

Yes I found that problem and can confirm the solution you give solves it.

 

:D

Link to comment
Share on other sites

I may be asking too much and this may already have an answer somewhere, but I'm running SPPC (Separate Pricing Per Customer 4.1.1) and QPBPP (Quantity Price Breaks Per Product 1.11.3) and have items with attributes that affect pricing. For instance, there's a product attribute priced at 8.99 and a sample at $1 (-7.99). It appears that when a group logs in with a price break, it will only compute the original price of the product and will not break it down by price attributes. Is this correct?

 

Don't sweat it if it won't work, like I said it seems like a lot to be asking. I'd just like to know if I'm doing something wrong or asking the impossible. Great mod btw!

 

thanks, Mike

Link to comment
Share on other sites

It appears that when a group logs in with a price break, it will only compute the original price of the product and will not break it down by price attributes. Is this correct?
I'm not sure if I understand your question correctly so I'll just write what I know and if it doesn't answer your question let us know ;)

 

Attributes are (as far as I can see in the code, haven't looked at them very much) added/subtracted from the price after QPBPP has done its job. So the "base price" goes down when the quantity goes up.

 

For attributes there is no such thing as QPBPP, or special prices. So their price is always the same. For group prices the code for the catalog side is written but the admin side still isn't (actually I made a button tonight that should popup a window with the admin page for that, I don't see any room to squeeze in the group prices). So as long as you don't mind using phpMyAdmin for making changes you can use group prices for attributes.

 

Regarding a price break for quantities on attributes... I guess it should be possible but I have never looked at that so I could be very wrong. The seemingly stupid + and - prefixes might be a problem. MySQL can store negative numbers so why use that? I might overlook something here ;)

Link to comment
Share on other sites

What about using featured products instead of the new products module and products_new page? You can find the SPPC versions of those pages in this thread (somewhere ;) ).

well i am using featured products... but you can still click "see new products" when someone logs in... i guess i can delete the code that has the link in it (as its just a hyperlink in the english.php file i think)... but i guess the real question is do the new products populate ONLY when asked for (ie clicking the link) or are the cached somewhere... if so would increased performance be gained by disabling new products "caching" permanently??

 

my list of contribs:

 

SPPC (seperate pricing per customer)

CoolMenu

Featured Products

HPFCG (hide products from customer group)

Sort product by model (in ad

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Hi JanZ

 

hehe .. oppss .. how did you go searching for my replies. I want to know all the posts i have made in the forums. Is there a way of doing it?

 

Back to the question to do with this marvelous contribution you have done.

 

I have installed a small but very useful contribution. It is "Buy Now Or Customize Now Image".

 

Before i installed Separate Pricing Per Customer v4.1.5a i had the above mentioned contrib installed and it was running perfectly fine. After installing SPPC it has stopped working and gone back to default Oscommerce way.

 

The only thing i can think of is that i am missing something or done something wrong in the /catalog/includes/modules/product_listing.php file. Its a very small contribution so could you please have a quick look at it and tell me how i could get it to work with this contrib.

 

Thanks again JanZ

Edited by CGhoST
Link to comment
Share on other sites

well i am using featured products... but you can still click "see new products" when someone logs in...
Even after having done step 10 mentioned in the featured products contribution?

Step 10:
edit /catalog/index.php and change the two instances of FILENAME_NEW_PRODUCTS to FILENAME_FEATURED

Link to comment
Share on other sites

hehe .. oppss .. how did you go searching for my replies.
I didn't. I went searching for the post I remembered having made with that code and then came across your reply. Not the other way around :)
I want to know all the posts i have made in the forums. Is there a way of doing it?
Click on your own screen name at a post or on the bottom of the front page to go to "View profile" Than on the right top you see another drop down marked as "Profile Options". There you can choose for members topics or members posts.
I have installed a small but very useful contribution. It is "Buy Now Or Customize Now Image".

 

Before i installed Separate Pricing Per Customer v4.1.5a i had the above mentioned contrib installed and it was running perfectly fine. After installing SPPC it has stopped working and gone back to default Oscommerce way.

 

The only thing i can think of is that i am missing something or done something wrong in the /catalog/includes/modules/product_listing.php file.

Did you change the $listing['products_id'] to $listing[$x]['products_id'] in:

			  $show_buy_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$listing['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");

Link to comment
Share on other sites

Even after having done step 10 mentioned in the featured products contribution?

Step 10:
edit /catalog/index.php and change the two instances of FILENAME_NEW_PRODUCTS to FILENAME_FEATURED

Yes, i just verified that this change has been made:

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ 
 adapted for Separate Pricing Per Customer v4.1.1, Hide products from groups mod 2005/03/28
 osCommerce, Open Source E-Commerce Solutions
 [url=http://www.oscommerce.com]http://www.oscommerce.com[/url]

 Copyright ? 2003 osCommerce

 Released under the GNU General Public License
*/
 require('includes/application_top.php');
 global $customer_group_id;
 if(!isset($customer_group_id)) { $customer_group_id = '0'; }
// the following cPath references come from application_top.php
 $category_depth = 'top';
 *CUT OUT*
	  </tr>
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td>
	*CUT OUT*
	  <tr>
		<td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td>
	  </tr>   *CUT OUT*
<?php
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);

 

I didn't post the whole long thing....

Edited by herot

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

Yes, i just verified that this change has been made:
OK, change it in includes/functions/general.php, around line 1040:

// Return a customer greeting
 function tep_customer_greeting() {
global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
  $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
.
.

Link to comment
Share on other sites

Hi JanZ

 

Yes i did

 

This is the code that i have

 

			$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing[$x]['products_id']) . '">' . tep_image_button('button_customize_now.gif', IMAGE_BUTTON_CUSTOMIZE_NOW) . '</a> ';

 

that is right nah? i can't understand as to why its not working now :(

Link to comment
Share on other sites

OK, change it in includes/functions/general.php, around line 1040:

// Return a customer greeting
 function tep_customer_greeting() {
global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
  $greeting_string = sprintf(TEXT_GREETING_PERSONAL, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
.
.

i changed it but it says page not found when the customer logs in and clicks that same link now... used to go to new products but now goes to page not found...

Did you get rid of the voices in your head? Do you now miss them and the things that they said?

-David Gilmour

Link to comment
Share on other sites

I now need to remove the SPPC modification.. I;m wondering about the right way to go about this..

 

I'm thinking that if I go into the DB and make sure everyone is set to the lowest common "retail" as opposed to the other levels, then I can just remove these levels from the stre and move on..

 

I'm thinking that hand removing the MOD is not a good idea.. well at least one I am not looking forward to doing..

 

ideas???

 

thanks

Debbie D
Franklin County, VA "Moonshine Capitol of the World"
osCmax Mobile Template oscmaxtemplates.com

Link to comment
Share on other sites

i changed it but it says page not found when the customer logs in and clicks that same link now... used to go to new products but now goes to page not found...
You changed it using FILENAME_FEATURED_PRODUCTS? And did you add this to /catalog/admin/includes/filenames.php (step 3 in the readme.txt)
define('FILENAME_FEATURED_PRODUCTS', 'featured_products.php');

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