Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged

0

Please check whether you have set the values of: Is Active: Yes Description: Enables or disables the category Include in Navigation Menu: Yes Description: Decides whether the category will be shown in the top menu or not. Is Anchor: Yes Description: Decides whether the category will be shown in the layered navigation on the category page and search ...


0

OK, this is a little embarrassing but it might help somebody. At some moment I deleted the categories from url_rewrites, for some dumb reason. The widget was looking for some data inside that table and since it didn't find it, it returned blank.


0

To solve out your issue do the follow below step : Technical Review Guidelines You can email to marketplace@magento.com with any Marketplace submission problems. They'll be able to help you out. marketplacesupport.magento.com From here you can create a support ticket to ask your question and you will also find more Info regarding Magento Marketplace. This ...


0

If somebody needs more clear code, you are welcome :) <?php declare(strict_types=1); namespace Vendor\Module\Model\Config\Source; use Magento\Catalog\Helper\Category as CategoryHelper; use Magento\Framework\Option\ArrayInterface; class Category implements ArrayInterface { /** * @var \Magento\Catalog\Helper\Category */ protected $...


0

I think that is happening because there is code that already does that. Check: vendor/magento/module-catalog/Ui/Component/Product/Form/Categories/Options.php


0

I need to the something very similar to this but I can't get it to work. I hope get some answers from the wise guys out her. I need to get a attribute collection of the current category for example. I have 4 custom attributes (images) that I would like to use for category slider <?php $category = Mage::getSingleton('catalog/layer')->...


0

From much research and a lengthy conversation with a friendly developer at webpanda solutions, i purchased this module https://webpanda-solutions.com/url-rewrites-regenerate-and-customize.html After installing i still had some problems, but after the settings were customised, I was able to start importing the products using the firebear module, no more ...


0

I think yes it is possible, to achieve the above functionality at login time you should identify the store. So to achieve this i think you need to modify the admin login form also. In admin login form you can ask them to enter store name or something so by considering these details you can show specific category.


0

I looked at the base catalog_category_view.xml file in vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml: <referenceContainer name="columns.top"> <container name="category.view.container" htmlTag="div" htmlClass="category-view" after="-"> <block class="Magento\Catalog\Block\Category\View" name="category....


0

One of the possible solution for this Go this file: lib/web/mage/adminhtml/wysiwyg/tiny_mce/html5-schema.js Replace this: ['a', 'href target rel media hreflang type charset name rev shape coords download', phrasingContent], With this: ['a', 'href target rel media hreflang type charset name rev shape coords download', flowContent], Good approach to ...


0

I ran into the same issue today. I created a new custom category attribute (an int/select one), and I would try this, in list.phtml, and get an empty value: $value = Mage::registry('current_category')->getData('my_custom_Attribute'); However, this was solved by re-indexing catalog_category_flat; with n98: n98-magerun.phar index:reindex ...


0

The previous answers are wrong. For a new category there is no is_anchor attribute set, so you cant update it. You have to find the non existing categories and insert is_anchor attribute values for them. Solution (quick shot): <?php require_once 'abstract.php'; class Cartware_Import_Shell_Compiler extends Mage_Shell_Abstract { /** * Run ...


1

You have to use collection Factory \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory, $this->collectionFactory= $collectionFactory $this->collectionFactory->create(); because this will return every time new instance and no filter will apply default.


0

In Magento Root Category ID is hard coded You have to update Root category Id if you deleted default one, Then tree will appears normally. Just change Root category Id constant variable defined in model Update these constants


0

You can create a custom Block with two functions. one for get category image by categoryID and another function for get category data by categoryId . <?php namespace Vendor\Module\Block; use Magento\Catalog\Model\ResourceModel\CategoryFactory; use Magento\Framework\View\Element\Template\Context; use Magento\Store\Model\StoreManagerInterface; class ...


0

I think you should try to replace \Magento\Catalog\Model\ResourceModel\AbstractResource with \Magento\Catalog\Model\ResourceModel\Category in your constructor, then bin/magento setup:upgrade Also, the = null in your __construct() is mainly used for compatibility reasons with older versions of the same module. If you need to do this, you should either add ...


1

In my case I put the erorr message within the returned string vendor/magento/module-catalog/Model/CategoryLinkRepository.php public function save(\Magento\Catalog\Api\Data\CategoryProductLinkInterface $productLink) { $category = $this->categoryRepository->get($productLink->getCategoryId()); $product = $this->productRepository->get($...


0

You should try not to use a "core-like" class name. I doubt, it is because you named your class as Category which is already present in the Magento core. You can change it to something like Catlist at least it doesn't seem to duplicate any existing core class and instead more like what it seems to, which is Category list.


0

Try this: php bin/magento indexer:reset php bin/magento indexer:reindex php bin/magento c:c && bin/magento c:f php bin/magento setup:upgrade php bin/magento setup:di:compile and don't forget to give the right permissions to: var/ pub/ generated/ after these commands.


0

here a image where i put path below add to cart button just adding below code in addtocart.phtml in app/code/vendor_name/extension_Name/view/frontend/templates/product/view/addtocart.phtml <?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml(); ?> add this to any phtml file you will get the path you wanted hope this helps you


1

Try this public function __construct( \Magento\Framework\Registry $registry, \Magento\Catalog\Api\CategoryRepositoryInterface $categoryRepository, \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->storeManager = $storeManager; $this->registry = $registry; ...


1

Try this, Add the below code to your block <?php namespace Vendor\ModuleName\Block; class ProductCollection extends \Magento\Framework\View\Element\Template { protected $_productCollectionFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ResourceModel\Product\...


0

If you want to have the product id in the product listing template file, then you can try following code $_product->getId()


1

You can use this tag in config if you are creating it in ui-component. <item name="levelsVisibility" xsi:type="number">3</item> change the number according to your required levels. <field name="category_id"> <argument name="data" xsi:type="array"> <item name="options" xsi:type="object">Magento\...


0

After that, you must reindex and refresh the cache. php bin/magento indexer:reindex php bin/magento cache:flush


1

I think You have typo in your code: <?php if (_$product->getPriceInfo()->getPrice('special_price')->getValue()): ?> Should be: <?php if ($_product->getPriceInfo()->getPrice('special_price')->getValue()): See _$product


Top 50 recent answers are included