Marketpress Coupon not working since latest Upfront patch

While I have been successfully using MarketPress coupons prior to this last Upfront patch, now I do not receive any response when triggering the "Apply Coupon" button. There is no event listener registered for it. I noticed another thread with a similar problem using the "Avada" theme, which I am not using nor familiar with. There are no console errors. Access has been granted.

  • Rupok

    Hi Jeremy, hope you had a wonderful day.

    I tried to regenerate this on my test site but I could not. I installed Parrot and updated Upfront to the latest version, but I can still use coupons without any problem. So I think this is your site specific issue.

    Can you please do a plugin conflict test just to make sure no other plugin is causing this? To know more about plugin conflict test, you can check this guide: http://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Please let us know the result. We will be glad to help further.

    Have a nice day. Cheers!
    Rupok

  • Jeremy

    Hello?

    I have been experimenting with this issue. I realized that the problem only began after I had to shift the cart page to a new page and URL, from "/services/cart/" to "/your-cart/". This was due to the fact that my original cart page went completely blank with no PHP errors or console errors. After making a new page with the same [mp_cart] shortcode and assigning it in the Marketpress settings. Yet, I have been unable to get any response from "Apply Coupon" since then. Could this have something to do with my issue?

  • Rupok

    Hi Jeremy, hope you had a wonderful day.

    I do apologize for delay in response. Actually we have a queue to maintain. First replies from users get first response from us. So every time you reply again, it becomes a fresh new thread and goes down below in the queue.

    However, I'll try to make sure delay doesn't happen again. For troubleshooting the issue, can you please move back to your cart page to its previous position and check if it's still blank. If yes, please confirm. Can you turn on debug mode in WordPress? To enable it, open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:

    define('WP_DEBUG', true);

    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

    Past errors here. If file is very long, paste them to a text file and attach with your reply.

    This will give you valuable data about why that page is blank. When you are done, please let us know. We will be glad to investigate further.

    Have a nice day. Cheers!
    Rupok

  • Jeremy

    Very odd queue system, though very useful to know! Thank you.

    I have had already had debugging logging for a while. The file is included but here is the most recent set of errors:

    [21-Jul-2016 19:31:34 UTC] PHP Strict Standards:  Redefining already defined constructor for class Wdsb_PublicPages in /var/www/betterbetterbetter.org/public_html/wp-content/plugins/sharebox/lib/class_wdsb_public_pages.php on line 11
    [21-Jul-2016 19:31:34 UTC] PHP Strict Standards:  Non-static method Wdsb_PublicPages::serve() should not be called statically in /var/www/betterbetterbetter.org/public_html/wp-content/plugins/sharebox/sharebox.php on line 78
    [21-Jul-2016 19:31:34 UTC] PHP Notice:  Trying to get property of non-object in /var/www/betterbetterbetter.org/public_html/wp-content/plugins/e-newsletter/email-newsletter-files/builder/class.builder.php on line 368

    Disabling the e-newletter and social sharing plugins does not display the page, but it does change the errors to the following:

    [21-Jul-2016 19:43:52 UTC] PHP Strict Standards:  call_user_func() expects parameter 1 to be a valid callback, non-static method MS_Rule_Shortcode_Model::debug_protect_content_shortcode() should not be called statically in /var/www/betterbetterbetter.org/public_html/wp-includes/shortcodes.php on line 326
    [21-Jul-2016 19:43:52 UTC] PHP Strict Standards:  call_user_func() expects parameter 1 to be a valid callback, non-static method MS_Rule_Shortcode_Model::debug_protect_content_shortcode() should not be called statically in /var/www/betterbetterbetter.org/public_html/wp-includes/shortcodes.php on line 326

    Finally, this last set of notices and warnings is terminated when I remove the Membership 2 shortcode from the page (used to output a data object to the DOM which then is used by javascript to check if a membership is present). While I can remove all of these warnings, the cart page still does not display.

    As I mentioned before, I have recreated the cart page by using the [mp_cart] shortcode on a new page with apparent success. This is definitely no longer problematic, just the fact that coupons do not work.

    Thank you again. Looking forward to resolving this issue.
    Jeremy

  • Rupok

    Hi Jeremy, hope you had a wonderful day.

    I checked further and it seems like for some reason, jQuery is not enqueued. Can you try enqueuing jQuery by creating a MU Plugin? For creating a MU Plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    <?php
    add_action('init', 'init_scripts');
    
    function init_scripts(){
        wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js');
        wp_enqueue_script( 'jquery' );
    }

    For getting more idea on mu plugins, you can go through this article: http://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    This should solve the issue. If not, please let us know. We will be glad to troubleshoot further.

    Have a nice day. Cheers!
    Rupok

  • Jeremy

    I have added the mp-coupons.js to a mu-plugins .php file, though now I get a fatal PHP error on line 784 of marketpress.php. It reads as follows:

    require_once $this->plugin_dir( 'includes/addons/class-mp-addons.php' );

    Indeed, this file is missing. Instead, I only have a class-mp-addons-list-table.php in that location. If I change the require_once to point to this file, I get the following error:

    Fatal error: Class 'MP_Addons' not found in /var/www/betterbetterbetter.org/public_html/wp-content/plugins/marketpress/includes/common/helpers.php on line 1096

    This block is as follows:

    if ( ! function_exists( 'mp_register_addon' ) ) :
    
    	/**
    	 * Wrapper function for MP_Addons::register()
    	 *
    	 * @since 3.0
    	 *
    	 * <a title="@param" href="/profile/param">param</a> array $args
    	 */
    	function mp_register_addon( $args = array() ) {
    		MP_Addons::get_instance()->register( $args );
    	}
    
    endif;

    MP_Addons seems to be declared in my missing file, since the only other place I can find this class is in the class-mp-addons-list-table.php as MP_Addons_List_Table. Perhaps you could post this file for me so I can add it to my installation?

    Thanks,
    Jeremy

  • Nithin

    Hi Jeremy,

    Hope you are doing good today. :slight_smile:

    It seems like you already have a similar thread, opened here: https://premium.wpmudev.org/forums/topic/marketpress-coupons-apply-coupon-does-nothing

    To avoid any confusion, would recommend you to follow the above thread, as Predrag has already asked for FTP credentials in order to help get this resolved asap.

    If I had missed out anything please do let me know. Have a nice day. :slight_smile:

    Kind Regards,
    Nithin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.