Hi, since you have already checked your site in regards to the cache issue, have you also spoken to your host? They might have a cache system set up in your server.
Regards
Thread Starter
JK123
(@zealoapparel)
Hi, thanks! I spoke to them and there is another cache system but I cleared it and turned it off and the problem’s still happening.
Hi, please check the following documentation to carry out a test transaction.
You might also be interested in the following documentation to help you read your debug log file.
Let me know how you go.
Thank you
-
This reply was modified 7 years, 1 month ago by
mbrsolution.
Thread Starter
JK123
(@zealoapparel)
Hi,
I did a test transaction earlier today and it didn’t work. But a relative helped me identify that it was a problem with some php code for 30 day cookies. Removing that code makes it work, but I don’t know if I need the code for other functions.
Hi,
But a relative helped me identify that it was a problem with some php code for 30 day cookies. Removing that code makes it work, but I donβt know if I need the code for other functions.
Can you provide more information so that I can understand what you mean.
Thank you
Thread Starter
JK123
(@zealoapparel)
Sure, removing this code from functions.php makes the order go through as normal.
// Set cookie for new users
add_action( 'init', 'set_newuser_cookie'); // Run when WordPress loads
function set_newuser_cookie() {
$cookie_value = $_SERVER["HTTP_REFERER"]; // Get URL the user came to your site for
if ( !is_admin() && !isset($_COOKIE['origin'])) { // If not an admin or if cookie doesn't exist already
setcookie( 'origin', $cookie_value, time()+3600*24*30, COOKIEPATH, COOKIE_DOMAIN, false); // Set cookie for 30 days
}
}
// Check cookie when order made and add to order
add_action('woocommerce_checkout_update_order_meta', 'add_referral_meta'); // Run when an order is made in WooCommerce
function add_referral_meta( $order_id, $posted ){
$ref_url = $_COOKIE['origin']; // Get the cookie
update_post_meta( $order_id, 'referrer', $ref_url ); // Add to order meta
}
Hi, was that function added for WooCommerce plugin? Are you running our plugin separately to WooCommerce plugin?
If you think removing this function can affect you in any way, you should contact WooCommerce developers. However as you have already found out this function causes an issue with our plugin.
Kind regards
Thread Starter
JK123
(@zealoapparel)
I have the WooCommerce Stripe Gateway plugin and the WooCommerce plugin.
I have no idea where that function came from I’m afraid, but if it’s not associated with Stripe I’ll look into it elsewhere.
Hi, well the good news is that your issue with our plugin is resolved π
You can mark this thread as resolved if you don’t need any more help with your issue and our plugin.
Kind regards
You might have confused our plugin with WooCommerce Stripe Payment Gateway – https://wordpress.org/plugins/woocommerce-gateway-stripe/
Thread Starter
JK123
(@zealoapparel)
Oh, so sorry! I didn’t know there were different ones.
No problem. Though you might want to notify the devs of the issue you had, perhaps it could be fixed on their side.