Forums / General Questions / Discount to customers paying by cash or check

Discount to customers paying by cash or check

Locked

Started by audradh on 22 Jul 2006, 8:13 PM · Views: 2,583

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
22 Jul 2006, 8:13 PM
#1
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Discount to customers paying by cash or check

I would love to add a discount for a particular payment method. Anybody have any ideas about how to do such a thing?

Audra

22 Jul 2006, 9:35 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Discount to customers paying by cash or check

look in the old downloads, there is a module to do just that

Zen cart PCI compliant Hosting

23 Jul 2006, 12:07 AM
#4
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Discount to customers paying by cash or check

I have installed this mod and received this error when trying to checkout:

Call to a member function get_products() on a non-object in /home/naturew/public_html/tip_top/includes/modules/order_total/ot_payment.php on line 80

Here is the code surrounding line 80:

// Check if gift voucher is in cart and adjust total
    $products = $cart->get_products();
    for ($i=0; $i<sizeof($products); $i++) {
      $t_prid = zen_get_prid($products[$i]['id']);
      $gv_result = $db->Execute("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");

Guessing this has something to do w/ updated Zen code.

Any guesses?

Oh, I guess I should add that the error occurs during step two of the checkout process, Payment, under the heading Your Total.

Thanks!
Audra

23 Jul 2006, 1:01 AM
#5
audradh avatar

audradh

Zen Follower

Join Date:
Oct 2005
Location:
Eastern US
Posts:
429
Plugin Contributions:
0

Re: Discount to customers paying by cash or check

Oh, I don't care about Paypal. That was someone else who started this thread a while back.

I want to use this mod to give a discount to customers that pay by cash or check.

23 Jul 2006, 3:13 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Discount to customers paying by cash or check

audradh:

Oh, I don't care about Paypal. That was someone else who started this thread a while back.

(Moderator: All the more reason to start new threads, rather than change topics on old ones... ... splitting this discussion to a new topic...)

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

7 Feb 2007, 9:53 AM
#7
ronwong avatar

ronwong

Zen Follower

Join Date:
Jan 2006
Posts:
223
Plugin Contributions:
0

Re: Discount to customers paying by cash or check

audradh:

I have installed this mod and received this error when trying to checkout:

Call to a member function get_products() on a non-object in /home/naturew/public_html/tip_top/includes/modules/order_total/ot_payment.php on line 80

Here is the code surrounding line 80:

// Check if gift voucher is in cart and adjust total
$products = $cart->get_products();
for ($i=0; $i<sizeof($products); $i++) {
$t_prid = zen_get_prid($products[$i]['id']);
$gv_result = $db->Execute("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");

> 
> Guessing this has something to do w/ updated Zen code.
> 
> Any guesses?
> 
> Oh, I guess I should add that the error occurs during step two of the checkout process, Payment, under the heading Your Total.
> 
> Thanks!
> Audra

Was this ever resolved?
31 Mar 2007, 5:12 PM
#9
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Re: Discount to customers paying by cash or check

I have been running this module for about a year and actually using it to charge a surcharge for credit cards. I have only just discovered that it has a problem.

I get a similar error, it seems that this is old code adapted from OS Commerce.

I have only just got around to setting up Gift certificates and that's the only time I have found a problem with this order payment module. Here's my error:

Fatal error: Call to a member function on a non-object in /hsphere/local/home/waycool/waycool.com.au/includes/modules/order_total/ot_payment.php on line 92

I hope somebody can help with a fix because I can't get the gift certificates up and running until this is sorted.

Here is what I think is the offending code.

// Check if gift voucher is in cart and adjust total
$products = $_SESSION['cart']->get_products();
for ($i=0; $i<sizeof($products); $i++) {
$t_prid = zen_get_prid($products[$i]['id']);
$gv_result = $db->Execute("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'");
//$gv_result = zen_db_fetch_array($gv_query);

  if (ereg("^GIFT", addslashes($gv_result->fields['products_model']))) {
    $qty = $cart->get_quantity($t_prid);
    $products_tax = zen_get_tax_rate($gv_result->fields['products_tax_class_id']);
    if ($this->include_tax =='false') {
       $gv_amount = $gv_result->fields['products_price'] * $qty;
    } else {
      $gv_amount = ($gv_result->fields['products_price'] + zen_calculate_tax($gv_result->fields['products_price'],$products_tax)) * $qty;
    }
    $order_total=$order_total - $gv_amount;
  }

}

Cheers all,

Gruntre69

WayCool
Zen is Way Cool too!

31 Mar 2007, 5:16 PM
#10
gruntre69 avatar

gruntre69

Zen Follower

Join Date:
Aug 2005
Location:
Australia
Posts:
103
Plugin Contributions:
0

Re: Discount to customers paying by cash or check

Oh sorry, I forgot to say that this is line 92

$qty = $cart->get_quantity($t_prid);

Cheers all,

Gruntre69

WayCool
Zen is Way Cool too!