WP/WooCommerce multisite with polylang, product duplication between websites [closed]
WP/WooCommerce multisite with polylang, product duplication between websites [closed]
WP/WooCommerce multisite with polylang, product duplication between websites [closed]
You’re going to want to use hooks and filters to change that. I would look at the woocommerce_get_price_html and/or woocommerce_variable_price_html filters. EDIT: here is the core WC code you need to alter: /** * Format a sale price for display. * * @since 3.0.0 * @param string $regular_price Regular price. * @param string $sale_price Sale … Read more
What do you mean on a dark background? Did you change the background color? My default twenty seventeen & woo install has a white background. Anyway, you can make CSS adjustments by going into the admin > Appearance > Customize > Additional CSS. You can inspect the CSS on the page by hitting f12. I … Read more
Try this code by using global $woocommerce add_action( ‘wp_logout’, ‘force_clear_woocommerce_cart’ ); function force_clear_woocommerce_cart() { error_log(“Clearing cart”); global $woocommerce; $woocommerce->cart->empty_cart(); } hope this will help you
I have solved my problem and want to share it with anyone who has problems like me. First, you should find out about a few simple SQL commands to make it easier to manipulate the database. I learned them at https://www.w3schools.com/sql/ My idea is that I will export all the data I need into a … Read more
You can use the woocommerce_registration_errors hook to validate the username & set an error if your conditions aren’t met – WooCommerce will bail and pass the error back to the UI for the user: add_filter( ‘woocommerce_registration_errors’, function ( WP_Error $errors, $username ) { if ( ! preg_match( ‘/[a-z]/i’, $username ) ) { $errors->add( ‘username’, ‘Username … Read more
If you look how that script is loaded in WC core ‘wc-cart-fragments’ => array( ‘src’ => self::get_asset_url( ‘assets/js/frontend/cart-fragments’ . $suffix . ‘.js’ ), ‘deps’ => array( ‘jquery’, ‘js-cookie’ ), ‘version’ => WC_VERSION, ), You’ll see the path to that script, as well as it’s dependencies. rebuild that path and enqueue it yourself. FYI $suffix is … Read more
The is_category() method checks whether the current query is for an existing category archive page. Being woocommerce you should use the is_product_category() method instead, and to check for single product the has_term($slug, ‘product_cat’, $product_id) method. This code will remove prices from archive pages and single product pages: add_action( ‘woocommerce_after_shop_loop_item_title’, ‘hide_loop_product_prices’, 1 ); function hide_loop_product_prices(){ global … Read more
You can use this Plugin and it will automatically insert the code for you on every page. Just download the plugin and add your code to the header box that the pugin provides. Super easy to use and super lightweight. Plugin: Insert Headers and Footers https://pt.wordpress.org/plugins/insert-headers-and-footers/
Pay attention to the comments along the snippet. <?php /** * Filters the attachment URL. * * @param string $url URL for the given attachment. * @param int $att_id Attachment post ID. * * @return string $url Custom URL for the given attachment. */ function wp_get_attachment_url_callback( $url, $att_id ) { // Instead of keeping full … Read more