Enable Magento2 Command-Line Interface (CLI) on Linux

For both development, ongoing management and scheduled tasks Magento’s Command Line Interface is able to do it all.

To enable CLI for Magento to you’ll need to make sure the file /bin/magento is executable by the system.

If you’re on the server SSH into the root of your Magneto install and run the command

chmod +x bin/magento

If you’re on desktop simply locate the file in your file explorer, right click and set the “Allow executing file as program” checkbox on the Permissions tab.

The latest update to PHP7 is here… 7.2.0

This month PHP released the latest update PHP7.2.0. While PHP 7.2 is an improvement, it is not groundbreaking as the jump from PHP5.6 to PHP7.0. However the biggest change, having encryption as part of the standard library in PHP, is very exciting. As PHP7 evolves and developers get more interesting tools to work with there are more and more reasons for dumping PHP5 and embracing the change.

Amongst the security updates there are a few cool new features and a couple of significant deprecations. Carlo Daniele has compiled a list here.

Running web applications on PHP7.2.0

Magento2 & PHP7.2.0

If you’re running Magento2 now might not be the best time to upgrade your PHP installation. It is important to note that both each() and mcrypt() have been removed from PHP 7.2. So stick with PHP 7.1, it doesn’t reach its end of life until 2019. Full list M2 requirements from Magento.

Magento 1 & PHP7

Out-of-the-box Magento 1.X installs are not designed to run on PHP7 at all. If you really need to run Magento 1.X on PHP7 Inchoo have created an our open-source compatibility extension for Magento and PHP 7 with impressive speed improvements. Details here

WordPress & PHP7.2

As you’d expect as long as your WordPress install is up to date it’ll run fine.

Shopify: Setting up a multipurpose CMSed liquid homepage section

Setting up a multipurpose CMSed liquid homepage section for Shopify.

The below schema includes two sets of data

  1. A YouTube Video display
  2. A list of testimonials (max 5)
{% schema %}
  {
    "name": "Video & Testimonial",
    "max_blocks": 5,
  	"settings": [
		{
          "id": "video_title",
          "type": "text",
          "label": "Heading",
          "default": "Learn 'How to' with our video"
		},
		{
          "id": "video_sub",
          "type": "text",
          "label": "Heading",
          "default": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed incididunt. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod"
		},
		{
          "id": "video_code",
          "type": "text",
          "label": "YouTube Code",
          "default": "GF60Iuh643I"
		},
		{
          "id": "video_image",
          "type": "image_picker",
          "label": "Background Image"
		}
  	],
  	"blocks": [
      {
        "type": "testimonial",
        "name": "Testimonial Option",
        "settings": [
          {
            "id": "testimonial_subject",
            "type": "text",
            "label": "Testimonial Subject"
      	  },
          {
            "type": "image_picker",
            "id": "image",
            "label": "Image"
          },
          {
            "id": "testimonial_desc",
            "type": "textarea",
            "label": "Testimonial Description"
          },
          {
            "id": "testimonial_author",
            "type": "text",
            "label": "Testimonial Author"
          }
        ]
      }
      
    ],
    "presets": [
      {
        "name": "Video and Testimonial",
        "category": "Testimonial",
		    "settings": {}
      }
    ]
  }
{% endschema %}

First we grab and display the variables from the Settings section of the JSON

<div class="medium-6 columns">
	<div class="content-wrap">
		<h3><span class="subheading">Learn 'How to' with our</span>{{ section.settings.video_title }}</h3>
		<p>{{ section.settings.video_sub }}</p>
		<a data-fancybox href="https://www.youtube.com/watch?v={{ section.settings.video_code }}" class="button">View Video</a>
	</div>
</div>
<div class="medium-6 columns">
	<a data-fancybox class="image-wrap" href="https://www.youtube.com/watch?v={{ section.settings.video_code }}">
		<img class="play-button" src="//cdn.shopify.com/s/files/1/2602/4064/t/2/assets/play-button.png">
		<img src="{{ section.settings.video_image | img_url }}">
	</a>
</div>

Then we grab the repeating testimonial blocks

{% if section.blocks.size > 0 %}
<section class="testimonial1 angle-bigarrow">
	<div class="row">
		<div class="small-12 column">
			<ul class="grid-1 wow fadeInUp">
				{% for block in section.blocks %}
				<li {{ block.shopify_attributes }}>
					<div class="testimonial-inner">
						<img src="{{ block.settings.image | img_url: '150x150' }}" alt="slider" />
						<h5>{{ block.settings.testimonial_author }}</h5>
						<p>{{ block.settings.testimonial_desc }}</p>
					</div>
				</li>
				{% endfor %}
			</ul>
		</div>
	</div>
</section>
{% endif %}

 

Shopify: List product variations on collection pages

The code below will allow you to display a set of product variations on a Shopify product collection pages.

Set this code in the collections page product loop, or within the liquid snippet that controls the display of products. On line three I’ve specified “Weight” as the option I want to display so on the list page the customer can see that I have 25ml, 50ml, and 100ml product sizes available.

{% for option in product.options %}
  {% if option == 'Weight' %}
    {% assign index = forloop.index0 %}
      {% for variant in product.variants %}
        {{ variant.options[index] }}
      {% endfor %}
    {% endif %}
{% endfor %}

CMS blocks disappear after version 1.9.2.2 upgrade or SUPEE-6788 patch

Magento veresion 1.9.2.2 and patch SUPEE-6788 both introduce a new security featuer to Magento. Blocks on the front-end have to be enabled or whitelisted before it will work.

Blocks can be added via a new Admin Panel section under Permissions > Blocks. Adding or allowing a new block is pretty streight forward:

  1. Navigate to System > Permissions > Blocks
  2. Click “Add New Block”
  3. Enter the block name: e.g. cms/block*
  4. Set “Is Allowed” to Yes

* Replace this with the name of the block that has disappeared

Running Ubuntu on Windows

One of my favourite aspects of Windows 10 has been the Linux subsystem for Windows.

I’ve been using it since launch partly because it sounded cool but also because a majority of my development projects are Linux based and when I’m interacting with a server I use Bash, a command line interface for Linux.

Day to day usefulness

As someone who daily has to interact with various servers it makes sense to use bash everywhere. On Windows with the Linux subsystem, you can Bash scripts, use command-line tools like sed, awk, grep, and you can even run Linux-first tools like Ruby, Git, Python, etc. directly on Windows.

You have complete access to your existing Windows filesystem from within Bash allowing you to work on the same set of files using both Windows applications and Linux command-line tools.

Desktop experiments

On the experimental side and with the addition of a window manager Xming X Server I have been able to run Linux applications such as Open Office, Firefox and Tor Browser from within the Linux subsystem on Windows.

 

Why is WordPress so popular?

WordPress is a free and open source software used by millions of people around the world to create websites and blogs. The most popular features of WordPress include its ease of use and ability to be extended way beyond the simple blog software it starts out as.

WordPress Northern Ireland

I’ve been developing WordPress websites for 10 years and am always looking for the next exciting project from personal blog, community portal or business website. Why not get in touch to see if I can help you with yours.

Front-end themes and templates can be easily downloaded from the official WordPress site or from hundreds of other places around the web. The same goes with extensions and plugins, which are used to extend the functionality of your WordPress site. A wide range of people contribute time, knowledge and skill to keeping the core WordPress software updated and secure.

There’s also a huge number of designers, developers & bloggers who share their knowledge through blog posts, tutorials, reviews, videos and the creation of thousands of themes & plugins.

It is estimated that WordPress could power as much as 29% of the world wide web. It is used for everything from personal blogs to large corporate websites with an even wider range of uses. From news sites and magazines to full e-commerce and online booking systems.

GDPR: What is the EU General Data Protection Regulation?

The General Data Protection Regulation (GDPR) will have an impact on how organisations handle the personal information that they look after.

GDPR is a regulation by which the European Parliament, the Council of the European Union and the European Commission intend to strengthen and unify data protection for all individuals within the European Union (EU). It also addresses the export of personal data outside the EU. The GDPR aims primarily to give control back to citizens and residents over their personal data and to simplify the regulatory environment for international business by unifying the regulation within the EU.

GDPR will have a role in four main areas:

1. Easier Access
Users will have easier access to their own data. Individuals will be better informed as to how their information is processed and stored and organisations will need to inform users in the clearest way possible.

2. Portability
Users should easily transfer their own information between service providers.

3. Right to be forgotten
Users that no longer want you to control or store their personal information you have processed should be able to easily have their data removed from your system unless there are legitimate grounds for keeping it.

4. Data breaches
Users should know that their information has been lost/stole or otherwise compromised. If your systems have been breached the users affected should be informed as soon as possible.

The implementation of the four points will depend on how you currently store and access user information. You will also need to be clear what you are using that information for.

 

Spammers: Murphy Consulting

You’ll have picked up from previous posts, I really don’t like spam. Running a website with a contact form I get a fair bit but occasionally I get spammed by what otherwise looks to be a reputable company and I have to call them out on it.

At Murphy Consulting (www.murphyconsulting.us) their number one goal is to create a mutually beneficial relationship with their partner, keep them happy and earn repeat business.

The spamming itself has been outsourced to the Philippines. Which itself is worrying for anyone taking-up Murphy Consulting as a web designer/developer or SEO agency. Brian Murphy at Murphy Consulting is already well known as a spammer. They are also known for ignoring SPAM warnings and violating terms of use of websites like this example.

If their own marketing capabilities are anything to go by they are best avoided.

I tried contacting Murphy Consulting via their Facebook and the Twitter account of another company that shares their office. Patrick Murphy and Brian Murphy are yet to respond to requests for help.

No response this far.

 

https://twitter.com/Keithology/status/940170964117151745

Checkout problems upgrading to Magento 1.9.3.4+

Magento version 1.9.3.4 include patch SUPEE-9767 V2 which includes security patching for the checkout process.

For your current front-end templates to work with this patch you will need to include a form key value to a number of forms in the checkout process.

<?php echo $this->getBlockHtml('formkey') ?>

Load the templates below from your  app/design/frontend/<package>/<theme> directory and add the Form Key code above between the <form> and </form> tags on each.

The basic templates that will need upgraded:

  • /template/checkout/cart/shipping.phtml
  • /template/checkout/onepage/billing.phtml
  • /template/checkout/onepage/shipping.phtml
  • /template/checkout/onepage/payment.phtml

If persistant checkout is enabled:

  • /template/checkout/onepage/shipping_method.phtml
  • /template/persistent/checkout/onepage/billing.phtml

If you allow shippinng to multiple addresses:

  • /template/checkout/multishipping/billing.phtml
  • /template/checkout/multishipping/shipping.phtml

Upgrading Magento 1 through the Magento Connect Downloader

If you don’t fancy upgrading Magento 1 through command line, you can upgrade Magneto core using Magento’s in-built Magento Connect Downloader.

  • Load yoursite.com/downloader.
  • Login with a user who has full Magento permissions.
  • Make sure to click the “Clear all sessions after successful install or upgrade” option before proceeding.
  • Click the Check for Upgardes button
  • This will load all the packages with upgrade options beside them.
  • Find the package name Mage_All_Latest
  • In the dropdown choose the most recent version of Mage_All_Latest
  • Use the checkbox beside it to include it in the upgrade
  • Click Commit Changes

If you login and don’t see any packages, this may be due to the way the site was built.

At the top of Magento connect downloader enter magento-core/Mage_All_Latest  in the in put box, this will install all latest MagentoConnect core packages on top of existing files and will allow future upgrades through Magento Connect Downloader.

Upgrading Magento 1 through command line

Alternative: Upgrade Magneto using the Magento Connect Downloader

Upgrading Magento is a must to keep your store in top-top condition, protect your customers and your business.

Upgrading Magento through command line is the easiest way to make sure you are running the latest version of the Magento Software

  • Load the root directory of your Magento store
  • Make sure the “mage” file has the right permissions: chmod 777 mage
  • Then launch Magento set-up: ./mage mage-setup
  • If all goes well you can then pull the latest version of the code source code:
    ./mage install http://connect20.magentocommerce.com/community Mage_All_Latest --force

If things didn’t go well with mage-setup you may need to run set som preferences….

  1. Make sure your prefered code is set: ./mage config-set preferred_state stable
  2. Then sync your changes: ./mage sync

You can then try the install command again.

That should do the trick.

 

Spammers: Lee Andrew Meranda

I’ve been getting spammed by a company called The Compensation Specialist. They are a personal injury outfit. I’m not sure how they got my email but I didn’t subscribe and we don’t have an existing relationship, both are required for a UK company to send unsolicited email marketing material.

The rules on electronic mail marketing are in regulation 22. In short, you must not send electronic mail marketing to individuals, unless:

  • they have specifically consented to electronic mail from you; or
  • they are an existing customer who bought (or negotiated to buy) a similar product or service from you in the past, and you gave them a simple way to opt out both when you first collected their details and in every message you have sent.

You must not disguise or conceal your identity, and you must provide a valid contact address so they can opt out or unsubscribe.

I can’t seem to find any online or email contact details so might have to send this post out to him at his registered address.

Edit: Found an email address for one of Lee’s other companies, I’ll email there to find out wasssup.

The link in the spam email directs through to a contact form, which handily includes Mr Meranda’s companies record with the Crisis Management Regulator.

The Claims Regular provides an outline of Lee’s organisations. I’ll see if I can contact him through one of those.

Other trading names include: UK Claim Experts, Accident Compensation Alliance, 60 Second Claim, UK Claim Lawyers, Nationwide Injury Lawyers, Smart Compensation