Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Discount Coupon Applicable for Regular Price Item Only?

    I figured, that following SQL gives me what I need to know:

    select sum(products_quantity*final_price*(products_tax/100+1)) as sum from zen_orders_products where orders_id=27 and orders_products_id in (select orders_products_id from zen_orders_products_attributes where orders_products_id in (select orders_products_id from zen_orders_products where orders_id=27) and Products_options='Tyyppi' and product_attribute_is_free=1);

    So, basically that SQL gives me the sum-value of the products ordered, where I want to apply group discount. ie. those products have been selected with certain attributes by purchaser.

    in ot_group_pricing.php I found following line:

    $discount = ($order_total - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;

    Now, the only thing what I seem to need to do is to replace $order_total with the output of my SQL clause.

    The only last problem is that I am not able figure out which variable contains the orders_id in ot_group_pricing.php

    Ideas?

  2. #2
    Join Date
    Jul 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Discount Coupon Applicable for Regular Price Item Only?

    Anybody interested, this is what I did, and it works: (for me)

    Code:
    // Mod - start
    // $discount = ($order_total - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
    
    $normals = $db->Execute("select sum(p.products_price*b.customers_basket_quantity) as sum from zen_customers_basket b, zen_products p where b.products_id in (select ba.products_id from zen_customers_basket_attributes ba where ba.customers_id='" . (int)$_SESSION['customer_id'] . "' and ba.products_options_id=1 and ba.products_options_value_id=1) and p.products_id=substring_index(b.products_id,':',1);");
    
    $discount = ($normals->fields['sum'] - $gift_vouchers) * $group_discount->fields['group_percentage'] / 100;
    // Mod - end
    What I wanted, is 10% discount given on products, which have certain attribute name and certain attribute value.
    Above hardcoded mod inserted into ot_group_pricing.php and users in discount group, which has that 10% discount gives the desired results.

    This effectively disables normal group discount system and may break something else as well ... But serves the purpose for me

  3. #3
    Join Date
    Apr 2006
    Posts
    32
    Plugin Contributions
    0

    customer issue Re: Discount Coupon Applicable for Regular Price Item Only?

    So what you are saying is that if I have specials and on top of that a coupon/discount/newcustomer then I would be applying the discount on top of the specials?


    So your option removes this? Did anything break?

  4. #4
    Join Date
    Jul 2007
    Posts
    13
    Plugin Contributions
    0

    Default Re: Discount Coupon Applicable for Regular Price Item Only?

    This mod has an effect only on the group discount module, other modules should operate as normal.

    I have not noticed any unwanted behaviour because of this.

 

 

Similar Threads

  1. Discount coupon for one item confusion
    By RobWUK in forum General Questions
    Replies: 2
    Last Post: 25 Nov 2011, 12:16 AM
  2. Discount Price per item with Free Shipping with Coupon Code?
    By JRayfield in forum Setting Up Specials and SaleMaker
    Replies: 9
    Last Post: 2 Mar 2010, 03:15 PM
  3. Coupon for only one item. and only for people I tell
    By replicapropscom in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 29 Jun 2009, 03:50 PM
  4. Discount price shown as regular price
    By TomCZ in forum General Questions
    Replies: 3
    Last Post: 24 Jan 2008, 02:36 PM
  5. coupon for specific item only?
    By w2e in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 9 Nov 2007, 07:41 AM

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