Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

thank Jan.

 

Now that we are at v. 4.1.1 and it seems that v. 4.1 is not being released onto the contributions page, what do you think about starting a brand new thread titled "SPPC 4.1" and making the first post contain a link to the zip file (either to Marvin's external host or, in the event that the osC team allow 4.1 zip onto the contributions area, a link to the contribution page). Just as SPPC has been totally revised, so too would the discussion thread.

 

the second post could be a precis of the outstanding issues that you are answering from this thread.

 

finally a large and bold post in this thread could direct people to post in the new 4.1 forum.

 

Pesonally, I find it a little weird that we are discussing 4.x issues in a thread labelled 3.5. Besides which, I suspect that we will end up having posts like the two above every few pages. marvins post with the link is just getting buried in 34 pages of posts. No one new to this thread really knows exactly where to start reading.

Share this post


Link to post
Share on other sites

i am getting error

 

access denied when i try to open link

 

www.mydomain/admin/customers_groups.php

 

all the register gloabals settings are okay

 

but still getting error for register_gloabals

 

what could be the problem

Share this post


Link to post
Share on other sites
Yiannis,

 

This is an example how you could show a list price. Of course you might want to put this in another spot, another font etc. The below code is a replacement for

 

:D Thank you JanZ it works perfectly. I will try to make it work with special prices also but it might be difficult for my programming skills. I hope I will succeed. :rolleyes:

Share this post


Link to post
Share on other sites

pushkraj,

what could be the problem
Perhaps the webserver is not allowed to read the file (permission settings are not OK?).

Share this post


Link to post
Share on other sites

Hey,

 

I'm not if this is a SPPC problem or not, but it appears on the customers page, so i'll post here and see wat u guys say.

 

Ok, when i go onto customers.php in admin panel, it displays the following error:

 

Warning: array_merge() [C:\apache2triad\php\manual\function.array-merge.html]: Argument #1 is not an array in C:\apache2triad\htdocs\oscom\admin\customers.php on line 1056 Warning: array_merge() [C:\apache2triad\php\manual\function.array-merge.html]: Argument #2 is not an array in C:\apache2triad\htdocs\oscom\admin\customers.php on line 1058 Warning: reset() [C:\apache2triad\php\manual\function.reset.html]: Passed variable is not an array or object in C:\apache2triad\htdocs\oscom\admin\includes\classes\object_info.php on line 17 Warning: Variable passed to each() is not an array or object in C:\apache2triad\htdocs\oscom\admin\includes\classes\object_info.php on line 18

 

Any Ideas?

 

Cheers

Fatmcgav

Share this post


Link to post
Share on other sites

Probably these two lines:

        $customer_info = array_merge($country, $info, $reviews);

       $cInfo_array = array_merge($customers, $customer_info);

Weird error.

 

Did you manually change that page, or did you replace the customers.php page? If you did it manually, you could try replacing the page, if it were only to see if the error goes away.

Share this post


Link to post
Share on other sites
Probably these two lines:

        $customer_info = array_merge($country, $info, $reviews);

       $cInfo_array = array_merge($customers, $customer_info);

Weird error.

 

Did you manually change that page, or did you replace the customers.php page? If you did it manually, you could try replacing the page, if it were only to see if the error goes away.

The only difference in the code between the two files, is that i've removed a few </tr> and </td> tags which seems to be out of place.

 

Tis a strange error, had it on a diff contrib a while back, think it was somet about array_merge not being valid in php4.x or similar, also had a fix for it, but i cant find it now :)

 

Any ideas ppl?

 

Cheers

Fatmcgav

Share this post


Link to post
Share on other sites
The only difference in the code between the two files, is that i've removed a few </tr> and </td> tags which seems to be out of place.

 

Tis a strange error, had it on a diff contrib a while back, think it was somet about array_merge not being valid in php4.x or similar, also had a fix for it, but i cant find it now :)

 

Any ideas ppl?

 

Cheers

Fatmcgav

Ah, i think i've found the problem. It looks like the user account is not correct, or atleast the details in the db arent, and thats wat's causin the error. I just created another account, and that worked fine, no error displayed.

 

Very strange though.

 

Thanks anyways.

 

Fatmcgav

Share this post


Link to post
Share on other sites
i am getting error

 

access denied when i try to open link

 

www.mydomain/admin/customers_groups.php

 

all the register gloabals settings are okay

 

but still getting error for register_gloabals

 

what could be the problem

 

check that you have the closing "}" before the "?>".

 

 

see below:

} else {
     echo tep_draw_checkbox_field('sppcoption[' . $customers_group['customers_group_id'] . ']', 'sppcoption[' . $customers_group['customers_group_id'] . ']', true) . ' ' . $customers_group['customers_group_name'];
     }
?>
 </td>
      <td class="main"><?php

Edited by ausipodskins

Share this post


Link to post
Share on other sites
Tis a strange error, had it on a diff contrib a while back, think it was somet about array_merge not being valid in php4.x or similar, also had a fix for it, but i cant find it now
Could be that it is indeed a PHP5 issue. According to the php website something did change:

 

The behavior of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array. However, you can use typecasting to merge other types. See the example below for details.
I just don't think it applies in this case, because if I "print" those variables it shows they are arrays.

 

So the page that was in the contrib works?

Share this post


Link to post
Share on other sites

Piquet,

Now that we are at v. 4.1.1 and it seems that v. 4.1 is not being released onto the contributions page,  what do you think about starting a brand new thread titled "SPPC 4.1" and making the first post contain a link to the zip file (either to Marvin's external host or, in the event that the osC team allow 4.1 zip onto the contributions area, a link to the contribution page).  Just as SPPC has been totally revised, so too would the discussion thread.

In hindsight we should have done that with the release of 4.0, when Marvin posted the screen shots, I think. Personally, I feel it is too late for that now. It would happen that you have to refer to the "old" thread if someone asks for something that has already be done, e.g..

 

Just my two cents...

Share this post


Link to post
Share on other sites

Yiannis,

I will try to make it work with special prices
I assume you meant that you also want to show the special price is there is one for the retail customers. That takes a lot more code. An example below. First add a new function to the bottom of the page:

</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php');

 function tep_get_p_specials_prices($product_id) {
// For Separate Pricing Per Customer, to acquire all special prices

   $product_query = tep_db_query("select specials_new_products_price, customers_group_id from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status ='1'"); 
   while ($_product = tep_db_fetch_array($product_query)) {
   $product[] = $_product;
   }
   return $product;
 }
?>

Then the code as shown on the previous page would be:

  } else {
// BOF Separate Pricing Per Customer
   $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_price as list_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd 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 . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
   
// replace the next query for the specials price for a customer group for one that collects all of them
// for this product_id
//    if ($new_price = tep_get_products_special_price($product_info['products_id'])) {

   $all_special_prices = tep_get_p_specials_prices($product_info['products_id']);

  for ($x = 0; $x < count($all_special_prices); $x++) {
   if ($all_special_prices[$x]['customers_group_id'] == $customer_group_id ) { 
    $cg_specials_price = $all_special_prices[$x]['specials_new_products_price'];
   }
   if ($all_special_prices[$x]['customers_group_id'] == '0' ) { 
    $specials_retail_price = $all_special_prices[$x]['specials_new_products_price'];
   }
  } // end for ($x = 0; $x < count($all_special_prices); $x++;)

      $scustomer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id']. "' and customers_group_id =  '" . $customer_group_id . "'");
       if ($scustomer_group_price = tep_db_fetch_array($scustomer_group_price_query)) {
       $product_info['products_price']= $scustomer_group_price['customers_group_price'];
}
$products_price = '';

  if ($customer_group_id == '0') {
       if (tep_not_null($cg_specials_price)) {
$products_price .= '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($cg_specials_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
       } else {
$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
       }
  } else { // end if ($customer_group_id == '0')
     $products_price = '<span class="smallText">List Price: ';
     if (tep_not_null($specials_retail_price)) {
      $products_price .= '<s>' . $currencies->display_price($product_info['list_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($specials_retail_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span></span><br />';
     } else {
     $products_price .= $currencies->display_price($product_info['list_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
     $products_price .= '</span><br>'; // customer group prices on the next line end of small text for retail prices
     }
     if (tep_not_null($cg_specials_price)) {
$products_price .= '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($cg_specials_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
     } else {
$products_price .= $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }
} // end else , $customer_group_id !='0'  
// EOF Separate Pricing Per Customer, specials code

Share this post


Link to post
Share on other sites
Piquet,

In hindsight we should have done that with the release of 4.0, when Marvin posted the screen shots, I think. Personally, I feel it is too late for that now. It would happen that you have to refer to the "old" thread if someone asks for something that has already be done, e.g..

 

Just my two cents...

 

It's never too late to tidy up.

 

Personally I think that the advantages will outweigh the disadvantages. either way. if you need to link to a previous post, the effort is the same. And the main advantage is that new users of the contribution don't get lost in 35 pages of posts trying to figure out where 4.0 starts. You could even make a link from the new thread to the point in the old one where 4.0 begins so that if people want to read about it, they now where to start.

 

I'll see your 2c and raise you 2c :rolleyes: :-" but it's your call. Please do give it some further thought. I'm happy to construct the opening post and then email it to you or Marvin so that you can fine tune it as you see fit and have the honour of opening the thread. I'll stop pushing now. LOL

Share this post


Link to post
Share on other sites

Hi Jan, I have another glitch. I am hoping you might point me to the correct place for me to see what is missing.

 

My problem is that for my wholesale customer group (I'm only using two groups at the moment - wholesale and retail), they can't progress in the checkout past the first page - "Delivery Information". when the "continue" button is pressed, the page simply refreshes itself. for the customer group "retail" there is no such problem and they progress to the next page in the checkout process.

 

sounds like I am missing some lines of code but I'm not sure where to look.

Share this post


Link to post
Share on other sites

Product Specials are not cooperating.

The "Special" price is shown in the product listing and the Customer Specific Price is slashed out. In this case, the special is only for the retail group but it shows up in another group.

 

Any ideas?

 

The price shown in the product_info.php page is the normal price but the customer specific price gets sent to the shopping cart. Why is the visible price the wrong one but the Customer Specific price gets sent to the cart?

 

Could they be related?

 

 

BTW: I love this contribution!!! :rolleyes:


Sam M. - Seattle

Share this post


Link to post
Share on other sites

Ever since I installed this Contribution I noticed that when a user is logged in and there ARE specials active:

 

1. The Specials Box does not show up.

2. Nothing displays on the specials.php page.

3. Products that are on special do not show up as so on their product page.

 

 

Everything seems to function normally when users are not logged in. Anyone else have this problem?

 

Thanks,

Aaron

Share this post


Link to post
Share on other sites
Ever since I installed this Contribution I noticed that when a user is logged in and there ARE specials active:

 

1. The Specials Box does not show up.

2. Nothing displays on the specials.php page.

3. Products that are on special do not show up as so on their product page.

Everything seems to function normally when users are not logged in. Anyone else have this problem?

 

Thanks,

Aaron

 

 

Aaron/Royalfunk,

 

This seems very odd as I haved tested and installed SPPC 4.1 a number of times and all the osCom special features work perfect. Are you suing SPPC 4.1, as I know with older versions (SPPC 3.5) there were a number of issues with the specials. If possible I would suggest trying to install it again on a clean version of osCom, if you do this you will not have to make the manual changes to the PHP pages. Good Luck!

Share this post


Link to post
Share on other sites

Piquet,

My problem is that for my wholesale customer group (I'm only using two groups at the moment - wholesale and retail), they can't progress in the checkout past the first page - "Delivery Information".  when the "continue" button is pressed, the page simply refreshes itself.  for the customer group "retail" there is no such problem and they progress to the next page in the checkout process.

I have no clue really. That page seems to use a few classes (only includes/classes/order.php and shipping.php I think) so you could double check those. I don't have the problem on my test system though....

Share this post


Link to post
Share on other sites
Product Specials are not cooperating.

The "Special" price is shown in the product listing and the Customer Specific Price is slashed out. In this case, the special is only for the retail group but it shows up in another group.

 

Any ideas?

Sounds like the bug that was in 4.0. Did you download 4.1 or 4.1.1 and checked the bug fixes in changelog text?

 

The price shown in the product_info.php page is the normal price but the customer specific price gets sent to the shopping cart. Why is the visible price the wrong one but the Customer Specific price gets sent to the cart?
Prices in the shopping cart are checked independently from what is shown on the page. There was also a bug in product_info.php that not everybody was seeing (the test users and I never saw it for example). Picking up the customer_group_id was in a loop that was not traversed (but since register_globals is on, it usually meant that it was already added to the global variables so it didn't matter). You woud see the retail price in that case.

Share this post


Link to post
Share on other sites

Aaron,

Ever since I installed this Contribution I noticed that when a user is logged in and there ARE specials active:
The perfect explanation would be that there are no active specials for that customer group. But I guess you figured out already that you have to make specials active for each customer group for them to see it.

Share this post


Link to post
Share on other sites
Aaron, The perfect explanation would be that there are no active specials for that customer group. But I guess you figured out already that you have to make specials active for each customer group for them to see it.

 

 

JanZ,

 

Thanks! No, I didn't realize that now the Specials work that way but it totally makes sense. That is the best way for it to function with customer groups. That is what was causing my "problem".

 

NO Worries,

Aaron

Share this post


Link to post
Share on other sites

Also, I know this is probably very difficult to code and plan for, but it would be great to implement....

Percentage or dollar value specials across the board.

 

A couple customers of ours use over 30 customer groups, so putting products on special would take forever if all customers have access to the special. If there was a checkbox or option for "All Customer Groups" and a text field where you could enter a percentage or dollar number that would then be applied across the board - that would be awesome. Big time saver and very convenient. Just a thought...

 

 

-Aaron

Share this post


Link to post
Share on other sites

Aaron/ royalfunk,

 

Jan has allready come up with a % fix--- you just need to read the last few pages of the thread starting with this post http://forums.oscommerce.com/index.php?sho...ndpost&p=571539

 

Also, I know this is probably very difficult to code and plan for, but it would be great to implement....

Percentage or dollar value specials across the board.

 

A couple customers of ours use over 30 customer groups, so putting products on special would take forever if all customers have access to the special. If there was a checkbox or option for "All Customer Groups" and a text field where you could enter a percentage or dollar number that would then be applied across the board - that would be awesome. Big time saver and very convenient. Just a thought...

-Aaron

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×