Nikola Tomic
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Can’t get regular price for the productYep, that could also work
Forum: Plugins
In reply to: [WooCommerce] Can’t get regular price for the productSolved, it was some kind of error with quantity getting, it affected rest of the code (it wasn’t in the example).
So, if you are interested to know what it is:
This won’t work (but it worked before):
$product_info = $item['item_meta']; $quantity = $product_info['_qty'][0];
And this works instead:
$quantity = $item['qty'];
- This reply was modified 7 years, 11 months ago by Nikola Tomic.
Forum: Plugins
In reply to: [WooCommerce] Can’t get regular price for the productUPDATE: It does work with non-variable products, but not with the variations…
Forum: Plugins
In reply to: [WooCommerce] Can’t get regular price for the productWell nothing. If I turn on debugging, I only get this:
Notice: The “woocommerce_get_product_attributes” hook uses out of date data structures and is deprecated since version 3.0.0! Use woocommerce_product_get_attributes instead. in /home/homejungles/public_html/wp-includes/functions.php on line 3829
This is my code (short version) if you want to take a look:
Forum: Fixing WordPress
In reply to: Updated to 3.4.1 and custom post type pagination seems amiss…Here is how i fixed this:
Add this code to functions.php file of your theme:
if ( ! function_exists( 'ucc_add_cpts_to_pre_get_posts' ) ) { function ucc_add_cpts_to_pre_get_posts( $query ) { if ( $query->is_main_query() && ! is_post_type_archive() && ! is_archive() && ! is_search() && ! is_singular() && ! is_404() ) { $my_post_type = get_query_var( 'post_type' ); if ( empty( $my_post_type ) ) { $query->set('post_type', 'video'); } } } } add_action( 'pre_get_posts', 'ucc_add_cpts_to_pre_get_posts' );
And use this to query your posts:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $loop = new WP_Query(array('post_type' => 'name_of_post_type','paged'=>$paged)); ?>
Forum: Fixing WordPress
In reply to: Updating problem (or not?)Thaks for the answer ??
I deactivated all plugins, and reinstaled WP (automaticly upgrade) and it’s ok for now.I turned on some plugins i consider “safe”, ike Akismet, Category order, etc.
Now i suspect that plugin “Admin in English” (my WP is serbian version) causing this behavior.But i’m not totaly shure.We will see…