webdna / commerce-currency-prices

Add a product price for each currency
Other
3 stars 5 forks source link

Simple change to get price by currency #6

Open mediabeastnz opened 5 years ago

mediabeastnz commented 5 years ago

I've just added a simple change to extend the functionality of getPricesByPurchasableId($id) which allows you to get a single price instead of returning the full array.

I've tried to do it so it wont affect any existing implementations.

For example:

CurrencyPrices::$plugin->service->getPricesByPurchasableId($id, 'USD')

Would return the value of that currency for that particular purchasable.