Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    5
    Plugin Contributions
    0

    Default Combining product quantities for volume discount

    I've seen this question asked before in the past, and the answer was "no". I apologize in advance for bringing it up again, but I was hoping that someone had found a solution in the meantime.

    Is there a way to count different products' quantities for the Products Price Manager quantity discount?

    In my store, I have multiple products that I want to offer quantity discounts on. My customers expect to be able to mix-and-match some (but not all) products to meet the discount quantities. I like the format of discount that the Product Price Manager produces. The price schedule shows up in the product description and when quantities are met, the discounted unit prices show up in the shopping cart. I can also create different discount schedules for different products, which is important to protect me from over-discounting low margin products.

    But, Product Price Manager (PPM) won't combine different products' quantities.

    I can't combine my products into a single product differentiated by attributes, because the products have different attributes already. If I could get PPM to count quantities by category, I'd accept that, but I'd prefer a user definable discount class. I currently use different hierarchical categories to provide multiple navigation paths to products that are linked. A category-based quantity discount would require me to redo my category/product layout.

    I've tried the Quantity Discount Add-On Module, but it doesn't do what I'd like. It offers only one global discount schedule, does not show that schedule in the product description, does not show discounted unit prices (only a total discount amount), and (unless you pay extra), does not show the discount in the shopping cart. In order to get my customers to buy higher quantities, I need the discount to be more evident while they're purchasing. I also dislike how the add-on is implemented.

    I saw a virtuemart modification that changed the core code to count discount quantities by category rather than by product. Is something like that available for zencart? Better yet, is there a way to use some other tag (product metadata perhaps) to define the discount group?

    Thanks,
    Eric

  2. #2
    Join Date
    Jan 2011
    Posts
    5
    Plugin Contributions
    0

    Default Re: Combining product quantities for volume discount

    Ok, here is what I've come up with. I'm totally new to php programming, and zen cart programming, so I'm basically just copying what I've seen elsewhere, with changes based on a little browsing of the wiki. I may be barking up the wrong tree entirely. If there's a better way to do this, please point me to it.

    I've modified function in_cart_mixed_discount_quantity in file includes/classes/shopping_cart.php. I've changed
    PHP Code:
       // compute total quantity regardless of attributes
        
    $in_cart_mixed_qty_discount_quantity 0;
        
    $chk_products_idzen_get_prid($products_id);

        
    // reset($this->contents); // breaks cart
        
    $check_contents $this->contents;
        while (list(
    $products_id, ) = each($check_contents)) {
          
    $test_id zen_get_prid($products_id);
          if (
    $test_id == $chk_products_id) {
            
    $in_cart_mixed_qty_discount_quantity += $check_contents[$products_id]['qty'];
          }
        } 
    to:
    PHP Code:
        // compute total quantity regardless of attributes
        
    $in_cart_mixed_qty_discount_quantity 0;
        
    //!! $chk_products_id= zen_get_prid($products_id);
        
    $product $db->Execute("select products_id, master_categories_id from " TABLE_PRODUCTS " where products_id='" zen_get_prid($products_id) . "' limit 1");
        
    $chk_products_id$product->fields['master_categories_id'];

        
    // reset($this->contents); // breaks cart
        
    $check_contents $this->contents;
        
    reset($check_contents);
        while (list(
    $products_id, ) = each($check_contents)) {
          
    //!! $test_id = zen_get_prid($products_id);
          
    $product $db->Execute("select products_id, master_categories_id from " TABLE_PRODUCTS " where products_id='" zen_get_prid($products_id) . "' limit 1");
          
    $test_id$product->fields['master_categories_id'];
          if (
    $test_id == $chk_products_id) {
            
    $in_cart_mixed_qty_discount_quantity += $check_contents[$products_id]['qty'];
          }
        } 
    I've changed the count from products with the same id to products with the same master category id. It seems to work. I realize that it will only combine totals if the product has "Discount Qty Applies to Mixed Attributes" set to "yes", but I think that may be a good thing. If there's a product that I don't want to combine, all I have to do is change that setting to "No".

    Since it's checking the master category id, I think it will combine linked products based on the primary category, not the category that the customer used to navigate to them. Again, I think that's a good thing. It allows me to set up a category for products with combined discounts, and other categories that link those products for easier navigation.

    I'm slightly concerned that counting this way may result in quantity totals that exceed a product's maximum purchase quantity, but I don't see where that causes any problem.

    Again, I'm new at this, so I've probably overlooked something. If I missed any important points, or if there's a better way to do this, please let me know. I welcome any feedback.

    Regards,
    Eric

 

 

Similar Threads

  1. Discount groups and volume discount?
    By Mammoth in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Jun 2010, 11:21 PM
  2. Setting up Product Volume Discount
    By boukmn in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Aug 2008, 03:58 AM
  3. Volume Discount
    By tvmangum in forum Setting Up Specials and SaleMaker
    Replies: 2
    Last Post: 29 Sep 2007, 02:50 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
  •