Forum

Thread tagged as: Problem, Error, Shop

No default currency set - error

When I change the default currency in Shop > Currencies from GPB to EUR, then I get the following error message: "No default currency set."

    Perch: 2.8.29, PHP: 5.6.22, MySQL: 5.5.32, with PDO
    Server OS: Linux, cgi-fcgi
    Installed apps: content (2.8.29), assets (2.8.29), categories (2.8.29), perch_blog (5.0), perch_forms (1.8.3), perch_shop_orders (1.0), perch_shop_products (1.0), perch_shop (1.0.1), perch_members (1.5)
    App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', 'perch_members', 'perch_shop', 'perch_forms' );
    PERCH_LOGINPATH: /perch
    PERCH_PATH: /home/travelu5/public_html/perch
    PERCH_CORE: /home/travelu5/public_html/perch/core
    PERCH_RESFILEPATH: /home/travelu5/public_html/perch/resources
    Image manipulation: GD
    PHP limits: Max upload 128M, Max POST 128M, Memory: 256M, Total max file upload: 128M
    ...

I found a workaround that is to change in the DB the default currency ID (that was fixed to 47). But it causes another issue with the order history line; the item price is always showing 0.00 for new orders. Please note that the total price shown is correct and using correct currency.

Also, it worked perfectly when currency was GBP.

The source code that generate the error message when trying to put an item in the cart :

        // Find the currency
        $Currency = $Currencies->find((int)$cart['currencyID']);
        if (!$Currency) {
            $Currency = $Currencies->get_default();

            if (!$Currency) {
                die('No default currency set.');
            }
        }

(PerchShop_Cart.class.php)

andre atreecalled

andre atreecalled 0 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can you update the Shop apps to the latest version and see if you still have the problem?

Please do not change things directly in the database - that will quickly cause you issues and also leave us in a place where we can't support you as we will be dealing with Perch in an inconsistent state.

Hi Rachel,

Updating to perch_shop 1.0.4 fixed my problems. Thank you very much for your advises.