Giter Club home page Giter Club logo

magento2-baseprice's Introduction

Magenerds_BasePrice

With this extension you can show the base price of volume products to your customers.
If you have products which you sell in amounts and units this extension can calculate the base price.
The extension installs the following basic units and its conversions:

  • kg
  • g
  • mg
  • l
  • ml
  • m
  • cm
  • mm

You can also extend the units and edit all conversions. Furthermore the display of the base price is editable. This extension also works for configurable products if you provide the necessary information for the configurable’s simple products.

Extension installation

The easiest way to install the Magenerds module is via composer

# add to composer require
composer require studioraz/magento2-baseprice

# run magento setup to activate the module
bin/magento set:up

Extension activation

At any time you can enable and disable this extension in the system configuration.
You can do this by opening the backend menu Stores > Configuration.
There you will find the entry Magenerds > Base Price.
After clicking on it you see a dropdown box where you can enable/disable the module. Save the configuration and delete the cache.

BasePrice-Activation

Extension configuration

The extension can be configured if you go to Stores > Configuration and afterwards to Magenerds > Base Price.
After enabling the extension you can edit the base price template in order to influence the base price rendering in the frontend. You can type in whatever you want.
There are five variables available to render the base price information:

  • {BASE_PRICE}: Renders the calculated base price

  • {BASE_AMOUNT}: Renders the product sale amount

  • {BASE_UNIT}: Renders the product sale unit

  • {REF_AMOUNT}: Renders the reference amount

  • {REF_UNIT}: Renders the reference unit

Example: {BASE_AMOUNT} {BASE_UNIT} | {BASE__PRICE} / {REF__AMOUNT} {REF__UNIT} will render to: 1 tn | 2.90€ / 10 kg

BasePrice-Template

The extension install basic units and its conversions. But you can edit these conversions, delete the units or extend it with further units and its conversions.
Just click on Add below all those conversions in order to add another unit row. You define the product unit on the left side and the reference unit (the unit which the price will be calculated to) on the right side.

BasePrice-Mapping

How to use

Every product needs detailed information about the base price calculation. There are four attributes which every product has:

  • Product amount: Select the amount the product gets selled with quantity 1
  • Product unit: Select the unit the product gets selled with
  • Reference amount: Select the reference amount the product price has to be calculated with
  • Reference unit: Select the reference unit the product price has to be calculated with

Example: You have a product which is a bottle of milk which is 100 ml of size. It costs 2 €.
You want to display the price of milk for 1 l which is 20 €.
Therefore you have to configure your product like the following:

  • Product amount: 100
  • Product unit: ml
  • Reference amount: 1
  • Reference unit: l

You can configure the attributes in a product edit mask under the tab Base Price on the left side.

BasePrice-Usage

magento2-baseprice's People

Contributors

sydekumf avatar denistrator avatar itaymesh avatar ffalkone avatar mardl avatar sippsolutions avatar atlan avatar niclashoyer avatar nikolasmeyer avatar bullitt300 avatar mvenghaus 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.