Hutchhouse
Forum Replies Created
-
Forum: Plugins
In reply to: [Marketo Forms and Tracking] Error while installingHi pacomelo,
I haven’t heard back on this one for quite some time so I’m going to hit resolved…
Hi,
We have now successfully applied the coupon but it could certainly be done better. We were not getting a value in the $woocommerce->cart->recurring_coupon_discount_amounts array so we are now forcing this value to be added per cart item that requires it. In our case the filter looks like this:
add_filter('wjecf_coupon_has_a_value', 'recurring_autocoupon', 10, 2 ); function recurring_autocoupon($has_a_value, $coupon) { if ( ! $has_a_value ) { //Test if a value applies for WooCommerce Subscriptions plugin //See class-wc-subscriptions-cart.php function cart_coupon_discount_amount_html if ( class_exists( 'WC_Subscriptions_Cart' ) && WC_Subscriptions_Cart::cart_contains_subscription() ) { global $woocommerce; if ( $woocommerce->cart->has_discount( $coupon->code ) ) return true; $woocommerce->cart->recurring_coupon_discount_amounts[ $coupon->code ]; $has_a_value = true; } } return $has_a_value; }
Can you see anything wrong with this approach or do you think we are good to go?
It’s being called because the params are being dumped – we’ll check out and debug. Thanks for your help.
The site currently running on our dev environment which is local but the I have added the var_dump for you below:
object(WC_Coupon)#5409 (20) { ["code"]=> string(15) "firstregiongold" ["id"]=> int(210) ["exists"]=> bool(true) ["discount_type"]=> string(13) "recurring_fee" ["coupon_amount"]=> string(3) "250" ["individual_use"]=> string(2) "no" ["product_ids"]=> array(1) { [0]=> string(2) "57" } ["exclude_product_ids"]=> array(0) { } ["usage_limit"]=> string(0) "" ["usage_limit_per_user"]=> string(0) "" ["limit_usage_to_x_items"]=> string(0) "" ["usage_count"]=> string(0) "" ["expiry_date"]=> string(0) "" ["free_shipping"]=> string(2) "no" ["product_categories"]=> array(0) { } ["exclude_product_categories"]=> array(0) { } ["exclude_sale_items"]=> string(2) "no" ["minimum_amount"]=> string(0) "" ["maximum_amount"]=> string(0) "" ["customer_email"]=> array(0) { } }
I used the new dev release (it has the auto silent option) and recreated the coupon just incase. The params do display in a var_dump – the coupon is there but the boolean continues to return false before it is returned.
I’ve given that a try but it doesn’t work still. I’m not returning either of the params in the filter ($has_a_value or $coupon).
It works as a basket discount but just not a s a recurring one..
Any other ideas?
HI josk79,
I’ll ping over a copy – we can build something bespoke for this but the auto coupon functionality has been a constant on other sites so would prefer not to.
If it’s something you can do quickly then let me know, otherwise we may look at forking your plugin and doing the integration ourselves.
John at Hutchhouse
Forum: Plugins
In reply to: [Marketo Forms and Tracking] my forms disappearedThanks for letting me know bodlodi.
Good luck with the fix – hopefully your devs can find the root of the problem quickly and let me know if we can be of any help.
I’ll mark this as resolved.
Forum: Plugins
In reply to: [Marketo Forms and Tracking] Error while installingHi pacomelo,
I have to apologise – these emails had been popping into spam so we missed them. The only other thread in the forum alerted to their issue on twitter so now we’ve checked them and we found yours.
The error is likely to be because you are running an old version of PHP. the __DIR__ constant has only been available since PHP 5.3.0.
Did you get over the issue or is it still a problem? If it is still an issue then upgrading PHP to 5.3+ is the answer.
Forum: Plugins
In reply to: [Marketo Forms and Tracking] my forms disappearedHi boblodi,
I have just re-checked your site and the forms look like they are back.
Was there an issue with the Marketo details as we suspected?
John
Forum: Plugins
In reply to: [Marketo Forms and Tracking] my forms disappearedThanks for the detail.
So the only thing that changed is that Marketo renewed today. It seems like it’s too much like a co-incidence but I appreciate that they are reporting that their end is all ok.
The forms rely on the account ID and base URL to load the forms and the API info like the secret key to pre-populate, but that is it. Even so I would double check all those details because if anything has changed and you are sending incorrect authentication details then this would almost certainly throw an exception.
If you can check and report back we’ll check again in the morning GMT.
John
Forum: Plugins
In reply to: [Marketo Forms and Tracking] my forms disappearedHi boblodi.
Let’s move the conversation to the support forum so we might be able to help other people rather than on Twitter.
We can try and help but we aren’t seeing the same problem elsewhere so we need to try and isolate the specific issue.
Did you check the Marketo instance?
John