Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Need Different Payment Options for wholesale and retail

Need Different Payment Options for wholesale and retail

Locked

Views: 2,917

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
13 Dec 2009, 4:16 PM
#1
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Need Different Payment Options for wholesale and retail

Hello,
Not even sure if I made the title to this thread correct, therefore, please be patient as I explain what I need. Currently, I have a shop that requires a wholesale side and retail side. I installed the wholesale module but can't use it due to the store owner wanting to apply a total order discount tier for wholesalers instead of per item amount as the wholesale module requires. No problem...I applied group discounts for the wholesaler accounts and applied retail discounts per amount of order.

Now I find out the wholesaler accounts have 30 days to pay and not taking full payment when wholesale order is placed.
So in essence...I need to either enable the wholesale module using a percentage off per order or disable instant payment options at the time of check-out.

How can I make only one payment option show up for wholesalers while all payment options will show for a retail customer? Keep in mind, the store owner will have to create account for wholesaler and then issue the login information to them.

Any and all ideas or help with this will be deeply appreciate!
Thanks,
Pkat

13 Dec 2009, 5:15 PM
#2
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

After looking at the post I made above and re-checking...here is a simple question on what I need:

I have the Offsite payment module installed and we'll be using PayPal Pro and money orders.

How do I make wholesale accounts show only the Offsite Payment option and the retail accounts to show paypal pro or money order?

This will solve my issues

What do I need to add in what module??

Thanks!

14 Dec 2009, 4:41 AM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

What distinguishes the wholesale from retail customers?

You can control the Payment Modules by controlling the $this->enabled ...

For example, let's say I want to NOT show the Payment Module for Check/Money Order moneyorder and not show it when customers_id is set to customers_id 123 ...

After this line:

      $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);

could be added the code:

if ($_SESSION['customer_id'] == 123) {
  $this->enabled = false;
}

Now, if customers_id were checking out, then they would not see the Checks/Money Order moneyorder Payment Module ...

The same thing can be done with many "identifiers" in an IF statement to control when the Payment Modules does not show, despite the fact that it is installed and meant to normally run ...

14 Dec 2009, 11:39 AM
#4
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

Ok. I decided to take the money order module off and add this payment option to offsite payment. How would I place the code?

To distinguish a wholesaler from a retailer: Wholesalers will be assigned a **group ** quantity level of Silver Discount - Level 1 45.00%; Gold Discount - Level 2 50.00%; Platinum Discount - Level 3 55.00%; Maximum Discount - Level 4 62.00% .

Retailers are assigned a price level discount for dollars spent inside store.

I had to set up this way because the wholesaler module does not configuring as a total order discount...instead it operates from a per item wholesale price level.

How would I enter the above discounts in the offsitepayment.php file? Here is the code from the file:

  if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_OFFSITEPAYMENT_ZONE > 0) ) {
    $check_flag = false;
    $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_OFFSITEPAYMENT_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
    while (!$check->EOF) {
      if ($check->fields['zone_id'] < 1) {
        $check_flag = true;
        break;
      } elseif ($check->fields['zone_id'] == $order->billing['zone_id']) {
        $check_flag = true;
        break;
      }

Thanks so very much!

17 Dec 2009, 2:44 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

To distinguish a wholesaler from a retailer: Wholesalers will be assigned a group quantity level of Silver Discount - Level 1 45.00%; Gold Discount - Level 2 50.00%; Platinum Discount - Level 3 55.00%; Maximum Discount - Level 4 62.00% .

I would really need to know what these values are ...

Are you wanting the Wholesalers to see this Off Site Payment module?

When a wholesaler is on site, I am assuming they either have a discount group that they are in or they don't ...

There has to be a variable of some sort that is set to a specific value or values to mark that the customer is a wholesaler ...

Just like I used $_SESSION['customer_id'] in the example IF statement ... there should be some "other" variable for the wholesaler to mark them as a "wholesaler vs retail customer" ...

17 Dec 2009, 3:04 AM
#6
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

Thanks Linda...but that's the issue here. Store owner does not want a wholesale price per item (and I really it in order to set the darn thing up correctly using the wholesale mod) therefore, the only values I can give is the order total giving discounts of 45% for level 1; 50% for level 2; 55% for level 3; 62% for level 4.

Yes, wholesalers are the only ones that will use the offsite payment module and invoice module.

Retailers will only have the paypal pro options. Sorry I can't give exact prices for the discounts. That is why I had to use group discounts for this site.

I hope this helps...if not I don't know what to do here. Why the heck people want to be difficult?? You try to explain WHY you need things done in certain ways, but NOOOO...thats just not the way it goes! :no:

17 Dec 2009, 3:42 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

Level 1 - 4 get the discount based on their assigned Level ...

To obtain the assigned level, there is a variable set ...

The mystery here is the "variable" that changes the Levels for the Discount ...

By knowing that "variable" then it can be used to turn on and off the various modules ...

Just like each customer gets a:
$_SESSION['customer_id']

set when they are logged in, each customer has "something" set for this "Discount Group Level" ...

17 Dec 2009, 4:02 AM
#8
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

So...in other words I have to get a dollar amount in order to do this? Wow...that's gonna be fun. :frusty:

17 Dec 2009, 3:41 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

No ... you don't ...

You need someone to go into your site and look at your code/databases and figure out how the customers are setup to determine who is wholesale and who is retail and then write this into the modules ...

You either have a new field in the customers table or you are using the group_pricing or something ...

Once this is found, it can be written into your module(s) to control them based on which customer type is logged in ...

17 Dec 2009, 4:43 PM
#10
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

I can look if you tell me where.

I am using the Group Pricing to set the discounts for wholesalers and then assign a wholesale level (1 through 4) to each wholesaler account.

If left at 0, this is for retailers.

17 Dec 2009, 5:06 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

Okay that helps ...

It sounds as if when the customer has groups_id of 0, then this is a Retail Customer ...

If that is the case, then you can test for the customer's Group ID with:

$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");

Now the variable:
$group_query->fields['customers_group_pricing']

will contain the current customers group id that is in the customers table ...

You can check this by going into phpMyAdmin and browse the customers table and see what value is in the field:
customers_group_pricing

and if Retail Customers are set to 0 and wholesale customers have values other than 0 ...

17 Dec 2009, 5:59 PM
#12
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

Group pricing is:

group_id 1, 2, 3, 4

17 Dec 2009, 7:15 PM
#13
perkiekat avatar

perkiekat

Zen Follower

Join Date:
Aug 2009
Location:
Carmi, IL
Posts:
354
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

ok. What code would I place in there so the Offsite and Paypal payment options will not show for wholesale accounts?

All I need is the Invoice Payment Option for wholesale when they get ready to complete the order. Not going to use the Money Order option.

Thanks!!

17 Dec 2009, 10:35 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

Above this line:

if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_OFFSITEPAYMENT_ZONE > 0) ) {

You would add the test to only show the Off Site Payment module will only show for Retailers ...

If the Retailers have the value of 0 set on the field:
customers_group_pricing

in the customers table, then you can use:

$group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");

if ($group_query->fields['customers_group_pricing'] > 0) {
  $this->enabled = false;
}

and this will turn OFF the payment module if the customers table has the field customers_group_pricing with a value greater than 0 ...

28 Dec 2009, 12:50 AM
#15
lunabug avatar

lunabug

New Zenner

Join Date:
Dec 2009
Posts:
94
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

This is great... i want my wholesale customers to be able to send me a check. Here's what I've done, please confirm it's right:

First I set the Check/Money order option to true in the Admin section, then I added the following (in red) code to the moneyorder.php file

  $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);

if ($_SESSION['group_id'] != 1) {
$this->enabled = false;
}

28 Dec 2009, 2:06 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

By default, there is not a $_SESSION['group_id'] set ... do you set this somewhere in your code?

28 Dec 2009, 3:12 AM
#17
lunabug avatar

lunabug

New Zenner

Join Date:
Dec 2009
Posts:
94
Plugin Contributions:
0

Re: Need Different Payment Options for wholesale and retail

I realized that when this didn't work as planned. So what do I need to do to get this to work like I mentioned?

28 Dec 2009, 4:07 AM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Different Payment Options for wholesale and retail

If you look at the code I posted in post #14 to get the customers_group_pricing field from the customers table, you can use that to determine the customer's customers_group_pricing ...