• Anything About Wordpress

    How to fix wordpress white screen of death?

    Fixing Blank or white screen wordpress website cab be frustrating, specially when you don’t know what it causes or or it does not give you any error message. In order to fix it. You can enable the debugging script from wordpress wp-config. To enable debugging you’ll need to open the wp-config.php file of your WordPress install. Within it you should find the script define (‘WP_DEBUG’, false); . You’ll need to replace false with true and reload your site. If it doesn’t exist, you can add it towards the top. After refreshing the page, wordpress will now give the exact error message you need to fix. If it is a plugin.…

  • Custom Functions

    Remove Woocommerce Product Tabs Heading

    add_filter('woocommerce_product_description_heading', '__return_empty_string');   Css Code for horizontal tab : .product .woocommerce-tabs ul.tabs { width: 100%; float: none; margin-right: 5.8823529412%; } .woocommerce div.product .woocommerce-tabs ul.tabs { list-style: none; padding: 0; /*padding: 0 0 0 1em;*/ margin: 0 0 1.618em; overflow: hidden; position: relative; } .woocommerce div.product .woocommerce-tabs ul.tabs::before { position: absolute; content: ‘ ‘; width: 100%; bottom: 0; left: 0; /*border-bottom: 1px solid #d3ced2;*/ z-index: 1; } .woocommerce div.product .woocommerce-tabs ul.tabs li { border: 1px solid #d3ced2; border-radius: 4px 4px 0 0; /*background-color: #ebe9eb;*/ display: inline-block; position: relative; z-index: 0; /*margin: 0 -5px;*/ padding: 0 1em; } .woocommerce div.product .woocommerce-tabs ul.tabs li.active { /*background: #fff;*/ z-index: 2; border-bottom-color: #777; background-color: #ebe9eb;…

  • Custom Functions

    Add Product categories on invoices under product name

    add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_categories', 10, 3 ); function wpo_wcpdf_show_product_categories ( $template_type, $item, $order ) { // get a comma separated list of categories (category links stripped) if (isset($item['product'])) { if (function_exists('wc_get_product_category_list')) { // WC3.0+ $category_list = wc_get_product_category_list( $item['product']->get_id() ); } else { $category_list = $item['product']->get_categories(); } echo ' Categories: '.strip_tags( $category_list ).' '; } } if categories does not show… replace the $item[‘product’]->get_id() to $item[‘product_id’].

  • Custom Functions

    PDF Invoice Number and Order Number

    Invoice number to be the same as Order number , here is the code for this one. /** * Format order number with invoice number settings */ add_filter( 'wpo_wcpdf_raw_document_number', 'wpo_wcpdf_raw_document_number', 10, 4 ); function wpo_wcpdf_raw_document_number( $number, $settings, $document, $order ) { if ( $document->get_type() == 'invoice' ) { $number = $order->get_order_number(); } return $number; }

  • Anything About Wordpress

    Slow Woocommerce processing variation fix!

    Here is one solutions that can improve your woocommerce speed, specially when you are adding tons of variations. There lots of ajax processing inside your website By increasing your memory limit, your woocommerce can process more than its default memory limit. Check your hosting server if it will allows you to increase more than your default php settings. Add this code to your functions.php or to your wp-config.   define('WP_MEMORY_LIMIT','256M'); define('WP_MAX_MEMORY_LIMIT', '256M'); I hope this simple solutions can help you. Thanks

  • Anything About Wordpress

    Adding SKU on Cart

    add_filter( 'woocommerce_cart_item_name', 'showing_sku_in_cart_items', 99, 3 ); function showing_sku_in_cart_items( $item_name, $cart_item, $cart_item_key ) { // The WC_Product object $product = $cart_item['data']; // Get the SKU $sku = $product->get_sku(); // When sku doesn't exist if(empty($sku)) return $item_name; // Add the sku $item_name .= '' . __( "SKU: ", "woocommerce") . $sku . ''; return $item_name; }

  • Custom Functions

    Adding strike through on product subtotal after coupon code

    Here is the short custom function if you want to add a strike though on prices after coupon code. function jp_discount( $price, $type, $amount ){ switch( $type ){ case 'percent_product': $newprice = $price * ( 1 - $amount/100 ); break; case 'fixed_product': $newprice = round($price - $amount,2); break; case 'percent_cart': $newprice = $price * ( 1 - $amount/100 ); break; case 'fixed_cart': $newprice = $price - $amount; break; default: $newprice = $price; } return round($newprice,2); } function jp_woocommerce_cart_item_subtotal( $subtotal, $cart_item, $cart_item_key ){ $coupons = WC()->cart->get_coupons(); foreach ( $coupons as $code => $coupon ) : $newsubtotal = wc_price( jp_discount( $cart_item['line_total'], $coupon->discount_type, $coupon->amount ) ); $categories = array(35); if( has_term( $categories, 'product_cat',…