Magento 2


Magento 2 vs Magento 1 pricing differences

Advanced Pricing

Advanced pricing is a section where you can setup specials and tiered pricing.  The functionality is the same as in M1, but they’ve just moved and renamed some functionality.

There are two kinds of advanced pricing in magento 2.

  1. You can set a special price for a date range, which was already available in M1.
    1. Special price to and from date is missing in Magento 2 EE. This is because Magento intentionally removed it from EE so admins would use scheduled updates instead.
    2. In addition to specifying a fixed price discount for tiered pricing, in M2 tiered pricing can be a percentage off discount.
    3. M2 has an input for product cost, which has no value that I can find.  It’s not in reports or anything; it does get inserted into the order quote though.

 

Configurable Products

In Magento 1, once the simple product is associated to the configurable, the simple’s price no longer matters; it’s not used.  It’s still visible when viewing the configurable’s simple products and adds confusion.  In M1 the variations’s pricing is based off the configurable’s price plus a difference of fixed amount or percentage.  The difference can be negative. 

In Magento 2, configurable variation pricing is one of the following:

  1. All simple variations inherit the price from the configurable
  2. A price is specified for each simple. The difference from M1 is, the price you specify isn’t based on the configurable’s price at all; it’s independent.  If the configurable’s price is $20, and you want this simple’s price to be $25, you’ll specify $25 in M2 instead of $5 in M1.  This works much better if you’re pulling in prices from an ERP that has the full price specified. 


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]) . '\')',