Remove Paypal Express Checkout from Prestashop

In order to remove the PayPal Express Checkout button from the product and shopping cart pages in Prestashop 1.6, you need to remove the PayPal Modul from the correlating hooks.

Step 1:

Go to Modules > Positions:

Step 2:

Click  ‘All Modules‘, do a search for the PayPal Module and choose it from the search results:

Step 3:

Now you get a list of all hooks which the PayPal module is attached to. Scroll down the page and look for the displayFooterProduct hook, click on the arrow next to the PayPal modules ‘Edit‘ button. Then click on ‘Unhook‘.

Step 4:

Like in step 3, just this time remove the PayPal module from the displayFooterProduct hook.

The PayPal Express button should now be removed.

Do you know a better way? Let me know about it in the comments below:

How to clear the Firefox browser cache?

This tutorial is written for Mac users, but it should also apply for Windows users.

For clearing the cache in the Firefox browser, go to: Firefox > Preferences > Privacy & Security,  scroll to the Cached Web Content section and click the ‘Clear Cache‘ button.

Additionally, go to the Site Data section, here you also need to click the ‘Clear all data‘ button.

Now close the browser and open it again to start a new session.

This should clear the cache in most cases.

Firefox clearing the cache didn’t work? Browser still shows cached data?

If Firefox still shows you a cached website, try this additional step:

In the menu bar at the top, click on History > Clear Recent History…

A pop-up window will open where you can select how much of your history you want to clear. To be sure, you can select ‘Everything‘ in the time range field and click the ‘Clear now‘ button.

Note:  This clears all your browsing history. If you don’t want this, you could try first to delete todays files and see if this is enough.

Don’t forget to close and reopen the browser.

Now you should see the website you want in the uncached version.

How to use titanium search with tableviews and listviews

Titanium mobile has a build in search feature for iOS and Android devices. It is mostly used on tableViews or listViews. But how are the search methods and properties implemented for some of the common scenarios?

The input field

In any case we need a search bar input field. Here we have the following options:

  1.  The build-in Titanium.UI.SearchBar object for iOS and Android devices
  2. The build-in Titanium.UI.Android.SearchView object for Android devices
  3. A custom build search input field for added flexibility

searchBar (ios and android)

The searchBar is commonly used with table and list views, but can also be used independently (see searchText below). To create a searchBar use the Titanium.UI.createSearchBar method.
Simple example:

var searchBar = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0,
})

android.searchView (android)

The android.searchView is similar to the searchBar above, but can be added to the action bar. See example implementation below:

// Use action bar search view
var search = Ti.UI.Android.createSearchView({
hintText: "Table Search"
});

win.activity.onCreateOptionsMenu = function(e) {
var menu = e.menu;
var menuItem = menu.add({
title: 'Table Search',
actionView : search,
icon: (Ti.Android.R.drawable.ic_menu_search ? Ti.Android.R.drawable.ic_menu_search : "my_search.png"),
showAsAction: Ti.Android.SHOW_AS_ACTION_IF_ROOM | Ti.Android.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW
});
};

Custom search bar

To get more flexibility in designing the search bar, we can use a normal Titanium text field and button to create our own search bar. For this we can use the Ti.UI.textField and Ti.UI.button objects and add them to the view.

Event Handling

The searchBar doesn’t really do anything by itself. We need to use event listeners to react when the searchBar is used.

Here are some examples:

//when text is added or changed in the searchBar we store the text in e.value
searchBar.addEventListener('change', function(e){
e.value;
});

//when the return key is hit, remove focus from our searchBar
searchBar.addEventListener('return', function(e){
searchBar.blur();
});

//when the cancel button is tapped, remove focus from our searchBar
searchBar.addEventListener('cancel', function(e){
searchBar.blur();
});

Connecting it to the views

A view needs to know which input field it should use to filter the results. For this we can use some build-in properties in both the tableView and the listView.

search (tableView)

The search property is used in tableViews, and tells us which searchbar input field should be used in conjunction with the tableView.

In the below example we assume that searchBar is the variable name for the actual searchBar implemented earlier.

var listView = Titanium.UI.createListView({
templates : {'plain' : plainTemplate },
defaultItemTemplate : 'plain',
search: searchBar
});

searchView (listView)

This is the equivalent to the ‘search’ property above, but is used for listViews, not for tableViews.

var listView = Titanium.UI.createListView({
templates : {'plain' : plainTemplate },
defaultItemTemplate : 'plain',
searchView: searchBar
});

searchText (listView)

This is a second way on how to implement search with a listView. Here we display the searchBar in the listView header, and not inside the listView itself. And we pass the search bar input value directly into the listViews searchText property.

For this to work we have to change the event listener so it updates the build-in searchText property in our listView:

searchBar.addEventListener('change', function(e){
listView.searchText = e.value;
});

Then we need to tell the listView to add the searchBar into the header of the view:

var tblTrees = Titanium.UI.createListView({
templates : {'plain' : plainTemplate },
defaultItemTemplate : 'plain',
sectionIndexTitles: indices,
headerView: searchBar
});

It is possible to show the search bar outside the listView all together. For this we need to remove the headerView: searchBar line above, and instead add the searchBar directly to the window.

win.add(searchBar);
win.add(listView);

This works because we pass the search terms directly to the searchText property, and so don’t rely on the listView knowing what search field the values come from. Don’t forget to add the ‘top’ property to the listView in order to move it down and make space for the newly added searchBar, otherwise the listView might cover the searchBar.

How To Register Your Apple Development Device

In order to test your app on your Apple device you need to register it in your developer program account. This video shows you how to register your Apple development device, using the UDID provided by iTunes.

Prerequisite: Get an Apple ID and register for the paid developer program.

Add Honeypot to Simplenews subscription form block

The Drupal Honeypot module (https://drupal.org/project/honeypot) works well out of the box for comments and web forms in nodes.

In my case i needed to add the Honeypot spam filter to a Simplenews (https://drupal.org/project/simplenews) newsletter subscription form, which resides inside a block in the sidebar of most pages.

The problem here was that if the time restriction feature is active, the Honeypot module disables the cache on pages where it is used (which is on most pages). I could have disabled this feature all together, but it is just another layer of protection that i didn’t want to loose.

So the way to get around this is to target a specific form and add or alter the Honeypot feature specifically. This is done by creating a custom module.

Step by step

Create a folder in the module section (sites/all/modules), and give it the name of your module. Example: overwrite_simplenews

Add two files to the folder.

  1. overwrite_simplenews.info
  2. overwrite_simplenews.module

The .info file should contain something like this (change as required):

name = Overwrite Simplenews
description = Customization
package = Mail
core = 7.x

The .module file should contain something like this (change as required):

/* Add Honeypot to simplenews subscription form */

function kleinermann_form_alter(&$form, &$form_state, $form_id){
	if ($form_id == 'REPLACE_WITH_FORM_ID') {
		honeypot_add_form_protection($form, $form_state, array('honeypot'));
	}
}

You need to replace REPLACE_WITH_FORM_ID with the ID of the form you want to target. To find the form ID, you can check your page source in the browser with Firebug, or if the theme doesn’t output this information, you can use the Devel module. After activation of the Devel module, put this inside your module to output the form ID:

function kleinermann_form_alter(&$form, &$form_state, $form_id){
   dsm ($form);
   dsm ($form_id);
}

For more details check out this great video by Peter Yaworski: https://www.torontowebsitedeveloper.com/drupal-video-tutorials/drupal-6-simplenews-subscription-block-override-tutorial-1-2

If you check the form now in the source of your browser output you should find that there is an extra hidden field in your subscription form, named as specified in the Honeypot settings page.

How to customise and restore the Microsoft Word menu on Mac

If you need to make changes to the menu on Word you can rightclick onto the Toolbar and choose ‘Customise Toolbars and Menus…’

Remove, add or reorder menu items in the small menu on the top of the screen.

word-menu-2

Restore the original menu by clicking the reset button. Make sure you have highlighted the menu you want to reset before you push the button.

word-menu-3

How to Talk to a CentOS server via Command Line

Here are a few commands that I found helpful when I learned to use the command line to connect to the server.

Connect

To connect to the server, type the following line into your command line tool. I’m on a Mac and use the terminal:

ssh username@ip

username is the name of a user that has ssh permission, example: root. ip is the ip of the domain you want to connect to, example: 321.130.21.12

you will then be asked for a password for the user, which you need to provide.

Getting around

To manoeuvre to the right directory, you can use some of the following commands:

  • ls (list files and folders in the current directory)
  • cd (change directory)
    cd .. (change to parent directory)
    cd folder/folder1/folder2/ (go to a directory directly by typing the exact location)
  • use the ~ symbol to get back to the home directory. Example: cd ~

Doing things with files

You can manipulate files and folders by using the following commands.

cp
The cp command makes a copy of a file for you. For example, cp file foo makes an exact copy of the file whose name you entered and names the copy foo, but the first file will still exist with its original name. After you use mv, the original file no longer exists, but after you use cp, that file stays and a new copy is made.

mv
The mv command moves a file to a different location or renames a file. Examples are as follows: mv file foo renames the original file to foo. mv foo ~/Desktop moves the file foo to your desktop directory but does not rename it. You must specify a new filename to rename a file.

rm
Use this command to remove or delete a file in your directory. It does not work on directories that contain files.

mkdir
The mkdir command allows you to create directories. For example, mkdir music creates a music directory.

chmod
The chmod command changes the permissions on the files listed.
Permissions are based on a fairly simple model. You can set permissions for user, group, and world, and you can set whether each can read, write, and/or execute the file. For example, if a file had permission to allow everybody to read but only the user could write, the permissions would read rwxr–r–. To add or remove a permission, you append a + or a – in front of the specific permission. For example, to add the capability for the group to edit in the previous example, you could type chmod g+x file.

Example:

chmod 764 pics.html

owner group other
777 = rwxrwxrwx
755 = rwxr-xr-x
744 = rwxr–r–
644 = rw-r–r–

chown
The chown command allows the user to change the user and group ownerships of a file. For example, chown john file changes the ownership of the file to John.

How do I permanently delete my Facebook account?

I was quite surprised at how many hoops I had to jump through to permanently delete my Facebook account.

If you use the deactivation link from within your account preferences, the account is only deactivated and can be reactivated  at a later stage if you change your mind.

However, if you want to permanently delete your Facebook account, there doesn’t seem to be any way of doing so from within your account preferences.

I had to resort to searching for an external url via Google.

If you want to get off Facebook permanently, log into your account and use the following link:

https://www.facebook.com/help/delete_account

Add a new tab to a Facebook page (2012)

I had so many problems with adding a new tab to a Facebook page containing an iframe content from an external website, that I though i’d put this tutorial together for others who might be experiencing the same difficulties.

Requirements
In this tutorial I assume you have already set up or know how to set up the following things:

  1. Facebook Page
  2. Facebook Developer account
  3. URL to external website

The steps

Create New App: Go to https://developers.facebook.com/apps/ and create a new app. Then choose your app from the list and click the Edit App button on the top right.

Allow Tab feature: Scroll down the page and activate the Page Tab field. Here you need to fill in the name, url and secure url. The URL is the address to an external page (Example: https://www.my-website.com/facebook-landing-page). More and more users are using Facebook’s secure browsing feature. If you’d like to provide a page for these users as well, you’ll need to provide a url to a website with ssl security as well (Example: https://www.my-website.com/facebook-landing-page). Facebook actually requires this address now, but it is unclear what happens if you don’t provide it.

Activate the tab: At the time of writing,  there is no way to activate the tab other than using the link below. In the past, this was done by going on the application page. But since Facebook has gotten rid of his page, we need to use this link (replace YOUR_APP_ID with your apps id. This can be found in the url of your app).

https://www.facebook.com/dialog/pagetab?app_id=YOUR_APP_ID&display=popup&next=https://www.facebook.com/

 

When you go to your Facebook page you should now see your new tab (If not, click the arrow on the right of your page to expose the second row of tabs – you might find your new tab there)

iPhoto Videos Don’t Work

Recently, I had the problem that videos on iPhoto wouldn’t play anymore on my Macbook pro (Snow Leopard 10.6.8). It took me quite a while to figure out the cause, so I thought i’d share my solution here.

Upgrade Quicktime

First, I uninstalled Quicktime by deleting it from the applications folder, and made sure I installed the latest version from here: Quicktime 7

This still didn’t fix the issue, but it’s probably still a good idea to make sure you’re runing the latest release.

Perian

Then I removed Perian, which I had installed a few months earlier. Perian is a collection of Quicktime components that add support for many popular video formats. I suspected that this may be causing the problem.

How to uninstall Perian

  1. Go to System preferences
  2. Click on Perian
  3. Click the uninstall button
  4. Go back to the system preferences overview page and right-click on Perian. Click on remove.
  5. Restart

When I restarted the Mac, the videos in iPhotos worked again. I don’t know why, but I think that the version of Perian I was running is what caused the issue. There might be other ways around it but I decided not to use Perian anymore and to simply install the codec components I needed manually instead.

Missing Codecs

I installed the XVid and DivX codec only, as they were the video formats I used primarily.

DivX can be installed from here.

And the XVid component can be downloaded from here. After the download, unpack and move the file to /Library/QuickTime.

 

 

x


Angebot anfordern

Ich melde mich innerhalb von 24 Stunden zurück.