A CakePHP Plugin to Convert Your Price From A Currency To another

cakephp-currency-converter V 3.1.0    

A CakePHP 3.x Plugin to

  • convert price from a currency to another one
  • get rate from a currency to another one

Background

Is very frequently that inside your sites you need to convert your price or simply get a currency rate from a currency to another one. This Plugin convert your price or provide to you a rate from a currency to another one currency in every currency of the world.

It works with free.currencyconverterapi.com and can store currency rates inside a database if you want to. In case you want to use database to store currency rates inside, DO NOT FORGET to create the table to store rates into (sql schema is given to you in config/table.txt).

You can configure refresh key in configuration settings to get new conversion from free.currencyconverterapi.com, if you don't want to use database, rates are updated every time with the current conversion.

If you have set to use database, for example, you can set to update currency rates every hour, this library get the currency conversion from free.currencyconverterapi.com the first time, store it inside the database and for the next hour it takes conversion rates from the database if exist. In this way reduce the request time to convert and every hour currency rates are updated.

If you haven't set to use database, instead, every time you call the library it makes a request to free.currencyconverterapi.com and gets the actual conversion rate. This solution is great if you haven't a lot of request. Instead, if you have a lot of request conversions is better to use the database configuration.


Requirements

  • CakePHP 3.x
  • PHP >=5.6

For cakephp 2.x you can download version 1.1.4


Installation & Docs

Installation

Installing the Plugin is pretty much as with every other CakePHP Plugin.

How to include

composer require "alessandrominoccheri/cakephp-currency-converter"

Details @ https://packagist.org/packages/alessandrominoccheri/cakephp-currency-converter

Enable plugin

If you haven't use composer to include the Plugin in your App make sure the plugin is enable in your config/bootstrap.php file:

Plugin::load('CurrencyConverter');

If you are already using Plugin::loadAll();, then this is not necessary.

Documentation

CurrencyConverter component

Convert price or simply get currency rate from currency to another one.

Adding the component

In the initialize method of your Controller load the component:

$this->loadComponent('CurrencyConverter.CurrencyConverter', $config);

Setting

By default component will use this following settings:

$config = [
	'database' => true, // (true|false) precise if component have to store currency rate in database
	'refresh' => 24, // (int) precise interval time for refrshing currency rate in database, in case you are using database
	'decimal' => 2 // (int) number of decimal to use for the converted price
	'round' => false // (false|int) number to divise 1 and get the sup step to round price to (eg: 4 for 0.25 step)
];
  • database (mention if component have to store currency rate in database)
  • refresh (time interval for refreshing currency rate in database)
  • decimal (number of decimal to use when formatting price)
  • round (number to divise 1 and get the sup step to round price to eg: 4 for 0.25 step)

You can change default setting and write your own.

Database

If you want to use database to store currency rate DO NOT FORGET to create the table wich will store it. SQL schema is provided in table.txt file in config folder. Note that when using database, The Plugin store rate in session to avoid requesting database at each time we want to use the component. Do not be worry even rate stored in session the Plugin keep refresh rate when it has to do.

Convert price

You can convert price from a currency to another one in your Controller. To do it you have to use convert method of the Component. Assuming you want to convert a price from EUR to GBP:

$price_converted = $this->CurrencyConverter->convert($price_to_convert, $from, $to);
  • price_to_convert: is the price to convert (Example: 10.5, '10.5' or '10,5').
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the converted price will be 0.

Get currency rate

You can get a currency rate from a currency to another one in your Controller. To do it you have to use rate method of the Component. Assuming you want to get the rate from EUR currency to GBP currency:

$price_converted = $this->CurrencyConverter->rate($from, $to);
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the rate, rate will be null.

CurrencyConverter helper

Convert price or simply get currency rate from currency to another one.

Adding the helper

In the initialize method of your AppView class load the component:

$this->loadHelper('CurrencyConverter.CurrencyConverter', $config);

Setting

By default component will use this following settings:

$config = [
	'database' => true, // (true|false) precise if component have to store currency rate in database
	'refresh' => 24, // (int) precise interval time for refrshing currency rate in database, in case you are using database
	'decimal' => 2 // (int) number of decimal to use for the converted price
	'round' => false // (false|int) number to divise 1 and get the sup step to round price to (eg: 4 for 0.25 step)
];
  • database (mention if component have to store currency rate in database)
  • refresh (time interval for refreshing currency rate in database)
  • decimal (number of decimal to use when formatting price)
  • round (number to divise 1 and get the sup step to round price to eg: 4 for 0.25 step)

You can change default setting and write your own.

Database

If you want to use database to store currency rate DO NOT FORGET to create the table wich will store it. SQL schema is provided in table.txt file in config folder. Note that when using database, The Plugin store rate in session to avoid requesting database at each time we want to use the helper. Do not be worry even rate stored in session the Plugin keep refresh rate when it has to do.

Convert price

You can convert price from a currency to another one in your View. To do it you have to use convert method of the Helper. Assuming you want to convert a price from EUR to GBP:

$price_converted = $this->CurrencyConverter->convert($price_to_convert, $from, $to);
  • price_to_convert: is the price to convert (Example: 10.5, '10.5' or '10,5').
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the converted price will be 0.

Get currency rate

You can get a currency rate from a currency to another one in your View. To do it you have to use rate method of the Helper. Assuming you want to get the rate from EUR currency to GBP currency:

$price_converted = $this->CurrencyConverter->rate($from, $to);
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the rate, rate will be null.

Contributing

Your help is greatly appreciated.


TODOs

  • Use a second one API to convert price (ex fixer.io) and purpose wanted API to convert price in Component and Helper settings.

Author: AlessandroMinoccheri
Source Code: https://github.com/AlessandroMinoccheri/cakephp-currency-converter 
License: MIT license

#php #cakephp #convert 

What is GEEK

Buddha Community

A CakePHP Plugin to Convert Your Price From A Currency To another

A CakePHP Plugin to Convert Your Price From A Currency To another

cakephp-currency-converter V 3.1.0    

A CakePHP 3.x Plugin to

  • convert price from a currency to another one
  • get rate from a currency to another one

Background

Is very frequently that inside your sites you need to convert your price or simply get a currency rate from a currency to another one. This Plugin convert your price or provide to you a rate from a currency to another one currency in every currency of the world.

It works with free.currencyconverterapi.com and can store currency rates inside a database if you want to. In case you want to use database to store currency rates inside, DO NOT FORGET to create the table to store rates into (sql schema is given to you in config/table.txt).

You can configure refresh key in configuration settings to get new conversion from free.currencyconverterapi.com, if you don't want to use database, rates are updated every time with the current conversion.

If you have set to use database, for example, you can set to update currency rates every hour, this library get the currency conversion from free.currencyconverterapi.com the first time, store it inside the database and for the next hour it takes conversion rates from the database if exist. In this way reduce the request time to convert and every hour currency rates are updated.

If you haven't set to use database, instead, every time you call the library it makes a request to free.currencyconverterapi.com and gets the actual conversion rate. This solution is great if you haven't a lot of request. Instead, if you have a lot of request conversions is better to use the database configuration.


Requirements

  • CakePHP 3.x
  • PHP >=5.6

For cakephp 2.x you can download version 1.1.4


Installation & Docs

Installation

Installing the Plugin is pretty much as with every other CakePHP Plugin.

How to include

composer require "alessandrominoccheri/cakephp-currency-converter"

Details @ https://packagist.org/packages/alessandrominoccheri/cakephp-currency-converter

Enable plugin

If you haven't use composer to include the Plugin in your App make sure the plugin is enable in your config/bootstrap.php file:

Plugin::load('CurrencyConverter');

If you are already using Plugin::loadAll();, then this is not necessary.

Documentation

CurrencyConverter component

Convert price or simply get currency rate from currency to another one.

Adding the component

In the initialize method of your Controller load the component:

$this->loadComponent('CurrencyConverter.CurrencyConverter', $config);

Setting

By default component will use this following settings:

$config = [
	'database' => true, // (true|false) precise if component have to store currency rate in database
	'refresh' => 24, // (int) precise interval time for refrshing currency rate in database, in case you are using database
	'decimal' => 2 // (int) number of decimal to use for the converted price
	'round' => false // (false|int) number to divise 1 and get the sup step to round price to (eg: 4 for 0.25 step)
];
  • database (mention if component have to store currency rate in database)
  • refresh (time interval for refreshing currency rate in database)
  • decimal (number of decimal to use when formatting price)
  • round (number to divise 1 and get the sup step to round price to eg: 4 for 0.25 step)

You can change default setting and write your own.

Database

If you want to use database to store currency rate DO NOT FORGET to create the table wich will store it. SQL schema is provided in table.txt file in config folder. Note that when using database, The Plugin store rate in session to avoid requesting database at each time we want to use the component. Do not be worry even rate stored in session the Plugin keep refresh rate when it has to do.

Convert price

You can convert price from a currency to another one in your Controller. To do it you have to use convert method of the Component. Assuming you want to convert a price from EUR to GBP:

$price_converted = $this->CurrencyConverter->convert($price_to_convert, $from, $to);
  • price_to_convert: is the price to convert (Example: 10.5, '10.5' or '10,5').
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the converted price will be 0.

Get currency rate

You can get a currency rate from a currency to another one in your Controller. To do it you have to use rate method of the Component. Assuming you want to get the rate from EUR currency to GBP currency:

$price_converted = $this->CurrencyConverter->rate($from, $to);
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the rate, rate will be null.

CurrencyConverter helper

Convert price or simply get currency rate from currency to another one.

Adding the helper

In the initialize method of your AppView class load the component:

$this->loadHelper('CurrencyConverter.CurrencyConverter', $config);

Setting

By default component will use this following settings:

$config = [
	'database' => true, // (true|false) precise if component have to store currency rate in database
	'refresh' => 24, // (int) precise interval time for refrshing currency rate in database, in case you are using database
	'decimal' => 2 // (int) number of decimal to use for the converted price
	'round' => false // (false|int) number to divise 1 and get the sup step to round price to (eg: 4 for 0.25 step)
];
  • database (mention if component have to store currency rate in database)
  • refresh (time interval for refreshing currency rate in database)
  • decimal (number of decimal to use when formatting price)
  • round (number to divise 1 and get the sup step to round price to eg: 4 for 0.25 step)

You can change default setting and write your own.

Database

If you want to use database to store currency rate DO NOT FORGET to create the table wich will store it. SQL schema is provided in table.txt file in config folder. Note that when using database, The Plugin store rate in session to avoid requesting database at each time we want to use the helper. Do not be worry even rate stored in session the Plugin keep refresh rate when it has to do.

Convert price

You can convert price from a currency to another one in your View. To do it you have to use convert method of the Helper. Assuming you want to convert a price from EUR to GBP:

$price_converted = $this->CurrencyConverter->convert($price_to_convert, $from, $to);
  • price_to_convert: is the price to convert (Example: 10.5, '10.5' or '10,5').
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the converted price will be 0.

Get currency rate

You can get a currency rate from a currency to another one in your View. To do it you have to use rate method of the Helper. Assuming you want to get the rate from EUR currency to GBP currency:

$price_converted = $this->CurrencyConverter->rate($from, $to);
  • from: is the actual price currency (Example: EUR, GBP)
  • to: is the currency that you want to convert your price to (Example: EUR, GBP)

To get a available list of currency code you can check here List of available currency code

Note: If plugin can't reach rate out from API the rate, rate will be null.

Contributing

Your help is greatly appreciated.


TODOs

  • Use a second one API to convert price (ex fixer.io) and purpose wanted API to convert price in Component and Helper settings.

Author: AlessandroMinoccheri
Source Code: https://github.com/AlessandroMinoccheri/cakephp-currency-converter 
License: MIT license

#php #cakephp #convert 

Hire Dedicated CakePHP Developers | Hire CakePHP Developers USA

The foundational structure behind removing the monotony from the development process is obtained by the CakePHP framework. The framework is open-sourced and helps in creating web applications rapidly.

Want a web application in a short time duration with the CakePHP framework?

Hire Dedicated CakePHP developers from the experts WebClues Infotech and take the step toward business growth. The developer WebClues Infotech offers to its clients is highly skilled and expert in the project requirements mentioned by the customers.

Look no further and share with us your requirements to see our commitments in action

Share your requirements here https://www.webcluesinfotech.com/contact-us/

Book Free Interview with CakePHP Developers: https://bit.ly/3dDShFg

#hire dedicated cakephp developers #hire cakephp developer #hire dedicated cakephp web developers #hire dedicated cakephp developers or programmer #hire cakephp developer #hire cakephp developer india

How To Customize WordPress Plugins? (4 Easy Ways To Do)

This is image title
WordPress needs no introduction. It has been in the world for quite a long time. And up till now, it has given a tough fight to leading web development technology. The main reason behind its remarkable success is, it is highly customizable and also SEO-friendly. Other benefits include open-source technology, security, user-friendliness, and the thousands of free plugins it offers.

Talking of WordPress plugins, are a piece of software that enables you to add more features to the website. They are easy to integrate into your website and don’t hamper the performance of the site. WordPress, as a leading technology, has to offer many out-of-the-box plugins.

However, not always the WordPress would be able to meet your all needs. Hence you have to customize the WordPress plugin to provide you the functionality you wished. WordPress Plugins are easy to install and customize. You don’t have to build the solution from scratch and that’s one of the reasons why small and medium-sized businesses love it. It doesn’t need a hefty investment or the hiring of an in-house development team. You can use the core functionality of the plugin and expand it as your like.

In this blog, we would be talking in-depth about plugins and how to customize WordPress plugins to improve the functionality of your web applications.

What Is The Working Of The WordPress Plugins?

Developing your own plugin requires you to have some knowledge of the way they work. It ensures the better functioning of the customized plugins and avoids any mistakes that can hamper the experience on your site.

1. Hooks

Plugins operate primarily using hooks. As a hook attaches you to something, the same way a feature or functionality is hooked to your website. The piece of code interacts with the other components present on the website. There are two types of hooks: a. Action and b. Filter.

A. Action

If you want something to happen at a particular time, you need to use a WordPress “action” hook. With actions, you can add, change and improve the functionality of your plugin. It allows you to attach a new action that can be triggered by your users on the website.

There are several predefined actions available on WordPress, custom WordPress plugin development also allows you to develop your own action. This way you can make your plugin function as your want. It also allows you to set values for which the hook function. The add_ action function will then connect that function to a specific action.

B. Filters

They are the type of hooks that are accepted to a single variable or a series of variables. It sends them back after they have modified it. It allows you to change the content displayed to the user.

You can add the filter on your website with the apply_filter function, then you can define the filter under the function. To add a filter hook on the website, you have to add the $tag (the filter name) and $value (the filtered value or variable), this allows the hook to work. Also, you can add extra function values under $var.

Once you have made your filter, you can execute it with the add_filter function. This will activate your filter and would work when a specific function is triggered. You can also manipulate the variable and return it.

2. Shortcodes

Shortcodes are a good way to create and display the custom functionality of your website to visitors. They are client-side bits of code. They can be placed in the posts and pages like in the menu and widgets, etc.

There are many plugins that use shortcodes. By creating your very own shortcode, you too can customize the WordPress plugin. You can create your own shortcode with the add_shortcode function. The name of the shortcode that you use would be the first variable and the second variable would be the output of it when it is triggered. The output can be – attributes, content, and name.

3. Widgets

Other than the hooks and shortcodes, you can use the widgets to add functionality to the site. WordPress Widgets are a good way to create a widget by extending the WP_Widget class. They render a user-friendly experience, as they have an object-oriented design approach and the functions and values are stored in a single entity.

How To Customize WordPress Plugins?

There are various methods to customize the WordPress plugins. Depending on your need, and the degree of customization you wish to make in the plugin, choose the right option for you. Also, don’t forget to keep in mind that it requires a little bit of technical knowledge too. So find an expert WordPress plugin development company in case you lack the knowledge to do it by yourself.

1. Hire A Plugin Developer3
This is image title

One of the best ways to customize a WordPress plugin is by hiring a plugin developer. There are many plugin developers listed in the WordPress directory. You can contact them and collaborate with world-class WordPress developers. It is quite easy to find a WordPress plugin developer.

Since it is not much work and doesn’t pay well or for the long term a lot of developers would be unwilling to collaborate but, you will eventually find people.

2. Creating A Supporting Plugin

If you are looking for added functionality in an already existing plugin go for this option. It is a cheap way to meet your needs and creating a supporting plugin takes very little time as it has very limited needs. Furthermore, you can extend a plugin to a current feature set without altering its base code.

However, to do so, you have to hire a WordPress developer as it also requires some technical knowledge.

3. Use Custom Hooks

Use the WordPress hooks to integrate some other feature into an existing plugin. You can add an action or a filter as per your need and improve the functionality of the website.

If the plugin you want to customize has the hook, you don’t have to do much to customize it. You can write your own plugin that works with these hooks. This way you don’t have to build a WordPress plugin right from scratch. If the hook is not present in the plugin code, you can contact a WordPress developer or write the code yourself. It may take some time, but it works.

Once the hook is added, you just have to manually patch each one upon the release of the new plugin update.

4. Override Callbacks

The last way to customize WordPress plugins is by override callbacks. You can alter the core functionality of the WordPress plugin with this method. You can completely change the way it functions with your website. It is a way to completely transform the plugin. By adding your own custom callbacks, you can create the exact functionality you desire.

We suggest you go for a web developer proficient in WordPress as this requires a good amount of technical knowledge and the working of a plugin.

Read More

#customize wordpress plugins #how to customize plugins in wordpress #how to customize wordpress plugins #how to edit plugins in wordpress #how to edit wordpress plugins #wordpress plugin customization

CakePHP Development Company | Hire CakePHP Developers | Skenix

Skenix Infotech is the best CakePHP development company in India. We are committed to providing personalized solutions as per the needs and requirements of the clients. We keep updated about the current improved technologies, using upgraded technologies. We provide group CakePHP Web Services at the most affordable prices. If you are searching to Hire CakePHP Developers for your website building, Contact us immediately.

Visit us for more details about Company and our Services:

Our Website: www.skenix.com
Mail: info@skenix.com
Phone: +91-8160248529
Address: 108 - 1st floor, Vraj Complex, Parivar Chowkdi, Waghodia Rd, Kendranagar, Vadodara, Gujarat 390025

#Cakephp Development Company #Hire Cakephp Developers #Cakephp Development Services #Cakephp Web Services #Cakephp Development

Rajat Rajput

1625301328

OST to PST Converter Free to Convert OST to PST Online

When the exchange server is synchronised with MS Outlook then, automatically a copy of its mailboxes will be generated in OST (Offline Storage Table) file format. The user can access OST data in the offline mode and work on them. The changes will get updated when the internet connectivity is re-established. OST files cannot be accessed in the other system or remote system. So to access the OST files in another system Outlook, then convert Outlook OST to PST format. Due to various reasons for which users’ want to convert OST to PST file format such as the Exchange might face some technical issues, downtime or crash. How to convert OST to PST in Outlook 2016, 2013, 2010? Well, in this blog, we will discuss both manual as well as the professional best OST to PST Converter online solution.
For better understanding of users’, we have listed some common reasons below.

Why There is a Need to Export OST to PST Outlook?

Before providing methods to the query “how to convert OST file to PST in outlook 2016”, first understand why users’ need to convert OST to PST. Some of the basic reasons are provided below.

  • When the Exchange server is under maintenance.
  • Accidental deletion of the Exchange server account.
  • Virus or Malware attacks.
  • Power Failures or intrusions by malicious software.

These are a few reasons for Outlook OST to PST conversion. Now let’s proceed ahead to different methods to convert OST to PST online.

How to Convert OST to PST in Outlook 2016 Manually?

Manual strategies are cost-effective methods and here, we will discuss the complete manual steps for OST to PST conversion. Before starting the steps, it is suggested to create a backup copy of the original data as there might be a risk of human error that can ultimately lead to severe data loss. How to convert OST to PST manually? Follow the methods provided below -

Method 1: Import/ Export Feature

  1. Open your Microsoft Outlook program.
  2. Click on the File tab.
  3. Select the Import/Export option.
  4. Click on Export to a file.
  5. Press the Next button.
  6. Now Select the Personal File folder (.pst).
  7. Click on the Parent root.
  8. Check on the include subfolders
  9. Click on browse and navigate to the path to save the resultant data.
  10. Click on the finish button.

Method 2: Use Outlook Archive Feature

  1. Sign-in to Microsoft Outlook.
  2. Go to the File section
  3. Click on Options
  4. Now, click on the Advanced section
  5. Click on Auto Archive settings…
  6. Navigate to the path to save the archived files.
  7. Click on the OK button.

Drawbacks

  • Manual Processes are lengthy and more time-consuming.
  • Need connectivity with the Exchange server.
  • Unable to export corrupt OST data.
  • Outlook application installation is required.
  • Feasible for small sized OST files only.
  • High risk of data loss.

How to Convert OST to PST in Outlook 2016 Using DRS OST to PST Converter

To avoid all the limitations that we have already seen above with the conventional manual techniques, users can opt for a well known and reliable automated method for conversion. There are numerous third-party solutions available to convert OST to PST, however it is suggested to use a trusted software. Using the smart DRS Best OST to PST Converter online utility that allows to export OST to PST, MBOX, MSG, EML, PDF, CSV, HTML, Gmail, Yandex mail, Yahoo, Office 365, etc. It can easily open corrupt OST files and convert them to healthy PST. The tool even allows users to smoothly export all the mailbox items like attachments, calendar, contacts, journals, tasks, etc. There are no file size restrictions and no risk of severe data loss. The advanced software is compatible with all versions of Mac and Windows. The free OST to PST Converter online version allows to export 50 emails for free.

Conclusion

Above in this blog, we have discussed the recommended solutions by experts on the query “how to convert OST to PST in Outlook 2016”. At the end of this article, we can conclude that manual strategies have several limitations, so it is suggested to use the well known DRS OST to PST Converter for an effective, accurate and effortless conversion.

#how to convert ost file to pst in outlook 2016 #how to convert ost to pst online #how to convert ost to pst manually #convert ost to pst #ost to pst converter #outlook ost to pst