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

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

Related

How to use Delivery Date and Time Slot options in Product Catalog?

I am starting to learn about magento and would like to setup a delivery date and time slot option in the product page.
If I am not wrong but I think I can do so by using product attributes or custom options?
Is there a way I can do validation of the date e.g. Delivery date must be at least 3 days after order?

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 do I find a Magento products primary category

I am using Magento 1.6.2.
I need to find an easy way of checking which category is the "default" category for any given product, where multiple categories have been assigned to that product.
The reason for this is as follows:
I have different discount amounts available on different categories in my store.
Where a product falls into two categories with different discounts applied, the highest discount should be applied to that product, but if that product has been added to the system (created) with a default category that has a lower discount, and then afterwards added into the higher discount category as well, the higher discount level is not being applied when that product is purchased.
If, however, I add the product to the higher discount category first, and then to the lower discount category afterwards (so the product appears on my website in all the right places), the correct (higher) discount level applies to that product.
I can only assume, therefore, that the default (or primary, or first, however you want to label it) category is the one that determines the outcome of the discount level to be applied to it. If this is wrong, then I need a lesson in understanding the mechanics behind this to see where I have gone wrong in the overall setup of this system...
If my assumption is correct, then I need a way to determine which category any given product (using the SKU) has been assigned to first, to ensure that the correct discount can be applied to that product.
I hope I have explained that clearly enough!
Does anyone have any suggestions. I have been unable to find information on this regardless of guessing specific search terms. The only things I can find are related to general category retrieval, and not this very specific task I need.
Cheers!
Im afraid your assumption is incorrect. Magento has no concept of a 'primary' category for a product. It only knows the product is in category id(s);
1, 12, 234
etc. The id's are stored numercially with no idea of which category might be more important than another.
What you could do instead is create a custom attribute and enter the id of the category you want to treat as 'primary' and retreive this attribute value when working out whether to give more discount or not.

Virtuemart Discount on hour and minute

I'm using virtuemart on Joomla and I was wondering if it is possible to make a discount depending on the clock. I want to add a 20% discount on sales made from 16.00 through 20.00 avery day.
Thanks in advance
I think there's a possible solution based on an extension called Chameleon. Using Chameleon you can set the VM shopper group on the fly, according to specific conditions.
So perhaps you could set up a special shopper group that has a 20% discount. Then you would make a "rule" in Chameleon that triggers only between 16:00 and 20:00. The "succeed action" in that rule would be to set the shopper group to the new shopper group.
That way, people would be able to see the special prices only during those times. The shopper group switch is not "sticky" i.e. it doesn't permanently assign the person to that shopper group.
Some people use this functionality for setting different pricing for people in different countries (GeoIP), or different domains on their site, so I think it should work fine for time-based things as well. The only issue might be what happens if they have added something to their cart before 20:00 but don't check out in time; but I am sure that could be solved.
www.metamodpro.com/chameleon
Out of the box is not possible to do that. If you doesn't mind to spend some money you may buy a virtuemart plugin called 'quantity plugin' which calculates discount based on quantity and modify it to use time instead of quantity.
Alternatively you may check how the calculation rules works by examining a few files:
administrator/com_components/com_virtuemart/controllers/calc.php
administrator/com_components/com_virtuemart/models/calc.php
administrator/com_components/com_virtuemart/views/calc/view.html.php
administrator/com_components/com_virtuemart/tables/calc*.php
Using those files as starting point you could implement your own discount rule.
Hope this helps.

Programmatically apply a discount price in product list

I would like to programmatically display a discounted price on the product list/page so that each customer as a personal price shown based on a customer attribute (like gender for instance, and of course let it be assigned as new price for the user session) but I can't see a viable option via the magento catalog price rules involving customer attributes other than the assigned group.
I'm using the group to do different kind of discounts and categorization of the customers, so the path of "split the customers on the gender" (or similar) is not an option unfortunately, since I can't assign more than 1 group per customer.
At the moment I was thinking about setting up a custom observer to check for calls to the price generation and then let it consider my customer attributes when calculating the price.
Is that possible? if so, any pointers about?
Would you suggest something different?
Thanks a lot to everyone for your time.
As I was thinking before, I solved my issue creating a custom module with an observer looking for catalog_product_get_final_price calls, getting the customer details from the current customer session.
It works great, I just need to let it display the correct price in the catalog product list, but is minimal, as the price seems to be calculated correctly inside the product page and the cart

Resources