Skip to main content

Hover colour when colours are similar and need to be changed from the body link colour

To change the hover colour of text when the background is clashing with the body hover colour, say in the heading when both colours are similar.

This was from macerator world and used on text in a list item.

#block_myaccount_infos .myaccount-title a, #header a, #wrapper .breadcrumb li a, .block-contact .block-contact-title, .block-contact .navbar-toggler .material-icons, .linklist .blockcms-title a { color:#ffffff;}

.elementor-3170201 .elementor-element.elementor-element-05ed664 a:not(#e):hover {
    color: #24B9D7;}
  • Hits: 9

MegaMenu Pro - padding, bullet points, and borders

MegaMenuPro needs some specfic css to stop it putting in bullet points, padding in the container and borders

Padding and bullets - In the column container of Creative Elements add the following in Advanced > Custom CSS

.container {
    padding-left: 0px;
    padding-right: 0px;
}

li {
    list-style: none; 
    margin-left: 0px; 
}

Keylines around the menu elements - In the custom.css of the chid theme add the following - this is using Layout 1 in MegamenuPro - if you are using a different layout then you will need to adjust accourdingly

.layout_layout1 .mm_menus_li {
    border-right: 0px solid #e7e7e7;
}

.layout_layout1 .mm_menus_li:nth-child(2) {
    border-left: 0px solid #e7e7e7;
}

.layout_layout1 .mm_menus_li.mm_no_border {
    border-left: medium none;
}

.layout_layout1 .mm_menus_li:last-child {
    border-right: 0px solid #e7e7e7;
}
  • Hits: 8

Increase the number of characters for the product title shown in the category view

There is a default of 30 characters set for the product title in the category view.

To increase this copy the file 'product.tpl' at themes/yourtheme/templates/catalog/_partials/miniatures to your child theme.

Around line 69 edit the 'truncate' function to say '60' - any more than that and you need to do some more serious adjustments to the theme view.

      <div class="product-description">
        {block name='product_name'}
          {if $page.page_name == 'index'}
            <h3 class="h3 product-title"><a href="/{$product.url}" content="{$product.url}">{$product.name|truncate:60:'...'}</a></h3>
          {else}
            <h2 class="h3 product-title"><a href="/{$product.url}" content="{$product.url}">{$product.name|truncate:60:'...'}</a></h2>
          {/if}
        {/block}

 

  • Hits: 4

Comment out the Sub Categories block from the classic template

By default the category page shows  a sub categories block that often just gets in the way of getting straight to the products.

In your child theme add the following folder path

/childtheme/templates/catalog/_partials

Download the subcategories.tpl file from the /theme/templates/catalog/_partials folder

at line 25 edit

{if !empty($subcategories)}

 to 

{if !empty($subcategories) && 1 eq 2}

Makes the _partial/subcategories.tpl add nothing (never becomes true), and the subcategory block is removed from the category page.

Upload the revised .tpl file to /childtheme/templates/catalog/_partials so that it will override the classic theme.

  • Hits: 4

Increase the length of the attachment name

The attachment name has an irritatingly short character allowance of 32 characters.

To change this you need to make a change to the database structure and the controlling php file.

In the database  > ps_attachment_lang - go to table structure and change the name attribute to say 128 characters.

To change the controller - go to /src/Core/Domain/Attachment/Configuration/AttachmentConstraint.php

change the following to a value LESS than you set in the database -as below

 /**
     * Maximum length for name (value is constrained by database)
     */
    public const MAX_NAME_LENGTH = 120;

 

 

  • Hits: 4

5009 error when duplicating a product

Exception thrown when trying to duplicate a product.

Debug gives these details

PrestaShopDatabaseException:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `re...' at line 1<br /><br /><pre>INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 4, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 5, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;</pre>

  at classes/db/Db.php:769
  at DbCore->displayError('INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 4, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 5, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;')
     (classes/db/Db.php:385)
  at DbCore->query('INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 4, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 5, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;')
     (classes/db/Db.php:566)
  at DbCore->execute('INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 4, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;INSERT INTO `pr_product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES (821, 5, 0.05) ON DUPLICATE KEY UPDATE `reduction` = 0.05;')
     (classes/GroupReduction.php:276)
  at GroupReductionCore::duplicateReduction(23, '821')
     (src/Adapter/Product/AdminProductDataUpdater.php:215)
  at PrestaShop\PrestaShop\Adapter\Product\AdminProductDataUpdater->duplicateProduct('23')
     (src/PrestaShopBundle/Controller/Admin/ProductController.php:1084)
  at PrestaShopBundle\Controller\Admin\ProductController->unitAction('duplicate', '23')
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68)
  at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, false)
     (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200)
  at Symfony\Component\HttpKernel\Kernel->handle(object(Request), 1, false)

Fix is to edit config/defines.inc.php

define('PS_ALLOW_MULTI_STATEMENTS_QUERIES', false); FALSE change to TRUE

  • Hits: 7