├── .github
└── FUNDING.yml
├── AddAColorPickerAttribute
└── app
│ └── code
│ └── MageVision
│ └── Blog52
│ ├── Setup
│ └── Patch
│ │ └── Data
│ │ └── AddCategoryColorPickerAttribute.php
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── adminhtml
│ └── ui_component
│ └── category_form.xml
├── AddACustomButtonToAdminSalesOrderView
└── app
│ └── code
│ └── MageVision
│ └── Blog27
│ ├── Plugin
│ └── Sales
│ │ └── Block
│ │ └── Adminhtml
│ │ └── Order
│ │ └── View.php
│ ├── etc
│ ├── adminhtml
│ │ └── di.xml
│ └── module.xml
│ └── registration.php
├── AddACustomCategoryAttribute
└── app
│ └── code
│ └── MageVision
│ └── Blog17
│ ├── Setup
│ └── InstallData.php
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── adminhtml
│ └── ui_component
│ └── category_form.xml
├── AddACustomFieldforAdminUser
└── app
│ └── code
│ └── MageVision
│ └── Blog50
│ ├── Block
│ └── Adminhtml
│ │ └── User
│ │ └── Edit
│ │ └── Tab
│ │ └── Main.php
│ ├── etc
│ ├── db_schema.xml
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── AddACustomOrderAttributeToAPIResponse
└── app
│ └── code
│ └── MageVision
│ └── Blog47
│ ├── Plugin
│ └── Sales
│ │ └── Model
│ │ └── OrderGet.php
│ ├── Setup
│ └── UpgradeSchema.php
│ ├── etc
│ ├── di.xml
│ ├── extension_attributes.xml
│ └── module.xml
│ └── registration.php
├── AddACustomSession
└── app
│ └── code
│ └── MageVision
│ └── Blog43
│ ├── Model
│ └── Session.php
│ ├── etc
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── AddANewTabOnProductDetailPage
└── app
│ └── code
│ └── MageVision
│ └── Blog55
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── catalog_product_view.xml
│ └── templates
│ └── product
│ └── view
│ └── custom_tab.phtml
├── AddAProgressBarInCLICommand
└── app
│ └── code
│ └── MageVision
│ └── Blog63
│ ├── Console
│ └── Command
│ │ └── ProgressBarCommand.php
│ ├── etc
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── AddBreadcrumbsOnContactPage
└── app
│ └── code
│ └── MageVision
│ └── Blog41
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ └── layout
│ └── contact_index_index.xml
├── AddComplexMessages
└── app
│ └── code
│ └── MageVision
│ └── Blog51
│ ├── Controller
│ └── Post
│ │ ├── AddMessage.php
│ │ └── Index.php
│ ├── etc
│ ├── frontend
│ │ ├── di.xml
│ │ └── routes.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── blog51_post_index.xml
│ └── templates
│ └── messages
│ └── redirect_account_message.phtml
├── AddCustomCategoryDisplayMode
└── app
│ └── code
│ └── MageVision
│ └── Blog38
│ ├── Plugin
│ └── Catalog
│ │ └── Model
│ │ └── Category
│ │ └── Attribute
│ │ └── Source
│ │ └── Mode.php
│ ├── etc
│ ├── adminhtml
│ │ └── di.xml
│ └── module.xml
│ └── registration.php
├── AddCustomConfigVariable
└── app
│ └── code
│ └── MageVision
│ └── Blog91
│ ├── etc
│ ├── adminhtml
│ │ └── system.xml
│ ├── config.xml
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── AddCustomFieldtoCMSPage
└── app
│ └── code
│ └── MageVision
│ └── Blog15
│ ├── Block
│ └── CustomContent.php
│ ├── Setup
│ └── InstallSchema.php
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ ├── adminhtml
│ └── ui_component
│ │ └── cms_page_form.xml
│ └── frontend
│ └── layout
│ └── cms_page_view.xml
├── AddCustomInventoryAttributeProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog86
│ ├── Model
│ └── StockManagement.php
│ ├── etc
│ ├── db_schema.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── adminhtml
│ └── ui_component
│ └── product_form.xml
├── AddCustomOrderStatusProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog88
│ ├── Setup
│ └── Patch
│ │ └── Data
│ │ └── CreateCustomOrderStatus.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── AddCustomValidationSystemConfigurationField
└── app
│ └── code
│ └── MageVision
│ └── Blog48
│ ├── etc
│ ├── acl.xml
│ ├── adminhtml
│ │ └── system.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── adminhtml
│ ├── requirejs-config.js
│ └── web
│ └── js
│ └── system
│ └── config
│ └── validator-rules-mixin.js
├── AddImageLogotoPaymentMethodinCheckout
└── app
│ └── code
│ └── MageVision
│ └── Blog67
│ ├── Model
│ ├── Checkmo.php
│ └── LogoConfigProvider.php
│ ├── etc
│ ├── adminhtml
│ │ └── system.xml
│ ├── di.xml
│ ├── frontend
│ │ └── di.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── requirejs-config.js
│ └── web
│ ├── js
│ └── view
│ │ └── payment
│ │ ├── method-renderer
│ │ └── checkmo-method.js
│ │ └── offline-payments.js
│ └── template
│ └── payment
│ └── checkmo.html
├── AddProductCustomOptionProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog40
│ ├── Observer
│ └── CatalogProductSaveBeforeObserver.php
│ ├── etc
│ ├── adminhtml
│ │ └── events.xml
│ └── module.xml
│ └── registration.php
├── AddTrackingNumberToShipmentProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog54
│ ├── Model
│ └── Tracking.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── ChangeCurrencySymbolPosition
└── app
│ └── code
│ └── MageVision
│ └── Blog30
│ ├── Observer
│ └── CurrencySymbolChangePositionObserver.php
│ ├── etc
│ ├── events.xml
│ └── module.xml
│ └── registration.php
├── ChangeOrderOfAddressFieldsInCheckout
└── app
│ └── code
│ └── MageVision
│ └── Blog33
│ ├── Plugin
│ └── Checkout
│ │ └── Block
│ │ └── LayoutProcessor.php
│ ├── etc
│ ├── frontend
│ │ └── di.xml
│ └── module.xml
│ └── registration.php
├── CreateACronWithConfigPath
└── app
│ └── code
│ └── MageVision
│ └── Blog89
│ ├── Cron
│ └── Post.php
│ ├── Model
│ └── Config
│ │ └── Backend
│ │ └── Post.php
│ ├── etc
│ ├── acl.xml
│ ├── adminhtml
│ │ └── system.xml
│ ├── config.xml
│ ├── crontab.xml
│ └── module.xml
│ └── registration.php
├── CreateAPaymentMethodOnlyVisibleInAdmin
└── app
│ └── code
│ └── MageVision
│ └── Blog78
│ ├── Model
│ └── AdminOnly.php
│ ├── etc
│ ├── adminhtml
│ │ └── system.xml
│ ├── config.xml
│ └── module.xml
│ └── registration.php
├── CreateAnInventorySourceProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog87
│ ├── Setup
│ └── Patch
│ │ └── Data
│ │ └── CreateInventorySource.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── CreateCustomerGroupProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog90
│ ├── Setup
│ └── Patch
│ │ └── Data
│ │ └── InstallCustomerCustomGroup.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── CustomAdminNotice
└── app
│ └── code
│ └── MageVision
│ └── Blog83
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── adminhtml
│ ├── layout
│ └── default.xml
│ └── templates
│ └── page
│ └── notices.phtml
├── CustomSourceModelConfiguration
└── app
│ └── code
│ └── MageVision
│ └── Blog5
│ ├── Model
│ └── Config
│ │ └── Source
│ │ ├── Category.php
│ │ ├── Custom.php
│ │ └── Customer.php
│ ├── etc
│ ├── acl.xml
│ ├── adminhtml
│ │ └── system.xml
│ └── module.xml
│ └── registration.php
├── DisableAPaymentMethodProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog20
│ ├── Observer
│ └── PaymentMethodIsActiveObserver.php
│ ├── etc
│ ├── events.xml
│ └── module.xml
│ └── registration.php
├── DisplayCartTotalToMiniCart
└── app
│ └── code
│ └── MageVision
│ └── Blog45
│ ├── Plugin
│ └── Checkout
│ │ └── CustomerData
│ │ └── Cart.php
│ ├── etc
│ ├── frontend
│ │ └── di.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── checkout_cart_sidebar_total_renderers.xml
│ └── web
│ └── template
│ └── minicart
│ ├── total
│ └── grand-total.html
│ └── totals.html
├── DisplayGenderFieldAsRadioButton
└── app
│ └── design
│ └── frontend
│ └── MageVision
│ └── default
│ └── Magento_Customer
│ └── templates
│ └── widget
│ └── gender.phtml
├── ExportDataInCsv
└── app
│ └── code
│ └── MageVision
│ └── Blog92
│ ├── Console
│ └── Command
│ │ └── ExportCommand.php
│ ├── etc
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── FormValidationCustomErrorPlacement
└── app
│ └── design
│ └── frontend
│ └── MageVision
│ └── default
│ └── Magento_Contact
│ └── templates
│ └── form.phtml
├── GetAProductAttributeInCheckoutSummary
└── app
│ └── code
│ └── MageVision
│ └── Blog16
│ ├── Plugin
│ └── Checkout
│ │ └── Model
│ │ └── DefaultConfigProvider.php
│ ├── etc
│ ├── catalog_attributes.xml
│ ├── di.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── checkout_index_index.xml
│ └── web
│ ├── js
│ └── view
│ │ └── summary
│ │ └── item
│ │ └── details.js
│ └── template
│ └── summary
│ └── item
│ └── details.html
├── GetAProductAttributeInMiniCart
└── app
│ └── code
│ └── MageVision
│ └── Blog10
│ ├── Plugin
│ └── Checkout
│ │ └── CustomerData
│ │ └── DefaultItem.php
│ ├── etc
│ ├── catalog_attributes.xml
│ ├── di.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── checkout_cart_sidebar_item_renderers.xml
│ └── web
│ └── template
│ └── minicart
│ └── item
│ └── default.html
├── GetBestsellerProducts
└── app
│ └── code
│ └── MageVision
│ └── Blog8
│ ├── Block
│ └── Product
│ │ └── Bestseller.php
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ └── templates
│ └── product
│ └── bestseller.phtml
├── GetCustomerGroups
└── app
│ └── code
│ └── MageVision
│ └── Blog28
│ ├── Helper
│ └── Data.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── GetListOfEmailTemplates
└── app
│ └── code
│ └── MageVision
│ └── Blog46
│ ├── Helper
│ └── Data.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── ImageUploadConfigurationField
└── app
│ └── code
│ └── MageVision
│ └── Blog4
│ ├── Model
│ └── Config
│ │ └── Backend
│ │ └── Image.php
│ ├── etc
│ ├── acl.xml
│ ├── adminhtml
│ │ └── system.xml
│ └── module.xml
│ └── registration.php
├── InstallUpgradeDatabaseSchema
└── app
│ └── code
│ └── MageVision
│ └── Blog12
│ ├── Setup
│ ├── InstallSchema.php
│ └── UpgradeSchema.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── MakeAPaymentMethodOnlyVisibleInAdmin
└── app
│ └── code
│ └── MageVision
│ └── Blog77
│ ├── Plugin
│ └── OfflinePayments
│ │ └── Model
│ │ └── CheckmoPlugin.php
│ ├── etc
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── OpenCategoryFiltersbyDefault
└── app
│ └── design
│ └── frontend
│ └── MageVision
│ └── default
│ └── Magento_LayeredNavigation
│ └── templates
│ └── layer
│ └── view.phtml
├── QuoteBackendValidationRule
└── app
│ └── code
│ └── MageVision
│ └── Blog80
│ ├── Model
│ └── Quote
│ │ └── ValidationRule
│ │ └── CustomValidationRule.php
│ ├── etc
│ ├── di.xml
│ └── module.xml
│ └── registration.php
├── README.md
├── RedirectToPreviousPageAfterCustomerLogin
└── app
│ └── code
│ └── MageVision
│ └── Blog24
│ ├── Controller
│ └── Post
│ │ └── Index.php
│ ├── etc
│ ├── frontend
│ │ └── routes.xml
│ └── module.xml
│ └── registration.php
├── RemoveCartTaxShippingEstimate
└── app
│ └── code
│ └── MageVision
│ └── Blog22
│ ├── etc
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ ├── layout
│ └── checkout_cart_index.xml
│ └── templates
│ └── cart
│ └── shipping.phtml
├── StoreConfigurationUsingDataPatch
└── app
│ └── code
│ └── MageVision
│ └── Blog79
│ ├── Setup
│ └── Patch
│ │ └── Data
│ │ └── SetStoreConfiguration.php
│ ├── etc
│ └── module.xml
│ └── registration.php
├── UpdateLayoutOnAttributeSet
└── app
│ └── code
│ └── MageVision
│ └── Blog37
│ ├── Plugin
│ └── Catalog
│ │ └── Helper
│ │ └── Product
│ │ └── View.php
│ ├── etc
│ ├── frontend
│ │ └── di.xml
│ └── module.xml
│ ├── registration.php
│ └── view
│ └── frontend
│ └── layout
│ └── catalog_product_view_attribute_set_id_17.xml
├── UpdateProductStockMSIProgrammatically
└── app
│ └── code
│ └── MageVision
│ └── Blog85
│ ├── Model
│ └── StockManagement.php
│ ├── etc
│ └── module.xml
│ └── registration.php
└── UseProfilerInCLICommand
└── app
└── code
└── MageVision
└── Blog64
├── Console
└── Command
│ └── ProfilerCommand.php
├── etc
├── di.xml
└── module.xml
└── registration.php
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13 | custom: ['https://www.paypal.com/donate/?cmd=_s-xclick&hosted_button_id=FGX4ZN5Z6LGJ6&ssrt=1706511551624']
14 |
--------------------------------------------------------------------------------
/AddAColorPickerAttribute/app/code/MageVision/Blog52/Setup/Patch/Data/AddCategoryColorPickerAttribute.php:
--------------------------------------------------------------------------------
1 | moduleDataSetup = $moduleDataSetup;
43 | $this->categorySetupFactory = $categorySetupFactory;
44 | }
45 |
46 | /**
47 | * @inheritDoc
48 | */
49 | public function apply()
50 | {
51 | $this->moduleDataSetup->startSetup();
52 |
53 | $categorySetup = $this->categorySetupFactory->create(['setup' => $this->moduleDataSetup]);
54 | $categorySetup->addAttribute(Category::ENTITY, 'color_picker_attribute', [
55 | 'type' => 'text',
56 | 'label' => 'Color Picker Attribute',
57 | 'input' => 'text',
58 | 'required' => false,
59 | 'global' => ScopedAttributeInterface::SCOPE_STORE,
60 | 'is_user_defined' => true,
61 | 'visible' => true,
62 | 'group' => 'Content',
63 | ]);
64 |
65 | $this->moduleDataSetup->endSetup();
66 | }
67 |
68 | /**
69 | * @inheritDoc
70 | */
71 | public static function getDependencies()
72 | {
73 | return [];
74 | }
75 |
76 | /**
77 | * @inheritDoc
78 | */
79 | public function getAliases()
80 | {
81 | return [];
82 | }
83 | }
--------------------------------------------------------------------------------
/AddAColorPickerAttribute/app/code/MageVision/Blog52/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AddAColorPickerAttribute/app/code/MageVision/Blog52/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/AddACustomButtonToAdminSalesOrderView/app/code/MageVision/Blog27/Plugin/Sales/Block/Adminhtml/Order/View.php:
--------------------------------------------------------------------------------
1 | addButton(
20 | 'order_custom_button',
21 | [
22 | 'label' => __('Custom Button'),
23 | 'class' => __('custom-button'),
24 | 'id' => 'order-view-custom-button',
25 | 'onclick' => 'setLocation(\'' . $subject->getUrl('module/controller/action') . '\')'
26 | ]
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/AddACustomButtonToAdminSalesOrderView/app/code/MageVision/Blog27/etc/adminhtml/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddACustomButtonToAdminSalesOrderView/app/code/MageVision/Blog27/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddACustomButtonToAdminSalesOrderView/app/code/MageVision/Blog27/registration.php:
--------------------------------------------------------------------------------
1 | eavSetupFactory = $eavSetupFactory;
37 | }
38 |
39 | public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
40 | {
41 | $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
42 |
43 | $eavSetup->addAttribute(
44 | Category::ENTITY,
45 | 'seo_description',
46 | [
47 | 'type' => 'text',
48 | 'label' => 'SEO Description',
49 | 'input' => 'textarea',
50 | 'required' => false,
51 | 'sort_order' => 4,
52 | 'global' => ScopedAttributeInterface::SCOPE_STORE,
53 | 'wysiwyg_enabled' => true,
54 | 'is_html_allowed_on_front' => true,
55 | 'group' => 'General Information',
56 | ]
57 | );
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/AddACustomCategoryAttribute/app/code/MageVision/Blog17/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/AddACustomCategoryAttribute/app/code/MageVision/Blog17/registration.php:
--------------------------------------------------------------------------------
1 | getForm();
26 | $model = $this->_coreRegistry->registry('permissions_user');
27 |
28 | $baseFieldset = $form->getElement('base_fieldset');
29 | $baseFieldset->addField(
30 | 'telephone',
31 | 'text',
32 | [
33 | 'name' => 'telephone',
34 | 'label' => __('Telephone'),
35 | 'title' => __('Telephone'),
36 | 'value' => $model->getTelephone()
37 | ]
38 | );
39 |
40 | return $this;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/AddACustomFieldforAdminUser/app/code/MageVision/Blog50/etc/db_schema.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/AddACustomFieldforAdminUser/app/code/MageVision/Blog50/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddACustomFieldforAdminUser/app/code/MageVision/Blog50/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AddACustomFieldforAdminUser/app/code/MageVision/Blog50/registration.php:
--------------------------------------------------------------------------------
1 | orderExtensionFactory = $orderExtensionFactory;
34 | }
35 |
36 | /**
37 | * @param OrderRepositoryInterface $subject
38 | * @param OrderInterface $resultOrder
39 | * @return OrderInterface
40 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
41 | */
42 | public function afterGet(
43 | OrderRepositoryInterface $subject,
44 | OrderInterface $resultOrder
45 | ) {
46 | $extensionAttributes = $resultOrder->getExtensionAttributes();
47 | if ($extensionAttributes && $extensionAttributes->getMagevisionComment()) {
48 | return $resultOrder;
49 | }
50 |
51 | /** @var \Magento\Sales\Api\Data\OrderExtension $orderExtension */
52 | $orderExtension = $extensionAttributes ? $extensionAttributes : $this->orderExtensionFactory->create();
53 | $orderExtension->setMagevisionComment($resultOrder->getMagevisionComment());
54 | $resultOrder->setExtensionAttributes($orderExtension);
55 |
56 | return $resultOrder;
57 | }
58 |
59 | /**
60 | * @param OrderRepositoryInterface $subject
61 | * @param Collection $resultOrder
62 | * @return Collection
63 | * @SuppressWarnings(PHPMD.UnusedFormalParameter)
64 | */
65 | public function afterGetList(
66 | OrderRepositoryInterface $subject,
67 | Collection $resultOrder
68 | ) {
69 | /** @var $order */
70 | foreach ($resultOrder->getItems() as $order) {
71 | $this->afterGet($subject, $order);
72 | }
73 | return $resultOrder;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/AddACustomOrderAttributeToAPIResponse/app/code/MageVision/Blog47/Setup/UpgradeSchema.php:
--------------------------------------------------------------------------------
1 | startSetup();
27 |
28 | if (version_compare($context->getVersion(), '2.0.0', '<')) {
29 |
30 | $table = $installer->getTable('sales_order');
31 | $installer->getConnection()
32 | ->addColumn(
33 | $table,
34 | 'magevision_comment',
35 | [
36 | 'type' => Table::TYPE_TEXT,
37 | 'length' => 255,
38 | 'nullable' => true,
39 | 'comment' => 'MageVision Order Comment'
40 | ]
41 | );
42 | }
43 | $installer->endSetup();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/AddACustomOrderAttributeToAPIResponse/app/code/MageVision/Blog47/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddACustomOrderAttributeToAPIResponse/app/code/MageVision/Blog47/etc/extension_attributes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AddACustomOrderAttributeToAPIResponse/app/code/MageVision/Blog47/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddACustomOrderAttributeToAPIResponse/app/code/MageVision/Blog47/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 | blog43
17 |
18 |
19 |
20 |
21 | MageVision\Blog43\Model\Session\Storage
22 |
23 |
24 |
--------------------------------------------------------------------------------
/AddACustomSession/app/code/MageVision/Blog43/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddACustomSession/app/code/MageVision/Blog43/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AddANewTabOnProductDetailPage/app/code/MageVision/Blog55/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 | Custom Tab
19 | 25
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AddANewTabOnProductDetailPage/app/code/MageVision/Blog55/view/frontend/templates/product/view/custom_tab.phtml:
--------------------------------------------------------------------------------
1 | getProduct()->getName()); ?>
--------------------------------------------------------------------------------
/AddAProgressBarInCLICommand/app/code/MageVision/Blog63/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | - MageVision\Blog63\Console\Command\ProgressBarCommand
18 |
19 |
20 |
21 |
22 |
23 | magevision:blog63:progress-bar
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/AddAProgressBarInCLICommand/app/code/MageVision/Blog63/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddAProgressBarInCLICommand/app/code/MageVision/Blog63/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddBreadcrumbsOnContactPage/app/code/MageVision/Blog41/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | Home
18 |
19 | - Home
20 | - Home
21 | - {{baseUrl}}
22 |
23 |
24 |
25 | Contact Us
26 |
27 | - Contact Us
28 | - Contact Us
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/Controller/Post/AddMessage.php:
--------------------------------------------------------------------------------
1 | customerUrl = $customerUrl;
34 | parent::__construct($context);
35 | }
36 |
37 | /**
38 | * @return ResultInterface
39 | */
40 | public function execute()
41 | {
42 | $url = $this->customerUrl->getLoginUrl();
43 | $this->messageManager->addComplexSuccessMessage(
44 | 'addRedirectAccountMessage',
45 | [
46 | 'url' => $url
47 | ]
48 | );
49 |
50 | $resultRedirect = $this->resultRedirectFactory->create();
51 | $resultRedirect->setPath('*/*/');
52 | return $resultRedirect;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/Controller/Post/Index.php:
--------------------------------------------------------------------------------
1 | resultPageFactory = $resultPageFactory;
34 | parent::__construct($context);
35 | }
36 |
37 | /**
38 | * @return ResultInterface
39 | */
40 | public function execute()
41 | {
42 | return $this->resultPageFactory->create();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/etc/frontend/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 | -
19 |
- \Magento\Framework\View\Element\Message\Renderer\BlockRenderer::CODE
20 | -
21 |
- MageVision_Blog51::messages/redirect_account_message.phtml
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/etc/frontend/routes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | Blog Post 51
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AddComplexMessages/app/code/MageVision/Blog51/view/frontend/templates/messages/redirect_account_message.phtml:
--------------------------------------------------------------------------------
1 |
12 | = $block->escapeHtml(__(
13 | 'Please click here to redirect to your account.',
14 | $block->getData('url')
15 | ), ['a']);
16 | ?>
--------------------------------------------------------------------------------
/AddCustomCategoryDisplayMode/app/code/MageVision/Blog38/Plugin/Catalog/Model/Category/Attribute/Source/Mode.php:
--------------------------------------------------------------------------------
1 | 'CUSTOM_MODE', 'label' => 'Custom Mode'];
25 | return $result;
26 | }
27 | }
--------------------------------------------------------------------------------
/AddCustomCategoryDisplayMode/app/code/MageVision/Blog38/etc/adminhtml/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddCustomCategoryDisplayMode/app/code/MageVision/Blog38/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddCustomCategoryDisplayMode/app/code/MageVision/Blog38/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AddCustomConfigVariable/app/code/MageVision/Blog91/etc/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 | support@magevision.com
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/AddCustomConfigVariable/app/code/MageVision/Blog91/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 | -
19 |
- 1
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/AddCustomConfigVariable/app/code/MageVision/Blog91/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddCustomConfigVariable/app/code/MageVision/Blog91/registration.php:
--------------------------------------------------------------------------------
1 | _filterProvider->getPageFilter()->filter($this->getPage()->getCustomContent());
23 | return $html;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/AddCustomFieldtoCMSPage/app/code/MageVision/Blog15/Setup/InstallSchema.php:
--------------------------------------------------------------------------------
1 | startSetup();
27 |
28 | $setup->getConnection()->addColumn(
29 | $setup->getTable('cms_page'),
30 | 'custom_content',
31 | [
32 | 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
33 | 'length' => '2M',
34 | 'nullable' => true,
35 | 'comment' => 'Page Custom Content'
36 | ]
37 | );
38 |
39 | $installer->endSetup();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/AddCustomFieldtoCMSPage/app/code/MageVision/Blog15/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/AddCustomFieldtoCMSPage/app/code/MageVision/Blog15/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
29 |
--------------------------------------------------------------------------------
/AddCustomFieldtoCMSPage/app/code/MageVision/Blog15/view/frontend/layout/cms_page_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/AddCustomInventoryAttributeProgrammatically/app/code/MageVision/Blog86/Model/StockManagement.php:
--------------------------------------------------------------------------------
1 | stockRegistry = $stockRegistry;
27 | }
28 |
29 | /**
30 | * @param string $sku
31 | * @param bool $comingSoon
32 | * @return void
33 | * @throws NoSuchEntityException
34 | */
35 | public function update(string $sku, bool $comingSoon): void
36 | {
37 | $stockItem = $this->stockRegistry->getStockItemBySku($sku);
38 | $stockItem->setData('coming_soon', $comingSoon);
39 | $this->stockRegistry->updateStockItemBySku($sku, $stockItem);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/AddCustomInventoryAttributeProgrammatically/app/code/MageVision/Blog86/etc/db_schema.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/AddCustomInventoryAttributeProgrammatically/app/code/MageVision/Blog86/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddCustomInventoryAttributeProgrammatically/app/code/MageVision/Blog86/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
36 |
--------------------------------------------------------------------------------
/AddCustomOrderStatusProgrammatically/app/code/MageVision/Blog88/Setup/Patch/Data/CreateCustomOrderStatus.php:
--------------------------------------------------------------------------------
1 | moduleDataSetup = $moduleDataSetup;
34 | }
35 |
36 | /**
37 | * @inheritDoc
38 | */
39 | public function apply()
40 | {
41 | $this->moduleDataSetup->startSetup();
42 |
43 | $this->moduleDataSetup->getConnection()->insert(
44 | $this->moduleDataSetup->getTable('sales_order_status'),
45 | [
46 | 'status' => self::STATUS_CODE,
47 | 'label' => self::STATUS_LABEL
48 | ]
49 | );
50 |
51 | $this->moduleDataSetup->getConnection()->insert(
52 | $this->moduleDataSetup->getTable('sales_order_status_state'),
53 | [
54 | 'status' => self::STATUS_CODE,
55 | 'state' => Order::STATE_PROCESSING,
56 | 'is_default' => 0,
57 | 'visible_on_front' => 1
58 | ]
59 | );
60 |
61 | $this->moduleDataSetup->endSetup();
62 | }
63 |
64 | /**
65 | * @inheritDoc
66 | */
67 | public static function getDependencies()
68 | {
69 | return [];
70 | }
71 |
72 | /**
73 | * @inheritDoc
74 | */
75 | public function getAliases()
76 | {
77 | return [];
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/AddCustomOrderStatusProgrammatically/app/code/MageVision/Blog88/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddCustomOrderStatusProgrammatically/app/code/MageVision/Blog88/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/AddCustomValidationSystemConfigurationField/app/code/MageVision/Blog48/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | magevision
22 | MageVision_Blog48::blog48_configuration
23 |
24 |
25 |
26 |
27 | validate-greater-than-one
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/AddCustomValidationSystemConfigurationField/app/code/MageVision/Blog48/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/AddCustomValidationSystemConfigurationField/app/code/MageVision/Blog48/registration.php:
--------------------------------------------------------------------------------
1 | escaper = $escaper;
48 | $this->method = $paymentHelper->getMethodInstance($this->methodCode);
49 | }
50 |
51 | /**
52 | * {@inheritdoc}
53 | */
54 | public function getConfig()
55 | {
56 | $config = [];
57 |
58 | if ($this->method->isAvailable()) {
59 | $config['payment']['logo'][$this->methodCode] = $this->getLogo($this->methodCode);
60 | $config['payment']['display_logo_title'][$this->methodCode] = $this->method->displayTitleLogo();
61 | }
62 |
63 | return $config;
64 | }
65 |
66 | /**
67 | * Get logo url from config
68 | *
69 | * @param string $code
70 | *
71 | * @return string
72 | */
73 | protected function getLogo($code)
74 | {
75 | return nl2br($this->escaper->escapeHtml($this->method->getLogo()));
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/AddImageLogotoPaymentMethodinCheckout/app/code/MageVision/Blog67/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | Magento\Config\Model\Config\Backend\Image
19 | payments/logo
20 | payments/logo
21 |
22 |
23 |
24 | Magento\Config\Model\Config\Source\Yesno
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/AddImageLogotoPaymentMethodinCheckout/app/code/MageVision/Blog67/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AddImageLogotoPaymentMethodinCheckout/app/code/MageVision/Blog67/etc/frontend/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 | - MageVision\Blog67\Model\LogoConfigProvider
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/AddImageLogotoPaymentMethodinCheckout/app/code/MageVision/Blog67/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/AddImageLogotoPaymentMethodinCheckout/app/code/MageVision/Blog67/registration.php:
--------------------------------------------------------------------------------
1 | productOptionFactory = $productOptionFactory;
32 | }
33 |
34 | /**
35 | * Catalog Product Before Save
36 | *
37 | * @param \Magento\Framework\Event\Observer $observer
38 | * @return void
39 | */
40 | public function execute(\Magento\Framework\Event\Observer $observer)
41 | {
42 | $product = $observer->getEvent()->getProduct();
43 |
44 | $exist = false;
45 | //check if the custom option exists
46 | foreach ($product->getOptions() as $option) {
47 | if ($option->getGroupByType() == ProductCustomOptionInterface::OPTION_TYPE_FIELD
48 | && $option->getTitle() == 'Custom Option') {
49 | $exist = true;
50 | }
51 | }
52 |
53 | if (!$exist) {
54 | try {
55 | $optionArray = [
56 | 'title' => 'Custom Option',
57 | 'type' => 'field',
58 | 'is_require' => false,
59 | 'sort_order' => 1,
60 | 'price' => 0,
61 | 'price_type' => 'fixed',
62 | 'sku' => '',
63 | 'max_characters' => 0
64 | ];
65 | $option = $this->productOptionFactory->create();
66 | $option->setProductId($product->getId())
67 | ->setStoreId($product->getStoreId())
68 | ->addData($optionArray);
69 | $product->addOption($option);
70 | } catch (\Exception $e) {
71 | //throw new CouldNotSaveException(__('Something went wrong while saving option.'));
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/AddProductCustomOptionProgrammatically/app/code/MageVision/Blog40/etc/adminhtml/events.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/AddProductCustomOptionProgrammatically/app/code/MageVision/Blog40/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/AddProductCustomOptionProgrammatically/app/code/MageVision/Blog40/registration.php:
--------------------------------------------------------------------------------
1 | shipmentRepository = $shipmentRepository;
38 | $this->trackFactory = $trackFactory;
39 | }
40 |
41 | /**
42 | * @param int $shipmentId
43 | */
44 | public function addCustomTrack($shipmentId)
45 | {
46 | $number = 12345;
47 | $carrier = 'custom';
48 | $title = 'Custom Title';
49 |
50 | try {
51 | $shipment = $this->shipmentRepository->get($shipmentId);
52 | $track = $this->trackFactory->create()->setNumber(
53 | $number
54 | )->setCarrierCode(
55 | $carrier
56 | )->setTitle(
57 | $title
58 | );
59 | $shipment->addTrack($track);
60 | $this->shipmentRepository->save($shipment);
61 |
62 | } catch (NoSuchEntityException $e) {
63 | //Shipment does not exist
64 | }
65 | }
66 | }
--------------------------------------------------------------------------------
/AddTrackingNumberToShipmentProgrammatically/app/code/MageVision/Blog54/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AddTrackingNumberToShipmentProgrammatically/app/code/MageVision/Blog54/registration.php:
--------------------------------------------------------------------------------
1 | getEvent()->getCurrencyOptions();
28 | $currencyOptions->setData('position', Currency::RIGHT);
29 | return $this;
30 | }
31 | }
--------------------------------------------------------------------------------
/ChangeCurrencySymbolPosition/app/code/MageVision/Blog30/etc/events.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ChangeCurrencySymbolPosition/app/code/MageVision/Blog30/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ChangeCurrencySymbolPosition/app/code/MageVision/Blog30/registration.php:
--------------------------------------------------------------------------------
1 | $payment) {
41 |
42 | /* telephone */
43 | $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
44 | ['payment']['children']['payments-list']['children'][$key]['children']['form-fields']['children']
45 | ['telephone']['sortOrder'] = 75;
46 | }
47 | }
48 |
49 | //Billing Address on payment page
50 | if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
51 | ['payment']['children']['afterMethods']['children']
52 | )) {
53 |
54 | /* telephone */
55 | $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
56 | ['payment']['children']['afterMethods']['children']['billing-address-form']['children']['form-fields']
57 | ['children']['telephone']['sortOrder'] = 75;
58 |
59 | }
60 | return $jsLayout;
61 | }
62 | }
--------------------------------------------------------------------------------
/ChangeOrderOfAddressFieldsInCheckout/app/code/MageVision/Blog33/etc/frontend/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ChangeOrderOfAddressFieldsInCheckout/app/code/MageVision/Blog33/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/ChangeOrderOfAddressFieldsInCheckout/app/code/MageVision/Blog33/registration.php:
--------------------------------------------------------------------------------
1 | scopeConfig = $scopeConfig;
32 | }
33 |
34 | /**
35 | * Execute cron
36 | *
37 | * @return void
38 | */
39 | public function execute()
40 | {
41 | // check if enabled
42 | if (!$this->scopeConfig->isSetFlag(
43 | self::XML_PATH_ENABLE,
44 | ScopeInterface::SCOPE_STORE
45 | )
46 | ) {
47 | return;
48 | }
49 |
50 | //Add your code
51 |
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/etc/acl.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | magevision
22 | MageVision_Blog89::blog89_configuration
23 |
24 |
25 |
26 |
27 | Magento\Config\Model\Config\Source\Yesno
28 |
29 |
30 |
31 | Magento\Cron\Model\Config\Source\Frequency
32 | MageVision\Blog89\Model\Config\Backend\Post
33 |
34 | 1
35 |
36 |
37 |
38 |
39 |
40 | 1
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/etc/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | 0
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/etc/crontab.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 | crontab/default/jobs/magevision_blog89_cron/schedule/cron_expr
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CreateACronWithConfigPath/app/code/MageVision/Blog89/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | Magento\Config\Model\Config\Source\Yesno
22 |
23 |
24 |
25 | Magento\Sales\Model\Config\Source\Order\Status\NewStatus
26 |
27 |
28 |
29 | validate-number
30 |
31 |
32 |
33 |
34 |
35 |
36 | Magento\Payment\Model\Config\Source\Allspecificcountries
37 |
38 |
39 |
40 | Magento\Directory\Model\Config\Source\Country
41 | 1
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/CreateAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog78/etc/config.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | 1
18 | Admin Payment Only
19 | pending
20 | 0
21 | 1
22 | 0
23 | 1
24 | MageVision\Blog78\Model\AdminOnly
25 | offline
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/CreateAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog78/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/CreateAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog78/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CreateAnInventorySourceProgrammatically/app/code/MageVision/Blog87/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/CreateCustomerGroupProgrammatically/app/code/MageVision/Blog90/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CustomAdminNotice/app/code/MageVision/Blog83/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | MageVision_Blog83::page/notices.phtml
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/CustomAdminNotice/app/code/MageVision/Blog83/view/adminhtml/templates/page/notices.phtml:
--------------------------------------------------------------------------------
1 |
12 |
17 | displayNoscriptNotice()) : ?>
18 |
26 |
27 | displayDemoNotice()) : ?>
28 |
29 |
30 | = $block->escapeHtml(__('This is only a demo store. You can browse and place orders, but nothing will be processed.')) ?>
31 |
32 |
33 |
34 |
35 |
36 | = $block->escapeHtml(__('This is a custom admin notice')) ?>
37 |
38 |
39 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/Model/Config/Source/Category.php:
--------------------------------------------------------------------------------
1 | categoryManagement = $categoryManagement;
40 | }
41 |
42 | /**
43 | * Return array of categories
44 | *
45 | * @return array
46 | */
47 | public function toOptionArray()
48 | {
49 | if ($this->options === null) {
50 | $this->options = [];
51 | $categories = $this->categoryManagement->getTree();
52 |
53 | foreach ($categories->getChildrenData() as $category) {
54 | //Uncomment the following line to display only the active categories
55 | //if(!$category->getIsActive()) continue;
56 | $this->separator = '';
57 | $this->options[] = [
58 | 'value' => $category->getId(),
59 | 'label' => $category->getName(),
60 | ];
61 | if ($category->getChildrenData()) {
62 | $this->addSubcategories($category->getChildrenData());
63 | }
64 | }
65 | }
66 |
67 | return $this->options;
68 | }
69 |
70 | /**
71 | * @var \Magento\Catalog\Api\Data\CategoryTreeInterface[]
72 | *
73 | * @return $this
74 | */
75 | public function addSubcategories($subcategories)
76 | {
77 | $this->separator .= '-';
78 | foreach ($subcategories as $subcategory) {
79 | $this->options[] = [
80 | 'value' => $subcategory->getId(),
81 | 'label' => $this->separator.' '.$subcategory->getName(),
82 | ];
83 | if ($subcategory->getChildrenData()) {
84 | $this->addSubcategories($subcategory->getChildrenData());
85 | }
86 | }
87 | $this->separator = substr($this->separator, 0, -1);
88 |
89 | return $this;
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/Model/Config/Source/Custom.php:
--------------------------------------------------------------------------------
1 | 1, 'label' => __('Option 1')],
24 | ['value' => 2, 'label' => __('Option 2')]
25 | ];
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/Model/Config/Source/Customer.php:
--------------------------------------------------------------------------------
1 | collectionFactory = $collectionFactory;
34 | }
35 |
36 | /**
37 | * Return array of customers
38 | *
39 | * @return array
40 | */
41 | public function toOptionArray()
42 | {
43 | if ($this->options === null) {
44 | $customers = $this->collectionFactory->create();
45 |
46 | foreach ($customers as $customer) {
47 | $this->options[] = [
48 | 'value' => $customer->getId(),
49 | 'label' => $customer->getName(),
50 | ];
51 | }
52 | }
53 |
54 | return $this->options;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/etc/acl.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | magevision
22 | MageVision_Blog5::blog5_configuration
23 |
24 |
25 |
26 |
27 | MageVision\Blog5\Model\Config\Source\Custom
28 |
29 |
30 |
31 | MageVision\Blog5\Model\Config\Source\Customer
32 |
33 |
34 |
35 | MageVision\Blog5\Model\Config\Source\Category
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/CustomSourceModelConfiguration/app/code/MageVision/Blog5/registration.php:
--------------------------------------------------------------------------------
1 | customerSession = $customerSession;
32 | }
33 |
34 | /**
35 | * payment_method_is_active event handler
36 | *
37 | * @param Observer $observer
38 | */
39 | public function execute(Observer $observer)
40 | {
41 | //our example will disable the Banktransfer payment method
42 | //you can easily replace the Banktransfer code with yours payment method code
43 | if ($observer->getEvent()->getMethodInstance()->getCode() == Banktransfer::PAYMENT_METHOD_BANKTRANSFER_CODE) {
44 | $checkResult = $observer->getEvent()->getResult();
45 | if(!$this->customerSession->isLoggedIn()) {
46 | $checkResult->setData('is_available', false);
47 | }
48 | }
49 | }
50 | }
--------------------------------------------------------------------------------
/DisableAPaymentMethodProgrammatically/app/code/MageVision/Blog20/etc/events.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/DisableAPaymentMethodProgrammatically/app/code/MageVision/Blog20/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/DisableAPaymentMethodProgrammatically/app/code/MageVision/Blog20/registration.php:
--------------------------------------------------------------------------------
1 | checkoutSession = $checkoutSession;
43 | $this->checkoutHelper = $checkoutHelper;
44 | }
45 |
46 | /**
47 | * Add grand total to result
48 | *
49 | * @param \Magento\Checkout\CustomerData\Cart $subject
50 | * @param array $result
51 | * @return array
52 | */
53 | public function afterGetSectionData(
54 | \Magento\Checkout\CustomerData\Cart $subject,
55 | $result
56 | ) {
57 |
58 | $totals = $this->getQuote()->getTotals();
59 | $result['grand_total'] = isset($totals['grand_total'])
60 | ? $this->checkoutHelper->formatPrice($totals['grand_total']->getValue())
61 | : 0;
62 | return $result;
63 | }
64 |
65 | /**
66 | * Get active quote
67 | *
68 | * @return Quote
69 | */
70 | protected function getQuote()
71 | {
72 | if (null === $this->quote) {
73 | $this->quote = $this->checkoutSession->getQuote();
74 | }
75 | return $this->quote;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/DisplayCartTotalToMiniCart/app/code/MageVision/Blog45/etc/frontend/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/DisplayCartTotalToMiniCart/app/code/MageVision/Blog45/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/DisplayCartTotalToMiniCart/app/code/MageVision/Blog45/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 | -
19 |
-
20 |
-
21 |
-
22 |
-
23 |
-
24 |
- uiComponent
25 | -
26 |
- MageVision_Blog45/minicart/totals
27 |
28 | -
29 |
-
30 |
- Magento_Checkout/js/view/checkout/minicart/subtotal/totals
31 | -
32 |
- MageVision_Blog45/minicart/total/grand-total
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/DisplayCartTotalToMiniCart/app/code/MageVision/Blog45/view/frontend/web/template/minicart/total/grand-total.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/DisplayCartTotalToMiniCart/app/code/MageVision/Blog45/view/frontend/web/template/minicart/totals.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/DisplayGenderFieldAsRadioButton/app/design/frontend/MageVision/default/Magento_Customer/templates/widget/gender.phtml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | getGenderOptions(); ?>
7 | getGender(); ?>
8 |
9 | getValue()) continue; ?>
10 |
11 | isRequired()) echo 'data-validate="{\'validate-one-required-by-name\':true}"'?>
15 | name="getFieldName('gender')?>"
16 | data-selector="getFieldName('gender')?>"
17 | getValue() == $value) echo ' checked="checked"' ?>
18 | value="getValue() ?>"/>
19 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ExportDataInCsv/app/code/MageVision/Blog92/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | - MageVision\Blog92\Console\Command\ExportCommand
18 |
19 |
20 |
21 |
22 |
23 | magevision:blog92:export-csv
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ExportDataInCsv/app/code/MageVision/Blog92/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ExportDataInCsv/app/code/MageVision/Blog92/registration.php:
--------------------------------------------------------------------------------
1 | checkoutSession = $checkoutSession;
31 | }
32 |
33 | public function afterGetConfig(
34 | \Magento\Checkout\Model\DefaultConfigProvider $subject,
35 | array $result
36 | ) {
37 | $items = $result['totalsData']['items'];
38 | foreach ($items as $index => $item) {
39 | $quoteItem = $this->checkoutSession->getQuote()->getItemById($item['item_id']);
40 | $result['quoteItemData'][$index]['manufacturer'] = $quoteItem->getProduct()->getAttributeText('manufacturer');
41 | }
42 | return $result;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/etc/catalog_attributes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 | -
20 |
-
21 |
-
22 |
-
23 |
-
24 |
-
25 |
-
26 |
-
27 |
-
28 |
-
29 |
- MageVision_Blog16/js/view/summary/item/details
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/view/frontend/web/js/view/summary/item/details.js:
--------------------------------------------------------------------------------
1 | /**
2 | * MageVision Blog16
3 | *
4 | * @category MageVision
5 | * @package MageVision_Blog16
6 | * @author MageVision Team
7 | * @copyright Copyright (c) 2017 MageVision (https://www.magevision.com)
8 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
9 | */
10 | /*jshint browser:true jquery:true*/
11 | /*global alert*/
12 | define(
13 | [
14 | 'uiComponent'
15 | ],
16 | function (Component) {
17 | "use strict";
18 | var quoteItemData = window.checkoutConfig.quoteItemData;
19 | return Component.extend({
20 | defaults: {
21 | template: 'MageVision_Blog16/summary/item/details'
22 | },
23 | quoteItemData: quoteItemData,
24 | getValue: function(quoteItem) {
25 | return quoteItem.name;
26 | },
27 | getManufacturer: function(quoteItem) {
28 | var item = this.getItem(quoteItem.item_id);
29 | return item.manufacturer;
30 | },
31 | getItem: function(item_id) {
32 | var itemElement = null;
33 | _.each(this.quoteItemData, function(element, index) {
34 | if (element.item_id == item_id) {
35 | itemElement = element;
36 | }
37 | });
38 | return itemElement;
39 | }
40 | });
41 | }
42 | );
43 |
--------------------------------------------------------------------------------
/GetAProductAttributeInCheckoutSummary/app/code/MageVision/Blog16/view/frontend/web/template/summary/item/details.html:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/GetAProductAttributeInMiniCart/app/code/MageVision/Blog10/Plugin/Checkout/CustomerData/DefaultItem.php:
--------------------------------------------------------------------------------
1 | getProduct()->getAttributeText('manufacturer');
22 |
23 | return \array_merge(
24 | $result,
25 | $data
26 | );
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/GetAProductAttributeInMiniCart/app/code/MageVision/Blog10/etc/catalog_attributes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/GetAProductAttributeInMiniCart/app/code/MageVision/Blog10/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/GetAProductAttributeInMiniCart/app/code/MageVision/Blog10/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/GetAProductAttributeInMiniCart/app/code/MageVision/Blog10/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 | -
20 |
-
21 |
-
22 |
-
23 |
- uiComponent
24 | -
25 |
- defaultRenderer
26 | - MageVision_Blog10/minicart/item/default
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/GetBestsellerProducts/app/code/MageVision/Blog8/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/GetBestsellerProducts/app/code/MageVision/Blog8/registration.php:
--------------------------------------------------------------------------------
1 |
12 | getItems(); ?>
13 |
14 | getName(); ?>
15 |
16 |
--------------------------------------------------------------------------------
/GetCustomerGroups/app/code/MageVision/Blog28/Helper/Data.php:
--------------------------------------------------------------------------------
1 | collectionFactory = $collectionFactory;
34 | }
35 |
36 | /**
37 | * Get all customer groups to option array
38 | *
39 | * @return array
40 | */
41 | public function getCustomerGroupsArray()
42 | {
43 | return $this->collectionFactory->create()->toOptionArray();
44 | }
45 | /**
46 | * Get all customer groups collection
47 | *
48 | * @return \Magento\Customer\Model\ResourceModel\Group\Collection
49 | */
50 | public function getCustomerGroupsCollection()
51 | {
52 | return $this->collectionFactory->create();
53 | }
54 | }
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/GetCustomerGroups/app/code/MageVision/Blog28/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/GetCustomerGroups/app/code/MageVision/Blog28/registration.php:
--------------------------------------------------------------------------------
1 | collectionFactory = $collectionFactory;
43 | $this->emailTemplateConfig = $emailTemplateConfig;
44 | }
45 |
46 | /**
47 | * Returns collection of all custom templates created in backend
48 | *
49 | * @return mixed
50 | */
51 | public function getCustomTemplates()
52 | {
53 | return $this->collectionFactory->create();
54 | }
55 |
56 | /**
57 | * Return list of all email templates, both default module and theme-specific templates
58 | *
59 | * @return array[]
60 | */
61 | public function getConfigTemplates()
62 | {
63 | return $this->emailTemplateConfig->getAvailableTemplates();
64 | }
65 | }
66 |
67 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/GetListOfEmailTemplates/app/code/MageVision/Blog46/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/GetListOfEmailTemplates/app/code/MageVision/Blog46/registration.php:
--------------------------------------------------------------------------------
1 | _mediaDirectory->getAbsolutePath($this->_appendScopeInfo(self::UPLOAD_DIR));
36 | }
37 |
38 | /**
39 | * Makes a decision about whether to add info about the scope.
40 | *
41 | * @return boolean
42 | */
43 | protected function _addWhetherScopeInfo()
44 | {
45 | return true;
46 | }
47 |
48 | /**
49 | * Getter for allowed extensions of uploaded files.
50 | *
51 | * @return string[]
52 | */
53 | protected function _getAllowedExtensions()
54 | {
55 | return ['jpg', 'jpeg', 'gif', 'png', 'svg'];
56 | }
57 |
58 | /**
59 | * @return string|null
60 | */
61 | protected function getTmpFileName()
62 | {
63 | $tmpName = null;
64 | if (isset($_FILES['groups'])) {
65 | $tmpName = $_FILES['groups']['tmp_name'][$this->getGroupId()]['fields'][$this->getField()]['value'];
66 | } else {
67 | $tmpName = is_array($this->getValue()) ? $this->getValue()['tmp_name'] : null;
68 | }
69 | return $tmpName;
70 | }
71 |
72 | /**
73 | * Save uploaded file before saving config value
74 | *
75 | * Save changes and delete file if "delete" option passed
76 | *
77 | * @return $this
78 | */
79 | public function beforeSave()
80 | {
81 | $value = $this->getValue();
82 | $deleteFlag = is_array($value) && !empty($value['delete']);
83 | $fileTmpName = $this->getTmpFileName();
84 |
85 | if ($this->getOldValue() && ($fileTmpName || $deleteFlag)) {
86 | $this->_mediaDirectory->delete(self::UPLOAD_DIR . '/' . $this->getOldValue());
87 | }
88 | return parent::beforeSave();
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/ImageUploadConfigurationField/app/code/MageVision/Blog4/etc/acl.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ImageUploadConfigurationField/app/code/MageVision/Blog4/etc/adminhtml/system.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | magevision
22 | MageVision_Blog4::blog4_configuration
23 |
24 |
25 |
26 |
27 |
28 | MageVision\Blog4\Model\Config\Backend\Image
29 | blog/post4
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ImageUploadConfigurationField/app/code/MageVision/Blog4/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ImageUploadConfigurationField/app/code/MageVision/Blog4/registration.php:
--------------------------------------------------------------------------------
1 | startSetup();
23 |
24 | $table = $installer->getConnection()->newTable(
25 | $installer->getTable('magevision_blog12')
26 | )->addColumn(
27 | 'post_id',
28 | \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
29 | null,
30 | ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
31 | 'Post ID'
32 | )->addColumn(
33 | 'title',
34 | \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
35 | 255,
36 | ['nullable' => true],
37 | 'Post Title'
38 | )->setComment(
39 | 'MageVision Blog12 custom table'
40 | );
41 | $installer->getConnection()->createTable($table);
42 |
43 | $installer->endSetup();
44 |
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/InstallUpgradeDatabaseSchema/app/code/MageVision/Blog12/Setup/UpgradeSchema.php:
--------------------------------------------------------------------------------
1 | startSetup();
23 |
24 | $version = $context->getVersion();
25 | $connection = $installer->getConnection();
26 |
27 | if (version_compare($version, '2.0.1') < 0) {
28 |
29 | $connection->addColumn(
30 | $installer->getTable('magevision_blog12'),
31 | 'image',
32 | [
33 | 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
34 | 'length' => 255,
35 | 'nullable' => true,
36 | 'comment' => 'Post Image',
37 | ]
38 | );
39 | }
40 |
41 | $setup->endSetup();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/InstallUpgradeDatabaseSchema/app/code/MageVision/Blog12/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/InstallUpgradeDatabaseSchema/app/code/MageVision/Blog12/registration.php:
--------------------------------------------------------------------------------
1 | backendSession = $backendSession;
29 | }
30 |
31 | /**
32 | * @param Checkmo $subject
33 | * @param $result
34 | * @param CartInterface|null $quote
35 | * @return false|mixed
36 | */
37 | public function afterIsAvailable(
38 | Checkmo $subject,
39 | $result,
40 | CartInterface $quote = null
41 | ) {
42 | if ($this->backendSession->isLoggedIn()) {
43 | return $result;
44 | }
45 |
46 | return false;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/MakeAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog77/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/MakeAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog77/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/MakeAPaymentMethodOnlyVisibleInAdmin/app/code/MageVision/Blog77/registration.php:
--------------------------------------------------------------------------------
1 | validationResultFactory = $validationResultFactory;
34 | }
35 |
36 | /**
37 | * @inheritdoc
38 | *
39 | * @param Quote $quote
40 | * @return array
41 | */
42 | public function validate(Quote $quote): array
43 | {
44 | $validationErrors = [];
45 |
46 | if ($quote->isVirtual()) {
47 | $validationErrors[] = __(
48 | 'Quote is Virtual!'
49 | );
50 | }
51 |
52 | return [$this->validationResultFactory->create(['errors' => $validationErrors])];
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/QuoteBackendValidationRule/app/code/MageVision/Blog80/etc/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | - MageVision\Blog80\Model\Quote\ValidationRule\CustomValidationRule
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/QuoteBackendValidationRule/app/code/MageVision/Blog80/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/QuoteBackendValidationRule/app/code/MageVision/Blog80/registration.php:
--------------------------------------------------------------------------------
1 | resultPageFactory = $resultPageFactory;
42 | $this->customerSession = $customerSession;
43 | parent::__construct($context);
44 | }
45 |
46 | /**
47 | * Allow only customers - redirect to login page
48 | *
49 | * @param RequestInterface $request
50 | * @return \Magento\Framework\App\ResponseInterface
51 | * @throws \Magento\Framework\Exception\NotFoundException
52 | */
53 | public function dispatch(RequestInterface $request)
54 | {
55 | if (!$this->customerSession->authenticate()) {
56 | $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
57 | $this->customerSession->setBeforeAuthUrl($this->_url->getUrl(
58 | 'blog24/post/index'
59 | ));
60 | }
61 |
62 | return parent::dispatch($request);
63 | }
64 |
65 | /**
66 | * Default page
67 | *
68 | * @return \Magento\Framework\Controller\ResultInterface
69 | */
70 | public function execute()
71 | {
72 | return $this->resultPageFactory->create();
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/RedirectToPreviousPageAfterCustomerLogin/app/code/MageVision/Blog24/etc/frontend/routes.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/RedirectToPreviousPageAfterCustomerLogin/app/code/MageVision/Blog24/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/RedirectToPreviousPageAfterCustomerLogin/app/code/MageVision/Blog24/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/RemoveCartTaxShippingEstimate/app/code/MageVision/Blog22/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | MageVision_Blog22::cart/shipping.phtml
18 |
19 |
20 |
21 | -
22 |
-
23 |
-
24 |
- true
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/RemoveCartTaxShippingEstimate/app/code/MageVision/Blog22/view/frontend/templates/cart/shipping.phtml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
24 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/StoreConfigurationUsingDataPatch/app/code/MageVision/Blog79/Setup/Patch/Data/SetStoreConfiguration.php:
--------------------------------------------------------------------------------
1 | moduleDataSetup = $moduleDataSetup;
35 | $this->resourceConfig = $resourceConfig;
36 | }
37 |
38 | /**
39 | * {@inheritdoc}
40 | */
41 | public function apply()
42 | {
43 | $this->moduleDataSetup->startSetup();
44 | $this->resourceConfig->saveConfig('general/locale/timezone', 'Europe/Berlin');
45 | $this->moduleDataSetup->endSetup();
46 | }
47 |
48 | /**
49 | * {@inheritdoc}
50 | */
51 | public static function getDependencies()
52 | {
53 | return [];
54 | }
55 |
56 | /**
57 | * {@inheritdoc}
58 | */
59 | public function getAliases()
60 | {
61 | return [];
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/StoreConfigurationUsingDataPatch/app/code/MageVision/Blog79/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/StoreConfigurationUsingDataPatch/app/code/MageVision/Blog79/registration.php:
--------------------------------------------------------------------------------
1 | addPageLayoutHandles(
25 | ['attribute_set_id' => $product->getAttributeSetId()]
26 | );
27 |
28 | return [$resultPage, $product, $params];
29 | }
30 | }
--------------------------------------------------------------------------------
/UpdateLayoutOnAttributeSet/app/code/MageVision/Blog37/etc/frontend/di.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/UpdateLayoutOnAttributeSet/app/code/MageVision/Blog37/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/UpdateLayoutOnAttributeSet/app/code/MageVision/Blog37/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/UpdateProductStockMSIProgrammatically/app/code/MageVision/Blog85/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/UpdateProductStockMSIProgrammatically/app/code/MageVision/Blog85/registration.php:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 | - MageVision\Blog64\Console\Command\ProfilerCommand
18 |
19 |
20 |
21 |
22 |
23 | magevision:blog64:profiler
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/UseProfilerInCLICommand/app/code/MageVision/Blog64/etc/module.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/UseProfilerInCLICommand/app/code/MageVision/Blog64/registration.php:
--------------------------------------------------------------------------------
1 |