Prestashop 1.6: Breadcrumb to display the category that product is currently in (not its default category)

Source: https://www.prestashop.com/forums/topic/167513-how-to-show-the-full-breadcrumb-to-the-default-category-on-every-product-page/?do=findComment&comment=2684341

Function  assignCategory(), preferably in override/controllers/front/ProductController.php

protected function assignCategory()
{
// Assign category to the template
if ($this->category !== false && Validate::isLoadedObject($this->category) && $this->category->inShop() && $this->category->isAssociatedToShop()) {
$path = Tools::getPath($this->category->id, $this->product->name, true);
$all_product_subs = Product::getProductCategoriesFull($this->product->id, $this->context->language->id);

if(isset($all_product_subs) && count($all_product_subs)>0)
{
foreach($all_product_subs as $subcat)
$all_product_subs_path = array(); //reset array, only last one is used
$all_product_subs_path[] = Tools::getPath($subcat[‘id_category’], ”, true);
}

} elseif (Category::inShopStatic($this->product->id_category_default, $this->context->shop)) {
$this->category = new Category((int)$this->product->id_category_default, (int)$this->context->language->id);
if (Validate::isLoadedObject($this->category) && $this->category->active && $this->category->isAssociatedToShop()) {
$path = Tools::getPath((int)$this->product->id_category_default, $this->product->name);
}
}
if (!isset($path) || !$path) {
$path = Tools::getPath((int)$this->context->shop->id_category, $this->product->name);
}

if (Validate::isLoadedObject($this->category)) {

// various assignements before Hook::exec
$this->context->smarty->assign(array(
‘path’ => Tools::getPath($this->category->id, ”, true),
//THIS CONTAINS ALL PRODUCT SUBCATEGORIES PATH
‘all_product_subs’=>$all_product_subs_path,
‘category’ => $this->category,
‘subCategories’ => $this->category->getSubCategories($this->context->language->id, true),
‘id_category_current’ => (int)$this->category->id,
‘id_category_parent’ => (int)$this->category->id_parent,
‘return_category_name’ => Tools::safeOutput($this->category->name)
));

}
$this->context->smarty->assign(array(‘HOOK_PRODUCT_FOOTER’ => Hook::exec(‘displayFooterProduct’, array(‘product’ => $this->product, ‘category’ => $this->category))));
}

Posted in ecommerce | Tagged , | Comments Off on Prestashop 1.6: Breadcrumb to display the category that product is currently in (not its default category)

Prestashop: Fix pagination error on Attributes and Features in Backoffice

https://www.prestashop.com/forums/topic/554037-possible-bug-on-product-attributes-list-pagination-in-1616/

https://www.prestashop.com/forums/topic/507337-backoffice-pagination-error-in-products-attribute-section/

Hi, i fixed this by adding a short code to ‘AdminAttributesGroupsController.php’ in /controllers/admin/

    public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewattribute_group') && Tools::getValue('id_attribute_group')) {
            $addUrl = '&viewattribute_group&id_attribute_group=' . Tools::getValue('id_attribute_group');
        }

        $this->redirect_after = $url . $addUrl;
    }

Function fixes the bug too for Feature values. We need to create an override for ‘AdminFeaturesController.php':

<?php

class AdminFeaturesController extends AdminFeaturesControllerCore
{

   public function setRedirectAfter($url)
    {
        $addUrl = '';
        if(Tools::isSubmit('viewfeature') && Tools::getValue('id_feature')) {
            $addUrl = '&viewfeature&id_feature=' . Tools::getValue('id_feature');
        }

        $this->redirect_after = $url . $addUrl;
    }
}
Posted in troubleshoot | Tagged , | Comments Off on Prestashop: Fix pagination error on Attributes and Features in Backoffice

Prestashop: remove google maps from order page in backoffice

https://www.prestashop.com/forums/topic/336592-remove-google-maps-from-order-page-in-16-slowing-down-crashing-siteserver/

Put the modified file in the override/controllers/admin
After that, you need to trigger the regeneration of the /cache/class_index.php file. This is done simply by deleting the file. It is the same when manually removing an override: in order to reinstate the default behavior, you must delete the /cache/class_index.php file.

QN: Anyone know the best way to remove the google maps module lookup for the customers address in the order page in 1.6. Or a way to remove google maps all together from prestashop. We have a user in china that cannot access the order page whenever the china government tries to block google and its services (they do that every time something sensitive comes up in western news).
ANS:

controllers/admin/AdminOrdersController.php

find and then comment out as follows:

public function setMedia()
{
parent::setMedia();

$this->addJqueryUI(‘ui.datepicker’);
$this->addJS(_PS_JS_DIR_.’vendor/d3.v3.min.js’);
// $this->addJS(‘https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false’);

if ($this->tabAccess[‘edit’] == 1 && $this->display == ‘view’)
{
$this->addJS(_PS_JS_DIR_.’admin_order.js’);
$this->addJS(_PS_JS_DIR_.’tools.js’);
$this->addJqueryPlugin(‘autocomplete’);
}
}

Posted in ecommerce | Tagged , , | Comments Off on Prestashop: remove google maps from order page in backoffice

Troubleshoot: Solve Windows ink Wacom pen scrolling instead of selecting issue

Pen tablet scrolling instead of behaving as normal. Issue happened after routine Windows update.
Open Wacom Tablet Properties, selecting Mapping, uncheck Windows Ink option.

As a safe-guard, open Pen & Windows Ink Settings
Disable related items as well.

Posted in troubleshoot | Comments Off on Troubleshoot: Solve Windows ink Wacom pen scrolling instead of selecting issue

Prestashop 1.7: Smarty error blank page on front end if adding new language manually

http://forge.prestashop.com/browse/BOOM-3486

Error: When adding a new language in the backend (localization->languages), there is no option to enter the locale, resulting in an empty locale field in the table ps_lang.
This results in a smarty error on frontend when selecting the new language:
{code}
SmartyException in smarty_internal_templatebase.php line 129:
Unable to load template file ‘\index.tpl’ {code}

User’s suggested solution:
As soon as I manually add a locale in the database, the error goes away.
Table: ps_lang
Add the missing locale to the table

Normally adding/importing a new language should go to: Translation > Add/Update a new language (or through the localization page)
But there are times when languages may be required to be added manually and this causes the issue.

Posted in troubleshoot | Tagged , | Comments Off on Prestashop 1.7: Smarty error blank page on front end if adding new language manually

Prestaship 1.6 Fix for Contact form invulnerable to spam bots

Contact form is vulnerable to spam bot. Captcha does not help in this case.
Fix here – https://github.com/PrestaShop/PrestaShop/pull/8168/files

Useful information on how to build an anti spam bot contact form without captcha
http://www.nfriedly.com/techblog/2009/11/how-to-build-a-spam-free-contact-forms-without-captchas/

Update:
Doesn’t work well against some automated spammers. Change the friendly url of the contact-us to something else and it stopped the spamming completely.
https://www.prestashop.com/forums/topic/442633-add-recaptcha-to-prestashop-version-16014-for-free/?page=5
https://www.prestashop.com/forums/topic/673164-how-do-i-integrate-recaptcha-v2-into-prestashop/?tab=comments#comment-2697948

Posted in troubleshoot | Tagged , | Comments Off on Prestaship 1.6 Fix for Contact form invulnerable to spam bots

Video: Reduce MP4 file size using Handbrake

Source: https://www.engagemedia.org/help/video-compression-step-by-step-handbrake-tutorial

A step by step guide to using Handbrake to make H264 video for EngageMedia, plus links to some ready-made presets you can use.

Contents

Why use Handbrake?
Make H264 With Handbrake – Step by Step Guide
Compressing H264 Using Presets

Why use Handbrake?

Handbrake is easy to use software that is available for Mac, Linux and Windows. Originally designed for ripping DVDs, it is the most popular tool for creating H264 video from any video file or DVD disc.

Below you can find a step-by-step guide for using Handbrake to compress your video. If you’re in a hurry, you can also use the custom Handbrake presets we have uploaded, to quickly apply these settings without having to enter them yourself.
Make H264 With Handbrake – Step by Step Guide

This tutorial assumes you have an HD video file that is 1920×1080 pixels. We will make the frame size a bit smaller, as well as drastically reduce the file size (compared to for example a Pro Res file from Final Cut Pro or Avid).

Install Handbrake by choosing the version for your operating system from http://handbrake.fr/

Open Handbrake from your Applications or Programs folder.

Load video your file. A browse window should have automatically opened for you to select your source video file (or DVD) or just click the Source button.

open source video file

Select the file you want to compress and click Open.

select file

Destination: Select where you want the transcoded video file to be saved by clicking Browse…

browse destination

Give the file an appropriate name such as “(Original-Filename)-H264.mp4” so you know which version is the one you have compressed. Choose where you want to save it, and click Save.

Save As

Choose Format MP4 file.

choose Format

For Video Codec choose H.264 (x264).

Choose H264

Choose the High Profile preset from the Presets Drawer (if this isn’t open, you can open it from Window > Presets Drawer in the top menu bar).

High Profile preset

Choose the framerate depending on your source video. It is PAL (25 frames per second) then leave it at 25fps by choosing 25 (PAL Film/Video). If it is NTSC (29.97fps) then make it 30fps by choosing 30. Make sure you tick the Constant Framerate radio button to ensure better compatability.

Choose framerate

Enter an Average Bitrate (kbps) for the video between 5,000-10,000 (choose 5000 unless you want a much higher quality video that will take longer to upload and download – see File Size Guide for more details). If you have plenty of time to wait while the program compresses your video, tick 2-pass encoding for better results. If you are in a hurry, then leave this box un-ticked.

Set bitrate

Click the Picture Settings button which opens a new dialog box where we can change the video frame size or resolution.

picture settings

Change Anamorphic to None (this feature is more suited to DVD ripping). Change Modulus to 16. Tick Keep Aspect Ratio. Use the stepper (click the arrow down) on Width to change Width from 1920 (full HD) down to 1280. Your Height should automatically then read as 720, if you have Keep Aspect Ratio ticked.

Here we are re-sizing the video, making it substantially smaller in the number of pixels it uses compared to 1920×1080. However, you may choose to keep it at 1920×1080, and use a higher bitrate such as 10,000 kbps (see above).

Resolution and picture settings

Select the Audio tab and select AAC (ffmpeg) Codec. Choose the 48.000 Hz Samplerate. Choose Stereo for Mixdown. Choose 320 for your audio Bitrate.

Audio settings

Hit the Start button and wait until video has finished encoding.

You can choose to queue multiple files by clicking Add to Queue, and can start/stop the Queue by clicking Show Queue. This is helpful if you have many files to compress.

Start

Handbrake will let you know when it has finished.

Finished

Open your video file in VLC or another video player and check it looks good. Check periods of intense motion more carefully to make sure you don’t have too many compression artefacts. If the file doesn’t look good enough, try doing it again with a higher bitrate. If it looks good, then you are ready to upload the video file!

vlc

If you like the settings you are using you can save them as a preset by clicking the + sign in the bottom right of the Presets Drawer.

save a preset

Compressing H264 Using Presets

We have created a preset that uses the exact settings above, which makes it incredibly easy to apply these settings. To use this, first, you need to download the preset file.

For an original video file that is 25 frames per second, choose this preset file.

For an original video file that is 29.97 or 30 frames per second, choose this preset file.

To import the preset, choose go to Presets -> Import in the Handbrake top menu and select the preset file you just downloaded. They should appear in the Handbrake presets panel, available for use.

presets import

Make sure you have loaded your original video file by clicking Source, and given it a Destination and new filename by clicking Browse… Now just click on the appropriate preset called “(import) v4c.org H264 720p 25fps”, or “(import) v4c.org H264 720p 30fps”, then click Start.

Presets source and start

For further information and a glossary of terms, read on…

Posted in Video | Tagged | Comments Off on Video: Reduce MP4 file size using Handbrake

How to fix Sony Vegas Black Screen rendering error

Source: https://www.youtube.com/watch?v=7QVPSOBj3sQ

In timeline
Right click affected video, propeties >
Switches > Disable Resample

File menu
Options> Preferences > uncheck close media files when not the active application

Restart the application and try. Should work.

Posted in troubleshoot | Tagged | Comments Off on How to fix Sony Vegas Black Screen rendering error

Troubleshoot: Reclaim Disk Space from Drive C By Clearing iTunes Backups and Data

Drive C disk space went critically low to almost 0 Gig!

Uninstalled many programs which didn’t help much.

Initially I thought Adobe software cache was the culprit based on this link… but mine was only taking up around 200MB
http://marcschultz.com/blog/adobes-abuse-of-hard-drive-storage-space/

Which then led me to do a folder by folder size check

C:\Users\”Your Username”\AppData\Roaming\Apple Computer
Took up more than 60Gigs of space… =_= Housekeeping way overdue.

https://www.igeeksblog.com/how-to-reclaim-disk-space-by-clearing-itunes-backups-and-data/

Posted in Adobe, troubleshoot | Tagged , | Comments Off on Troubleshoot: Reclaim Disk Space from Drive C By Clearing iTunes Backups and Data

Troubleshoot: Fix Internet Explorer 8 mess up WordPress themes

Use this service to test the pages https://netrenderer.com

https://developer.microsoft.com/en-us/microsoft-edge/
https://ckon.wordpress.com/2009/03/19/how-to-fix-internet-explorer-8/

Download virtual machines
Test Microsoft Edge and versions of IE8 through IE11 using free virtual machines you download and manage locally.
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

https://developer.microsoft.com/en-us/microsoft-edge/tools/screenshots/

Posted in troubleshoot | Tagged , , , , | Comments Off on Troubleshoot: Fix Internet Explorer 8 mess up WordPress themes