31
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();
$...
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
...
11
votes
Accepted
How to check if product in cart is on sale (has a special price)?
You can do this by below code:
if($product->getPrice()>$product->getFinalPrice()):
// product in sales
endif;
If want only basic of Special price,Then you can try the below:
$...
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, ...
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\...
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
*/
...
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\...
6
votes
Use final price in addFieldToFilter
Well the field for "final price" has code final_price in Magento Eav product table.
First you have to add final price to the collection as below:
$collection = Mage::getResourceModel('catalog/...
5
votes
In the Magento Difference between Price, Group Price, Special Price, Tier Price, Display Actual Price and Manufacturer's Suggested Retail Price
Price - This is the regular price for a product
Group Price - This is the price a group (e.g whole sale) (This will be displayed instead of price)
Special price - This is a Promotional price, which ...
4
votes
How to add special price for customer group in admin
I would suggest using:
Promotions > Catalog Price Rule > Add New Rule in Magento admin panel
there you can select customer group, date from when to when the discount applies and can make BIG ...
4
votes
Special Price With Configurable And Simple Products
Magento completely ignores prices of associated products in the configurable product type. You can specify a price difference for each associated product within a configurable product, but the base ...
4
votes
Reindexing option not available in magento 2.0
In production mode Magento should be reindexed by a cronjob, see the documentation for further explanation: http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html.
...
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 ...
4
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')->...
4
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()...
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 ...
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 ...
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 ...
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.
3
votes
Accepted
Price of bottle shown as price of one shot
$coreHelper = Mage::helper('core');
$shotPrice = $_product->getFinalPrice() / ($volume * 25);
$displayShotPrice = $coreHelper->formatPrice($shotPrice);
now you just have to print $...
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));
$...
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 ...
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->...
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)->...
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....
3
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 ...
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() &...
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"
...
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....
2
votes
Accepted
Catalog Price Rules applied to special_price
Here is i have found solution after deep analysis.
you can override model
app\code\core\Mage\CatalogRule\Model\Action\Index\Refresh.php
<global>
<models>
<catalogrule>
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
special-price × 208magento2 × 92
price × 64
magento-1.9 × 42
product × 24
catalog-price-rules × 19
configurable-product × 15
magento-2.1 × 10
tierprice × 10
product-collection × 9
discount × 9
magento2.3 × 8
price-rules × 7
module × 6
date × 6
attributes × 5
magento-enterprise × 5
products × 5
shopping-cart-price-rules × 5
backend × 5
cart × 4
magento-1 × 4
catalog × 4
bundled-product × 4
promotions × 4