Allowed memory size exhausted problem

The problem is that you don’t have enough memory allocated for your php script in your php.ini file. there are two ways to solve it increase the memory allocation which might require you to increase the actual physical memory you use give up on some features of your site. There is no one root cause … Read more

Woocommerce Change The Price Of A Product Once Woocommerce Has Retreived It From Database

Finally, got it working with this code:- function return_custom_price($price, $product) { global $post, $woocommerce; $post_id = $post->ID; if($post_id == ‘696’ || $post_id == ‘697’ || $post_id == ‘705’ /*|| $post_id == ’53’*/ || $post_id == ”){ // cart, checkout, , order recieved, order now $post_id = $product->id; } $new_price = get_post_meta($post_id, ‘_price’, true); if($new_price==”) { … Read more

Close Fancybox, sumbit form data and redirect

So this is what I did to make it work: <form id=”formid” name=”form” action=”https://wordpress.stackexchange.com/checkout” method=”get”> Text: <input type=”text” name=”text”><br> <a href=”https://wordpress.stackexchange.com/checkout” target=”_parent” onclick=”document.getElementById(‘formid’).submit();”>Finish</a> <input type=”hidden” name=”mess” value=Finish /> </form>

Error checking when future updates are automatic

how do I stop the auto updates for sites which I know …etc Following code at least should prevent auto updating:(add in wp-config.php) define( ‘AUTOMATIC_UPDATER_DISABLED’, true ); Here you find an (imho) handy explanation about the how to handle in which cases: Chip Bennets “readers digest” Another nice informative page is following: The definitive guide … Read more

WooCommerce product and terms count [closed]

To get number of woocommerce published products – $total_products = count( get_posts( array(‘post_type’ => ‘product’, ‘post_status’ => ‘publish’, ‘fields’ => ‘ids’, ‘posts_per_page’ => ‘-1’) ) ); To get attributes count – $total_attribute_terms = get_terms(‘pa_’. $attribute_slug, array(‘hide_empty’ => false, ‘fields’ => ‘count’) ); The $attribute_slug can be found on Attribute edit page – Wp admin -> … Read more