Calculate price using percentage from product field - drupal-commerce

I'm using drupal commerce module and drive with pricing rule problem. User and product have percentage fields, which are discount values separately. Final discount gathered from sum of this fields. How can I calculate line item price with discount fields?

Related

Merge row cells after Summing up multiple rows by grouping in ssrs

I have a matrix report in SSRS which is grouped by Product Class, Tax Type and Depot Name as shown in the following image.
What I am trying to achieve is to get the sum of both the Order Volume and Marker Volume based on the tax type grouping and populate them respectively in the order volume total and marker volume total fields.
So I put the following queries for them respectively:
=Sum(Fields!OrderVolume.Value, "TaxType")
=Sum(Fields!MarkerVolume.Value, "TaxType")
I then got the total as expected but it's splitting. How can I merge both of them (order volume total and marker volume total) based on the Tax Type?
Kindly help,
Best Regards

Prestashop 1.6.1.4 not stacking discounts and showing wrong price

I have a problem with my Prestashop: If a product only have quantity discounts the total price shown in the cart is correct, but when I also apply a category general discount (from Price Rules) that involves a product that also had a quantity discount, the last one overrides the category discount.
In the product template (product.tpl) price is correct (I mean, both discounts are applied, firstly the category discount and then the quantity discount) but in the shopping cart only quantity discount is applied.
Is there a way to achieve stacking of these discounts?
Thank you in advanced!

How do I perform math in SQL query on certain conditions?

I have a few tables I am querying, Item movement, and price. There are three price levels, regular price, reduced price, and sale price. I am attempting to get a markdown (price that item sold at when on sale minus either the regular or reduced price). My item movement table contains only the price the unit sold at and the price type of that sale. I am currently selecting only the items that sold on the sale price type. Next I have to find out whether the item was on a regular or reduced price, which I determine by looking at my price table. The price table has my regular price and reduced price and if the reduced price is null then it is not currently reduced.
How do I tell SQL that I want a column named "markdown" that is essentially (IF price.tprprice not null AND price.tprenddate > #StartDate give me column (price.baseprice - price.tprprice) * itemmovement.qtysold AS markdown ELSE give me column (price.baseprice - itemmovement.price) * itemmovement.qtysold AS markdown)
I need to return the result of each calculation performed on each row into the same column titled Markdown.
Can anyone tell me how this query should be structured?
case when price.tprprice is not null AND price.tprenddate > #StartDate
then (price.baseprice - price.tprprice) * itemmovement.qtysold
else (price.baseprice - itemmovement.price) * itemmovement.qtysold
end as markdown
You would do it with a case statement which works in most databases.

How to calculate new value for field in Access

I've got a few problems with a database I have created.
I want to calculate a Total Price (Sandwich Quantity multiplied by Sandwich Price). I had it working before, but I had to delete Sandwich Price from the OrderDetailsT table of which it was originally in. I'm now having issues with this calculation, as I cannot make a calculation in the OrderDetailsT table (Sandwich Price isn't there).
How can I apply the Discount to the Total Price if the Total Price is more than $50 for instance? After the Discount has been applied to the Total Price field, I would also like to store it in the NewPriceAfterDiscount field.
Here is an image detailing my situation:
You have multiple questions in one:
But, first of all. As the image shows, why do you have a left join between OrderDetails an Sandwich? In a order calculation you don't need not ordered sandwiches.
To total price calculation:
Add a new column to the query grid (assuming discount is a percentaje stored has a number between 0 and 1):
[SandwichT].[SandwichPrice] * [OrderDetailT].[SandwichQuantity] * [OrderDetailT].[Discount]
To store total price: you can use the above formula, but using a update query.
If you plan to show the prices in a form or in a report:
you can do de calculations on the fly (and don't store the total
price)
or you should update the total price un one query and then build another
query as datasource of the form/report.
another posibility (my recomendation) is to store the total in the input form

how to set discount price for multiple products in prestashop

I am using prestashop version 1.5.4.1
I am need to set clearance sale offer to my shopping site (particular date).
In particular date i need to set discount price for all products in my products by common.
EXAMPLE : I have 250 products in my catalog. I need to discount price $100 for all products from june-24 to june 30. How to set in a one click
You can easily set a "Catalog price rule" in your PrestaShop Back-office.
Go to "Price rules > Catalog price rule" and create a new rule.
It will allow you to select various criteria and the amount or percentage of reduction you would like to apply to all the related products.
You can also cumulate the criteria, example:
For all products in the "T-shirts" category
With "XXXXX" as a Manufacturer
and with the color "Blue"
=> Apply a discount of 30%
Regards,