Author: admin

  • Prestashop: Stop subdomains from keep redirecting to main domain

    Source: https://www.prestashop.com/forums/topic/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem/?tab=comments#comment-2634035

    After installing prestashop, created subdomains don’t work properly due to the .htaccess rewrite conditions automatically created by prestashop.

    Add the following right at the end to solve this issue

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

    //////////////////

    some additional ones to try in case doesn’t work

    Source: https://www.prestashop.com/forums/topic/635858-2nd-store-redirects-to-main-store-multistore-redirection-problem/?tab=comments#comment-3116242

    #First condition, If is HTTPS without wwww, redirects to www.
    RewriteCond %{HTTPS} on
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

    #Second condition, If is not HTTPS and without www, redirects to HTTPS with WWW.
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*) https://www.%{SERVER_NAME}/$1 [R,L]

    #Third, If is not HTTPS and have www, redirects only to HTTPS
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.
    RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]

  • Prestashop: Search does not index product reference numbers properly

    The native Search.php class would only index characters that appear before ‘-‘ hyphen or other punctuations, so if your products have reference numbers for example like ‘ABC-123’, only ‘ABC’ is indexed for the product. The workaround is to edit the Search.php class and use it as override.

    use class Search extends SearchCore {} as a wrapper for public static function sanitize ()

    Find $indexation and remove the hyphen from preg_replace like so:

    if ($indexation) {
    $string = preg_replace(‘/[._]+/’, ‘ ‘, $string);
    }

    Reindex the products completely after upload.

    For additional reference, the database tables to cross check are ps_search_word and ps_search_index

  • Prestashop: change to 2 columns product listing for bootstrap theme in mobile

    Additional issue: because it is now 2 columns, and the original one column layout, height is not fixed, sometimes some products require more height, while some are shorter. When split side by side, this causes the grid to be broken if the combo is a tall and short product height.

    Fix: change the min-height in theme’s product-list.css to a value that fits the layout.
    (Product list(Grid) Styles) for @media (min-width: 480px) and (max-width: 767px)
    ul.product_list.grid > li .product-container
    In this case, min-height: 460px;

    Source: https://www.prestashop.com/forums/topic/388342-how-can-i-show-items-in-two-columns-on-mobile/?tab=comments#comment-2144346

    This is what I did and it worked for me.

    In your product-list.tpl file there should be a line like this:

    <li class=”ajax_block_product{if $page_name == ‘index’ || $page_name == ‘product’} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-3{/if}

    for me it was line 49.

    change the col-xs-12 to col-xs-6 instead and it should show up in two columns.

  • Sony Vegas: Tips and tricks

    How to place 2 Vertical (portrait mode) videos Side by Side in Vegas Pro

  • Prestashop: Full-width for CMS pages

    Warehouse theme.

    If the display left column option is disabled in the advanced setting of the theme, the center column does not know it is supposed to be in full width. A blank space is shown on the left.

    Enable “display left column”, then click “x” for all modules you don’t want to appear in the left column. E.g. CMS. After that, clear cache and reload. Full-width center column now works.

  • Prestashop: Layered Navigation Block – Auto Scroll to Products

    Source: https://www.prestashop.com/forums/topic/347990-layered-navigation-block-auto-scroll-to-products/

    js file under “/themes/themename/js/modules/blocklayered” called “blocklayered.js”

    Solution 1:

    Replace :

    $.scrollTo('.product_list', 400);

    by

    $.scrollTo('product_list', 0); //stop the scroll

    or

    $.scrollTo('body', 0); // brings to the top of the page instantly.

    Solution 2:

    //if(slideUp)
    	//$.scrollTo('.product_list', 400);
    //updateProductUrl();

     

  • WordPress: Disable plugins from database for troubleshooting

    Source: https://www.templatemonster.com/help/wordpress-disable-plugins-via-database-manual-removal.html
    UPDATE wp_options SET option_value = ” WHERE option_name = ‘active_plugins’;

  • Prestashop: remove PayPal logo from right column

    Solution: https://www.prestashop.com/forums/topic/249896-solved-how-do-i-remove-the-paypal-logo-from-my-home-page/?tab=comments#comment-1241457

    open the file:
    (paypal module directory)
    views/templates/hook/column.tpl and remove the content of this file

    And/or: https://www.prestashop.com/forums/topic/255741-solved-how-to-remove-paypal-logo/?tab=comments#comment-2010062

    unhook the PayPal module from the right column on my template. This is in the Modules – Positions.

  • Prestashop: delete customer’s cookies

    Solution: https://www.prestashop.com/forums/topic/364875-how-to-delete-cookies-customers/?tab=comments#comment-2348354

    Overriding the method __construct (classes/Cookie.php) changing the commented lines

    override/classes/Cookie.php

    class Cookie extends CookieCore
    {
        public function __construct($name, $path = '', $expire = null, $shared_urls = null, $standalone = false, $secure = false)
        {
            $this->_content = array();
            $this->_standalone = $standalone;
            $this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire;
            $this->_path = trim(($this->_standalone ? '' : Context::getContext()->shop->physical_uri).$path, '/\\').'/';
            if ($this->_path{0} != '/') {
                $this->_path = '/'.$this->_path;
            }
            $this->_path = rawurlencode($this->_path);
            $this->_path = str_replace('%2F', '/', $this->_path);
            $this->_path = str_replace('%7E', '~', $this->_path);
            $this->_domain = $this->getDomain($shared_urls);
    
            //remove www from url > example: .domain.com
            $this->_domain =str_replace('www','', $this->_domain);
    
            //Change cookie name "PrestaShop" > "MyCookieName" This will make all your customers cookies obsolete.
            $this->_name = 'MyCookieName-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);
    
            $this->_allow_writing = true;
            $this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
            if ($this->_standalone) {
                $this->_cipherTool = new Blowfish(str_pad('', 56, md5('ps'.__FILE__)), str_pad('', 56, md5('iv'.__FILE__)));
            } elseif (!Configuration::get('PS_CIPHER_ALGORITHM') || !defined('_RIJNDAEL_KEY_')) {
                $this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
            } else {
                $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
            }
            $this->_secure = (bool)$secure;
    
            $this->update();
        }
    }
  • Prestashop: category pages noindex

    Due to layered navigation block disabling robots by default…

    Solution: https://www.prestashop.com/forums/topic/866411-category-pages-noindex/

    Hi, the problem comes from the “Layered navigation block” module. After the update to v2.2.1 something has changed.

    To Fix the problem for Prestashop 1.6 go to Modules and Services >> Layered navigation block >> Configure
    Scroll down to the CONFIGURATION section and set to YES the “Allow indexing robots….”
    This action will change the metatags for all category pages to “indexed, follow”