Coder Social home page Coder Social logo

silvercommerce / currency-switcher Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 5 KB

Allow changing of site currency via a dropdown which uses a conversion service to provided accurate locational prices.

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%
currency ecommerce product shop silverstripe silverstripe-4 silverstripe-module

currency-switcher's People

Contributors

makreig avatar mlewis-everley avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

neonkore

currency-switcher's Issues

Need to ensure that order stores prices as default currency and converts

Invoices/Estimates need to store the price (of the order item) as the price in the default currency (so the correct order value is sent to the payment gateway).

We need to ensure that when viewing an app on the front end, that the shopping cart, order summary views show the prices converted to the current currency.

Set currency rates as a factory

I am thinking we need a factory class SilverCommerce\CurrencySwitcher\CurrencyFactory (for example).

Calling this will instantiate the currency conversion class chosen via config. Each currency conversion class will need to implement the same class, that defined the standard methods (in the same way that flysystem works).

By default, I think we should include a config based rates selector? We could have something like this in config.yml:

SilverCommerce\CurrencySwitcher\RateFromConfig # This is a fictitious class
  default_currency: GBP # you could probably also get this from siteconfig
  currencies: # currency codes and associated names
    - GBP: Pounds
    - USD: Dollars
    - EUR: Euros
  rates: # conversion rates to GBP (current default)
    - USD: 1.32016
    - EUR: 1.13009

We could also then create another module to use the cloud service you found last week.

Create a currency selection dropdropdown

Probably should be a standalone form? Would need to auto submit via JavaScript.

Make sure you add extension hooks on constructor and form submission function.

Form submission should set a session for the current currency, if the user is logged in then set their currency on the current Member and then save.

Need to be able to define active currencies

This would be used to populate the "select currency" drop down on the front end of a site.

I am guessing it will be a key:value list, one will be currency code, the other will be the name? I am guessing that you would also need some sort of helper to get the currency symbol from the code?

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.