Zen Cart Logo
Forums / All Other Contributions/Addons / customers.php correction for group pricing mod

customers.php correction for group pricing mod

Locked

Views: 947

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
12 Nov 2008, 4:27 PM
#1
r_nato avatar

r_nato

New Zenner

Join Date:
Aug 2008
Posts:
41
Plugin Contributions:
0

customers.php correction for group pricing mod

hopefully nobody else has already posted this...

In store/admin/customers.php

the following conditional, around line 880:

if(in_array($group_array_query->fields['group_name'], array(GROUP_PRICE_PER_ITEM1, GROUP_PRICE_PER_ITEM2, GROUP_PRICE_PER_ITEM3, GROUP_PRICE_PER_ITEM4))) {
        $group_array[] = array('id' => $group_array_query->fields['group_id'], 'text' => $group_array_query->fields['group_name'] . ' ' . GROUP_PRICE_PER_ITEM_TEXT);
      } else {
        $group_array[] = array('id' => $group_array_query->fields['group_id'], 'text' => $group_array_query->fields['group_name'].' '.$group_array_query->fields['group_percentage'].'%');
      }

the 'true' and 'false' lines are flip-flopped, so that when you go look at a customer's group pricing (say, if you want to change it in admin), the drop-down menu shows, "GROUP_PRICE_PER_ITEM_TEXT" instead of the percentage if it exists.

the conditional should instead read as follows:

if(in_array($group_array_query->fields['group_name'], array(GROUP_PRICE_PER_ITEM1, GROUP_PRICE_PER_ITEM2, GROUP_PRICE_PER_ITEM3, GROUP_PRICE_PER_ITEM4))) {
        $group_array[] = array('id' => $group_array_query->fields['group_id'], 'text' => $group_array_query->fields['group_name'].' '.$group_array_query->fields['group_percentage'].'%');
      } else {
        $group_array[] = array('id' => $group_array_query->fields['group_id'], 'text' => $group_array_query->fields['group_name'] . ' ' . GROUP_PRICE_PER_ITEM_TEXT);
      }

you might also want to declare a define for GROUP_PRICE_PER_ITEM_TEXT, the mod as it is, I don't think it adds that define in the appropriate file (english.php?).