34 votes
Accepted

Magento 2 : How to get Final price & Original price of all types of product

You can get Regular price and Final price of all types of product using below way. Simple Product $regularPrice = $product->getPriceInfo()->getPrice('regular_price')->getValue(); $...
Chirag Patel's user avatar
  • 6,126
17 votes

Magento 2 display old price AND special price in category list

Found solution here : https://github.com/magento/magento2/issues/7624 Copy final_price.phtml from Vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml to ...
cap340's user avatar
  • 711
9 votes
Accepted

Magento 2 - Unset Special Price programmatically

Saving the price and forcibly update the product attribute using the resource model worked in my situtation: $product->setSpecialPrice(null); $product->getResource()->saveAttribute($product, ...
Giel Berkers's user avatar
  • 12.3k
9 votes

Magento 2 - get special price of product by product id or sku

Use \Magento\Catalog\Model\ProductRepository class to get the special price of the product protected $_productRepository; public function __construct( ... \Magento\Catalog\Model\...
Prince Patel's user avatar
  • 22.7k
8 votes

magento2 - how to create Scheduled Changes (Magento_CatalogStaging module) of product programmatically?

like Igor already mention you can try with the following. First, create scheduled update instance and set name, start and end time. /** * @var \Magento\Staging\Api\UpdateRepositoryInterface */ ...
Chombe's user avatar
  • 81
7 votes
Accepted

Magento2: Attribute News to date, News from date , special from date and special to date doesn't show in admin

Magento intentionally hid these values in Enterprise Edition (see vendor/magento/module-catalog-staging/etc/adminhtml/di.xml). <type name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\...
mpchadwick's user avatar
  • 1,234
5 votes
Accepted

List all products with special price

This is how I did it $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $visibleProducts = $objectManager->create('\Magento\Catalog\Model\Product\Visibility')->...
Anna's user avatar
  • 1,645
5 votes

Get product FINAL price without loading entire product

"a more efficient way" is to use product collcections where final price is already add to. Some numbers here: What is faster - getting raw attribute value or use collection? Using ->addFinalPrice()...
sv3n's user avatar
  • 11.7k
4 votes

How to display Special Price end date on front end

On Product detail page or Category list page, You can use following code to display special price end date. <?php // check if product has special if($_product->getSpecialPrice()){ // get ...
Arunendra's user avatar
  • 7,446
4 votes
Accepted

Programatically get special price products that are active by checking the end date?

Here is complete search criteria with 4 filters: $withSpecialPrice - a filter for products with a special price greater then 0 $withVisibleStatus - a filter for product with a visible status (enabled ...
Siarhey Uchukhlebau's user avatar
4 votes
Accepted

Problem with Special Price Date in Magento2

Have you set your locale to any other than en_US? Try editing the admin user you are using, set the locale for that user to en_US and try setting this again. There is a bug with the datepicker I ...
ol'bob dole's user avatar
4 votes
Accepted

apply catalog promotion rule on tier prices and special prices in magento 2

Native magento doesn't support applying catalog promotion rule on tier prices and special prices but we can achieve this by extending some of the core files in magento. You can find the ...
Bibhu Asish's user avatar
4 votes
Accepted

Magento 2 get special price product collection

create your own block file and get collection below way.. <?php namespace Vendor\SaleProducts\Block\Home; use Magento\Catalog\Api\CategoryRepositoryInterface; class SaleList extends ...
Rakesh Donga's user avatar
  • 5,354
4 votes

Error showing special prices when changing store view - Magento 2.3.1

Hey Please check in catalog_product_index_price table with your entity_id. Like SELECT * FROM catalog_product_index_price WHERE entity_id =432 LIMIT 0 , 30 and see what price is there.
Krunal Pandya's user avatar
3 votes

How to display Special Price end date on front end

You can use $pro = Mage::getModel("catalog/product")->load(PRODUCT_ID); echo $pro->getSpecialToDate(); Change PRODUCT_ID with id of product For formatting date $dt = $pro->...
Anil Suthar's user avatar
  • 4,731
3 votes

How can I show the amount saved in magento 2

I ran into the same issue on category and search results pages on Magento 2. Here's what I eventually figured out. Hope it helps! (Note: this all falls within the foreach loop which iterates through ...
TMax's user avatar
  • 83
3 votes
Accepted

Magento Product Collection less then the Original price

$categoryIds = array(469);//category id $products = Mage::getResourceModel('catalog/product_collection') ->addCategoryFilter(Mage::getModel('catalog/category')->load($categoryIds)); $...
Qaisar Satti's user avatar
  • 32.5k
3 votes
Accepted

Magento 2 - get special price of product by product id or sku

use Magento/Catalog/Model/ProductFactory to load product, and get price information from the model Code is like: $specialPrice = $this->productFactory()->create()->load($id)->...
Tomi's user avatar
  • 305
3 votes

How can you set the customer group pricing for specific logged in ids as 50 percent discount for all products in magento2?

You can create a catalog price rule and select the customer group who will be eligible for the discount. In conditions tab you can select the condition for which product this discount will be applied....
Anshu Mishra's user avatar
  • 8,960
3 votes

apply catalog promotion rule on tier prices and special prices in magento 2

For archive your requirement you have to do some customization please check below solution. NOTE:- BELOW SOLUTION WILL ONLY WORK FOR THE APPLY CATALOG PROMOTION DISCOUND ON TIER PRICE Magento saved ...
Mohammad Bharmal's user avatar
3 votes
Accepted

Magento2.2.5 show original price when configurable product is part of catalog price rule

Copy this file vendor/magento/module-configurable-product/view/base/templates/product/price/final_price.phtml into your theme/module and remove the following condition, !$block->isProductList() &...
Prema Karthik's user avatar
3 votes

I am getting Invalid input datetime format of value '11/22/2018' when setting special price in magento 2.3.1

This is an official bug. See Magento / GitHub thread here! @jcdennen shows a temporary fix until Magento fix it by modifying the Timezone.php file and removing am and adding a 0 in $date .= " 0:00am" ...
Fox's user avatar
  • 211
3 votes
Accepted

How to add a label to simple & Bundle product price?

For Simple /vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml override on below path /app/design/frontend/theme/Magento_Catalog/templates/product/price/final_price....
Gohil Rajesh's user avatar
  • 2,924
2 votes
Accepted

Least selling special price should display on configurable product view page

When you create a configurable product it doesn't matter what's the price of simple products -- these prices are ignored completely. So if you want to sell a simple product A which has price $29.99 ...
Shakir Khan's user avatar
2 votes
Accepted

Display "Free Delivery" if Value = 0 in attribute textfield

<span class="price-label"><?php echo $_specialPriceStoreLabel ?></span> <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>"...
Rakesh Jesadiya's user avatar
2 votes

Apply special price to a list of products

you could add those products to a category, then create a Catalog Price Rule and in the Conditions tab, set the Category to the category you just created. Then in Actions you supply discount amount ...
Robin's user avatar
  • 507
2 votes

Special Price From Date and To Date

You may use following code $collection=Mage::getResourceModel('catalog/product_collection') ->addAttributeToSelect('name') ->addAttributeToSelect('sku') -&...
sanjeev's user avatar
  • 21
2 votes

magento special price still showing after expiration, reindexed, flushed, special date & price removed, still

If special prices are only applied via "special price", "special price from date" and "special price to date" attributes, make sure that you did not override the attributes per store view. Also, as ...
Fabian Schmengler's user avatar
2 votes

M2 Enterprise: How to add Special Price for product from date to date programmatically?

In vendor/magento/module-catalog-staging/etc/adminhtml/di.xml add comments to special_from_date and special_to_date <type name="Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Eav"> ...
HungryDB's user avatar
  • 906
2 votes

M2 Enterprise: How to add Special Price for product from date to date programmatically?

Try using Magento\Staging\Model\Entity\Update\Save to schedule a new update: $this->stagingUpdateSave->execute( [ 'entityId' => 1234, // <-- your product id '...
Fabian Schmengler's user avatar

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