I want to change the default quantity from the products, from 1 to 0,1 but I can’t seem to figure it out. I tried the following: The problem with this is that modifies the quantity input from cart as well, which isn’t what I want. To be more specific I want the following: when I go to the product …
Tag: wordpress
WordPress hide post from custom post-type on a single page
Initial situation custom post-type (projects)[projects.php] custom field (with cmb2)[projects.php] front-page.php What I want On my front-page is a section ( <div class=”m-rowteaser m-rowteaser–default”> ) what is displaying a random post from the post-type projects. There are some pos…
dynamically display posts of a user-chosen category without reloading page
I have a blog posts page that looks similar to this: https://magnolia.com/blog/ What I want to do is when the user clicks on a category, only posts of that type display below the search. The above …
Add custom “Add to cart” button based on ACF field to WooCommerce single product page
I want to add an additionall custom “Add to cart button” on the single product page conditionally using this code: This variable is field from ACF $mamut = get_field(‘mamut’); However when I put this code into my functions.php file, the single product page crash I am using theme Twenty…
Discount cart item price excluding a category and its children in WooCommerce
The fact is that the customer asks for a 50% discount for “Local Pickup” – I have already done this (I found a code here on StackOverFlow that applies a discount on all goods), but there is …
Getting current page url on wp-admin/admin dashboard?
Im trying to get the current page url while on the wp-admin/admin dashboard, is it possible? Im trying to use these codes but i can’t seem to get it to work. The output i wanted is like this: https://example.com/1/wp-admin/admin.php?page=test But instead, the output turns like this: /1/wp-admin/admin.ph…
Does WordPress trigger index.php when the page is cached?
All pages on my site are cached using the WP Rocket plugin, and everybody is telling me that the root index.php is not triggered when a page is cached. I went ahead and added this piece of code to my …
get_template_part – WordPress not working
I am trying to place the content of the about page inside a div on the header , the template part is located on folder template-parts/content-about.php on the header the code is: And the content-about.php looks like this: The issue is that is showing on the div the same content as the current page for example…
dealing with forms in php
I have only one php file called index.php. I have created there a form with one input text element and one input submit element. When I click on submit I want to deal with the value from the input element in the function that is in the same file, namely index.php. So my question is what to write into action
Add to cart validation in WooCommerce based on attribute value and product quantity from the cart page
Actually, I am trying to set a limit for adding to cart for some product ids based on product attribute. What i’ve done is: It works in a loop, but on the product page, it doesn’t take into account quantity input. Is there a way to get quantity add input in my function? Answer woocommerce_add_to_c…