Product Option Price Substract - opencart2.x

For example: My product price is 20$ and it has many option
Black : +5$
Blue : -5$
But inside dropdownlist in product detail it show
black (25$)
blue (25$)
what I want to do is:
black (25$)
blue (15$)
Inside Product controller I found this line like this
$price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax') ? 'P' : false));
What should i to do?

Related

How can i change different colors between 5 categories when I use pd.qcut(df, 5) in a chart. f example: first 3 row = red, next 2 rows is blue,

here is the image of the code, someone suggest at I patch for each bin and use color mapping but I dont know how to do it

Tabulator 4.9, is there a way to have 2 different colors of text within a cell?

The requirements from the customer state that a record's Comment and Description fields must be displayed in the same cell but the text of the Comment must be displayed in red while the Description should be black. Using a mutator, I can combine the 2 fields and display them in one cell, but I haven't seen how to make one have red text and the other black text within that cell.
Is there a way?
Thanks,
Matt
I wouldnt bother doing that, just use a Customer Formatter function
formatter:function(cell, formatterParams, onRendered){
return '<span style=color:red>' + cell.getRow().getData().Comment + '</span><P><span style=color:black>' + cell.getRow().getData().Description + '</span></p>';
}

Gravity form Change value of quantity based on previous field selection

Hi I am using Gravity Form, and I am trying to build a form where depending on the service you choose, the quantity of hours will update automatically. For example:
Multiple choice field: 1. Wash a car 2. wash a truck 3. wash a motorbike
Quantity field should pre-populate with either; 1 (if motorbike is selected, or 2 (if car is selected or 3 (if truck is selected)
Any help is much appreciated
A generous developer I know helped me out. Add this code after the form. here is the answer:
<script type="text/javascript">
var helpSelect = document.querySelector('#input_2_22')
var quantityInput = document.querySelector('#input_2_28')
helpSelect.addEventListener('change', function (e) {
quantityInput.value = e.target.value
})
</script>
Remember to change the input id to the id of the input in your form.

Increase decimal digits displayed on a grid field

Does anyone know how to increase the decimal digits displayed on a grid field?
When you click the ADD STOCK ITEM button on the Sales Orders (SO301000) screen, then click the Sold Since radio button, there is a field called Last Unit Price in the grid.
I would like to increase the decimal digits displayed from 2 to 3 decimals.
I tried customizing the data field using Ctrl+Alt, clicking on the field, and choosing ACTIONS -> Customize Data Fields... which yields this:
[PXCalcCurrency(typeof(SOSiteStatusSelected.curyInfoID), typeof(SOSiteStatusSelected.baseUnitPrice))]
[PXUIField(DisplayName = "Last Unit Price", Visibility = PXUIVisibility.SelectorVisible)]
[PXDefault(TypeCode.Decimal, "0.0")]
But I'm not sure if this is the place to do it.
Here is a screenshot of the field I want to change
You can go Organization > Organization Structure > Branches and set Decimal Precision from 2 => 3

How to calculate a price if 3 products are selected and, as a pack, they are cheaper than one at a time

I am trying to make a calculator in Excel, which should show the price of the products when the user clicks the item's checkbox.
Example + QUESTION:
If the user selects only item no 1, the price is 45$.
If the user selects only item no 2, the price is 28$.
If the user selects both item no 1 and item no 2, how do I make the price 45$?
In the formula bar I have this:
=IF(A3,45,0) + IF(G3,28,0) + IF(AND(A3,G3),45,0)
item no 1 item no 2 both items selected
But the problem is that the total price is 45 + 28 + 45.
How can I handle this? Thank you!
EDIT:
Ok, I didn't think it further, here's another situation:
My price calculator looks like this:
-voice100 -broadband surf -TV varied
-voice200 -broadband play -TV extra
-voice400 -broadband power -TV max
A user can select either one product, or a 2-pack (broadband + TV) or a 3-pack (voice+BB+TV).
Is there any source that could teach me how to do this in excel? (I'll use SpreadSheet Converter to make it HTML/PHP) I want to implement it on a website so that a user can choose his own combination of services and then call me when he's happy with what he chose.
Thank you!
This one works:
=IF(AND(A3,G3),45,IF(A3,45,IF(G3,28,0)))

Resources