GithubHelp home page GithubHelp logo

webjump / magento-set-price-precision Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aurmil/magento-set-price-precision

0.0 2.0 0.0 226 KB

Allows to change price precision (decimals count)

PHP 100.00%

magento-set-price-precision's Introduction

Magento - Set Price Precision extension

Overview

For some reason, you may need to change the number of decimals (precision) used when displaying prices in front office of your store.

This extension allows you to set the precision you want.

Compatibility

Tested on Magento CE 1.6 - 1.9

Notes

  • Free and open source
  • Fully configurable
  • Bundled with English, French and German (thanks to Thomas Klosinsky) translations

Installation

No Magento files will be modified but following classes will be extended and some of their methods overridden:

  • Mage_Core_Model_Locale
  • Mage_Directory_Model_Currency
  • Mage_Sales_Model_Order

Manually

  • Download the latest version of this module here
  • Unzip it
  • Move the "app" folder into the root directory of your Magento application, it will be merged with the existing "app" folder

With modman

With composer

  • Adapt the following "composer.json" file into yours:
{
	"require": {
		"aurmil/magento-set-price-precision": "dev-master"
	},
    "repositories": [
        {
            "type": "composer",
            "url": "http://packages.firegento.com"
        },
        {
            "type": "vcs",
            "url": "git://github.com/aurmil/magento-set-price-precision"
        }
    ],
	"extra": {
		"magento-root-dir": "./"
	}
}
  • Install or update your composer project dependencies

Usage

In System > Configuration > Catalog > Catalog > Price, this extension adds a new option: Price Precision

  • Set "2" (default value) to stay with the Magento basic behavior
  • Set a different value between 0 and 4 to change the price precision. 0 means no decimals will be displayed.

Avoiding side effect:

If Price Precision is changed in default scope, it will affect admininstration area in some ways. For instance, in Sales > Orders management, Order Totals section will be affected.

To avoid this behavior, let Price Precision unchanged (value = "2") in __default scope __and change its value in website scope, for each website you have (or in "store view" scope if needed).

Incomplete case:

On product detail page of a configurable product, there are drop-down lists (one per attribute), to choose product options. Some options may vary the final price. In this case, the price difference is written into the option label (e.g.: +โ‚ฌ50.00 or -$20.00). For these prices, the number of decimals is hard-coded in configurable.js and product.js files. This case is not managed by this extension.

Changelog

2.0

  • handle every product type
  • handle orders
  • fix admin display in "website" or "store view" mode

1.0

  • initial release

magento-set-price-precision's People

Contributors

aurmil avatar thomasklosinsky avatar

Watchers

 avatar  avatar

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.