jj
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Astra] Quantity buttons don’t work on mini cart or quick view@humayonk Sorry for the delayed reply. I am not using the same plugin, it’s a custom solution based on YITH Quick View. It doesn’t really matter what plugin you use, if you output the quantity buttons anywhere that Astra doesn’t expect the same issue will occur. That’s why I suggest adding a filter for “should_load_add_to_cart_quantity_btn_script”.
Forum: Themes and Templates
In reply to: [Astra] Quantity buttons don’t work on mini cart or quick view@vallesierra7 I think I posted it before on your thread but some trigger-happy mod deleted it because I was “derailing the topic”. Here’s the workaround I’m using (note I’m not using the same plugin, but this should work since it forces the missing script to be enqueued everywhere except the checkout):
/**
* Force Astra's quantity buttons script to be loaded sitewide (except for checkout).
* Issue reported and a filter requested here: https://ww.wp.xz.cn/support/topic/the-quantity-plus-minus-function-isnt-working-for-me/.
**/
add_filter( 'astra_theme_assets', function( $default_assets ) {
if ( !is_checkout() ) {
$default_assets['js']['astra-add-to-cart-quantity-btn'] = 'add-to-cart-quantity-btn';
}
return $default_assets;
});
add_action( 'wp_enqueue_scripts', function() {
$astra_qty_btn_localize = array(
'plus_qty' => __( 'Plus Quantity', 'astra' ),
'minus_qty' => __( 'Minus Quantity', 'astra' ),
'style_type' => astra_get_option( 'cart-plus-minus-button-type' ) ?: 'normal', // Quantity button type.
);
wp_localize_script( 'astra-add-to-cart-quantity-btn', 'astra_qty_btn', apply_filters( 'astra_qty_btn_js_localize', $astra_qty_btn_localize ) );
});Ideally they’d allow us to control when the script is enqueued, as this workaround could get out of sync with the theme if they change any of the localization parameters (in the second half of the code above).
Forum: Themes and Templates
In reply to: [Astra] The Quantity plus/minus function isn’t working for me.It’s a bit weird and unhelpful to remove posts that provide a solution to a problem, I think. Even the guidelines linked to state exactly the case that is relevant here:
We ask everyone make a new topic, just for themselves, unless they are absolutely certain the problem is the same
I am absolutely certain that the problem is the same, because I have identified the exact problematic code that was added in the version of the theme that both I and the OP are using. The code I previously referred to prevents the quantity buttons script being enqueued sitewide as it was previously, which would mean that any third-party plugin or widget, etc. that displays the quantity buttons will no longer work.
Hmm I don’t think it’s anything to do with caching; the error is correct – there is no cmplz_license class anywhere in the plugin. Commenting out the lines that call constants in that class resolves the issue (i.e. the ones in websitescan/class-wsc-settings.php on line 416).
Forum: Plugins
In reply to: [ShipStation for WooCommerce] V4.7.0 and 4.7.1 crash our website on CheckoutWe have the same issue, specifically we get an out of memory error from PHP.
Forum: Plugins
In reply to: [Redirection] BUG: product not appearing on MONITORRelated GitHub issue here https://github.com/johngodley/redirection/issues/3978.
A temporary workaround is to add this to your functions.php:
add_filter( 'redirection_post_types', function( $post_types ) {
if ( !empty( $post_types['product'] ) ) {
return $post_types;
}
// Note the misspelling of the label is on purpose as the plugin expects the post type *slug* when red_get_post_types( false ) is called here https://github.com/johngodley/redirection/blob/e89774a3747b39f660f0e75283f8c3ec581d5d3e/redirection-settings.php#L127
$post_types['product'] = 'product';
return $post_types;
});Having the same problem! The hotfix is to just update this line in
jetpack/modules/woocommerce-analytics/classes/class-jetpack-woocommerce-analytics-universal.phpfrom:if ( true === cartItem_{$cart_item_key}_logged )to this:
if ( true === cartItem_{$cart_item_key}_logged || !('hooks' in wp) )This code is part of Jetpack’s Woocommerce Analytics implementation, which looks like will be deprecated in the next version, per this PR, so hopefully this will magically fix itself in the next release.
@webtoffeesupport Thanks! Could you clarify what change has been made?
Thanks for the quick reply! Could you elaborate on what you mean regarding the server not being able to handle the load?
Sure, it’s https://www.storagegiant.co.uk/
Thanks for getting back to me @wfgerald! It looks like the alert has disappeared by now, so I think you’re probably right that it was a false alarm (or maybe some weird bug that WP Rocket have since fixed!).
Excellent, that works now, thank you for the great support!
I have done that (this is a completely fresh install on my local server too), the only thing that stops the message appearing is to trash the rule. I think the update must have removed some check for the rule’s on/off status, or the check no longer works?
Hey, thanks for the quick reply! I have retested on a fresh WP + WC install (latest versions of both), with Storefront as the theme, and get the same result. Downgrading to the previous version (2.0.0.9) restores normal functionality.
Here are the steps I take to reproduce:
- Add a new Cart Deal, with Package Pricing
- Set as a Basic rule, with default settings
- Qualify Group: Any, Group Amount: Buy Unit Quantity (e.g. 2), Unlimited Rule Usage, Discount Group: Same as Buy, Discount Type: Package Price, e.g. £20
- Enter a Checkout and Advertising Message, e.g. “Test Discount”
- Place the shortcode in a page, with no atts, just [pricing_deal_msgs_standard], verify that the advertising message shows
- Change Deal Schedule to OFF
- Refresh page, deal still shows
Forum: Plugins
In reply to: [W3 Total Cache] PHP Fatal error: Class ‘W3TC\Util_Content’ not found in…