CHM82
Forum Replies Created
-
I was here looking for the solution of the initial question of OP. After some research I see support of Cartflows mentioning adding a filter to let this plugin work on pages. “By default, the variation swatches work on the default WooCommerce shop/archive pages and product pages.”
Although the ‘related products’ are on product pages, it doesn’t show the variations on ‘related’ and ‘upsell’ products.
For anyone who needs the solution:
Try this filter code. For reference and guidance to make it suits your needs, read: https://www.businessbloomer.com/woocommerce-conditional-logic-ultimate-php-guide/add_filter( 'cfvsw_requires_shop_settings', function( $status ){ global $woocommerce_loop; if ( is_product() && $woocommerce_loop['name'] == 'related' ) { return true; } return $status; }); is_product() && $woocommerce_loop['name'] == 'related' can be replaced by the desired condition.
- This reply was modified 7 months, 2 weeks ago by CHM82.
Forum: Fixing WordPress
In reply to: WP_Query & pagination not workingmaybe
new WP_Query("category_name=$catName&paged=$paged&posts_per_page=1");
to:
new WP_Query("category_name=$catName&paged='. $paged .'&posts_per_page=1");
?
see
'&paged=' . $paged
Forum: Plugins
In reply to: [Plugin: The Events Calendar] Todays event not showing in widget…I had the same problem. The solution was to compare the meta value of the event start date with todays date.
<?php $todaysDate = date('Y-m-d G:i:s'); $cal_query = new wp_query('category_name=Events&nopaging=true&meta_key=_EventStartDate&meta_compare=>=&meta_value='.$todaysDate.'&orderby=meta_value&order=ASC'); ?> <?php while ($cal_query->have_posts()) : $cal_query->the_post(); ?> //your content here <?php endwhile; // posts ?>
Not sure what you mean with the second question though. You mean as a single page view?
this thread of SebAshton helped me:
[Plugin: The Events Calendar] Want to show 5 upcoming events outside of the sidebarForum: Plugins
In reply to: [Plugin: The Events Calendar] Change number of items shown in list view?You can solve this by implementing an if.. else statement? That’s why I love WordPress, the flexibility.
Forum: Plugins
In reply to: [Plugin: The Events Calendar] Sort by date of event and not date of postI’m assuming that you’re familiar with editing your own template files?
I use this in my template for ordering it by eventdate.
<?php $wp_query->set('meta_key', '_EventStartDate'); $wp_query->set('orderby', 'meta_value'); $wp_query->set('order', 'ASC'); $wp_query->get_posts(); if(have_posts()) : while(have_posts()) : the_post(); ?>
ASC = From old->new
Forum: Plugins
In reply to: [Plugin: The Events Calendar] Set time issue v1.5.4When choosing H:i time format (24h).. There is no option to choose the midnight time.. 24:00 or 00:00. How can I fix this?