Zen Cart Logo
Forums / General Questions / Is there Something Like This Available

Is there Something Like This Available

Locked

Views: 1,379

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
29 Jul 2008, 8:02 PM
#1
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Is there Something Like This Available

Hi All,
Before I go out an reinvent the wheel I figured I'd check here first.

I'm putting together a site for an old mail order and phone order company. They have a huge customer base with customer numbers. Now that they want to focus on the website we will need for customers to:

  1. Be able to enter their Customer number when registering.
  2. During checkout this customer number will be checked against an already populated customer # table in the db, if the number exists they will not be charged tax.

This rationale can also be used for shipping and other customer specific discounts but the tax free option is the most important right now.

The second part of this whole thing would also be the ability to view/add/edit/delete customer numbers.

I know it sounds like it's something that should be custom built but I was just wondering if there wasn't anything similar that I could modify.

I also know there's a tax module but this one requires the customer to first register then the admin has to set them to tax free. This is a hassle especially when clients are used to just calling in and placing their orders using their customer numbers.

Thanks

29 Jul 2008, 8:36 PM
#2
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

prosam:

The second part of this whole thing would also be the ability to view/add/edit/delete customer numbers.
From the Admin, I mean.

29 Jul 2008, 9:47 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is there Something Like This Available

A couple of alternatives and both require a bit of coding or DB work/savy...

Default - when a user registers they are given the next customer ID number....
These could be adjusted in the DB to be the current customer #

Alternate: Each registering customer's login is their email address by default and I believe there is some error trapping code to insure that a well formed email address is entered - - rewrite this to allow this to be a customer # instead

Either is viewable from the admin side with varying functionality

30 Jul 2008, 1:18 PM
#4
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

The first one sounds interesting but like you said it will require quite a bit of DB and coding. I'm not much of a coder, I just dabble in it. Design is my forte so I was hoping there was something I could just tweak. But I guess not. :(

30 Jul 2008, 1:39 PM
#5
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

But how bout this?

How easy would it be to include a tax exempt option into the coupon code generator? Cuz if that was an option we could just create a coupon code for every customer that they would enter at checkout. Then at the same time if a particular client is tax exempt plus gets free shipping it could be all tied into the coupon code. The we could rename the Discount Coupon box in the checkout to Customer # and instruct the clients to enter their number and boom it works.

I think this could work.

31 Jul 2008, 12:17 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Is there Something Like This Available

There are a couple of tax exempt modules in the downloads section and I would use one of them for the tax exempt status

31 Jul 2008, 1:55 PM
#7
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

Ok,
I have already installed THIS tax exempt module to the site and it works but like I said, we'd rather not want to go into each individual customer and set their tax exemption.

So I was looking at the code for this functionality and the DB changes it made and I think it's simple enough that it could be added to the coupon admin code as an option when creating coupons.

But I'm still a little worried that it might not compute, like in the post, when processing the coupon. Do you have any ideas or thoughts as to how to integrate two separate modules? What to look for so I don't break them or make sure it works.

Thanks in advance.

31 Jul 2008, 3:02 PM
#8
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

I've gone ahead and started integrating the module into the coupon_admin.php file

I added the customers_tax_exempt column to my coupons table in the DB and edited the coupon_admin.php file is attached.

Let me know if there's anything I need to change or if this will even work. I left the php comments in so it would be easy to find the edits.

31 Jul 2008, 6:23 PM
#9
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

That last file had a few bugs in it.

This one actually posts to the DB and saves all the information.

I still need help on getting that information to go into the checkout process.

Any help would really be appreciated.

1 Aug 2008, 2:37 PM
#10
prosam avatar

prosam

Zen Follower

Join Date:
Jun 2004
Posts:
118
Plugin Contributions:
0

Re: Is there Something Like This Available

Ok, now that the coupon_admin of it seems to be wroking I think we've got a solution to make it work during checkout.

Let me know if you think this would work.

  function get_order_total() {
    global  $order;
    if {
	$order_total = $order->info['total'];
    if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
    $orderTotalFull = $order_total;
    $products = $_SESSION['cart']->get_products();
    for ($i=0; $i<sizeof($products); $i++) {
      if (!is_product_valid($products[$i]['id'], $_SESSION['cc_id'])) {
        $order_total -= $products[$i]['final_price'] * $products[$i]['quantity'];        
      }
    }
    $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total);
    return $order_total;
	}
  }
	else {
	$order_total_tax = $order->info['tax'];
    $order_total = $order->info['total'];
    if ($this->include_shipping != 'true') $order_total -= $order->info['shipping_cost'];
    if ($this->include_tax != 'true') $order_total -= $order->info['tax'];
    $orderTotalFull = $order_total;
    $products = $_SESSION['cart']->get_products();
    for ($i=0; $i<sizeof($products); $i++) {
      if (!is_product_valid($products[$i]['id'], $_SESSION['cc_id'])) {
        $order_total -= $products[$i]['final_price'] * $products[$i]['quantity'];
        if ($this->include_tax == 'true') {
          $products_tax = zen_get_tax_rate($products[$i]['tax_class_id']);
         $order_total -= (zen_calculate_tax($products[$i]['final_price'], $products_tax))   * $products[$i]['quantity'];
        }
        $order_total_tax -= (zen_calculate_tax($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id'])))   * $products[$i]['quantity'];
      }
    }
    $order_total = array('totalFull'=>$orderTotalFull, 'total'=>$order_total, 'tax'=>$order_total_tax);
    return $order_total;
  }
  }

After the first if statement we need to say if coupon_tax_exempt in the coupons table = yes do this. BUt I'm not sure how to word it.