17

I was just getting the same error (Asymmetric transaction rollback) when I tried to update some categories after importing data using the Magento data-migration-tool. A manual reindex fixed the problem for me, to manually reindex your database via ssh just run the following command from your Magento installation: php bin/magento indexer:reindex If that ...


12

Propably the best option is to add new helper with following code: <?php namespace Vendor\Module\Helper; use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Model\Product as ModelProduct; use Magento\Store\Model\Store; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; class HelperName extends \Magento\Framework\Url\Helper\...


8

Create helper and add code. <?php namespace Vendor\Module\Helper; use Magento\Framework\Stdlib\DateTime\TimezoneInterface; class Newlabel extends \Magento\Framework\Url\Helper\Data { /** * @var TimezoneInterface */ protected $localeDate; public function __construct( TimezoneInterface $localeDate ) { $this-&...


6

The issue is resolved and the following are the steps Reindex by using the following command php bin/magento indexer:reindex run below commands rm -rf var/cache/* rm -rf var/page_cache/* rm -rf var/generation/* Give permissions to var/generation folder.


6

try this $productCollectionFactory = $objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory'); $collection = $productCollectionFactory->create(); $collection->addAttributeToSelect('*'); $collection->addAttributeToSort('entity_id','desc'); $collection->setPageSize(5); // selecting only 5 products foreach ($...


5

Welcome to Magento.SE! This is quite easy to do and will require that you make a module to rewrite the functionality of Mage_Catalog_Block_Product_New. Once you've done that, you need to just make an edit to the _getProductCollection method modifying the collection: protected function _getProductCollection() { $collection = parent::...


4

Date also plays an important role. While inserting the product details. You give recent date and you paste this code in the home page By going to cms and manage pages of Magento admin panel. I am new to magento and i tried it. It worked for me. {{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/...


4

The solution (for no clarified reason) was to enable all Magento caching options. This solved the issue for me. Tested this again in a new install: Fresh Luma templated with new product widget on the front page, with caching disabled. The 'Add to Cart' button wouldn't function as expected. Enabled all Magento2 caching options, and the problem was ...


4

Also, this error occurs in a situation when you have configured external search engine (Solr or Elasticsearch) and it is unavailable during product/category save.


3

It is not a complete solution but it can help you to detect the source of the problem in some cases. Comment out the around save plugin in this class Magento\CatalogSearch\Model\Indexer\Fulltext\Plugin\Product and you will see the exception error


3

Do not just copy the entire file from the core files- here what you need to do is to extend your class form core file and put the methods in your class in which you have made any changes; otherwise it should work fine. class ImageUploader extends \Magento\Catalog\Model\ImageUploader { }


2

Marius, Please reindex from admin>System>Index Management. Basically,You can filter any product collection by Mage::getSingleton('cataloginventory/stock')->addInStockFilterToCollection($collection); but it depends on System/Configuration/Catalog/Inventory/Display Out of Stock Products -NO If not work then try this /* $collection=Your Product ...


2

Simply check your dates and reindex from the backend.


2

To add children blocks to a widget one approach would be to simply create the block directly from the layout. $this->getLayout()->createBlock('what_block/you_need')->setTemplate('the/blocks/template.phtml')->toHtml(); You could incorporate this into a function inside the widget's block file like getMyBlockHtml and then in the widget's template ...


2

check out Mage_Catalog_Block_Product_New. so in your layout file you need to add something like <block type="catalog/product_new" name="products.new" template="catalog/product/list.phtml" /> There's also a template for new products, called new.phtml (replace list.phtml with new.phtml) - depends on how you want to display things


2

Please update bellow function from: protected function _getProductCollection() { switch ($this->getDisplayType()) { case self::DISPLAY_TYPE_NEW_PRODUCTS: $collection = parent::_getProductCollection(); break; default: $collection = $this->...


2

Take class Mage_Catalog_Block_Product_Widget_New in local folder or extend it with your own Find the below function protected function _getProductCollection() { switch ($this->getDisplayType()) { case self::DISPLAY_TYPE_NEW_PRODUCTS: $collection = parent::_getProductCollection(); break; ...


2

You can find the query to retrieve the new products in the class Mage_Catalog_Block_Product_New. Here is is just in case. $todayStartOfDayDate = Mage::app()->getLocale()->date() ->setTime('00:00:00') ->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $todayEndOfDayDate = Mage::app()->getLocale()->date() ...


2

Well, as a programmer, you will not do this if you think you are expert. But, who know, this is a easiest and fastest way to get the system work well, get all of products of all of categories sort by newest products in 5 minutes without any risk. Actually, this is not really “magento core edit”, we just inherit the core code and override it in local ...


2

In order to do what you want you'd have to create a simple module that would hook into event called catalog_product_save_before. In that observer you'd have to check if product's new by looking at protected property _origData. If that property would be NULL then set the values for product's properties newsFromDate and newsToDate. Values of those dates would ...


2

Try this: Company\Module\Model\Config public function getAttributeUsedForSortByArray() { $options = ['bestseller' => __('Best Seller'), 'newest' => __('Newest'), 'mostviewed' => __('Most Viewed')]; foreach ($this->getAttributesUsedForSortBy() as $attribute) { /* @var $attribute \Magento\Eav\Model\Entity\...


2

if (($newsTo != '' || $newsFrom != '')) means newsfromdate or newstodate not be blank. You can set date from particular product. $_config->getAdvanced('show_newlabel') this one like configuration to check label will be display on frontend or not. You can check it by System->Configuration


1

Try this, styles.css line no: 4230 change left to .products-grid > li:nth-child(3n+1) { clear: none; } Line no:4314 .products-grid > li { margin-right: 1% !important; width: 19%; } Use parent class name so that it won't affect rest of the page


1

Add below code in your file app/design/frontend/yourtheme/yourpackage/catalog/product/new.phtml <?php /** * Product list template * * @see Mage_Catalog_Block_Product_List */ /* @var $this Mage_Catalog_Block_Product_List */ ?> <?php $_productCollection=$this->getLoadedProductCollection(); $_helper = $this->helper('catalog/output');...


1

You can achieve this by two methods. 1) Cron you need to create a cron which will execute as per your required time frame and make the changes accordingly. you can follow the following url to create a cron. Remove product from category using cron http://inchoo.net/magento/creating-cron-script-in-magento/ 2) Observer you need to create a observer which ...


1

I have another solution for this one issue and it's easy. Just you can change reindex mode for product related indexer ->Update by schedule.


1

If you are using flat catalog and reindexing doesn't work, then maybe you just ran out of the MySQL row limitations. You should either turn off flat catalog or reduce the number of attributes which use the used in product listing and the used for sorting in product listing options.


1

Below are the steps I have taken to display New Products in a Category Page: Step 1: Create products with the 2 attributes filled in as below in the screenshot: Step 2: Create a category under Catalog > Manage Categories. Navigate to the tab Custom Design and do as per the screenshot: Custom Layout XML code as follows (Update list.phtml to new.phtml): &...


1

Instead of rewriting the price.phtml I would use the catalog_product_get_final_price event that is triggered from Mage_Catalog_Model_Product_Type_Price::getFinalPrice In your observeryou can set the final_price data of a product $observer->getProduct()->setData('final_price', $ yourCustomPrice); This will overwrite other previously set prices


1

Looks like the attribute set is borked. Try the following: add a simple product using the Default attribute set and see if you're still missing the options edit some random products and see if you have all the options visible in the left menu go to Catalog -> Attributes -> Manage Attribute Sets (exact path might vary depending on the version of ...


Only top voted, non community-wiki answers of a minimum length are eligible