Forums / Managing Customers and Orders / Bank transfer payment module for just one category?

Bank transfer payment module for just one category?

Views: 2,094

Results 1 to 4 of 4
16 Mar 2013, 1:22 PM
#1
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Bank transfer payment module for just one category?

Hi All!

i have enabled three type of payments.

paypal express for all countries

cod for hungary

i just uploaded eu standard bank transfer and would like to set this for all countries, incl. hungary but only for one type of category, like personalized gifts.

Is it possible? If yes , how?

When i set the other two methods (paypal, cod) , defined the zones so it went ok (till now it seems like ok...) But have no idea how to set for only one category.

thanks

Nandor

16 Mar 2013, 1:52 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Bank transfer payment module for just one category?

I do not know exactly how your Payment module is setup, but if you needed this customization to Check/Money Order moneyorder, you could change the code by adding the code in RED to the file:
/includes/modules/payment/moneyorder.php

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

[B]// bof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
  if (!IS_ADMIN_FLAG) {
    // check the count of a specific field
    $chk_cat = 0;
    // check how many Products are in the cart for master_categories_id 10 and 12
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','12');
    // if any are found turn off the shipping module
    if ($chk_cat != $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
  }
// eof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
[/B]
      if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) {

and only when the Shopping Cart contains Products with the master_categories_id 10 and/or 12 would the module show ...

If the content of the Shopping Cart is from any other master_categories_id values other than 10 and/or 12, the module would NOT show ...

See if you can't adapt it to your needs ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

16 Mar 2013, 3:06 PM
#3
nandor avatar

nandor

Zen Follower

Join Date:
Sep 2012
Posts:
104
Plugin Contributions:
0

Re: Bank transfer payment module for just one category?

Ajeh:

I do not know exactly how your Payment module is setup, but if you needed this customization to Check/Money Order moneyorder, you could change the code by adding the code in RED to the file:
/includes/modules/payment/moneyorder.php

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

[B]// bof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
if (!IS_ADMIN_FLAG) {
// check the count of a specific field
$chk_cat = 0;
// check how many Products are in the cart for master_categories_id 10 and 12
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');
$chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','12');
// if any are found turn off the shipping module
if ($chk_cat != $_SESSION['cart']->count_contents()) {
$this->enabled = false;
}
}
// eof: add extra control that when cart is NOT ALL master_categories_id 10 and 12 it will disable
[/B]

if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) {

> 
> and only when the Shopping Cart contains Products with the master_categories_id 10 and/or 12 would the module show ...
> 
> If the content of the Shopping Cart is from any other master_categories_id values other than 10 and/or 12, the module would NOT show ...
> 
> See if you can't adapt it to your needs ...


Hi!
I pasted it into the /includes/modules/payment/eustandardtransfer.php

rewrote it to master cat. id

 **// bof: add extra control that when cart is NOT ALL master_categories_id 4 it will disable
  if (!IS_ADMIN_FLAG) {
    // check the count of a specific field
    $chk_cat = 0;
    // check how many Products are in the cart for master_categories_id 4
    $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','4');
    // if any are found turn off the shipping module
    if ($chk_cat != $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
  }
// eof: add extra control that when cart is NOT ALL master_categories_id 4 it will disable
**

Now cash on delivery and bank trasnfer is allowed at all products but no paypal.
I have now three zones definitions : all countries, all countries for bank transfer and hungary
At payment methods : in cod zone hungary is chosen, in paypal all countries and in bank transfer all countries for bank transfer (and i pasted the code as instructed)
any ideas?
Maybe i set something somewhere wrong...

thanks in advance
Nandor
16 Mar 2013, 4:32 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Bank transfer payment module for just one category?

This code should only affect the one Payment module that you added this code to and not change how your other payment modules are working ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!