019mrb
Forum Replies Created
-
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictFollowing the last updates, my current solution:
if( $product_id && get_post_meta( $product_id, '_catalog', true) == 'yes' && get_post_meta( $product_id, 'disable_price', true) == 'yes' ) { if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') ) { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); $WCFM->wcfm_has_catalog = true; } } elseif( !has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') && $WCFM->wcfm_has_catalog && apply_filters( 'wcfm_is_allow_add_to_cart_restore', true ) && !function_exists( 'rigid_related_products_args' ) && !function_exists( 'astra_header' ) && !function_exists( 'zita_post_loader' ) && !function_exists( 'oceanwp_get_sidebar' ) && !function_exists( 'x_get_stack' ) ) add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictWhy marked as resolved, it isn’t resolved
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictThese conditions belongs to each product on the loop, because not all products can have the same option value
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictMy last proposal solution:
if( $product_id && get_post_meta( $product_id, '_catalog', true) == 'yes' && get_post_meta( $product_id, 'disable_price', true) == 'yes' ) { if(has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') ) remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); } else if(!has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') ) add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictI updated, the issue isn’t fixed. I checked your code and is wrong:
if( $product_id ) { $is_catalog = ( get_post_meta( $product_id, '_catalog', true) == 'yes' ) ? 'yes' : ''; if( $is_catalog == 'yes' ) { $disable_price = ( get_post_meta( $product_id, 'disable_price', true) ) ? get_post_meta( $product_id, 'disable_price', true) : 'no'; if( $disable_price == 'yes' ) { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); } elseif( !has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price') ) { add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); } } }The added/removed actions performs beyond the current product impression. When you modify the actions, you are modify the “routine actions” of the all loop.
Example:
Our loop has 3 products:
1- Price disabled: true
Then you remove de action
2- Price disabled: false
The action still removed
3- Price disabled: false
The action still removedThe logic of your code isn’t considering this fact
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictNew version and the bug still unfixed
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictthis isn’t resolved, you need update your files
i detected a new update, but the problem persistForum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictBug with my code: sometimes the hook was double, so I solved:
if( $product_id && get_post_meta( $product_id, '_catalog', true) == 'yes' && get_post_meta( $product_id, 'disable_price', true) == 'yes' ) remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); else if(!has_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price')) add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 11 );Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictI’m waiting
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictI update to 5.4.7 fixs that?
Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictAnother bug
changed conditionget_post_meta( $product_id, 'disable_price', true)toget_post_meta( $product_id, 'disable_price', true) == 'yes'Forum: Plugins
In reply to: [WCFM - Frontend Manager for WooCommerce] Catalog mode on product conflictI changed the if (line 111) from:
if( $product_id ) { $is_catalog = ( get_post_meta( $product_id, '_catalog', true) == 'yes' ) ? 'yes' : ''; if( $is_catalog == 'yes' ) { $disable_price = ( get_post_meta( $product_id, 'disable_price', true) ) ? get_post_meta( $product_id, 'disable_price', true) : 'no'; if( $disable_price == 'yes' ) { remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); } } }To:
if( $product_id && get_post_meta( $product_id, '_catalog', true) == 'yes' && get_post_meta( $product_id, 'disable_price', true) ) remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); else add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 11 );