Jump to content


  • Content count

  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
  1. julinhamp

    Current AUctions V2.0

    Yes, people are still using this, I installed it today (using the 2.0 zip file) and it works great!!!
  2. I think this is what you're looking for, hopefully I copied the link right http://forums.oscommerce.com/index.php?sho...ndpost&p=584768
  3. Sorry, Don't think I'm going to be much help. I'm in the middle of coding several projects right now and having to file my taxes isn't helping matters. One of the projects I had to code was this contribution but it needed to be modified in a way that someone else on this board was also asking for and since I've gotten so much help from these boards I wanted to make sure to give back by posting what I did. If you have the current contribution, with my code installed and removed the if(tep_get_prid($uprid)==tep_get_prid($products_id)) line from the function then it I think it should sum up the quantity of ALL products in your cart and return that quantity to get the discount. So if you have that line removed and you have 20 products in your cart, it would then look for the price that each one of the products has for qty 20+. I would think something like that would be better done on a global level with the other contribution than a per product level but I guess it would depend on the type of products you are carrying. If you already have qty price break and my code installed it might be worth trying to remove that one "if" statement and give it a test drive and see if it does what you want but my code above doesn't change any prices - that's the original qty contribution that does that. All my code does is adjust the quantity that gets passed to the function that computes the qty price break. Good Luck...Julie
  4. Hi, I don't think my code snippet above will do what you are looking for. It isn't truly adding a discount to a group of products. The only thing it groups together is the same product that appears to be a different product due to it's attributes. Example. You have 12 items in the cart (2 are oranges but the other 10 are the same product but you have added some of them to the cart with different attributes so they may appear in the cart on separate lines as such): 3 apple ---green 3 apple ---red ---mixed 3 apple ---red ---macs 1 apple 2 oranges In this case above - as long as the "apple" above was really the same product (same product id) and you wanted to give a discount to them if they ordered 10 apples whether or not they were all the same color or type then you would want to add my code snippet above since it will ignore the attributes and just look at the product id to sum up how many of that product id are in the cart. So, the code would see 10 apples and give a discount on apples but only 2 oranges so no discount on oranges. The original Qty discount contribution sees each of the entries above as a different product and no discount would be given since there isn't 10 of anything in the cart (in some cases this is desirable because you may not be able to give a discount to someone since the change of an attribute may mean that you can't get "bulk" pricing yourself). I hope I answered your question - If you have thousands of apples it sounds like they are all individual products and this won't help you.
  5. Hi, I added some code to my site that seems to accomplish what you are asking. The price_break contribution adds two calls to $pf->computePrice with quantity as the argument. I wrote a function to add up the quantity of all products in the cart with the same true product id (attributes change the product id's by adding the attributes to the end of the product id - this function ignores the extra code and just uses the true product id). 1 program to modify: catalog/includes/classes/shopping_cart.php Here's the function (which I added directly under function get_quantity) // custom function to get total quantity for the true product id // instead of counting product id's with attributes as separate products function get_prid_qty($contents,$uprid){ $products_qty=0; if (is_array($contents)) { reset($contents); while (list($products_id, ) = each($contents)) { if(tep_get_prid($uprid)==tep_get_prid($products_id)) $products_qty += $contents[$products_id]['qty']; } } return $products_qty; } then search the same program for 1. $products_price = $pf->computePrice($qty); and replace with $products_price = $pf->computePrice($this->get_prid_qty($this->contents,$prid)); 2. $products_price = $pf->computePrice($this->contents[$products_id]['qty']); and replace with $products_price = $pf->computePrice($this->get_prid_qty($this->contents,$products_id)); I tested this in my cart and it seems to be working the way I want it to but use at your own risk. It does not change the true quantity - it only uses the custom quantity when determing the product price. Your cart will still show the items with their attributes as different line items in the cart. HTH