I currently have this code in functions.php in order to display a message on the checkout page saying the customer has backordered products in their cart: What do I need to do to also have this same message display on the CART page? (Before going to Checkout). Thanks in advance. Answer Note 1: I changed the c…
Tag: wordpress
add_action gives error when call my function
I have below code but wp says me: Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘widget_categories’ not found or invalid function name in /home/deniztas/hekim….
Displaying icons using php IF
Just wondering, I’m creating a multi-vendor website. So far it has all been going well, however we have a need to display icons as badges if a field contains data. Here is an example of the code: &…
jQuery in wordpress showing warning of ‘cannot use import statement outside a module
I am a newbie developing WordPress theme but having some problems in the navigation menu. I want to open sub-menu through jQuery for certain reasons but terribly failed. Would you guys help me to get …
Ajax function call to php function
I have a simple php function as below defined in one of my php file add_action(‘wp_ajax_test’,’test’); add_action(‘wp_ajax_nopriv_test’,’test’); function test(){ echo “Hello”; } I am calling …
WooCommerce Memberships: How to adjust query to account for delayed content/content drip?
I’m trying to build a query that shows the latest post a member has access to, but I cannot find what parameters to add so that posts that they have access to in the future are removed from this list. Does anyone know how to do this? If not, can wc_memberships_is_post_content_restricted( ) be adapted in…
How can initialize Fancybox into WordPress with a separate .js file properly?
I did a search and found this method here using wp_add_inline_script. And it works. But what if I wanted to keep my initialization script into an other .js file? That’s what I wanted at first. How I …
WooCommerce hide pay button on my account page for failed/onhold orders
What would you be the correct CSS code to hide the pay button for the failed or hold orders on My Account page. I tried this and it is not working. Thanks. Answer You could use the following: CSS PHP
Access the product attribute selected value in WooCommerce product page
I am building a store which has some product with variations. I want that based on the selection of the user on a select element (It’s an attribute of the product) to hide other elements. I wrote some JavaScript code which is added in the functions.php file to access the value of the select element when…
Display custom taxonomy terms on WooCommerce product archive pages
I’ve create a taxonomy called “couchages” for product with value : 1 couchage, 2 couchages, 3 couchages,… I would like to print the value of this taxonomy, for each product on the archive page, like …