Skip to content

magento2.4

Auto Added by WPeMatico

Image Cleanup Cron not working properly

/var/www/html/project/app/code/Embitel/ImageCleanup/Cron/Clean.php /** * Copyright © All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace EmbitelImageCleanupCron; use MagentoFrameworkExceptionFileSystemException; use MagentoFrameworkFilesystemDirectoryWriteInterface; use MagentoFrameworkAppFilesystemDirectoryList; class Clean { /** * @var EmbitelImageCleanupModelimageFactory */ public $_imageFactory; const IMAGE_CLEANUP_CRON = ‘imagecleanup/general/enable’; public function… Read More »Image Cleanup Cron not working properly

How I can get products with random order?

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());… Read More »How I can get products with random order?

How I can load the Product repository without using the dependency injection?

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;… Read More »How I can load the Product repository without using the dependency injection?

How I can provide arguments towards the existing graphql request?

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… Read More »How I can provide arguments towards the existing graphql request?

How I can provide a Collection at the constructor of my Graphql Resolver?

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) }… Read More »How I can provide a Collection at the constructor of my Graphql Resolver?

Deprecated : strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in C:xampphtdocsmage2rockapp\list.phtml on line 112

when i install a free template i try to create a catagory I end up with an error that looks like this Exception #0 (Exception): Deprecated Functionality: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in… Read More »Deprecated : strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in C:xampphtdocsmage2rockapp\list.phtml on line 112