H D Charith

single deal page issue

HI. 1. Im using latest couponpress theme and my single deal page looks like in mysite.png. But original your demo site it is getting very nice way like real.png. Can you help you on this. 2. In deals page sidebar is getting vey bottom of the page. same ting in your demo couponpress too. How can i remove side bar. 3. how to exclude expierd deals. Thanks you

Created: May 31, 2020 at 4:01 am
  • In: General Discussion
  • Started by: H D Charith
  • 3 members left 11 comments
  • Last reply from: JamesDJamesD

  • EvieB
    EvieB
    June 2, 2020 at 1:52 am

    Answer to question 2:

    Go to pages >> deals & click on edit.
    Scroll down to bottom on RHS to PPT – page columns & select full width from the dropdown menu.
    Click update to save.


  • H D Charith
    June 5, 2020 at 3:02 am

    Thanks EvieB. It works to remove slide bar in deals page. You have helped me to fix issue number 2.

    Can anyone helpe my question 1 and 3.

    For regrding question number 1, I found that if I enble minify files from PPdashbord it’is working. Like real png. If i disable minify option it won’t work. How can i fix this without minify option.

  • EvieB
    EvieB
    September 8, 2020 at 4:33 am

    I’d also like to know how to stop expired deals from displaying if anyone knows please?

  • JamesD
    JamesD
    September 9, 2020 at 7:34 am

    “3. how to exclude expierd #8221; @H D Charith

    “Iā€™d also like to know how to stop expired deals from displaying if anyone knows please?” @EvieB

    In there is a setting at PremiumPress > Configuration > Coupon Settings > Show Expired Coupons that can be turned off.

  • EvieB
    EvieB
    September 10, 2020 at 12:21 am

    Hi James

    I always had mine set to off and they’re still displaying… So I turned it on & saved it, then turned if back off & saved it and it’s still the same! Please see the screen shot attached. I have asked support but no solution yet.

    Attachments:
    You must be logged in to view attached files.
  • EvieB
    EvieB
    September 10, 2020 at 12:25 am

    Here’s support’s answer James: I have checked the codes for the deals template, we cannot filter out the expired as it display all deals. What I can suggest is that you add a featured image for the expired deals instead so it will display to the thumbnail its already expired.

    Hmmm… wish there was a workaround.

    James do you know the name of the file that displays the single deal page that you arrive at when you click on any deal on the deals page?

  • EvieB
    EvieB
    September 10, 2020 at 3:38 am

    I’m almost there… I can get only the active deals to display in the database by taking part of the sql in the _ file and adding AND meta_value >= NOW() to it to display only active deals, but getting it to work in the php file for one entry is a bit tricky!

    It was:

    // GET VALUE

    $date = get_post_meta($post->ID,'expiry_date',true);

    if($date == ""){

    $date = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE post_id =('".$post->ID."') AND meta_key=('expiry_date') LIMIT 1" );

    }

    Changed to:

    // GET VALUE

    $date = get_post_meta($post->ID,'expiry_date',true);

    if($date == ""){

    $date = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE post_id =('".$post->ID."') AND meta_key=('expiry_date') AND meta_value >= NOW() LIMIT 1" );

    }

    But still displaying expired deals. Just needs a little tweak!

  • JamesD
    JamesD
    September 11, 2020 at 2:33 am

    Hi Evie,

    Keep the original code (remove your changes to that portion) and add these lines directly underneath that ‘if‘ statement:
    // Checking if the Deal has expired.
    $chk_date = strtotime($date);
    if( $chk_date < time() ) {
    // Nothing to display
    // Lets exit since the Deal HAS already expired.
    return;
    }

    It would then end up looking like:
    // GET VALUE
    $date = get_post_meta($post->ID,'expiry_date',true);
    if($date == ""){
    $date = $wpdb->get_var( "SELECT meta_value FROM $wpdb->postmeta WHERE post_id =('".$post->ID."') AND meta_key=('expiry_date') LIMIT 1" );
    }

    // Checking if the Deal has expired.
    if( strtotime($date) < time() ) {
    // Nothing to display
    // Lets exit since the Deal HAS already expired.
    return;
    }

  • JamesD
    JamesD
    September 11, 2020 at 2:43 am

    @EvieB
    Note: Here’s the short version if you didn’t want the comments included:
    if( strtotime($date) < time() ) { return; }

  • EvieB
    EvieB
    September 11, 2020 at 11:10 pm

    Fantastic! Thank you James! You’re a treasure. See I hate it when someone says you can’t do something when I know inside that you can! Really appreciate your help to make it work. šŸ™‚

  • JamesD
    JamesD
    September 12, 2020 at 4:09 am

    My pleasure Evie, glad it helped.


Viewing 12 posts - 1 through 12 (of 12 total)