Tag: prestashop 1.3

  • Prestashop: Category Quantity Discount

    Apply Quantity Discounts across all products in a category
    Prestashop 1.2 – 1.3 Source: http://www.prestashop.com/forums/topic/75558-mod-quantity-discounts-for-all-the-products-in-the-same-default-category/
    Prestashop 1.4 – 1.6 Source: http://www.prestashop.com/forums/topic/140803-free-module-category-quantity-discount-apply-quantity-discounts-across-all-products-in-a-category/

    Quantity discount is calculated based on the price of product. For promotion mechanics below, if we use the built-in sale price function for 1 product, the quantity discount will be calculated based on the discounted price of 1 product.
    Purchase 1 items 10% off
    Purchase 2 items 15% off
    Purchase 3 items 20 % off
    Purchase 4 items 25 % off
    Purchase 5 items 30% off
    Purchase 6 items 35% off

    So we disable the admin check for minimum more than 1 quantity in order to allow creating quantity discount % for purchase of 1 product.
    change: admin/tabs/AdminProducts.php

    elseif (!($quantity_discount = intval(Tools::getValue(‘quantity_discount’))) OR $quantity_discount <= 1) $this->_errors[] = Tools::displayError(‘quantity is required and must be superior of 1’);

    to

    elseif (!($quantity_discount = intval(Tools::getValue(‘quantity_discount’))) OR $quantity_discount <= 0) $this->_errors[] = Tools::displayError(‘quantity is required and must be superior of 0’);

  • Prestaship 1.3 Force default currency for checkout

    Source: http://www.prestashop.com/forums/topic/9473-module-force-currency/

    Note: Error in amount shown in store owner email but is correct in customer email. Use with caution.

    in init.php before:

    $currency = Tools::setCurrency();

    add:

    $cookie->id_currency = intval(Configuration::get(‘PS_CURRENCY_FRONT_DEFAULT’));

    in admin/tabs/AdminCurrencies.php after:

    ‘PS_CURRENCY_DEFAULT’ => array(‘title’ => $this->l(‘Default currency:’), ‘desc’ => $this->l(‘The default currency used in shop’), ‘cast’ => ‘intval’, ‘type’ => ‘select’, ‘identifier’ => ‘id_currency’, ‘list’ => Currency::getCurrencies()),

    add:

    ‘PS_CURRENCY_FRONT_DEFAULT’ => array(‘title’ => $this->l(‘Default currency front:’), ‘desc’ => $this->l(‘The default currency used in front shop’), ‘cast’ => ‘intval’, ‘type’ => ‘select’, ‘identifier’ => ‘id_currency’, ‘list’ => Currency::getCurrencies()),

    Next go to admin->payment->currencies and set up your default shop currency. Customer CAN change the currency if needed.

  • PrestaShop 1.3 BackOffice login refresh issue

    Took over an ecommerce project running PrestaShop 1.3.

    The BackOffice’s unexplained admin login time-out issue was driving me crazy. Tried many solutions to optimise the various settings to no avail. Finally found this solution below which finally worked.

    Solution discovered by http://www.gibni.com/solved-prestashop-backoffice-login-refresh

    Steps here:

    In the file “login.php” under your BackOffice’s folder, on line 55, you have:

    $cookie = new Cookie(‘psAdmin’, substr($_SERVER[‘PHP_SELF’], strlen(__PS_BASE_URI__), -10));

    where the “-10″ value corresponds to the number of letters of “prestashop”, set it to the number of letters of your store’s sub-directory name and your will be back in business again.

    For example:
    if your store is located at: http://www.yourdomain.com/store/
    the word “store” contains 5 letters, so the line 55 in login.php should become:

    $cookie = new Cookie(‘psAdmin’, substr($_SERVER[‘PHP_SELF’], strlen(__PS_BASE_URI__), -5));