Forum Replies Created
-
AuthorPosts
-
March 16, 2018 at 12:05 am in reply to: cURL error 28: Operation timed out after 5001 milliseconds with 0 bytes received #2796Jonathan MooreParticipant
I only noticed the curl once, but I’ve been getting some strange behaviour about once every couple of days and WJECF is always in the set of errors logged. No doubt it’s not WJECF, I’m just checking every angle for clues.
[15-Mar-2018 14:57:13 UTC] PHP Fatal error: Maximum execution time of 120 seconds exceeded in public_html/wp-content/plugins/woocommerce-auto-added-coupons-pro/includes/WJECF_Wrap.php on line 26
I didn’t realise about those debug settings, that’s very interesting thanks.
Jonathan MooreParticipantYes maybe it was the display rather than not being in the basket
December 5, 2017 at 5:56 am in reply to: Get coupon description using WC_Coupon::get_description() #2297Jonathan MooreParticipantthat was with WooCommerce 3.2.1
The same applies to the latest Coupons 2.6.0.2Coupon description comes from the excerpt field and since you are using $post->post_excerpt; rather than woocommerce api the woocommerce filters won’t be called
Jonathan MooreParticipant>If you want a ‘first order’-only coupon, this option has been added in the development version of 2.6.
A first order coupon is already supported in earlier versions by using an autocoupon with Usage limit per user=1 (and say minimum spend=1 which ensures that the coupon is removed when you remove the last paid item from the cart)..
.. at least I use that and it seems to workJonathan MooreParticipantI realised I had another variant on this, when removing the last item from cart, a free item was getting left behind and in fact there was no way for the user to remove it. There is a simple workaround which is to add a minimum spend on the coupon for the free item, at which point the free item is then removed automatically.
This is on woo3.1.2 (3.2.x is still getting too many patches and breaks too many other things) and WooCommerce Extended Coupon Features PRO v2.5.3 and 2.5.5 (tested both)
July 26, 2017 at 1:14 am in reply to: Why is wjecf-free-products.js needed on every page load? #1730Jonathan MooreParticipantdone as:
if ( (!is_cart()) && ( !is_checkout()) ){ wp_dequeue_style('wjecf-style'); wp_dequeue_script('wjecf-free-products'); }
though it would be more efficient to change the code to not enqueue them where not needed…
Jonathan MooreParticipantreceived with thanks,
I also have very limited time for testing, however I did already test and put into production the get_description() change and this seems to be working fineJonathan MooreParticipantYes I already do some of this.
but this sort of hard-coded stuff would very easily get out of date with changes to coupons made by the shop manager.Actually I think it should be quite easy to do some sort of enhancement with the plugin. I mean it seems crazy to write extra code to auto-add a coupon when the auto-add coupons already has all the logic for this.
For the theme code, instead of echo, use wc_add_notice() for a separate message, or simply implement as:
function my_check_offers($message, $products )
{
//check products added and add new coupons or messages
return $message;
}
add_filter( ‘wc_add_to_cart_message_html’, ‘my_check_offers’, 10, 2);Jonathan MooreParticipantThis is the non-commercial Hyyan WooCommerce Polylang Integration rather than the new Polylang commercial extension for WooCommerce, but the principles should be the same.
Coupons were not created as separate posts but Products are, and Terms etc are translated.
I’ve just checked in the coupons extension into this branch – there’s a coupons.php file:
https://github.com/hyyan/woo-poly-integration/tree/1.0.2
Note also documentation:
https://github.com/hyyan/woo-poly-integration/wikiI just took a quick look at WJECF_WPML.php now you mentioned it, and I think it’s already covered within the woo-poly-integration 1.0.2 but your feedback/suggestions welcome.
Jonathan MooreParticipantyeah, of course that should work too.. 🙂
Jonathan MooreParticipantso it would be a simple change:
`
private function coupon_excerpt($coupon) {
$my_post = get_post( WJECF_Wrap( $coupon )->get_id() );
return apply_filters( ‘woocommerce_coupon_get_description’,
__( $my_post->post_excerpt, ‘woocommerce-jos-autocoupon’ ), $coupon );
}
`
I’ve just tested this and working fine..
Jonathan MooreParticipantactually no, it should just use the existing filter woocommerce_coupon_get_description
the description is the excerpt and all the woo3 get() functions are filterable in this way (in fact I already implemented this one)
Jonathan MooreParticipantooo yes, nice one, that’s a very standard and filterable function, good point 🙂
Jonathan MooreParticipantIt seems to be working now, I’m not sure whether it was due to a particular combination of settings or solved by fixes applied from other threads.
Please close, I won’t raise any more unless there’s a case repeatable in limited test environment.Jonathan MooreParticipanthmmm that gives PHP Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR)
Probably it should be:
if ( $wrap_coupon->is_type( WJECF_WC()->wc_get_cart_coupon_types() ) ) {
that seems to work well.
-
AuthorPosts