Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    47
    Plugin Contributions
    0

    Default Show payment for only specific group pricing customers

    Hello,

    I am trying to add group pricing groups for the specific payment.

    There would be some different customer groups in group pricing table (TABLE_GROUP_PRICING) (wholesaler, normal customer, gold customer, ...) and based on this data only the specific payment would be shown.

    Lets say only bank transfer payment for wholesaler, PayPal for normal customer and for gold customer etc.

    I am trying to enable that in the admin payment configuration.

    Currently I have a solution which works something like this

    $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function ,date_added) values ('Allowed customer group pricing for Bank transfer Payment:', 'MODULE_PAYMENT_BANK_TRANSFER_GROUP_PRICING', '2,3', 'Allowed group pricing status:<br />0 Default, 1 Wholesaler, 2 Normal, 3 Gold', '6', '14','zen_cfg_select_multioption(array(\'0\', \'1\', \'2\', \'3\'), ', now())");

    This values are now preselected.

    How can this be done with checkboxes (function zen_cfg_select_multioption) to show values from the database (TABLE_GROUP_PRICING) GroupID and group_name something similar like this zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now()) would be perfect.

    However function zen_cfg_pull_down_order_statuses works if only one option is selected, the requirement in my case is to have an option to chose multiple options...

    Thank you in advance for any solution, help or idea how can this be done.

  2. #2
    Join Date
    Dec 2004
    Posts
    47
    Plugin Contributions
    0

    Default Re: Show payment for only specific group pricing customers

    I have somehow managed a solution, but it is kinda crude.

    Mine current solution looks like this:

    function zen_cfg_select_multioption_group_pricing($key_value, $key = '') {
    global $db;
    $name = (($key) ? 'configuration[' . $key . '][]' : 'configuration_value');
    $key_payment_value = substr($key, 15, -14);
    $key_payment_value = "MODULE_PAYMENT_".$key_payment_value."_GROUP_PRICING";
    $group_id_array = array(array('id' => '0', 'text' => TEXT_DEFAULT));
    $configuration_value = $db->Execute("select configuration_value
    from " . TABLE_CONFIGURATION . "
    where configuration_key = '" . $key_payment_value . "'");
    $group_id_name = $db->Execute("select group_id, group_name
    from " . TABLE_GROUP_PRICING . "
    order by group_id");
    while (!$group_id_name->EOF) {
    $string .= '<input type="checkbox" name="' . $name . '" value="' . $group_id_name->fields['group_id'] . '"';
    $key_values = explode( ", ", $configuration_value->fields['configuration_value']);
    if ( in_array($group_id_name->fields['group_id'], $key_values) ) $string .= ' CHECKED';
    //$group_id_array[] = array('id' => $group_id_name->fields['group_id'],
    // 'text' => $group_id_name->fields['group_name'] . ' [' . $group_id_name->fields['group_id'] . ']');
    $string .= ' id="' . strtolower($group_id_name->fields['group_id'] . '-' . $name) . '"> ' . '<label for="' . strtolower($group_id_name->fields['group_id'] . '-' . $name) . '" class="inputSelect">' . $group_id_name->fields['group_name'] . '</label>';
    $group_id_name->MoveNext();
    }
    $string .= '<input type="hidden" name="' . $name . '" value="--none--">';
    return $string;
    }

 

 

Similar Threads

  1. v150 Help with Minimum Order for Group Pricing Customers Only
    By philip937 in forum General Questions
    Replies: 5
    Last Post: 14 Oct 2013, 03:55 AM
  2. Flatrate only for group pricing
    By DigitalShadow in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 25 Oct 2011, 03:17 PM
  3. Disallowing Coupons for Group Pricing Customers?
    By dtakle in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 2
    Last Post: 9 May 2010, 09:22 PM
  4. Free Standard Shipping only for Customers who DO NOT receive Group Discount Pricing?
    By lauriek in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 28 Aug 2009, 02:19 PM
  5. Category of products for specific group only?
    By GoldBooks in forum Managing Customers and Orders
    Replies: 1
    Last Post: 10 Mar 2009, 06:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •