I’m using a custom function to change the style of the product price. This is my actual function: It works fine on product detail pages if I want some meta fields from the product. I can get these meta fields if I use global $product and go from there. The problem is, that global $product throws an error if used
Tag: wordpress
Woocommerce replace category image with AFC image
I have the following code that works and need to Replace the existing category with AFC images this scrolls but now the default images are in their place first screenshot of admin panel frontend screenshot how can I remove the default once Answer Just remove default one Add this in to your theme functions.php
WooCommerce Related Products: Rows
How can I display the Related Products output as 4 rows? Answer try this one If you want to divide into 4 rows you have to do few CSS. Basically it all depends on how much number of products you want to display, its no relation of number of rows and columns. Like I have added the 12 products in
Set timeout in WordPress hook
I need help here. I have taken 1-2 days to figure out how to redirect a user from one page to another page AFTER a few or 10 secs I know there is sleep() function I need to be fixed but where, I am not sure about it: I have a sample code here I am awaiting a response Thank
Namespace with extend from wordpress class not working
I’m having trouble with namespaces. When I put a namespace, my application will look for the class I extend in the namespace, while I want my namespace to be for my Quote_Recieved class. But I have this error : Uncaught Error: Class ’emailsWC_Email’ not found in C:xampphtdocswordpress….. How I can put my namespace for Quote_Received and not WC_Email ? Thanks.
How to Convert Number to always have 2 digits after the decimal?
Quick question: I am trying to always get 2 digits after the money amount I previously had this code: But it only returns me 650 and I want it to return 650.00 I have tried the following with no success: Thanks for any help on this, still a noob at php. Answer You need PHP will coerce the variable to
Can’t get wordpress to stop making an additional HTML section?
hope everyone is having a wonderful afternoon! I have been developing a website, and have for the most part left with removing unused assets, and cleaning up the code. I have managed to remove most of the non-essential material, however I can’t get past understanding how and why does my HTML produces another separating , and I cannot find a
Add Term Meta from Custom Taxonomy to Cart Item
What I’m trying to accomplish is adding term meta from a custom taxonomy that is attached to a product and display it on the cart/checkout/ order details/email notification. I’m not the greatest at this but know enough to get by. What I’m using is the ‘Perfect Brands WooCommerce’ plugin that adds in the “pwb-brand”. I’ve also added in my own
Disable payment gateway based on number of items and product category in WooCommerce cart
I am using the following code, which allows me to set a minimal quantity of products in cart to proceed payment Is there some option to exclude some specific category? For example: I need to set the minimum quantity for one order for 6 pieces of goods (applies to all categories). For one category of products (ID 2), however, I
PHP outputs images before divs – wordpress bootstrap carousel multiple items
I’m trying to create a wordpress slider with bootstrap carousel displaying multiple post on one slide. I have a problem with outputting the images in the <div class=”col-xxl-4″>. This is my code: and this the output I get: how can I fix this to get: <div class=”col-xxl-4″><img src=”…”></div> Answer Solution: Replace the_post_thumbnail by get_the_post_thumbnail. When using call the_post_thumbnail, it will