• Resolved virtualgeorge

    (@virtualgeorge)


    Does this still work? I get a 500 error when trying it? I need to exclude one singe product from the discounts/emails?

    add_filter(‘woo_ca_generate_coupon’, ‘update_coupon_options’);
    function update_coupon_options( $coupon_post_data ){
    $coupon_post_data[‘exclude_product_ids’] = ‘1,2’;
    return $coupon_post_data;

    add_filter(‘woo_ca_generate_coupon’, ‘update_coupon_options’);

    function update_coupon_options( $coupon_post_data ){

    $coupon_post_data[‘exclude_product_ids’] = ‘1,2’;

    return $coupon_post_data;
    }

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Aamir

    (@aamiribsf)

    Hello @virtualgeorge,

    Greetings for the day!

    Did you manage to locate the filter code from the previous WordPress thread?

    Additionally, could you please provide details about any errors you encountered while adding this code? If possible, sharing screenshots or a short screen recording would greatly assist us in understanding the issue better.

    We look forward to your response.

    Best Regards,

    Thread Starter virtualgeorge

    (@virtualgeorge)

    Snippet automatically deactivated due to an error on line 5:
    Syntax error, unexpected token “,”.

    So I removed the comma separating product ID’s and replaced with a single actual product ID and save again and got this error:
    Could not create snippet. Request failed with status code 500

    Adding function using code snippets & everything is updated to latest versions.

    Thread Starter virtualgeorge

    (@virtualgeorge)

    I just tried the snippet on a new install and did work so I suppose its a plugin conflict on my site. So I suppose there is an error log that would show the 500 error? I really don’t want to disable all plugins one by one ??

    Plugin Support Aamir

    (@aamiribsf)

    Hello @virtualgeorge,

    Thanks for writing back.

    Apologies for the delay in response due to a high number of tickets. It appears you are using the code snippet plugin to add that code. As the snippet works on the new install, most probably the issue is with the some plugin or the code snippet plugin itself. You can try a different plugin to add the code or try to add the code using the child theme.

    Alternatively, you can get in touch with the code snippet plugin support to see if it is something related to their plugin

    I hope this helps.

    Best Regards,

    Plugin Support Aamir

    (@aamiribsf)

    Hello @virtualgeorge,

    It’s been a while since we haven’t heard from you so we are marking this thread as resolved.

    If you faced any other issues while using our product, feel free to start a new thread.

    Best regards,

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude single item from coupon discounts’ is closed to new replies.