Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Need code to check if sale is active

    Greetings all,

    I would like to display content base on if a salemaker sale is active.

    Is there a function I can call that will return a T/F value I can test?

    Any suggestions?

    Thanks!
    Experience is what you get when you don’t get what you want…

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Need code to check if sale is active

    Is your question whether "any" sale is active?
    Or is it whether a "specific" sale is active? And if so, how do you intend to identify which "specific" sale?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Nov 2004
    Posts
    364
    Plugin Contributions
    0

    Default Re: Need code to check if sale is active

    Thanks for the reply DrByte,

    Since we only do a single "All Item" sale at a time, any sale detection would work.

    As a test, I just wrapped my items to display around the following code. It seems to work, but makes a db call:

    PHP Code:
    $sale $db->Execute("select sale_status from " TABLE_SALEMAKER_SALES " where sale_status = '1' and sale_categories_all != '' and sale_date_start <= now() and sale_date_end >= now()");
        if (
    $sale->RecordCount() >= 1) {

    echo 
    "Stuff to Display";


    BTW, the stuff I want to display is in the cart sidebox if that makes a difference!
    Experience is what you get when you don’t get what you want…

 

 

Similar Threads

  1. Check Code
    By marcopolo in forum General Questions
    Replies: 3
    Last Post: 19 Jan 2016, 10:40 PM
  2. v151 Adding sale tracking code for price comparison website
    By louisapple in forum General Questions
    Replies: 2
    Last Post: 4 Sep 2015, 03:31 AM
  3. Replies: 2
    Last Post: 21 Oct 2012, 09:56 PM
  4. USPS Check Code
    By Marco B in forum Upgrading to 1.5.x
    Replies: 2
    Last Post: 4 Sep 2011, 05:41 AM
  5. Sale maker not active - ARGHHHH
    By vik007 in forum Setting Up Specials and SaleMaker
    Replies: 0
    Last Post: 12 Sep 2009, 02:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg