Price rules in Magento - magento

I have a problem with the price rules in magento version 1.5.1. I have a rule that defines the discount according to an attribute of the product , called fascia_sconto . I had a series of products that had an attribute that defined a discount of 20 % , but now I need to change the discount to be able to cancel it and put another on the same products .
I changed that attribute using store manager for magento , changing all the products concerned , putting the attribute in the rule that defines a discount to 0 , and then I applied this rule , thinking now that the discount was applied . But I have not noticed any change. Then I emptied the cache, reindexed everything, but nothing yet , there is always the old discount. But the mystery of all mysteries: if I go to a product of which I have modified the attribute, and save it , magically the rule, for that product, of course, is applied , then the item on the frontend has no discount . I have to resave 1,600 products , so I can’t certainly lose a whole day one by one to save all the products to make the rule active .
I also tried to make a rule for it , which should overwrite the previous one. I set a rule that defined a discount of 18 % on those products , putting between actions, “Stop processing more rules “ to “ yes”, so that the previous rule was no longer calculated , but that this was directly applied . But nothing , magento continues to calculate the discount starting with the rule of 20 (which no longer exists all over for those products , since I changed the attribute ) and then apply an additional discount of 18% on discount price! I’m not understanding anything, would you be able to kindly give me a hand ? Where was I wrong?
I hope I was clear enough, and I really hope you grow to be of help .
PS: I’m sorry for my bad English, but it’s not my primary language

Applying price rules based on product attribute changes can be very difficult. I am sypmathetic to your cause.
It might not work but you are welcome to follow carefully my (paranoid) process for applying sale promotion rules:
(change any product attributes relating to the sales rules)
Re-index everything
Refresh the caches
'Save and apply' the rule to apply it to the fresh indexes
Re-index again
Refresh the caches again

Related

Magento Catalog Price Rule not calculating properly for some products

One order has an issue during our Black friday promotion (Catalog price rule 20%). The product original price is $198 but went through for $167 (around 15.6%). I checked the logs, order details etc but don't see any issues. The sale price is fine on front end and other orders were fine too.
Any thoughts how it happened? We are using Magento ver. 1.9.3.2.
Product order amount
Product original amount
The sale amount should have been $158.4
It seems like the rule which was applied is different. Please see the rule details assigned to the corresponding order.
You can see the rule by running the below SQL.
SELECT applied_rule_ids FROM sales_flat_order WHERE entity_id=[MAGNETO_ORDER_ID]
And then see the rule details corresponding to that applied_rule_id

catalog price rules disappear after mid night in magento site

we have a problem with catalog price rules in 1.9.0
we have some 1000 products in a site.
we applied catalog price rules to give discount for 500 products.
i did't gave any date limit for catalog price rules
those special prices are displaying only until mid night.
next day, after mid- night special prices are not displaying in site.
cron is working fine.
please help me to find some solution.
source : Magento catalog price rule disappears at night
credits for genius "Alexei Yerofeyev". mostly i will never forget this man.
Yes, this is a bug in Magento (or some logic beyond my understanding). When Magento displays products on frontend, it checks if there are catalog rules for this date. And the date used for this check is your local, so in your case GMT+5. However, when catalog rules are being applied, it uses GMT date. So that means that you aren't able to apply rules until 5 AM.
The problem is in Mage_CatalogRule_Model_Action_Index_Refresh::execute() function. You will have to rewrite this function/class either in your extension, or via the local version of the file.
You have to replace line 121 here : app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php
$timestamp = $coreDate->gmtTimestamp('Today');
with this line:
$timestamp = Mage::app()->getLocale()->date(null, null, null, true)->get(Zend_Date::TIMESTAMP);
After that you should be able to apply the rules.

Magento shopwide price reduction without needing to add a catalog price rule

I have added a shopwide catalog price rule of 20% on all products. This seems to work. However, for some reason after a re-index I have to reset this price rule time and time again. As most of my shop runs with automatic imports and cron jobs - I would somehow like to hardcode this rule in. So I don't need to reset the rule every time.
Also the fact that my price is tagged as special price is something I would like to get rid of. The price is just the initial price minus 20%. This is not a special offer - it's just the price how I want to offer it to my customers.
Up till now I haven't found a solution to my problem - or where to start. Suggestions would very welcome!
Use shopping cart price rules
admin/promo_quote/
And set the discount of 20% there. It will apply to the cart and you won't have to the catalog price rules every time.
If you need more fine-grain control, check out:
http://www.amasty.com ( unaffiliated but happy with dozens of their extensions )

How can I set up a shopping cart price rule that excludes products with scheduled dates for special price?

I have two types of products:
A product that is on sale all the time and uses the special price field with no scheduled dates.
A product that is scheduled to go on sale once or twice a year using special price field and scheduled to and from dates in the future.
I have a coupon that MUST not be applicable on products whose special price field is active, whether by virtue of today's date falling within the to and from date fields, or by simply having its special price field filled in.
I can easily solve for product 1 - add a condition excluding anything with a special price greater than .01.
BUT that doesn't solve for product 2 - I do not want to exclude product 2 when the dates of the special price on product 2 have not been reached yet or have expired.
I do not want a manual solution (i.e. manually add products to a sale category when on sale, remove when not on sale).
I'm thinking of creating a cron job to make changes on the fly in a semi-auto fashion, but that seems desperate. Is there nothing I can do here to automate this based on special price dates?
You can do that using the Magento Admin.
First in admin go to Catalog -> Attributes -> Manage Attribute -> Look for "special_from_date" and "special_to_date".
Click on it, look for the option "Use for promotion conditions" set "Yes"
Now your special_from and special_to date will show up on your cart promotion rules section.
I'm dealing with exactly the same need.
For now, I'm developing a cron job: it run every day at midnight andupdates the rule end_date with today(). It's hacky, but so far looks promising and it's way easier and more manteinable than messing with mage internals.
Edit: also see here https://magento.stackexchange.com/questions/210006/catalog-price-rules-with-date-as-conditions-cannot-possibly-work-due-to-strtotim

Magento Discount ANd Tax Calculation

Kindly have a look the image showing the checkout details on my magento store. The subtotal price of 6929.82 is correct - to which a discount of 10% is to be applied. The discount amount of 692.98 is also correct. However I cannot figure out how in the world could magento calculate the difference of 6929.82 and 692.98 as 6321.94 .
Though I am using a custom theme but I have tried restoring to default theme and the result remains the same which tells that the problem is either in the backend settings or in the core magento files. Further into the calculations - application of 14% tax after discount is calculated correctly and added to the figure.
Can anybody help me out in locating the setting that is leading to this strange behaviour from Magento.
Looks like its a bug. See https://magento.stackexchange.com/questions/2900/completely-incorrect-tax-calculation
Try the following solution
app/code/local/Mage/Tax/Model/Sales/Total/Quote/Tax.php
Line 144
if('cart' == Mage::app()->getRequest()->getControllerName()){
$address->setGrandTotal($address->getGrandTotal() + $address->getTaxAmount());
$address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseTaxAmount());
} // if
Maybe there is Shipping&handling total is not displayed (amount 85.1). You can check all totals and their value through database, review sales_flat_quote_address table.
After a lot of searching for possible solutions I could not come across any full proof solution to my problem. Modifying the Core Magento files is also something I would not recommend unless and until you are very sure what all areas of your website it will affect.
The solution I have implemented is to set the catalog prices as "excluding tax" in Tax Settings and thereafter manually changing all product prices by deducting the tax applicable on them.
e.g Before Implementing the solution:
Tax Setting - Catalog prices include tax
Price of Item (as entered in product specification)- 100 {subtotal 86 + 14#14% tax}
After Solution
Tax Setting - Catalog prices exclude tax
Price of Item (as entered in product specification)- 86
After implementing this I found the discount totals and everything was being calculated correctly. Since I had only 400 odd products I did it manually over the week just to be sure. However for larger number of products you can also run a query through phpmyadmin(etc) to change the values directly in the database. Do remember to backup your DB before doing so.

Resources