I need some help. I am trying to prevent direct access to a page that my customers get redirected to after checkout. I want the page to be accessible only after checkout. I have found this topic: …
Tag: wordpress
Change WooCommerce checkout city field to a dropdown for a unique country
In Woocommerce, I wrote some code for billing and shipping city to use the shipping charge. Now I want to change the cities list when change country. This is my custom code: But when the user change the country from Saudi Arabia to Qatar, the billing_city does not change to text type, so we must refresh the p…
Make order notes field required for variations with specific product attribute term in WooCommerce
I have few variable products with variation that have pa_size and pa_color attributes (taxonomy). I have 4 sizes (“s”, “m”, “l” and “special”) and 4 colors. My problem is, for the “special” size: Customer must fill order notes in checkout page, but s…
How do I fix issues with “composer dependencies” on a WordPress/Cpanel site? [closed]
Semi-inexperienced webmaster here running into a new problem. Recently, a client’s website started displaying the following error: Composer detected issues in your platform: Your Composer dependencies …
core file deleted in woocommerce / wordpress
I have noticed that the file “wp-admin/includes/ajax-actions.php” is deleted automatically in production. Even if I upload this file via ftp, it gets deleted after some time ( ~5min ). I …
Limit wp_count_posts to the last 7 days
I want to display the total number of posts within a post type, but limit it to the last 7 days. This is my current code successfully displaying the total amount of posts within the custom post type. <?php $published_posts = wp_count_posts($type = ‘games’)->publish; echo $published_posts;?&g…
Adding custom text after order total in Woocommerce orders and emails
I am using this to display a custom text for customers from specific countries on the cart and checkout page: This does however NOT add the custom text after the order totals in the plain order emails that Woocommerce is sending. I know there is a filter woocommerce_get_formatted_order_total but I cannot seem…
WordPress taxonomy last child separated by “en” instead of comma
I’m trying to create a shortcode that outputs my custom taxonomies, separated by a comma, but i want the last comma to be “en” instead of a comma. So like this: taxonomy, taxonomy, taxonomy en taxonomy So far i have this: Answer As I dont have an example of the $terms or $entry_terms variabl…
How do I insert meta data to my customers in woocommerce using an object array?
Hi I am trying to use the woocommerce API and do post requests of customer data and adding an internal customer ID. Here is my data I have tried to pass this data through a post request Below is the response when I commented out the meta data. But as you can see there is a meta data array. But
place results of each foreach objects into their own columns
I have an array of objects that I am getting values for using foreach: If I ECHO this, I get results like: The mysql is Great! Now since they are objects, if I wanted to get a count on each variation of the type and display that in a table how would I do that? I have tried adding things