Skip to content

Convert currencies by using currencies.js file provided by Shopify

Notifications You must be signed in to change notification settings

ownego/laravel-shopify-currency

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This package created for convert between 2 currencies by using currencies.js file provided by Shopify.

Installation

  1. Install package

    composer require ownego/laravel-shopify-currency
    
  2. Optional: add the service provider

    'providers' => [
       // ...
       Ownego\LaravelShopifyCurrency\LaravelShopifyCurrencyServiceProvider::class,
    ],
  3. Optional: publish config

    php artisan vendor:publish --provider=Ownego\LaravelShopifyCurrency\LaravelShopifyCurrencyServiceProvider
    
  4. Optional: add facade

    'alias' => [
       // ...
       'ShopifyCurrency' => Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency::class,
    ],

Usage

  1. Convert
    use Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency;
    
    $result = ShopifyCurrency::convert(100, 'eur', 'usd');
  2. Get rate
    use Ownego\LaravelShopifyCurrency\Facades\ShopifyCurrency;
    
    $result = ShopifyCurrency::rate('eur', 'usd');

Command

If you want to manually update currencies from cache, then run:

php artisan shopify-currency:cache

About

Convert currencies by using currencies.js file provided by Shopify

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages