• Resolved tripatwhat

    (@tripatwhat)


    Hello,

    we are using Coupon generator 1.0.1 together with Woocommerce 3.4.0 and WP 4.9.6.

    Until recently plugin was generating coupons and connecting it to our product normally, but now coupons are being created, but not connected to the product. Here’s the screenshot: https://imgur.com/ocfNIH5

    Do you maybe have some idea what could be the problem here?

    Thank you

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I’m not sure which other plugin you’re using, but that doesn’t loo like WC Core default settings. Any custom settings may not be included with the settings / generation. If you’d like to make this work it may require some custom coding to accomplish.

    Unfortunately a custom third party plugin integration is not something I’d be able to look into for you as support..

    Regards,
    Jeroen

    Thread Starter tripatwhat

    (@tripatwhat)

    Hello Jeroen,

    we firstly installed coupon generator, which, as far as we see, gets coupon options from WC and creates coupons.

    Since we needed free gift as an option, we also installed “WooCommerce Free Gift Coupons” plugin, which added free gift option and your plugin worked absolutely fine with it, until we recently updated WP and WC. Then connecting with product problem started to occur.

    We see here that your plugin is tested with WP up to version 4.7.10. Did you test the plugin with newest WP and newest WC?

    Best regards

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I’ve tested it with the latest WP and WC and its working fine on its own. I’ve however not tested it with the Free Gift Coupons plugin.

    From what I’d expect the custom data the plugin adds is stored separately as meta, which in this plugin code will not be automatically stored, instead it would have to be added manually through a code snippet.

    This is how the plugin has always worked and hasn’t changed since the beginning. Maybe something has changed in the other plugin?

    Wish I was more of help, but unfortunately not much I know / can do about with the other plugin.

    Cheers,
    Jeroen

    Thread Starter tripatwhat

    (@tripatwhat)

    Hi Jeroen,

    from what we’ve seen inside the DB, there seems to be two fields added for each coupon inside the postmeta table.
    First one is: _wc_free_gift_coupon_data, with information like this: a:1:{i:6;a:3:{s:10:”product_id”;i:6;s:12:”variation_id”;i:0;s:8:”quantity”;i:1;}}”); and this string holds the info about connection to specific product or products.

    Second one is: _wc_free_gift_coupon_free_shipping, with yes or no value, which defines if coupon has free shipping or not.

    I think that the problem is the interconnection between your plugin and Free Gift Coupons, since your plugin of course doesn’t have any idea about these fields, it adds only the things needed by core WC functionality.

    So, if your plugin would add these two fields, that would most likely solve the problem.

    If you have some idea what can we do to make it insert these two fields into DB, please let us know. That would be of great help to us.

    Thank you

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    You can use the woocommerce_coupon_generator_coupon_meta_data filter to add addtitional meta data to generated coupons.

    Cheers,
    Jeroen

    Thread Starter tripatwhat

    (@tripatwhat)

    Hi Jerome,

    ok, but where to add it? In which part of the plugin?

    More details, would be great. ??

    Thank you

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    You don’t want to modify the plugin, but use that in a custom code snippet instead. Your webdeveloper should be able to assist you in creating that for you, unfortunately I can’t do that within the support scope I can provide.

    Cheers,
    Jeroen

    Thread Starter tripatwhat

    (@tripatwhat)

    Hello,

    ok, we will try to figure something out.

    Thanks

    Thread Starter tripatwhat

    (@tripatwhat)

    Hi Jeroen,

    we’ve created additional snippet to insert two rows we need inside the postsmeta table:
    _wc_free_gift_coupon_data
    _wc_free_gift_coupon_free_shipping

    Now, _wc_free_gift_coupon_free_shipping should insert following string: a:1:{i:6;a:3:{s:10:”product_id”;i:6;s:12:”variation_id”;i:0;s:8:”quantity”;i:1;}}, but for some reason woocommerce_coupon_generator_coupon_meta_data filter adds s:81 in front of it, so in db we have s:81:”a:1:{i:6;a:3:{s:10:”product_id”;i:6;s:12:”variation_id”;i:0;s:8:”quantity”;i:1;}}”;

    How can we make your filter to insert string as it is, without surrounding it with s:81?

    Thank you

    Thread Starter tripatwhat

    (@tripatwhat)

    Just to update, i solved the problem. Thank you very much for your filter advice.

    Best regards.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Coupons not connected to product’ is closed to new replies.