I get the following error when running bin/magento setup:upgrade This is after I uninstalled MSI inventory management system Warning: Undefined array key “inventory_source” in /vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 153 Setup:upgrade stalls with this error and magento goes off line Appreciate help
Magento2
In Magento 2.4, I want to create a cart rule and that can not be applied if any product in the cart with 0 price. For Example, I have created a coupon code that allows a 20% discount on the total of the cart, and it is working fine. Now […]
Using Magento 2.4. I want to add some custom JS in the admin area. appcodeClientQuoteAdminThemeviewadminhtmlrequirejs-config.js var config = { map: { '*': { adminTheme: 'ClientQuote_AdminTheme/js/client-admin' } }, paths: { 'custom-script': 'ClientQuote_AdminTheme/js/client-admin' } }; I can see the above in the source of /static/adminhtml/Magento/backend/en_US/requirejs-config.js appcodeClientQuoteAdminThemeviewadminhtmlwebjsclient-admin.js define([ 'prototype' ], function () { […]
I am making a custom module and I want to get 5 random product skus. So far I tried: $objectManager = ObjectManager::getInstance(); /** * @var ProductRepository */ $productRepository = $objectManager->create(ProductRepository::class); /** * @var SearchCriteriaBuilder */ $searchCriteria = $objectManager->create(SearchCriteriaBuilder::class); $searchCriteria->addSortOrder(new SortOrder()); $skus = $productRepository->getList($searchCriteria)->getItems(); But how I can define that I […]
I’m currently working on a Magento 2 project and encountering issues with the “custom logger” when attempting to use it in developer mode. I’m hoping someone can help me troubleshoot this problem. "custom logger" Magento 2 version: 2.4.6 Logger used: $this->logger->debug()
I made my own command to seed a table: namespace MageGuideFirstModuleConsoleCommand; use MageGuideFirstModuleModelBlogPost; use MageGuideFirstModuleModelResourceModelBlogPostResource; use MagentoFrameworkAppObjectManager; use SymfonyComponentConsoleCommandCommand; use SymfonyComponentConsoleHelperProgressBar; use SymfonyComponentConsoleInputInputInterface; use SymfonyComponentConsoleOutputOutputInterface; /** * Seed Multiple Blogposts with Skus */ class BlogpostSeeder extends Command { const BLOGPOSTS_NUM=10000; protected function configure(): void { $this->setName('db:seed:blogposts')->setDescription('Seed Multiple Blogposts'); parent::configure(); } […]
In my module I defined a etc/schema.graphqls: type BlogPost { blog_post_id: ID title: String post: String } input BlogpostAttributeFilterInput { page: Int limit: Int } type Query { allBlogPosts(input: BlogpostAttributeFilterInput) : [BlogPost] @resolver(class: "\MageGuide\FirstModule\Model\Resolver\GetBlogPosts") @doc(description:"Retrieve All BlogPosts") @cache(cacheable: false) } And I made the following resolver: namespace MageGuideFirstModuleModelResolver; use MageGuideFirstModuleModelBlogPost; […]
I made the followig schema.graphqls type BlogPost { blog_post_id: ID title: String post: String } input BlogpostAttributeFilterInput { page: Int limit: Int } type Query { allBlogPosts(input: BlogpostAttributeFilterInput) : [BlogPost] @resolver(class: "\MageGuide\FirstModule\Model\Resolver\GetBlogPosts") @doc(description:"Retrieve All BlogPosts") @cache(cacheable: false) } And I want to provide some arguments towards the request allBlogPosts I […]
how to get this amount? I try – foreach ($_order->getAllVisibleItems() as $item) { $productId = $item->getProductId(); $productName = $item->getName(); $productSku = $item->getSku(); $Price = $item->getPrice(); $qtyOrdered = intval($item->getQtyOrdered()); }