PHP code example of swissup / core
1. Go to this page and download the library: Download swissup/core library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
swissup / core example snippets
$module = $this->_objectManager->create('Swissup\Core\Model\Module');
$module->load('Swissup_ArgentoDefault')
->setNewStores([0])
->up();
namespace Swissup\ArgentoDefault\Upgrades;
class InitialInstallation extends \Swissup\Core\Model\Module\Upgrade
{
public function up()
{
// This method is optional.
// Additional logic may be placed here.
}
public function getCommands()
{
return [
'Configuration' => [
'prolabels/on_sale/product/active' => 1,
'prolabels/on_sale/category/active' => 1,
'prolabels/is_new/product/active' => 1,
'prolabels/is_new/category/active' => 1,
],
'CmsBlock' => [
'header_callout' => [
'title' => 'header_callout',
'identifier' => 'header_callout',
'is_active' => 1,
'content' => 'content'
]
]
'ProductAttribute' => [
[
'attribute_code' => 'featured',
'frontend_label' => array('Featured'),
'default_value' => 0
]
],
'Products' => [
'featured' => 6,
'news_from_date' => 6
]
];
}
}
$this->popupMessageManager->addError(
__('Decoding failed: Syntax error'),
$popupText,
$popupTitle
);
Swissup/ArgentoDefault/Upgrades/1.0.0_initial_installation.php
Swissup/ArgentoDefault/Upgrades/1.0.1_add_callout_blocks.php
Swissup/ArgentoDefault/Upgrades/1.1.0_create_featured_products.php