Promotions Scheduling mod

The following mod is extremely simple, but when used with Product Features, can be a very powerful way of scheduling a Cart OR Catalog Promotion.



Note: the following involves changes to an existing file in 2.0.12 and does not use hooks. This means that the next time you upgrade CS-Cart, there will be conflicts which you will need to resolve manually.



Open /core/fn.promotions.php and find:```php foreach ($val as $v) { ```and paste this directly below:```php //time() Condition mod

if ($condition == “[now]”) {

$condition = time();

} ```



Now, take a look through the attached screenshots to see how I use this to create a “Deal of the Day” promotion that is only available for a set time frame.



To configure that, I:

  1. Create a “Deal of the Day” Product Feature Group
  2. Create “begin date” and “end date” Product Features with Type = Date
  3. Edit a product I want in the “Deal of the Day” and set the “begin date” and “end date” Product Feature values
  4. Create a Catalog Promotion called “Deal of the Day”
  5. Add a Condition: Product Feature / begin date / equal or less / “[now]”
  6. Add a Condition: Product Feature / end date / equal or greater / “[now]”
  7. Add a Bonus (ex. 50% off)



    Done. The “Deal of the Day” Promotion will always be active, but only products with the “begin date” / “end date” configured will be eligible during their duration. I can use the “Edit selected” admin feature to bulk add date assignments and easily setup my entire calendar of “Deal of the Day”.



    Bonus: “[now]” just tells the Promotion Conditions logic to use PHPs time() function - which is the current time to the second. You could use “[now]” with a Product Feature type of “Text” and then enter UNIX Timestamps in the “begin” / “end” fields. That would allow you to control the availability of the Promotion down to the second (ex “Deal of the Hour”)



    I’m now investigating a way to nicely present the Promotion’s eligible product in a block or on the Promotions list page.



    cheers,

    Glen

    DOTD_promotion_setup3.jpg

    DOTD_promotion_setup2.jpg

    DOTD_promotion_setup1.jpg

    DOTD_product_setup.jpg

    DOTD_feature_setup.jpg

Very nice mod - thanks for sharing.



Bob

Very nice! I suppose one could create a graphic block that advertises the Deal of the Day but I would love to get some help on how to show the current item’s picture in the block. I’m not pHp savvy so would definitely need help with that! Thanks!!

Awesome!! Thanks for doing this.



You mentioned in the other thread we might be able to use the “Shop by Features” addon to display the DOTD. Do you think that would work? I will have that addon when it’s released… no use in reinventing the wheel…

Have you tried the shop by features addon yet Ogia? Will this work with it? Has anyone gotten this to work in a block? I can’t seem to do it.



Thank you,



Brandon

I haven’t installed the Shop by Features addon and I haven’t tried this yet. I plan to experiment with it tomorrow.



Glen did say…

[QUOTE]I’m now investigating a way to nicely present the Promotion’s eligible product in a block or on the Promotions list page.[/QUOTE]

so I think he will be back with more.

[quote name=‘brandonvd’]Have you tried the shop by features addon yet Ogia? Will this work with it? Has anyone gotten this to work in a block? I can’t seem to do it.



Thank you,



Brandon[/QUOTE]



Are you talking about the Shop by Features Addon or the DOTD Addon? If your talking about creating blocks with Shop by Features you need to select “features” for the block content - Sno

I was talking about this DOTD mod. It’s not exactly what I wanted, but it is a whole lot cheaper and might do the job. I was able to set up the promotions just fine, but I can’t figure out how to display them. I was just hoping that this could be put into a block. Can you shop by features addon work with this to make it do what I want? Sorry, I couldn’t figure out a better way to say it.



Brandon

By the way, I forgot to add,



Thank you for coming up with this solution Sixnin9, I really appreciate the efforts.



Brandon

[quote name=‘brandonvd’]Can you shop by features addon work with this to make it do what I want?[/QUOTE]

I don’t think so, it wasn’t really designed for this purpose at all. Can’t you just make a block and assign a product to the block manually?

Well yeah I can make a block and then chage the product manually, but that is what I already have to do. That is the main reason why I wanted to have the DOTD addon developed.



This mod works great for making a product go on a promotion for a certain time, but I really need something that will change out the products in a block when the time expires.



Brandon

This works great in theory, but it only provides the discount through the cart or checkout pages. Can we modify the product_data file to allow for the new price to show on the product details page and category page?



Also, is there a way to hide the deal of the day features on the front end without losing functionality?



I don’t want customers to know when products are going to be deal of the day products in the future. Surprise element, if you will.



Besides that, we need a link to the product detail page and this is golden. I already have a countdown clock for the special. I just need a way to link the graphic on my home page to link directly to the product established for that day.



http://www.shipfreejewelry.com Here is the example of the clock and graphic



I will be willing to share the countdown clock code with everyone once we work out the kinks

Brandon:

Did you create a “Cart Promotion” or a “Catalog Promotion”? If you want the discount to appear on the Product View, you need to configure this as a “Catalog Promotion”.

Glen

scratch the hiding of the features, I just had to put the DEAL OF THE DAY group status as hidden on the product features page.



Everything still works fine

I was able to get the updated price on the product details page. I used the cart promotion instead of the catalog promotion to begin with.

I did a catalog promotion.



I don’t have a problem with the promotion showing up. That works great. My problem is that part of how I wanted the DOTD addon to work is that there would be a block called “Deal of the Day” in this block it would show the products that are on sale for that day.



With what you did, this can work, but you have to go in daily and manually change the product.



What you did does save a lot of work, but I wanted something that would only have to be changed once a week, not once a day.



I know that I can bulk edit, but that only works well if the products are in the same category. Basically I just wanted to be able to add the products like you do with the promotions addon and then just choose which day I wanted them to be on sale.



I do really appreciate your work, but I think it is only half way there for me. Don’t get me wrong, I could totally be missing something. It wouldn’t be the first time.



Brandon

Brandon,



What you are saying is that you would have to manually change the block everyday, correct?



Is there a way to modify the block content to product feature - deal of the day?



If this was true, everything can be done well in advance and you would never have to adjust your block content.



Maybe we could have someone program the rest of this for us. The cost should be no where close to what we were being quoted at before.

If we have a deal of the day promotion set up, why do we need a begin and end date?



Can we just establish a date for the promotion to work



On the promotion page just state a condition that dod date is equal to [now]



I’ve tried this but it doesn’t seem to work.



Glen, do you have any ideas to make this work?

Jeff,



I wasn’t able to get this to work with “todays” date. I set this up last night and what I had to do what put the begin date at 3/3/2010 and the end date at 3/5/2010. I wasn’t able to just select 3/4/2010.



Does that make sense? if not I’ll try to explain better.



Brandon

I am in the same boat Brandon. I would like to just select one date.



I don’t see the point on a start and end date for a ‘daily’ promotion.