Change the headline for the Jetpack related posts
If you have out of stock flash displayed on product catalog pages, but not on single product pages, you can follow my instructions to fix this.
- Copy over the code from functions.php to your WordPress copy of that file.
- Use Chrome dev tools to identify the class of div which is used to output 'Out of stock' flash on products category page of your website.
- Update line 6
printf( '%s', __( 'Out of Stock', 'Avada' ) );
with your div class details. Keep in mind: The div class used in this file does belong to Avada and may not work on other themes.
If you have set up shipping classes and assigned products to your shipping categories, then you can see here how to add fees for products from specific shipping classes.
- Copy over the code from functions.php to your functions.php copy of WordPress site.
- You can remove lines 40-45.
- For each shipping class you would like to add fee for, copy and paste lines 46-48.
- Now simply update
'your-shipping-class-slug-here'
with your shipping class slug,'Any text you would like to see as fee heading :'
with your text and$fixed
with your preferred price.
If you have a specific product that you would like to have a fixed fee for and adjust the shipping cost not to take that product into account accordingly, then you need the code from this repository. There are two seperate functions involved:
function wc_ninja_manipulate_shipping
which takes care of adjusting the shipping cost not to take into account a particular vendor products or productfunction woocommerce_custom_surcharge
that adds $30 surcharge fee below the shipping methods on its own line. Keep in mind: I am using the Table Rate Shipping plugin as well as my shipping costs are based upon order total for this example.
If you are not satisfied with the amount of menu areas or widget areas provided by your theme, you can use the code from this repository to add extra menus or widgets or both.
- Copy the lines 3-13 from functions.php of current repository and place it in your functions.php file.
- In your template file, wherever you would like your custom menu to appear add the following
<?php wp_nav_menu( array('menu' => 'Header Menu' )); ?>
. - If you want to add more than one custom menu just add new line into an array in place of comments on line 8, for example,
, 'footer-menu' => __( 'Footer Menu' )
.
Add fee for products from specific vendor in cart
- Copy the repository code into your functions.php file replacing line 5
$fixed=30;
with your desired fee and line 11if ($values['data']->post->post_author == 40) {
40 with id of the vendor you would like to add a fee for. Keep in mind that the code in this repository adds one instance of fixed fee no matter how many products from the specific vendor is in the cart.
If you are using WC Vendors Plugin and you have set to show categories on the main shop page in woocommerce settings, you may notice the common issue that on individual vendor page we have categories displayed instead of the vendor products. That is because WC Vendors is using the archive-product.php file which is also used for shop page views. This issue can be easily resolved by changing the woocommerce settings to show all products on the main shop page, nevertheless, if you still would like to show vendor products on the wc vendor page while having product categories on main shop page, you would need to update your archive-product.php file.
Backup your archive-product.php and just copy repository archive-product.php to your current theme folder/woocommerce/
Instead of the line 67 (that was `
If you have set the WooCommerce Settings -> Shop Page Display to show categories & subcategories, you may notice that your base shop page automatically shows all parent categories. This PHP snippet maybe useful if you would like to remove certain categories from the view on shop page.
- Copy over the code in the current repository to your WordPress functions.php or woo-config.php files.
- Go to your Wordpress Admin Panel -> Products -> Categories and note down the slugs of categories that you would like to hide on your shop page.
- Place the noted slugs into the array of slugs on line 14 of functions.php
If you have installed the Woocommerce Products Filter (woof) plugin and you have custom page that you would like your users to return when they press the reset button no matter where they are, please follow my instructions. Keep in mind: Permalinks are turned on.
- You need to have the woof plugin installed or downloaded.
- Download current repository and place the contents within woof plugin directory overwriting changes.
- Open
views/woof.php
and replace the http://your_link on line 479data-link="http://your_link"
with your url where you would like your users to go when they hit refresh. - Enjoy!
Fixing the issue of woof filtering on main shop page - woof filter results showing product categories instead of products
If you have installed WooCommerce Products Filter by realmag777 and set the shop base to display categories in woocommerce settings, you may notice that using woof filters from your main shop page brings products categories instead of filtered products result. This issue can be easily resolved by changing the woocommerce settings back to show all products on the main shop page, but, if you still would like to have product categories on main shop page, you would need to update your archive-product.php file.
Just copy the archive-product.php to your current theme folder/woocommerce/
Instead of the line 67 that was <?php woocommerce_product_subcategories(); ?>
put :
if ( !strpos($_SERVER['REQUEST_URI'], "swoof")) {