Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Idea or Suggestion Enable only certain payment/shipping methods for wholesale/retail customers

    Received this via PM (please always ask questions in the forum so everyone can benefit):

    Quote Originally Posted by PM_SENDER
    Hi,

    I'm about to install Dual Pricing on zen cart store to have one group of retail customers and one group of wholesalers with different product prices..

    The problem is that I'd like to offer only some shipping options and payments options to wholesalers.
    In this thread https://www.zen-cart.com/showthread....ther-questions

    I see that you have an add-on for table shipping module.
    I'd like to modify other modules (and payment modules) adding to them some code to run a check at the beginning based on the fact that $_SESSION['customer_whole'] is 0 for customers and 1 for wholesalers in Dual Pricing.

    The problem is that I'd not know how to set that check.
    Could you please help me with the code?

    Thank you very much,
    PM_SENDER
    The way I would do this would be to modify the includes/modules/payment/ or includes/modules/shipping/ files.


    I'll use money order payment method for the example:

    Change something like:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true false); 
    if enabling for wholesale customers ONLY:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True' && $_SESSION['customer_whole'] == 1) ? true false); 
    or for retail ONLY:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True' && $_SESSION['customer_whole'] != 1) ? true false); 
    **NOTE how it is != 1 versus == 0**

  2. #2
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Hi, thank you very much for your help!
    I'm having some issues implementing your solution with freeoptions shipping module.

    In fact, if I change the PHP code:
    PHP Code:
    if (zen_get_shipping_enabled($this->code)) {
              
    $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True') ? true false); 
    to this:
    PHP Code:
          if (zen_get_shipping_enabled($this->code)) {
              
    $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True' && $_SESSION['customer_whole'] != 1) ? true false); 
    Thoe module is never displayed to any type of customer and in addition, it is not showed in the admin>modules>shipping
    What is wrong?

    Thank you

  3. #3
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Hi, I fixed it moving position of the statement. Thank you.

  4. #4
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Hi,

    I'd like to set a minimum order value to proceed checkout (let's say $200) only for wholesaler, not for regular customers.
    I think that your code already used for shipping methods would be a starting point for this.

    Do you have any idea of the code and where to put it?
    The need is to either don't show any checkout button or whatever is easier to wholesalers whose order is less than $200.

    Thank you very much for your help.

    Quote Originally Posted by bislewl View Post
    Received this via PM (please always ask questions in the forum so everyone can benefit):



    The way I would do this would be to modify the includes/modules/payment/ or includes/modules/shipping/ files.


    I'll use money order payment method for the example:

    Change something like:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true false); 
    if enabling for wholesale customers ONLY:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True' && $_SESSION['customer_whole'] == 1) ? true false); 
    or for retail ONLY:
    PHP Code:
    $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True' && $_SESSION['customer_whole'] != 1) ? true false); 
    **NOTE how it is != 1 versus == 0**

  5. #5
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Quote Originally Posted by ilmarchez View Post
    Hi,

    I'd like to set a minimum order value to proceed checkout (let's say $200) only for wholesaler, not for regular customers.
    I think that your code already used for shipping methods would be a starting point for this.

    Do you have any idea of the code and where to put it?
    The need is to either don't show any checkout button or whatever is easier to wholesalers whose order is less than $200.

    Thank you very much for your help.
    You can use this module and then modify for wholesale
    https://www.zen-cart.com/downloads.php?do=file&id=402

  6. #6
    Join Date
    Aug 2009
    Posts
    128
    Plugin Contributions
    0

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Thank you. How should I modify the code of the module to have it applying the minimum order condition only to wholesale?

    Thanks again for all.

    Quote Originally Posted by bislewl View Post
    You can use this module and then modify for wholesale
    https://www.zen-cart.com/downloads.php?do=file&id=402

  7. #7
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Enable only certain payment/shipping methods for wholesale/retail customers

    Quote Originally Posted by ilmarchez View Post
    Thank you. How should I modify the code of the module to have it applying the minimum order condition only to wholesale?

    Thanks again for all.
    Change lines like these:

    PHP Code:
    if ($_SESSION['cart']->count_contents() > && MIN_FIRST_ORDER_AMOUNT 0) { 
    to
    PHP Code:
    if ($_SESSION['cart']->count_contents() > && MIN_FIRST_ORDER_AMOUNT && $_SESSION['customer_whole'] == 1) { 
    and

    PHP Code:
    if($_SESSION['cart']->show_total() < MIN_FIRST_ORDER_AMOUNT) { 
    to
    PHP Code:
    if($_SESSION['cart']->show_total() < MIN_FIRST_ORDER_AMOUNT && $_SESSION['customer_whole'] == 1) { 
    That should only flag orders that are wholesale... where $_SESSION['customer_whole'] == 1

 

 

Similar Threads

  1. v154 Different shipping rates for retail vs wholesale customers?
    By Seanobr88 in forum Customization from the Admin
    Replies: 11
    Last Post: 17 Mar 2016, 07:17 PM
  2. v151 Only allow certain shipping methods for some countries?
    By doooomed in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 1 Oct 2013, 12:30 AM
  3. Is it possible to enable free shipping for only a certain customer group?
    By green couch designs in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 19 Apr 2011, 04:35 PM
  4. Is it possible to enable a shipping method for only a certain customer group?
    By sacotechnology in forum Built-in Shipping and Payment Modules
    Replies: 37
    Last Post: 26 Dec 2010, 06:52 PM
  5. Wholesale Price Only, Items Show as $0 For Retail
    By clifford in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 20 Jun 2007, 03:05 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR