Development


Magento 2 Solutions Specialist

The other day I passed the Magento 2 Solutions Specialist exam. I cannot provide details of the exam, but I’ll say there were a number of challenging questions. I found the study guide and practice test from swift otter to be very helpful https://swiftotter.com/technical/magento-2-certified-solution-specialist-practice-test , but there were some incorrect statements that should be fixed. I have emailed Joshua with this request.

“Inventory is associated with a specific website.”
This is incorrect. Invetory Qty is global.

“Flat product pricing can be changed on a store view basis.”
Product price is global by default, but can be changed to “website” (not store) in stores->configuration->catalog->catalog->price .

“What marketing and merchandising features are available only in Magento 2 Enterprise Edition?”
1. Bulk ordering doesn’t exist out of box.
2. Bluefoot CMS is not built in. Module today has been deprecated.

“What does the acronym MOSCOW stand for? How is it used?”
MosCoW is a way determining the importance of requirements for a project, hence the term MoSCoW Prioritisation. MoSCoW stands for Must haves, Should haves, Could haves, Won’t haves. The o’s are added to make the acronym pronounceable and memorable.

Details of the exam are here https://u.magento.com/certified-magento2-solution-specialist#.WkfCtt-nFhE .

MAGENTO 2 SOLUTION SPECIALIST OVERVIEW

A Magento 2 Solution Specialist is an expert user of the Magento 2 ecommerce platform. Drawing on a deep background in business and ecommerce, the Magento 2 Solution Specialist can efficiently align business objectives with Magento 2 functionality, optimize use of native features, and avoid unnecessary customization. Whether as a merchant, a manager, a consultant, or an analyst, the Magento 2 Solution Specialist knows how to make the best use of Magento 2 features and functionality.

A Magento 2 Certified Solution Specialist has deep familiarity with the Magento platform, including:

Magento 2 Architecture: layouts, themes, extensions and customizations; Magento data models
Elements of a Magento 2 ecommerce site: catalog, shipping, payment, order processing, promotions, extensions, import/export, etc.
Application of Magento 2 knowledge to business goals: mapping client needs to Magento features, recommending the most effective options for implementing client requirements in Magento
ABOUT THE EXAM
75 Multiple Choice items
90 minutes to complete the exam


Magento 2: cron “Too late for the schedule” message in cron_schedule table

I ran into this issue today where every cron job would get created a few seconds after when it was supposed to execute. Because of this it would fail to run.

Notice the “send_notification” cron job at the top was executed, but then never finished and the “Too late for the schedule” message started shortly after. Geil Berkers also encountered this issue with Magento 2 in his post https://gielberkers.com/solving-too-late-for-the-schedule-with-magento-crons/ .

The issue with that cron job caused all subsequent crons to become too late for the schedule. As a temporary solution I manually entered a date in the “finished_at” column of the “send_notification” record and within a few minutes all crons started running again.


Magento 2: Add grid column with a link in each row

I was tasked with adding a column with a link in each row to a custom grid in the Magento 2 admin panel. This grid does not use Ui Components. It took quite a while to find the solution, so I’m posting here to save for later and also for your viewing. This file is \Block\Adminhtml\$area\Grid.php and adds a “Delete” link to each row. The below sample uses a value for “id” for each data item in the collection (“index”), and adds an “id” URL variable with the id value to the hyperlink.

protected function _prepareColumns()
{
	//.... other columns here
 
	$this->addColumn('action', array(
		'header' => __('Action'),
		'width' => '100',
		'type' => 'action',
		'getter' => 'getId',
		'actions' => array(
			array(
				'caption' => __('Delete'),
				'url' => array('base' => '*/config_cms_page_field/delete'),
				'field' => 'id'
			)
		),
		'filter' => false,
		'sortable' => false,
		'index' => 'id',
		'is_system' => true,
	));
	return parent::_prepareColumns();
}

Further enhancements might include adding a confirmation popup once the delete link is clicked. For that we’d use this instead of the “url” array key. The trouble I had is what variable is used for the “id” of each row. If you can figure it out please let me know. A view renderer may be needed for this.

'onclick' => 'deleteConfirm("'.__('Are you sure you want to delete this?').'", \'' . $this->getUrl('*/config_cms_page_field/delete', ['id' => 111]) . '\')',

Importing wordpress database error “Invalid default value for .. “

While moving my wordpress blog to the new Google Cloud Hosting setup, the database would not import. This is due to MySQL being setup in strict mode by default in MySQL version 5.7 . One solution on the internet is to set MySQL’s SQL_MODE to “NO_ENGINE_SUBSTITUTION”, but Google knows better and won’t let you do that for security purposes. They do provide an option https://cloud.google.com/sql/docs/mysql/flags to alter the settings and allow for invalid dates. In the drop down as pictured, select “Allow Invalid Dates”. Then your wordpress database import will work.


Prevent iPhone from zooming when entering text

The iPhone likes to zoom into form elements when entering text. This is great, but once you’re finished entering text, the zoom remains and leaves an undesirable horizontal scrollbar and generally poor user experience until (if) they figure out they need to zoom back out. The below code will prevent the zooming in the first place.

/* prevent iphones from zooming in when entering text */
@media screen and (-webkit-min-device-pixel-ratio:0) { 
	select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"] { font-size: 16px; }
}