Giter Club home page Giter Club logo

m2.price's Introduction

Magento2 Rounding Price

Total Downloads Latest Stable Version

Rounding Price to Prettier Value for Multi-Currency Stores.

Compatibility

Magento CE(EE) 2.0.x, 2.1.x, 2.2.x, 2.3.x, 2.4.x

Base prices - US Dollar

Magento2 Rounding Price

Store prices - Euro

Magento2 Rounding Price

Store rounding prices - Round fractions down, precision is 0

Magento2 Rounding Price

Store rounding prices - Round fractions down, precision is -1

Magento2 Rounding Price

Store rounding prices - Round fractions down, precision is -1 and enabled Subtract Amount

Magento2 Rounding Price

Store rounding prices - Round fractions down, precision is -1 and enabled Subtract Amount(negative)

Magento2 Rounding Price

Configuration

Magento2 Rounding Price

The idea of adding a rounding algorithm 'Swedish rounding' is suggested by ScIT-Raphael.

Install with Composer as you go

  1. Go to Magento2 root folder

  2. Enter following commands to install module:

    For Magento CE (EE) 2.0.x, 2.1.x, 2.2.x, 2.3.x

    composer require faonni/module-price:2.0.*

    For Magento CE (EE) 2.4.x

    composer require faonni/module-price:2.4.*

    Wait while dependencies are updated.

  3. Enter following commands to enable module:

    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy

m2.price's People

Contributors

faonni avatar karliuka avatar nealz avatar quentinfarizon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

m2.price's Issues

Exception #0 (ReflectionException): Class Faonni\Price\Model\Math does not exist

Hello,
we use Mirasvit Rewards Points Extension. When we apply points in checkout then we get bellow issue. Can you please help us solve this issue?

1 exception(s):
Exception #0 (ReflectionException): Class Faonni\Price\Model\Math does not exist

Exception #0 (ReflectionException): Class Faonni\Price\Model\Math does not exist

#1 Magento\Framework\Code\Reader\ClassReader->getConstructor('Faonni\Price\Mod...') called at [vendor/magento/framework/ObjectManager/Definition/Runtime.php:54]
#2 Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Faonni\Price\Mod...') called at [vendor/magento/framework/ObjectManager/Factory/Compiled.php:100]
#3 Magento\Framework\ObjectManager\Factory\Compiled->create('Faonni\Price\Mod...', array()) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#4 Magento\Framework\ObjectManager\ObjectManager->create('Faonni\Price\Mod...') called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Total/Quote/Discount.php:713]
#5 Mirasvit\Rewards\Model\Total\Quote\Discount->roundPriceWithFaonniPrice(10) called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Total/Quote/Discount.php:588]
#6 Mirasvit\Rewards\Model\Total\Quote\Discount->process() called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Total/Quote/Discount.php:289]
#7 Mirasvit\Rewards\Model\Total\Quote\Discount->spendPoints(&Magento\Quote\Model\Quote\Address\Total#00000000510660370000000054f77695#, &Magento\Quote\Model\ShippingAssignment#00000000510660c40000000054f77695#) called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Total/Quote/Discount.php:238]
#8 Mirasvit\Rewards\Model\Total\Quote\Discount->collect(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#, &Magento\Quote\Model\ShippingAssignment#00000000510660c40000000054f77695#, &Magento\Quote\Model\Quote\Address\Total#00000000510660370000000054f77695#) called at [vendor/magento/module-quote/Model/Quote/TotalsCollector.php:274]
#9 Magento\Quote\Model\Quote\TotalsCollector->collectAddressTotals(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#, &Magento\Quote\Model\Quote\Address\Interceptor#000000005106554b0000000054f77695#) called at [generated/code/Magento/Quote/Model/Quote/TotalsCollector/Interceptor.php:50]
#10 Magento\Quote\Model\Quote\TotalsCollector\Interceptor->collectAddressTotals(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#, &Magento\Quote\Model\Quote\Address\Interceptor#000000005106554b0000000054f77695#) called at [vendor/magento/module-quote/Model/Quote/TotalsCollector.php:148]
#11 Magento\Quote\Model\Quote\TotalsCollector->collect(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#12 Magento\Quote\Model\Quote\TotalsCollector\Interceptor->___callParent('collect', array(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#13 Magento\Quote\Model\Quote\TotalsCollector\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#14 Magento\Quote\Model\Quote\TotalsCollector\Interceptor->___callPlugins('collect', array(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#), array(array('in-store-pickup-...'))) called at [generated/code/Magento/Quote/Model/Quote/TotalsCollector/Interceptor.php:39]
#15 Magento\Quote\Model\Quote\TotalsCollector\Interceptor->collect(&Magento\Quote\Model\Quote\Interceptor#00000000510656350000000054f77695#) called at [vendor/magento/module-quote/Model/Quote.php:1999]
#16 Magento\Quote\Model\Quote->collectTotals() called at [generated/code/Magento/Quote/Model/Quote/Interceptor.php:1064]
#17 Magento\Quote\Model\Quote\Interceptor->collectTotals() called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Purchase.php:465]
#18 Mirasvit\Rewards\Model\Purchase->refreshQuote(false) called at [vendor/mirasvit/module-rewards/src/Rewards/Model/Purchase.php:337]
#19 Mirasvit\Rewards\Model\Purchase->refreshPointsNumber(true) called at [vendor/mirasvit/module-rewards/src/RewardsCheckout/Plugin/AddRewardsConfigToCheckoutConfig.php:126]
#20 Mirasvit\RewardsCheckout\Plugin\AddRewardsConfigToCheckoutConfig->afterGetConfig(&Magento\Checkout\Model\DefaultConfigProvider\Interceptor#00000000510652290000000054f77695#, array('formKey' => 'NsIAS4SiBj4trlAb', 'customerData' => array('website_id' => 4, 'email' => 'sylwester.zabiel...', 'group_id' => 1, 'store_id' => 6, 'created_at' => '2020-09-17 19:41...', 'updated_at' => '2020-11-12 19:15...', 'disable_auto_gro...' => 0, 'created_in' => 'Poland', 'prefix' => NULL, 'firstname' => 'sylwester', 'middlename' => NULL, 'lastname' => 'zabielski', 'suffix' => NULL, 'dob' => NULL, 'default_billing' => 1, 'default_shipping' => 1, 'taxvat' => NULL, 'confirmation' => NULL, 'gender' => 0, 'custom_attribute...' => array('rewards_subscrip...' => array('attribute_code' => 'rewards_subscrip...', 'value' => 1), 'mst_rewards_tier...' => array('attribute_code' => 'mst_rewards_tier...', 'value' => 1)), 'addresses' => array(array('id' => 1, 'customer_id' => 1, 'company' => 'firma', 'prefix' => NULL, 'firstname' => 

Only rounds display price

Setup

  1. Product with base price of $10
  2. Current conversion to GBP is e.g. £7.89

Action

  1. Display as GBP - rounds to £8
  2. Go through checkout and pay for item

Expected

  1. Displayed £8 is what the customer expects to pay. The conversion of £8 to USD might be $10.14. This is what should be paid as it is the base currency version of what has been displayed

Actual

  1. The customer is charged exactly $10

What seems to have happened is that the rounding is only for display. We cannot do this as it would be false advertising to display one price but then use another for actually charging.

What I would have hoped to see is this conversion back to the base currency. Do you think this is possible?

Rounding up

Hi

I have a price on 1754.99 how can i get this to 1755 instead?

Country Based Tax Rates Issue: Confirmed

Fantastic extension.

One issue - destination with different tax rate.

TAX Configuration

Catalog Prices - Including Tax
Show Prices - Including Tax
Tax calculated on Shipping Destination

Product page displays correctly with the including tax price being rounded.

Proceed to checkout, set destination to different country, example zero tax.

Expected result rounding of the product price

Actual result - no rounding

Only possibility to fix - set Cross Border Trading Yes to keep prices rounding

price / base_price difference when base currency and global currency are equal

After installing the module the synchronization with our ERP system stopped working.
The reason is that the synchronization process is checking for possible errors in the order. As base and global currency are equal it assumes that all prices have to be equal with the base currency and the exchange rate is 1 .

The module keeps the base prices as they would be without rounding. This might be caused by the fact that the module kind of acts as different currency when rounding? But if it would act as currency the rate should be the same for all prices which is not possible when rounding.

Is there any reason why the base prices are not updated?

Instead of acting as currency wouldn't it be a better approach to use pricing adjustments?
https://developer.adobe.com/commerce/php/development/components/price-adjustments/

Prevent rounding in the Admin system?

I thought the intention of the of this was to update the frontend only? When using this module it affects the admin and any other area. I'm looking at the best way to add a pull request, but at present my fix is to change...

if ($this->isRoundEnabled($subject, $toCurrency)) {

to...

if ($this->isRoundEnabled($subject, $toCurrency)
        	&& \Magento\Framework\App\ObjectManager::getInstance()
        		->get('Magento\Framework\App\State')->getAreaCode() == 'frontend'
        ) {

in aroundConvert in Faonni\Price\Plugin\Directory\Model\Currency

When using "Catalog Price Rule" Discount Percentage, the total is not rounded

I have following configuration:

Enabled Rounding: yes
Rounding Base Price: no
Rounding Type: Swedish Round
Swedish Fraction: 0.05
Substract Amount: Yes
Amount: 0.01
Show decimal zeros: Yes
Replace zero price: No

When using a discount percentage, it subtracts the discount correctly, but then it does not round it.

discount_percentage

Enable/disable for specific currencies

Hi,

I need to remove 2 decimals on specific currencies (only on product display prices, not checkout stuff like tax), but retain the USD/EUR currencies as is.

We have a lot of prices that are "XXX,00" with 2 decimals which we do not need to display. But we need it when changing to EUR.

So being able to set rounding and decimal precision and settings per currency would be amazing.

Can this feature be added?

Thanks.

Not working with Incl Tax

Hello,

I have enabled Incl and Excl tax price on Product list and detail page. When I enabled this module then its only rounding Excl price, not Incl and old price.

Swedish rounding

Hi

Thanks for the useful extension! Just have done some first checks in our demo envroiment and have noticed that you not can "Swedish Round" (round to the next 0.05, for example: 2.42 => 2.40 / 2.43 => 2.45).

Is it possible, that you can implement this feature?

Normaly it works over this small code snip:
$betrag = round(($betrag + 0.000001) * 20) / 20;

Best Regards
Raphael

Decimal's rounding

Hi,

I can't round decimals to 1 decimal precision:

rounding 12,44 € to 12,40 € or to 12,4 € – like Excel's function ROUND(12,44;1)

and

rounding 12,45 € to 12,50 € or to 12,5 € – like Excel's function ROUND(12,45;1)

The module's settings are:

Enabled Rounding: Yes
Rounding Base Price: Yes
Rounding Discount: Yes
Rounding Type: Excel Round
Precision: 1
Subtract Amount: No
Show decimal zeros: No
Replace zero price: No

multistore

Hi, how can I set rounded prices on a multistore website... Currently, I can set in global configuration, but it changes the price on both websites.

disable rounding shipment prices

Hello,

I am using this plugin to round up my store prices to .45 or .95. However I would like to keep my shipment prices as they were entered in the admin panel (for example: 4.50 , 5.00, 5.50). Is there a way to disable rounding prices on shipment costs?

Thanks in advance

Installation issue

Hello,
I'm trying to install the extension on Magento 2.2.8, anyway when I enter the command
composer require faonni/module-price:2.0.*
I get the following error:

The "magento/magento-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Problem 1
- magento/magento-composer-installer 0.1.13 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
- magento/product-community-edition 2.2.8 requires magento/magento-composer-installer >=0.1.11 -> satisfiable by magento/magento-composer-installer[0.1.13].
- magento/product-community-edition is locked to version 2.2.8 and an update of this package was not requested.
You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

How can I get through it?

Thank you in advance!

Magento 2.1.5, wrong price in configurable product

Hello

Thanks for making good extensions that helps every website.

I am facing one issue as below.
For configurable product wrong price displayed.

I have 3 stores. There are 2 different currency for different stores.
Store 1 > Basic currency > EURO.
Store 2 > EURO.
Store 3 > Kč

Once I am on 3rd store (Kč currency).

E.g:
For Product 1
Base price: 2.50 Euro
Kč Price: 65.10 (rate like 1 euro = 26.0410 Kc)

After Round price it shows = (2.50 * 26.0410) = 65 Kč > This is perfect for simple product and on list page.

But it is showing wrong price on product details page and configurable product.
It shows

(2.50 * 26.0410 * 26.0410) = 1 693,00 Kč something. Which is not good. It should only display 65 Kc.

For more information please see attached screenshot.

home-page-product-price
product-detail-page-good-price-select-swatch
Uploading product-detail-page-price-2times.png…

Weird behavior

For some products it's working fine but on the other it's not, like 149.5 will show 150 which is correct and the other products will still shows the 2 decimal point.

I did reindex and clear/flush the cache many times but still the issue persists. Any fix for this?

Magento 2.1.4

Store rounding prices - UP

Hi,

I want minor change in this extension.

My Price are coming on store like as

Now: $59.40, $124.1, $128.56, $70.87

Required: $60, $125, $129, $71

How to i can set prices in setting for required result like this. because I want to round up.

if 30.02 is coming then round price should be 31 not 30.

If there is any custom change, please guide me which code I'll change for this result ?

Thank You.

Round subtotals and totals only

Hello, I download your extension to round my CHF prices.
All product prices have the correct round price, but on my shop I can sell products by meter, so for example, I have a product with price 7.90 CHF / meter, if I buy 0.6m, the price will be 4,74 CHF, and I need that this price to be round to 4.75 CHF.

Is possible to round subtotal and totals, but not the base product price?
totals

Thank you

Error installing on Magento 2.3

Hi,

I'm trying to install the module on Magento 2.3 that uses PHP 7.1 or 7.2 and getting this error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - faonni/module-price 2.0.12 requires magento/module-sales-rule 100.0.*|100.1.*|101.0.* -> satisfiable by magento/module-sales-rule[100.0.2, 100.0.3, 100.0.4, 100.0.5, 100.1.0, 100.0.6, 100.1.1, 100.1.2, 100.0.7, 100.1.3, 100.0.8, 100.0.9, 100.1.4, 100.0.10, 101.0.0, 100.0.11, 100.1.5, 100.1.6, 101.0.1, 100.1.7, 101.0.2, 101.0.3, 100.1.8, 101.0.4, 100.1.9, 101.0.5].
    - faonni/module-price 2.0.13 requires magento/module-sales-rule 100.0.*|100.1.*|101.0.* -> satisfiable by magento/module-sales-rule[100.0.2, 100.0.3, 100.0.4, 100.0.5, 100.1.0, 100.0.6, 100.1.1, 100.1.2, 100.0.7, 100.1.3, 100.0.8, 100.0.9, 100.1.4, 100.0.10, 101.0.0, 100.0.11, 100.1.5, 100.1.6, 101.0.1, 100.1.7, 101.0.2, 101.0.3, 100.1.8, 101.0.4, 100.1.9, 101.0.5].
    - faonni/module-price 2.0.9 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - faonni/module-price 2.0.4 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - faonni/module-price 2.0.11 requires php ~5.5.0|~5.6.0|~7.0.0|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - faonni/module-price 2.0.10 requires php ~5.5.0|~5.6.0|~7.0.0|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.5 requires php ~7.0.13|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.4 requires php ~7.0.13|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.3 requires php ~7.0.13|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.2 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.1 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 101.0.0 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.9 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.8 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.7 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.6 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.5 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.4 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.3 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.2 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.1 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.1.0 requires php ~5.6.0|7.0.2|~7.0.6 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.11 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.10 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.9 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.8 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.7 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.6 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.5 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.4 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.3 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - magento/module-sales-rule 100.0.2 requires php ~5.5.0|~5.6.0|~7.0.0 -> your PHP version (7.2.10) does not satisfy that requirement.
    - Installation request for faonni/module-price ^2.0 -> satisfiable by faonni/module-price[2.0.10, 2.0.11, 2.0.12, 2.0.13, 2.0.4, 2.0.9].

Does it mean that I can't install the module because of wrong PHP version?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.