Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

Janet,

Hello again,  I have been trying to install the Quantity Price Breaks contribution to a mirror/ working area of my store.  I seem to be stuck on the admin side and my categories.php page is not loading.  I also have Small, Medium, & Large Images, Header Tags, and Category Descriptions installed, so I have a lot of edits to this php page.  I've done it using Compare and Merge and by hand, but still get a blank page.  (My isp doesn't let me see the error logs, so I'm working blind!).

 

I'm including my admin/categories.php page below.  If somebody sees where I've gone wrong, or perhaps there's another file I should be concentrating on, I would appreciate the guidance.

Pretty tough to find a mistake that could be as small as a missing or extra brace in a page of this size. However, even if I paste the two pieces in one file, there are large chunks missing: "only" 1160 lines where the original Quantity Price Breaks has already 1512 lines. You really need to know what PHP is complaining about. Working blind in a file like this is not an option.

 

Also, a bit off topic, I have tried creating a local copy, but ran into trouble because of the Register Globals Patch on my computer... perhaps there's a way to make my local server have the same configuration?
No clue what you mean: do you have some Register Globals Patch on your own computer and not on the server or vice versa? Register globals can be set in php.ini, what should be easy if it is on your own computer.
Link to comment
Share on other sites

However, even if I paste the two pieces in one file, there are large chunks missing: "only" 1160 lines where the original Quantity Price Breaks has already 1512 lines. You really need to know what PHP is complaining about. Working blind in a file like this is not an option.

 

No clue what you mean: do you have some Register Globals Patch on your own computer and not on the server or vice versa? Register globals can be set in php.ini, what should be easy if it is on your own computer.

 

Thanks JanZ, this gives me two things to try tomorrow. I'll doublecheck the original file and see what I am missing, and also try and get my local copy running so I can see errors and maybe figure this out. At least I'm not breaking anything live!

 

But I think the contribution will exactly what my client needs, once I get through the install. :thumbsup:

Link to comment
Share on other sites

Thanks JanZ, this gives me two things to try tomorrow.  I'll doublecheck the original file and see what I am missing, and also try and get my local copy running so I can see errors and maybe figure this out. 

 

JanZ, I found it... sneaky little > was missing. I was able to get the local copy working well enough to start seeing errors, and that made all the difference in narrowing down the error. Thanks again!

 

Janet :lol:

Link to comment
Share on other sites

Hello,

I'm hoping someone can help me. I'm fixing up an OSC site for a friend, and they have this mod installed. I'm not sure what version it is, but there's a problem with it.

Certain people have a 100% discount. There's no use of groups or anything else. When logged in as one of these 100% off people, the prices in the catalog all display as 0 as they should. But when you add an item to the cart, the regular price shows up, from then all the way through to the end of the checkout.

How can I fix this?

I've browsed through this topic, and I may have missed it, but I didn't find any mention of this.

Thank you.

Link to comment
Share on other sites

There's no use of groups or anything else.
If there are no groups used, what is the purpose of having this mod installed then? The idea is having your customers in groups, to be able to charge different prices for the same item (e.g. retail and wholesale customers).

If they have no use for groups, better uninstall it. Otherwise, find out what version was used. Older versions (3.5 and other mods before 22 February 2005) had a lot of errors/problems.

Link to comment
Share on other sites

If there are no groups used, what is the purpose of having this mod installed then? The idea is having your customers in groups, to be able to charge different prices for the same item (e.g. retail and wholesale customers).

If they have no use for groups, better uninstall it. Otherwise, find out what version was used. Older versions (3.5 and other mods before 22 February 2005) had a lot of errors/problems.

 

Isn't the mod called separate pricing per customer lol?

They have some specific customers with a percentage off in their profiles.

There isn't any grouping, it just has a field in each customer's profile where you can specify a percentage off.

I guess it must be a really old version then?

Link to comment
Share on other sites

Isn't the mod called separate pricing per customer lol?
True, but used that way it would mean that every customer had it's own group...
There isn't any grouping, it just has a field in each customer's profile where you can specify a percentage off.

I guess it must be a really old version then?

Actually, it sounds like either another mod was used or one added later since SPPC doesn't have this (and never had as far as I know). Perhaps B2B suite or another kind of similar one (can't remember the name) was used? I suppose you found comments in the code with "Seperate Pricing Per Customer"?
Link to comment
Share on other sites

Hi,

 

I've installed this great contribution, setup a couple of test customers and two customer groups, retail and wholesale.

 

When I try to login with the site administrator email address I get the 'choose a customer group' drop down menu. However the continue button image doesn't show and if I click on the continue button nothing happens. Same thing happens if I select wholesale from the menu options.

 

Help?

 

Lyj

Link to comment
Share on other sites

True, but used that way it would mean that every customer had it's own group...

Actually, it sounds like either another mod was used or one added later since SPPC doesn't have this (and never had as far as I know). Perhaps B2B suite or another kind of similar one (can't remember the name) was used? I suppose you found comments in the code with "Seperate Pricing Per Customer"?

 

Yes, sorry. It turns out that it was CustomerDiscount that I was dealing with lol.

Is anyone willing to help me with that one? I don't think it's a difficult fix. I posted in that contrib's official thread.

Thank you.

Link to comment
Share on other sites

When I try to login with the site administrator email address I get the 'choose a customer group' drop down menu. However the continue button image doesn't show and if I click on the continue button nothing happens. Same thing happens if I select wholesale from the menu options.

You are a bit confusing since you say the continue button image doesn't show and you click it. I suppose you see a link or something?

I don't have an explanation since it uses the exact same code in line 70 for this intermediate screen in login.php as the original code for the customer login on line 254:

echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);

If you do a "view source" on that page, do you see anything out of the ordinary?

Link to comment
Share on other sites

You are a bit confusing since you say the continue button image doesn't show and you click it. I suppose you see a link or something?

I don't have an explanation since it uses the exact same code in line 70 for this intermediate screen in login.php as the original code for the customer login on line 254:

echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE);

If you do a "view source" on that page, do you see anything out of the ordinary?

 

For some reason, the continue button box has the red cross with 'continue' on it. When I view source code, it is showing the correct path,

 

<td align="right">

<input type="image" src="includes/languages/english/images/buttons/button_continue.gif" border="0" alt="Continue" title=" Continue "></td>

 

I know the continue button works as it's on the new customer login.php screen.

 

But the main thing is that wherever I try to click the area where the continue button should reside, nothing happens.

 

it says very quickly that is is opening the page http://www.xxxxx.co.uk/catalog/login.php/a...ocess/skip/true

 

then nothing... strange.

 

If I set a new customer in the wholesale group (not with the site administrator email address) they can login okay and view the wholesale prices.

Link to comment
Share on other sites

For some reason, the continue button box has the red cross with 'continue' on it. When I view source code, it is showing the correct path,
That is strange indeed.
But the main thing is that wherever I try to click the area where the continue button should reside, nothing happens.

 

it says very quickly that is is opening the page http://www.xxxxx.co.uk/catalog/login.php/a...ocess/skip/true

 

then nothing... strange.

I see what is going on, although I don't know how to change that. You are using some SEO contribution and the intermediate screen adds a number of parameters as get variables to the url: blabla/login.php?action=process&skip=true. Apparently, the second GET variable skip=true is something that your SEO contribution cannot recognize since it changes the url to blabla/login.php/action/process/skip/true .

 

I suggest a hack: using a POST parameter instead of a GET:

// BOF Separate Pricing Per Customer: choice for logging in under any customer_group_id
// note that tax rates depend on your registered address!
if ($_POST['skip'] != 'true' && $_POST['email_address'] == SPPC_TOGGLE_LOGIN_PASSWORD ) {
  $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");
echo '<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">';

The form to:

echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'));

and further on add after:

print ("<input type=\"hidden\" name=\"email_address\" value=\"".$_POST['email_address']."\">");

another hidden field:

print ("<input type=\"hidden\" name=\"skip\" value=\"true\">");

I think that should work better, although I cannot fathom why the button image can't be found.

Link to comment
Share on other sites

Hi Jon,

 

I have a trouble with this.

I am installing SPPC but I couldn't do it anymore because of Credit Classs & Gift Voucher.

 

This is includes/classes/shopping_cart.php

 

// products price

$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

if ($product = tep_db_fetch_array($product_query)) {

// ICW ORDER TOTAL CREDIT CLASS Start Amendment

$no_count = 1;

$gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

$gv_result = tep_db_fetch_array($gv_query);

if (ereg('^GIFT', $gv_result['products_model'])) {

$no_count = 0;

}

// ICW ORDER TOTAL CREDIT CLASS End Amendment

$prid = $product['products_id'];

$products_tax = tep_get_tax_rate($product['products_tax_class_id']);

$products_price = $product['products_price'];

$products_weight = $product['products_weight'];

 

$special_price = tep_get_products_special_price($prid);

if ($special_price) {

$products_price = $special_price;

}

 

$this->total_virtual += tep_add_tax($products_price, $products_tax) * $qty * $no_count;// ICW CREDIT CLASS;

$this->weight_virtual += ($qty * $products_weight) * $no_count;// ICW CREDIT CLASS;

 

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

$this->weight += ($qty * $products_weight);

}

 

 

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

This is SPPC file.

 

// products price

$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");

 

if ($product = tep_db_fetch_array($product_query)) {

$prid = $product['products_id'];

$products_tax = tep_get_tax_rate($product['products_tax_class_id']);

$products_price = $product['products_price'];

$products_weight = $product['products_weight'];

// BOF Separate Pricing Per Customer

/* $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");

if (tep_db_num_rows ($specials_query)) {

$specials = tep_db_fetch_array($specials_query);

$products_price = $specials['specials_new_products_price'];

} */

$specials_price = tep_get_products_special_price((int)$prid);

if (tep_not_null($specials_price)) {

$products_price = $specials_price;

} elseif ($this->cg_id != 0){

$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$prid . "' and customers_group_id = '" . $this->cg_id . "'");

if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {

$products_price = $customer_group_price['customers_group_price'];

}

}

// EOF Separate Pricing Per Customer

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

$this->weight += ($qty * $products_weight);

}

 

 

 

there are two $products_price. one is $special_price and the other $specials_price.

 

How should I use two contributions together?

can you please help me?

 

 

 

jay

Link to comment
Share on other sites

jay/aramsore,

How should I use two contributions together?

I think this combines the two contributions in this part of the code:

// products price
$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
if ($product = tep_db_fetch_array($product_query)) {
// ICW ORDER TOTAL CREDIT CLASS Start Amendment
$no_count = 1;
$gv_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
$gv_result = tep_db_fetch_array($gv_query);
if (ereg('^GIFT', $gv_result['products_model'])) {
$no_count = 0;
}
// ICW ORDER TOTAL CREDIT CLASS End Amendment
$prid = $product['products_id'];
$products_tax = tep_get_tax_rate($product['products_tax_class_id']);
$products_price = $product['products_price'];
$products_weight = $product['products_weight'];

/* original code
$special_price = tep_get_products_special_price($prid);
if ($special_price) {
$products_price = $special_price;
} // end of original code */

// BOF Separate Pricing Per Customer
$specials_price = tep_get_products_special_price((int)$prid);
if (tep_not_null($specials_price)) {
$products_price = $specials_price;
} elseif ($this->cg_id != 0){
$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$prid . "' and customers_group_id = '" . $this->cg_id . "'");
if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
$products_price = $customer_group_price['customers_group_price'];
} 
}
// EOF Separate Pricing Per Customer

$this->total_virtual += tep_add_tax($products_price, $products_tax) * $qty * $no_count;// ICW CREDIT CLASS;
$this->weight_virtual += ($qty * $products_weight) * $no_count;// ICW CREDIT CLASS;

$this->total += tep_add_tax($products_price, $products_tax) * $qty;
$this->weight += ($qty * $products_weight);
}

Link to comment
Share on other sites

Hey guys!

 

We have this mod installed and so far, so good :thumbsup:

However, we would like to be able to enable different payment methods based on the customer group.

 

For example, standard customers have to pay by credit card, but there is a certain group for who we would like to enable the option of cheque on delivery.

 

Have there been any mods that come close to this?

Link to comment
Share on other sites

For example, standard customers have to pay by credit card, but there is a certain group for who we would like to enable the option of cheque on delivery.

 

Have there been any mods that come close to this?

That was built-in in the last version... Doesn't show on admin/customers_groups.php ?
Link to comment
Share on other sites

Hi, I have Separate Pricing and Quantity Price Breaks up and running and have one little question that is hopefully easy for somebody here, but baffling to a php newbie...

 

On my homepage, I have buttons to click to various categories in the store. When I am logged in to an account, which is wholesale, and I click on those links, the store reverts to retail, because I don't have the url coded correctly.

 

Ive tried: <a href="index.php?cPath=32&osCsid=?"> but that doesn't work. Is there a way to code it to add the session so it's not lost?

 

Thanks and apologies if this is a really dumb question! :blush:

Janet

Link to comment
Share on other sites

Janet,

On my homepage, I have buttons to click to various categories in the store.  When I am logged in to an account, which is wholesale, and I click on those links, the store reverts to retail, because I don't have the url coded correctly.
Right, that is what the tep_href_link function is for (found in includes/functions/html_output.php ): function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)

 

In your case I think you need <a href="<?php echo tep_href_link("index.php", "cPath=32") ?> but I haven't tested it. The osC code should be full of this kind of links so there should be plenty of examples, e.g. in the code for the boxes.

Link to comment
Share on other sites

Janet,

Right, that is what the tep_href_link function is for (found in includes/functions/html_output.php ):  function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true)

 

In your case I think you need <a href="<?php echo tep_href_link("index.php", "cPath=32") ?> but I haven't tested it. The osC code should be full of this kind of links so there should be plenty of examples, e.g. in the code for the boxes.

 

As always JanZ, you are very kind and helpful! If I may, one clarification... I'm using STS templates, so the coding of my homepage is an html page. I'm assuming a php call would not work on that, but is there a way to do this using an include, or some other kind of call?

 

Thanks, and btw, my client is delighted with this contribution!

Janet

Link to comment
Share on other sites

Hi

I've just installed this contribution and it is exactly what i wanted.

Great work you have here.

 

However I am having trouble with the login / Account after installing and I don't know if this has been answered, but OSC sometimes doesn't recognized a user is signed in. and if you click on another link, it sometimes shows that user is signed in.

 

Am I missing some sort of codes / files? and is there a fix to this?

Thanks.

Link to comment
Share on other sites

I'm using STS templates, so the coding of my homepage is an html page.  I'm assuming a php call would not work on that, but is there a way to do this using an include, or some other kind of call? 
Yes, from what I read in the description of STS you got a real problem there. But surely you are not the first with that problem because if there are links and the osCsid gets lost, lots of people would empty their shopping cart by clicking on a link. You better search/ask about this in the STS thread. Maybe it can be done using the "eval" function when the template file is called (but don't me ask me how).
my client is delighted with this contribution!
That is good to hear :) Thanks.
Link to comment
Share on other sites

However I am having trouble with the login / Account after installing and I don't know if this has been answered, but OSC sometimes doesn't recognized a user is signed in. and if you click on another link, it sometimes shows that user is signed in.

 

Am I missing some sort of codes / files? and is there a fix to this?

This mod really doesn't do anything special to recognizing the customer when he is signed in, it solely relies on the regular osC code. How do you determine if a customer is signed in? Because when cookies are used the osCsid that is initially in the url then disappears, but that doesn't mean the customer is not logged-in anymore. The cookie thing is transparent to the user.

 

If you don't use cookies (so always use the osCsid in the url as GET parameter) and have links like Janet has above the osCsid gets lost and the customers looses the items in his shopping cart. That would be a good way to test it: put something in the shopping cart before and after logging in and click around to see if you loose the shopping cart.

Link to comment
Share on other sites

Yes, from what I read in the description of STS you got a real problem there. But surely you are not the first with that problem because if there are links and the osCsid gets lost, lots of people would empty their shopping cart by clicking on a link. You better search/ask about this in the STS thread. Maybe it can be done using the "eval" function when the template file is called (but don't me ask me how).

 

JanZ, you did it again! :thumbsup: Here's how I changed the url in the STS template:

 

from: <a href="index.php?cPath=34&osCsid=319443d4c6c8bb2963d08da7fab3afd7">

 

to: <a href="index.php?cPath=34&$sid">

 

The &$sid is the tag that calls the session id. You gave me just enough to set me on the right track. Many many thanks. It's all working now. :)

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