VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: maegras on February 16, 2012, 23:56:53 PM

Title: Discount for single product
Post by: maegras on February 16, 2012, 23:56:53 PM
Hi everyone. I'd like to assign a discount % to some of my products.
In order to achieve this I've created a calculation rule (-%, 10.0000) but it affects all af my products.

How should I configure virtuemart?
Title: Re: Discount for single product
Post by: John2400 on February 17, 2012, 23:03:06 PM
When you are in pproducts>>taxesand calculations>>do you have the product category set to a Category?

Like  in the default examples-

You might like to put up an image of that page. To show us the settings.
Title: Re: Discount for single product
Post by: simbus82 on April 12, 2012, 12:19:40 PM
Quote from: John2400 on February 17, 2012, 23:03:06 PM
When you are in pproducts>>taxesand calculations>>do you have the product category set to a Category?

Like  in the default examples-

You might like to put up an image of that page. To show us the settings.

Same problem here
http://forum.virtuemart.net/index.php?topic=101136.0

Without selecting categories, a rule like Discout After Tax is applied to all categories... now i think is it a bug.
Title: Re: Discount for single product
Post by: John2400 on April 12, 2012, 13:21:07 PM
simbus82

I am confirming I have the same issue - I tried several time like you all did .

I added a tax of 10 % - firstly to a category and they all changed , I took away the category and every item on my site added 10% tax.

I set the tax "to apply no rule" - and it still added the tax ?

I posted it here : http://forum.virtuemart.net/index.php?topic=101143.0
Title: Re: Discount for single product
Post by: Milbo on April 12, 2012, 17:25:35 PM
I am really sorry, but I dont have this error. Maybe a skype session could help, to see what is different in your case.
Title: Re: Discount for single product
Post by: simbus82 on April 12, 2012, 18:18:53 PM
Quote from: Milbo on April 12, 2012, 17:25:35 PM
I am really sorry, but I dont have this error. Maybe a skype session could help, to see what is different in your case.

Don't confuse tax with discount!!!

My problem is about discount rule that is applied to all with the category/nation/ecc selection empty.

Tax works well (i have 3 rules for taxes, one for each type of products).

Maybe the problem occours only in some combinations. Assign a tax to one product, then create a discount rule "discount after tax" and publish it without assigning to any product.

I see the discount applied everywhere!
Title: Re: Discount for single product
Post by: rafipl on April 12, 2012, 19:42:58 PM
i have the same... please help :(
when i create new rule, it affects automatically to all products. when i try to assidn "no rule" in product description, rule is still there... ;/

(http://raf-com.pl/rabat.jpg)
(sorry for polish language)

please help :(
Title: Re: Discount for single product
Post by: rafipl on April 16, 2012, 13:20:23 PM
nobody can help? :(
Title: Re: Discount for single product
Post by: jenkinhill on April 16, 2012, 21:33:33 PM
There is a bug in VM2.0.4 - update to 2.0.6  http://dev.virtuemart.net/projects/virtuemart/files
Title: Re: Discount for single product
Post by: LAMF on April 17, 2012, 13:06:43 PM
I got this set up ok but what if I want to add a special discount for just a few products in a special category?
This way all products in the choosen category gets the discount.
Can I create a Category that is invisible in the shop but ar still active in the background and that way add the discount to just th eproducts that are added to this category?
That would be a smooth way to solve this...
But if there's another way I'd be more than happy to know.

This works! Excellent.
I just added a new category called 10% rebate and set it as unpublished and in the discount -10% rule I added this category and voila it works and don't display on the startpage among other categories!
Title: Re: Discount for single product
Post by: simbus82 on April 17, 2012, 13:57:05 PM
Quote from: jenkinhill on April 16, 2012, 21:33:33 PM
There is a bug in VM2.0.4 - update to 2.0.6  http://dev.virtuemart.net/projects/virtuemart/files

The bug is not resolved.

If i simply create and PUBLISH a DATax (modificator of price with tax), and i NOT ADD THIS RULES TO ANY PRODUCT..... all products are influenced by this rule!
Title: Re: Discount for single product
Post by: Setko on August 10, 2012, 00:00:56 AM
Did anyone solve this problem?
Title: Re: Discount for single product
Post by: Arky527 on August 10, 2012, 12:54:18 PM
Fix for those on 2.0.4:

In administrator/components/com_virtuemart/helpers/calculationh.php on line 732

Replace
Quote
if(!empty($id) && $rule['virtuemart_calc_id']!==$id){
//    vmdebug('Price override set '.$id);
   continue;
}

With
Quote
if(!empty($id) && $rule['virtuemart_calc_id']!==$id){
//    vmdebug('Price override set '.$id);
   continue;
}
elseif(empty($id))
{
   continue;
}

Will reverse current system of apply discount (when no category set) to all products with no discount set - to apply no discounts when none are set in the product, regardless of the discounts properties

Briefly tested and works
Title: Re: Discount for single product
Post by: Setko on August 10, 2012, 14:51:57 PM
Thank you for that, i solved it. But i'm using 2.0.8 version and it seems like it's a different code as in 2.0.4, so i had to replace this one:

Quote
if(!empty($id)){
   if($rule['virtuemart_calc_id']==$id){
      $testedRules[] = $rule;
   }
   continue;
}
Title: Re: Discount for single product
Post by: simbus82 on December 12, 2013, 23:41:40 PM
One year, versione 2.0.24c.

The problem is still here.

i have 300 correctly setted products, today i go to create a single DBTax Rule, and... voilĂ ! All of my products now have this Rule without my decision...  :-X
Title: Re: Discount for single product
Post by: sydawn on January 18, 2014, 15:52:07 PM
Has anyone been able to fix this ???
Title: Re: Discount for single product
Post by: jenkinhill on January 18, 2014, 18:35:20 PM
Single product discount? That's what the Product Pricing Override is for in the product editor.  That's what I use.

It is possible to make a discount rule and apply it to single products but I think you can only apply that to the final price on the product editor.
Title: Re: Discount for single product
Post by: MatCat on December 20, 2014, 05:17:48 AM
I am getting this issue in VM3...  I am trying to setup a price structure of 1 for 12.95, 2 for 23.95, 3 for 32.95, I tried to do this by setting up a modifier with a - amount, now if I leave them unpublished and I select to apply the rule to a price it does not work, if I publish the modifiers they automatically apply themselves to everything regardless of rule settings on the product.
Title: Re: Discount for single product
Post by: MatCat on December 20, 2014, 05:23:21 AM
I was able to cheat by this wierdness by creating a ghost category called Discounts, leaving it unpublished, and giving my discount modifiers the Discounts category and publishing them, now I can apply the rule specifically to a price on a product.  It's a bit of a hack but it works. 
Title: Re: Discount for single product
Post by: jenkinhill on December 20, 2014, 11:17:52 AM
That's a lomng way to do it . Advice included in http://forum.virtuemart.net/index.php?topic=127356.msg436575#msg436575