VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: rayge on April 10, 2017, 23:01:44 PM

Title: Discount amount showing as a positive number
Post by: rayge on April 10, 2017, 23:01:44 PM
I have set a calculation rule to take 10% off all products except for special offers.
ALL of those products in this rile shows the discount as a positive number EXCEPT for
special offers which have an override discount. THOSE items show the discount as a negative number as expected.
What can i do to fix this? it is making invoices look bad and the website look bad too.

THANKS for any help!

Joomla! 3.6.5   
VM 3.2.1
Title: Re: Discount amount showing as a positive number
Post by: jenkinhill on April 10, 2017, 23:56:23 PM
Using a commercial template/template overrides? What happens with Protostar?
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 11, 2017, 17:57:17 PM
I checked using prostar.. it didn't change anything.
Trying to track this down to make it right is driving me NUTS!
Title: Re: Discount amount showing as a positive number
Post by: jenkinhill on April 11, 2017, 18:28:05 PM
Sounds like you used a quickstart template? Is there a URL to see this issue?
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 11, 2017, 18:46:50 PM
Here take a look.
http://www.seslaundry.com/parts/american-dryer/part-100019-3-hp-3ph-575v-60hz-motor-detail
Title: Re: Discount amount showing as a positive number
Post by: jenkinhill on April 11, 2017, 21:13:58 PM
On that page I see:
Market Price: $699.07
VIP Price: $629.16
Discount: $69.91

Nothing strange with that.
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 11, 2017, 21:28:34 PM
Right... it should show
Market Price: $699.07
Discount: $-69.91
VIP Price: $629.16

the MINUS is missing... which makes things look wrong in the cart and the invoice.
the settings in the admin are correct though.
so for example go to
http://www.seslaundry.com/special-offers/part-432-184302-gasket-door-180h-330-liter-washer-black-detail
NOTE that it shows
Discount: $-7.05 this product is using an override price.

add it to the cart

THEN goto
http://www.seslaundry.com/parts/american-dryer/part-100021-7-1-2-hp-3ph-575v-60hz-motor-detail
NOTE that it shows
Discount: $171.82 THIS is using the tax and calculation rules of 10% off.

add it to the cart and go to the cart.
IN the total for DISCOUNT i get $164.77 when it should be $-178.87 because of this issue.

now there is definitely something strange with that and i cant find where to fix it. :/

side note i now realize this might have been better suited in the Product pricing forum.
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 12, 2017, 18:11:02 PM
There HAS to be a way to do linear troubleshooting to figure out what needs modified for this.
THANKS again for any help!
Title: Re: Discount amount showing as a positive number
Post by: jenkinhill on April 12, 2017, 19:11:50 PM
OK
Set discount rule as Price modifier after tax, Math Operation -% and Value as 5.0000 shows discount as -XX
Set discount rule as Price modifier before tax, Math Operation -% and Value as 5.0000 shows discount as XX
Also
Set discount rule as Price modifier before tax, Math Operation -% and Value as -5.0000 shows discount as -XX

Personally I like a discount to be shown as a number without a minus sign, as the discount is a positive figure which is subracted from the original price.
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 20, 2017, 00:29:58 AM
I wouldn't mind if it all showed without the minus.
I tested your modifiers and it didnt fix the issue.
maybe instead of trying to get the minus on the price modifiers
what if we figured out how to get the MINUS off of the special offers section?
Title: Re: Discount amount showing as a positive number
Post by: jenkinhill on April 20, 2017, 10:26:43 AM
Assuming that you use a category for your special offers use Set discount rule as Price modifier before tax, Math Operation -% and Value as 5.0000 shows discount as XX and assign the rule to that category.
https://docs.virtuemart.net/manual/general-concepts/204-tax-and-calculation-rules-overview.html
Title: Re: Discount amount showing as a positive number
Post by: rayge on April 20, 2017, 21:23:34 PM
Unfortunatly all special offer products use the pricing override to handle its discounts.
This is why i think it is displayed differently.
Title: Re: Discount amount showing as a positive number
Post by: GJC Web Design on April 21, 2017, 23:27:35 PM
but at the end of the day it is just a display thing -- over ride the template of what ever displays your special offers to remove the " - "
Title: Re: Discount amount showing as a positive number
Post by: rayge on May 04, 2017, 20:16:24 PM
Well its not just a display thing. i can make it display as poistive but when i go to the cart it is still functioning wrong.
Under discount if i have an item from specials and another item from another area with a discount it doesnt ADD up.. one ends up subtracting from another making the total discount wrong.

JUST to re iterrate. DISCOUNT using tax and Calculation rules uses a POSITIVE number for its discount number
Product OVERRRIDE price uses a NEGATIVE number for its discount number
I just need them to be the SAME so it calculates its total discount properly.

That is ALL
Why is this so difficult for me to figure out?

Follow?
Title: Re: Discount amount showing as a positive number
Post by: GJC Web Design on May 05, 2017, 11:18:53 AM
QuoteProduct OVERRRIDE price

if u mean in the product pricing it has been mentioned that this is  an old legacy method that isn't recommended to be used and will be removed afaik in the future as it isn't fully integrated into VM any more

With calc and unpublished cats etc etc you can come up with just about any discount scenario.