OceanWP child issues with CSS
-
Hi!
We´re having issues to get the css in our child-theme to load on our site. We use OceanWP and Elementor Pro. We´ve use your child template. This is the code in the functions.php
<?php /** * Child theme functions * * When using a child theme (see http://codex.ww.wp.xz.cn/Theme_Development * and http://codex.ww.wp.xz.cn/Child_Themes), you can override certain * functions (those wrapped in a function_exists() call) by defining them first * in your child theme's functions.php file. The child theme's functions.php * file is included before the parent theme's file, so the child theme * functions would be used. * * Text Domain: oceanwp * @link http://codex.ww.wp.xz.cn/Plugin_API * */ /** * Load the parent style.css file * * @link http://codex.ww.wp.xz.cn/Child_Themes */ // Queue parent style followed by child/customized style function oceanwp_child_enqueue_parent_style() { // Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme) $theme = wp_get_theme( 'OceanWP' ); $version = $theme->get( 'Version' ); // Load the stylesheet wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'oceanwp-style' ), $version ); } add_action( 'wp_enqueue_scripts', 'oceanwp_child_enqueue_parent_style' ); add_action( 'wp_footer', 'my_elementor_pro_popup' ); /** * Disable Zoom, Lightbox and Gallery Slider on WooCommerce Products **/ function wc_remove_image_effect_support() { remove_theme_support( 'wc-product-gallery-zoom' ); remove_theme_support( 'wc-product-gallery-lightbox' ); // remove_theme_support( 'wc-product-gallery-slider' ); } add_action( 'after_setup_theme', 'wc_remove_image_effect_support', 100 ); /** * Kod för ajax sök i Elementor **/ function my_elementor_pro_popup() { ?> <script> window.addEventListener('load', function() { if (window.jQuery) { jQuery( document ).on( 'elementor/popup/show', function() { window.setTimeout(function(){ jQuery('.elementor-container .aws-container').each( function() { jQuery(this).aws_search(); }); }, 1000); } ); } }, false); </script> <?php } /** * Kort beskrvning i produktkategorier **/ function prefix_add_short_description() { global $product; if ( ! $product->get_short_description() ) return; ?> <div itemprop="description"> <?php echo apply_filters( 'woocommerce_short_description', $product->get_short_description() ) ?> </div> <?php } add_action('ocean_after_archive_product_title', 'prefix_add_short_description',5); /** * Trim zeros in price decimals **/ add_filter( 'woocommerce_price_trim_zeros', '__return_true' ); add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 90;' ), 20 ); /** * Changes Return to Shop button URL on Cart page. * */ function wc_empty_cart_redirect_url() { return 'https://www.vattenliv.se/'; } add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' ); /** * Hides the product's weight and dimension in teh single product page. */ add_filter( 'wc_product_enable_dimensions_display', '__return_false' ); /** * Fix för avrundning i pluginet YITH WooCommerce Dynamic Pricing and Discounts Premium */ add_filter ( 'yith_ywdpd_get_discount_price', 'yith_ywdpd_round_price'); function yith_ywdpd_round_price( $discount_price){ return round( $discount_price ); } /** * Display Advanced Custom Fields @ Single Product - WooCommerce * * woocommerce_single_variation * woocommerce_before_add_to_cart_form * add_action( 'woocommerce_product_meta_end', 'display_acf_field_before_add_to_cart', 10 ); function display_acf_field_before_add_to_cart() { echo '<div class="leveranstid">' . get_field('leveranstid') . '</div>'; } */ add_action( 'woocommerce_sco_before_notes_field', 'shipping_message', 10 ); function shipping_message( ) { echo '<div class="wc-svea-checkout-notes-field"> Förklaring fraktsätt: <ul> <li>Ombud - du hämtar paketet på det av PostNords utlämningsställe som ligger närmast din adress.</li> <li>Hämta - du hämtar paketet på vårt lager, <a href="https://www.vattenliv.se/kundservice/var-butik-i-kalmar/" target="_blank" rel="noopener noreferrer">adress och öppettider</a></li> </ul> Mer information hittar du i <a href="https://www.vattenliv.se/kundservice/kopvillkor/" target="_blank" rel="noopener noreferrer">köpvillkoren</a>. </div> </br> '; } /** Visar delbealning från Svea även på Composite produkter **/ add_filter( 'woocommerce_sco_part_pay_widget_product_types', function ($product_types) { $product_types[] = 'yith-composite'; return $product_types; }); /** Sätter status på betalningsmedel check **/ add_action( 'woocommerce_thankyou', 'cheque_payment_method_order_status_to_processing', 10, 1 ); function cheque_payment_method_order_status_to_processing( $order_id ) { if ( ! $order_id ) return; $order = wc_get_order( $order_id ); // Updating order status to processing for orders delivered with Cheque payment methods. if ( get_post_meta($order->id, '_payment_method', true) == 'cheque' ) $order->update_status( 'processing' ); } /** * Visa beräknad leverantsid i varukorg och kassa */ function cm_display_delivery_in_product_list($item_data, $cart_item) { // get by variation id if set, otherwise by product id if (isset($cart_item['variation_id']) && $cart_item['variation_id'] !== 0) { $product = wc_get_product($cart_item['variation_id']); } else { $product = wc_get_product($cart_item['product_id']); } if (!$product->is_on_backorder($cart_item['quantity'])) { return $item_data; } $expected_delivery = ''; switch (get_field('leveranstid', $cart_item['product_id'])) { case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 2-5 vardagar': $expected_delivery = '2-5 vardagar'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 5-10 vardagar': $expected_delivery = '5-10 vardagar'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 14-20 vardagar': $expected_delivery = '14-20 vardagar'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 1-5 veckor': $expected_delivery = '1-5 veckor'; break; default: return $item_data; } $item_data[] = array( 'key' => 'Beräknad leveranstid', 'value' => wc_clean($expected_delivery), 'display' => '', ); return $item_data; } add_filter('woocommerce_get_item_data', 'cm_display_delivery_in_product_list', 10, 2); /** * Visa leverantsid på orderbekräftelsen (både på sidan och i mailet) */ function cm_display_delivery_on_order($item_id, $item, $order) { $product = wc_get_product($item->get_product_id()); if ($order->get_status() !== 'completed') { if ($item->meta_exists('Vi beställer den hos vår leverantör. Antal') || $item->meta_exists('Backordered')) { switch (get_field('leveranstid', $item->get_product_id())) { case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 2-5 vardagar': echo '<div style="margin-top:2px; color:#aaa;"><em>Beräknad leveranstid: 2-5 vardagar</em></div>'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 5-10 vardagar': echo '<div style="margin-top:2px; color:#aaa;"><em>Beräknad leveranstid: 5-10 vardagar</em></div>'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 14-20 vardagar': echo '<div style="margin-top:2px; color:#aaa;"><em>Beräknad leveranstid: 14-20 vardagar</em></div>'; break; case 'Har vi inte det antal i lager du vill beställa är beräknad leveranstid 1-5 veckor': echo '<div style="margin-top:2px; color:#aaa;"><em>Beräknad leveranstid: 1-5 veckor</em></div>'; break; default: break; } } } } add_action('woocommerce_order_item_meta_end', 'cm_display_delivery_on_order', 10, 3); /** * Hide "backordered" meta * DISABLED */ function cm_order_item_get_formatted_meta_data($formatted_meta) { if (is_admin()) { return $formatted_meta; } $updated_meta = array(); foreach ($formatted_meta as $key => $meta) { if ($meta->key === 'Vi beställer den hos vår leverantör. Antal' || $meta->key === 'Backordered') { continue; } else { $updated_meta[$key] = $meta; } } return $updated_meta; } /** * @snippet WooCommerce add text to the thank you page * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 * @sourcecode https://businessbloomer.com/?p=382 * @author Rodolfo Melogli * @testedwith WooCommerce 2.6.7 */ add_action( 'woocommerce_thankyou', 'add_content_thankyou', 5 ); function add_content_thankyou() { echo ' <br> <br> <br> <br> <h2>Tack för att du har handlat av oss!</h2> <p>Vi hoppas att du kommer att bli nöjd med ditt köp och hur vi hanterar din order.</p> <h3>Vad händer nu?</h3> <ul> <li>En orderbekräftelse skickas inom 15 minuter till din e-post. Kontrollera gärna att allt ser rätt ut.</li> <li>Har vi de produkter du precis beställde på lager skickar vi varorna snarast möjligt. Oftast som senaste nästkommande vardag. Är någon vara tillfälligt slut skickas varorna när alla produkter finns på lager.</li> <li>Samma dag din order skickas får du e-post med att din order är färdigbehandla och e-post med spårningsnr om vi ska skicka din order.</li> <li>Din order levereras med valt leveranssätt. Har du valt att hämta din varor hos oss är dom vid detta tillfälle klara för upphämtning.</li> <li>Fakturan skickas ut till din e-postadress vardagen efter vi skickat din order. Har du inte fått den kolla först i ditt skräppostfilter.</li> </ul> '; }Can you see anything that´s wrong?
Peter
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘OceanWP child issues with CSS’ is closed to new replies.
