carver1g
Forum Replies Created
-
Forum: Plugins
In reply to: [WC Fields Factory] Cart edit works only after multiple attemptsThanks for your quick reply.
I have opened the Developer Console and see no js errors. Debug log shows nothing. One thing I noticed is the first product I add to the cart the edit works first time and works well. If I add an additional product the cart and need to edit the name this is when the delay happens and I have to update multiple times before it takes.
I am developing this site on localhost if that makes a difference.
Thanks for your help and a great plugin.
Forum: Plugins
In reply to: [WooCommerce] Stop auto scroll to empty field on checkoutPlace this in functions.php file:
function custom_override_checkout_fields( $fields ) { $fields['billing']['billing_first_name']['autofocus'] = 'false'; $fields['shipping']['shipping_first_name']['autofocus'] = 'false'; return $fields; } add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
Forum: Plugins
In reply to: [WC Fields Factory] Red border around wccpf-field on errorNevermind, got things working. Solved.
Forum: Plugins
In reply to: [WooCommerce] Pre-checkout FormMight be able to use this plugin:
Forum: Themes and Templates
In reply to: [Storefront] Display user logged in top menucbhurji,
Follow up to my last post. If the positioning (margin-bottom) works and you wish to use the color of your top menu as the background, make the background of the topbar transparent and adjust the color of the font accordingly depending on the top menu’s background color.
Forum: Themes and Templates
In reply to: [Storefront] Display user logged in top menucbhurji,
Place the css in your child’s theme style.css. It may be possible to ‘appear’ that this top bar is part of the top menu by using a negative bottom margin e.g. ‘margin-bottom: -30px’ or whatever amount it takes to line up with the top menu.#topbar{
background-color: #333333;
height: 30px;
line-height: 30px;
overflow: visible;
clear: both;
margin-bottom: -30px;
}Forum: Themes and Templates
In reply to: [Storefront] Display user logged in top menuYou could create a top bar which will display the logged in user’s name. This is the code I use in my child theme:
/** * Adds a top bar to Storefront, before the header. */ function storefront_add_topbar() { global $current_user; wp_get_current_user(); if ( ! empty( $current_user->first_name ) ) { $user = $current_user->first_name; } else { $user = __( 'guest', 'storefront-child' ); } ?> <div id="topbar"> <div class="col-full"> <div class="welcome"> <p style='font-family:helvetica,tahoma,arial; font-size:16px; font-weight: 500; color:#FFF!important;'>Welcome <?php echo $user ?>!</p> </div> </div> </div> <?php } add_action( 'storefront_before_header', 'storefront_add_topbar' );
I then styled it as follows:
#topbar{
background-color: #333333;
height: 30px;
line-height: 30px;
overflow: visible;
clear: both;
}.welcome{
max-width: 250px !important;
height: 25px !important;
text-align: left;
margin-top: 0px !important;
clear: none;
}Of course you can style it any way you like. Don’t know if this is what you are looking for.
Forum: Plugins
In reply to: [WooCommerce] install woothemes updater promptPlace this in functions.php:
remove_action('admin_notices', 'woothemes_updater_notice');
Forum: Themes and Templates
In reply to: [Storefront] Mini cart and scroll barsThanks, appreciate your quick reply and help.
Forum: Plugins
In reply to: [CDN Enabler] Undefined IndexSeems to have done the trick!
Greatly appreciate your help.
Forum: Plugins
In reply to: [CDN Enabler] Undefined IndexWill do. Will let you know the outcome.
Thanks
Forum: Plugins
In reply to: [CDN Enabler] Undefined IndexThanks for your reply. Here’s a link to the screenshot.
Forum: Themes and Templates
In reply to: [Storefront] 4 products per row not working anymoreThis is what I use in functions.php
add_filter( 'storefront_loop_columns', 'sf_child_products_per_row' ); function sf_child_products_per_row() { return 4; }
Forum: Plugins
In reply to: [WC Fields Factory] Overriding priceseank123,
It’s possible I got a white screen at first trying your suggestion because I was missing “$all_fields = apply_filters( ‘wccpf/load/all_fields’, $product_id );” in the original code. I added the “$all_fields…” and your original suggestion and now the code works!
I found these notices in the debug.log:
PHP Notice: Undefined variable: product_id
PHP Notice: price was called incorrectlyHad to add a couple of things to this code to avoid notices in the debug log. Here is my modified code along with my annotations:
unction calculate_cart_total( $cart_object ) { $additionalPrice = 3; $product_id = get_the_id(); //this corrected the undefined variable notice foreach ($cart_object->cart_contents as $key => $value) { $all_fields = apply_filters( 'wccpf/load/all_fields', $product_id ); //missing in my original code if( isset( $value["wccpf_logo_1"] ) && ( $value["wccpf_logo_1"] == "rose"||$value["wccpf_logo_1"] == "football"||$value["wccpf_logo_1"] == "baseball"||$value["wccpf_logo_1"] == "basketball")){ $orgPrice = floatval($value['data']->get_price()); //this corrected the price called incorrectly notice $value['data']->set_price($orgPrice+$additionalPrice); //thanks to you } } } add_action( 'woocommerce_before_calculate_totals', 'calculate_cart_total', 99 );
I hand carve logos on cedar boxes I sell, that’s why the “wccpf_logo_1”.
Been pulling what little hair I have left out for the past month trying to get this code to work again. Don’t know how you figured that one out but thanks to you it works. Well done!
Forum: Plugins
In reply to: [WC Fields Factory] Overriding priceI’ll give it a try and see what happens. Will let you know.
Thanks