Forums / Built-in Shipping and Payment Modules / Flatrate only for group pricing

Flatrate only for group pricing

Views: 736

Results 1 to 4 of 4
25 Oct 2011, 9:51 AM
#1
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Flatrate only for group pricing

I have this code

  $chk_group = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
  if ($chk_group->fields['customers_group_pricing'] != 1 || $chk_group->fields['customers_group_pricing'] != 2)  {
    $this->enabled = false;
  }

But it doesn't work, I want the flatrate shipping to only be visible by people who are in group price groups 1 and 2.

If i can make it work, then also groups 3 and 4.

So basically, I want the flat rate shipping option to only be available to those who have group pricing.

25 Oct 2011, 9:54 AM
#2
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Re: Flatrate only for group pricing

Would it be easier to say disable if customer is not in a group pricing group

25 Oct 2011, 10:00 AM
#3
digitalshadow avatar

digitalshadow

Totally Zenned

Join Date:
Mar 2009
Posts:
616
Plugin Contributions:
0

Re: Flatrate only for group pricing

Solved it

// bof: Only for Discount Groups
if (!IS_ADMIN_FLAG) {
$chk_discount_group_sql = "SELECT customers_group_pricing FROM " . TABLE_CUSTOMERS . " WHERE customers_id = '" . $_SESSION['customer_id'] . "'";
$chk_discount_group = $db->Execute($chk_discount_group_sql);
if ($chk_discount_group->fields['customers_group_pricing'] == 0) {
$this->enabled = false;
}
}
// eof: Only for Discount Groups

25 Oct 2011, 2:17 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Flatrate only for group pricing

Thanks for the update that you have this working now and for posting your solution to the problem ... :smile:

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!