WooCommerce cart calculations - shopping-cart

I built a website for my company and I want to know if there is a way to make add to cart button do calculations.
If the customer select a product with a price of 1
then I want to multiply it to a given number.But a different number each time not the same in all products.
Thanks in advance for any possible help.

Related

Calculate difference between two dates in different tables not directly related in PowerBI

I need to calculate the time elapsed between to dates, in days. The values are the creation date and the payment date for every invoice in my model table. I will use this value to classify my invoices: sort by time passed, classyfy them, make a Pareto Chart... etc. So I need to create a calculated column in the inoice model table (can't imagine an approach using measures).
But I have two handicaps:
Tables ARE NOT DIRECTLY RELATED, so I can't use the RELATED function
The invoice can be paid in several installments
So, for each invoice, I need to calculate de time elapsed, in days, between the generation date (in a table) and the MAX payment date of all it's installments (in another indirectly related table)
This:
DaysElapsedInPayment = DATEDIFF(Invoices[InvoiceDate], Max(RELATED(Installments[InstallmentPaymentDate])), DAY)
would work if the tables were directly related an DateDiff whould accept MAX, but no, it's not the case. For your information, if could be usefull to you, this is my invoice-payment model scheme:
Could you help me, please?
EDIT:
As requested, I explain more deeply my data model...
My model looks complex because an invoice can be paid by several payments (part in cash, part in direct debit, for example), so a invoice can have MULTIPLE payments. At the same time, a payment can involve several invoices. Thats why my invoices-payments is many-to-many. And also, a payment (for example a payment by direct debit) can be divided in installments that are monthly sent to bank.
My model has lots of tables, not in english. For my purpose, I mock the needed ones here:
As you can see in the mocked data:
One invoice is paid in a single payment. It's the common case. We only have a single payment date in 'Payments'. That one is the one I need.
Another invoice is paid in TWO payments (part in cash, part payed by VISA), in different days. I need the date of the LAST of both payments.
Last case, I have two invoices that will be paid as a 'SINGLE' payment. Both should have to return the PaymentDate in Payments. But, at the las moment, we agreed with the client to pay them in installments. So installments are created, each one with a DueDate an the date wuere they were finally payed. So I need to get the LAST date of all installments for this payment.
It's complex, I know, but at the end, is about:
Given a value, find related values in anoter table indirectly related
From all values found, get the greatest
The function must perform theese operations, and put the results in a calculated column.
Have you triend creating a Calendar Table with the AUTOCALENDAR function? That way you could create a relation between both tables to make the calculations. Let me know if you need further assistance in order to add this table to the model

Opencart Related Products appears three times

If I add more than one related product to my product, all products will be displayed 3x. Where is the mistake?
Thanks for the help!

How to display top 3 highest amount info for a record from a table?

For one of the tables imported into the PowerBI, I have columns as Company Name, Debit Amount, Credit Amount and Net Amount (Calculated column: Debit Amount- Credit Amount).
Now is it possible to pull the three highest Company Names from the table in terms of having either higher Debit, Credit or Net Amount and display it on a tile? May be by creating a measure using DAX or OOTB? It should look like:
Top Grossing Second Grossing Third Grossing
12000(Net Amount) 10000(Net Amount) 5000 (Net Amount)
Company Name Company Name Company Name
I am envisioning the above in terms of tiles and they would change dynamically once anything updates in the data source table. Not sure if this is possible to do using DAX, I am open to suggestions. Any help will be greatly appreciated. Thanks.
DAX has a TOPN() function that you can use for this sort of thing.
The other possibility is to use the built-in advanced filtering. Under the visual level filters, choose filter type Top N, pick how many you want to show and what value you are sorting by.

Saved search report in Netsuite

I want to create a report in Netsuite ERP that shows me the information about Departments Sales and Budget by Month. I think I can achieve this by creating a saved search that chooses this items, however I don't understand under which category I can find this fields. A saved search would be ideal as I am trying to authomatize the reports in a java application, and I discovered that I can call the savedSearch results.
I found the Department under the standard Criteria in the subcategory "Owner..." and I added a Date standard criteria with the values "within this month", however I have not found the group that contains all the Sales/Income/Margin or the budget (though, I found an aggregation sum function that may be used along with a field). I will appreciate any help. Also, will the addition of this fileds be enough to get the Sales X Department X Date information or do I have to use a different join method?
Thanks!
You'd have to combine two saved searches to achieve this.One on budgets for the period you need. The department column is available on the budgets saved search.
The other would be transactions for the period. Generally budgets are against posting transactions so Invoices, Cash Sales, Credit Memos and Cash Refunds would be in your other search. If you group those by Department you could then combine the two searches in code to create your own budget vs actuals report.

Opencart Substract Stock doesn't work

All quantity of my product in the store are set to 10. And then my I tried to checkout . It seem the quantity of product still the same (Not Substract Stock).
Please help!!!
Go to edit a product in the admin panel and in the Data tab you will see a field called Subtract Stock. Make sure it's set to Yes.