Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Products that can't be purchased with vouchers

    Is it possible - in any way - to have a set of products, that can't be purchased with gift vouchers only on the spot with "hard cash"? I.e. the checkout would recognize and abort, if attempted! Please humor me and don't dissect why I need it, just say if you think it's possible!

  2. #2
    Join Date
    Jul 2012
    Posts
    16,817
    Plugin Contributions
    17

    Default Re: Products that can't be purchased with vouchers

    Quote Originally Posted by kalastaja View Post
    Is it possible - in any way - to have a set of products, that can't be purchased with gift vouchers only on the spot with "hard cash"? I.e. the checkout would recognize and abort, if attempted! Please humor me and don't dissect why I need it, just say if you think it's possible!
    Thought that the gift vouchers could be assigned to apply or not apply to certain product...

    Would need to know what conditions are applying the gift voucher to the product(s) and what conditions need to exist to prevent the scenario undesired... How much of an abort are you looking for? Product to be removed from the cart and the rest of the purchase continue on? Return to the shopping cart? Return to elsewhere?

    Otherwise, yeah possible... Just about anything is...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Products that can't be purchased with vouchers

    The scenery would be as follows - no "abortion" needed. Just disable the gift voucher field, if this product (e.g. id = 15 or 16) is present. The situation is then: either the customer aborts the purchases or he pays with a credit card. There need not be any possibility to pay partially with vouchers - it's all or nothing.

  4. #4
    Join Date
    Mar 2010
    Location
    Finland
    Posts
    463
    Plugin Contributions
    0

    Default Re: Products that can't be purchased with vouchers

    Found the "credit_selection()"-function (includes/modules/order_total/ot_gv,php), where the following code seems to do the trick:
    Code:
     function credit_selection() {
        global $db, $currencies;
    
        //DTC->
        global $order;
        $level_purchase = false;
        for ($i = 0, $n = sizeof($order->products); $i < $n; $i++)  {
          $the_id = $order->products[$i]['id'];
          if ($the_id <= 5) $level_purchase = true;
        }
        if ($level_purchase) return $selection;
        //->DTC
        .......
    The credit_selection()-function already returns an unspecified $selection - so I just did the same....

    BTW: What is the use of the "zen_products_lookup()"-function used in other places? The "$order->products[$i]['id']" does the trick, doesn't it?

 

 

Similar Threads

  1. v150 Coming soon can be purchased, any add on to change that?
    By MamaDawn in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 21 Aug 2012, 01:45 PM
  2. Replies: 0
    Last Post: 14 Nov 2011, 07:49 PM
  3. Limit number of products that can be purchased
    By USONE in forum General Questions
    Replies: 3
    Last Post: 24 Aug 2010, 09:18 PM
  4. Products that can only be purchased once.
    By Youngblood in forum Setting Up Categories, Products, Attributes
    Replies: 16
    Last Post: 2 Jun 2010, 03:40 PM

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