mathijsvdbeek
Forum Replies Created
-
Thanks. I was just looking for the docs about this subject within FSE. I asked the question already there ๐
Thank you for your response. See code below.
<?php
add_action( ‘woocommerce_init’, function() {if ( ! function_exists( 'woocommerce_register_additional_checkout_field' ) ) return; // Checkbox Zakelijk afrekenen woocommerce_register_additional_checkout_field(array( 'id' => 'my-plugin/business-checkout', 'label' => __('Zakelijk afrekenen', 'your-text-domain'), 'location' => 'order', 'type' => 'checkbox', 'default' => '0', )); // Bedrijfsnaam woocommerce_register_additional_checkout_field(array( 'id' => 'my-plugin/business-name', 'label' => __('Bedrijfsnaam', 'your-text-domain'), 'location' => 'order', 'type' => 'text', 'required' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['1']] ] ] ] ] ], 'hidden' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['0','']] ] ] ] ] ] )); // Bedrijfsadres woocommerce_register_additional_checkout_field(array( 'id' => 'my-plugin/business-address', 'label' => __('Bedrijfsadres', 'your-text-domain'), 'location' => 'order', 'type' => 'text', 'required' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['1']] ] ] ] ] ], 'hidden' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['0','']] ] ] ] ] ] )); // BTW-nummer woocommerce_register_additional_checkout_field(array( 'id' => 'my-plugin/business-vat', 'label' => __('BTW-nummer', 'your-text-domain'), 'location' => 'order', 'type' => 'text', 'required' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['1']] ] ] ] ] ], 'hidden' => [ 'checkout' => [ 'properties' => [ 'additional_fields' => [ 'properties' => [ 'my-plugin/business-checkout' => ['enum' => ['0','']] ] ] ] ] ] ));});
Solved it with some css. Although i like to adjust this with some code.
2nd question still active.Forum: Plugins
In reply to: [WooCommerce] Mini cart open trigger product pageI made a simple solution. For anybody who reads this post. Try:
function custom_add_to_cart_message($message) {
// Voeg een trigger toe om ons script te laten weten dat er een product is toegevoegd
add_action('wp_footer', 'add_mini_cart_opener_script', 99);
// Retourneer een lege melding
return '';
}
add_filter('wc_add_to_cart_message_html', 'custom_add_to_cart_message', 10, 1);
function add_mini_cart_opener_script() {
?>
<script>
jQuery(document).ready(function($) {
$(window).on('load', function() {
setTimeout(function() {
const miniCartButton = document.querySelector('.wc-block-mini-cart__button');
if (miniCartButton) {
miniCartButton.click();
}
}, 1000);
});
});
</script>
<?php
}Forum: Plugins
In reply to: [WooCommerce] Mini cart open trigger product pageThank you for your suggestions. Ajax was already on. I checked and unchecked it, but it does not make any difference. I will have a look how to solve this otherwise.
Forum: Plugins
In reply to: [WooCommerce] Mini cart open trigger product pageI made a temp staging website so you can see. https://staging.mathijsvanderbeek.nl/index.php/shop/
and for the product https://staging.mathijsvanderbeek.nl/index.php/product/test-product/Forum: Plugins
In reply to: [WooCommerce] Mini cart open trigger product pageI like the block theme idea and my website is a selfmade block theme. I started making my own block theme for my other website which has woocommerce. My setup is locally so I can not show you the setup. Basically I started an empty block theme in which I only use the woocommerce plugin for a clean setup. In the template I used the mini-cart block from the guide. Let me know if this helps. Otherwise I will see if I can make a temp staging website.
I noticed some small wc block glitches. Like the breadcrumbs font size which works in s / m etc, but not in em. Is there a place where I can report this?Forum: Plugins
In reply to: [Theme Switcha - Easily Switch Themes for Development and Testing] sourcemapsOkay. Thank you for your quick reply. It seems I could solve the problem by removing the theme I made. I will let the theme developers look at the other problem.
Forum: Plugins
In reply to: [Payment Plugins for PayPal WooCommerce] PayPal only available under 35Found it. For someone who wants the same just use:
add_filter(‘woocommerce_available_payment_gateways’, function($gateways){
$maximum = 35;
if (is_checkout() && WC()->cart && WC()->cart->get_total() > $maximum) {
unset($gateways[‘ppcp’]);
}
return $gateways;
});Forum: Plugins
In reply to: [Create Block Theme] css styles missing index.htmlThe plugin developers are looking at it. It looks like it is more of a problem with the plugin I use than this one. Although I have made a shortcode to get childpages and added css in the shortcode itself which won’t load on an index page and loads on a normal page. I think this is a wordpress thing…
It is okay. Any suggestions how to parse css from a shortcode on a index page is always welcome.
Forum: Plugins
In reply to: [Temporary Login Without Password] suggestionI noticed this, but if you like to give acces to +50 users I like everything to go automatically. Maybe a premium version?
Forum: Plugins
In reply to: [Print-O-Matic] No commentsFound the solution. I just need to add a standard header. I guess I will figure that out also.
Forum: Plugins
In reply to: [WP Cerber Security, Anti-spam & Malware Scan] Matomo block?Thank you for the solution.
Forum: Themes and Templates
In reply to: [Hotel Galaxy] Main menu – head menu not clickableThank you. This is not what I mean. When you hover the menu the submenu drops down. This works fine. I added the code, but my problem is not solved. What I mean is the following.
I like to hover for example “ยท Unsere Zimmer” and then click on Unsure Zimmer to go to this page and follow the link (you can see the link on the left side of the screen in chrome) but if you click you stay on the same page. The arrow of the menu item changes back and forward. But it does not follow the link. How to fix this?
Kind regards,
Forum: Plugins
In reply to: [JinMenu] UpdateThanks ๐