I am converting a static an html code to wordpress theme, i want to open another page to open when i click on the anchor tag, how do i go about it. Thanks. Answer In WordPress, links are permalinks: Permalinks are the permanent URLs to your individual weblog posts, as well as categories and other lists of web…
Tag: wordpress
How to check the weight of product in cart based on meta_key?
I am looking for a solution to check the weight in the cart based on meta. for example, it prints: : 5kg in your basket is Cold and Hot 2.5kg in your basket is other I use the following loop to check the meta_key: Then after checking products with a special meta, I want to calculate the weight. Would you
How to get the meta value of the ACF field (wordpress)?
I need to get the meta value of the ACF field. ACF field called ‘submitdate’ (format => Date Time picker : Y-m-d H:i:s) already has data ‘2021-06-11 17:23:36’ I tried the following code, but it only shows correct $post->ID, it doesn’t show $submitdate. No error in console. …
WooCommerce shipping fileds required state
I’m using the function below to show / hide the shipping address section of the checkout based on if a customer chooses local pickup or not. It works fine, however some of the fields in the shipping section are required and so the checkout won’t work if local shipping is selected. Is there a way t…
How can I display multiple lines of version.php?
I’m new to PHP code and am trying to find a way to display 3 lines from the version.php file within WordPress without having to download the file; look into it and move on – this is what I have come up with so far, but does not seem to be working. I’m sure I’m doing something wrong her…
Disable auto-complete fields (auto-fill) on Woocommerce checkout except for some fields
I use below code to disable Autocomplete Fields in the woocommerce checkout page: Above code disables all autocomplete fields. How about I want to enable autocomplete for specific fields like Billing Country and Shipping Country? Answer You found the correct hook woocommerce_checkout_get_value. You just had t…
Get href on click and redirect with shortcode
I’m working with this idea: get href onclick and redirect with link Because i need a link redirect to another page. My problem is that the second page is dinamic. For it, i use a shortcode. But im not know how i can do for it works. The var yourHTML is not working. Answer You should use event.preventDef…
Automatically add a percentage discount if WooCommerce cart contains at least X products
I am trying to create an automated discount that kicks in when and if the cart contains a minimum of three products or more. If and when that is, a discount of 10% should be given no matter if the customer is logged in or not. This is the code I’m trying to get to work (without success). Answer It
How to reorder additional fields on checkout page in WooCommerce
I cant figure out how to reorder the additional fields, on the checkout page in WooCommerce. I have added one extra field to the WooCommerce additional information section. I would like to show the time field first then the order notes below it. This is the code that I am using: However, this does not have th…
Customizer Object Header Background image issue (HTML to WordPress)
i’m trying to convert html template into wordpress with more easy to edit, for this i do try to add front page header slider images and content into customizer object. Like easy to edit for users. user can go to Appearance>>customize>>Home Page hader>> and then there he/she can choose …