oakwoodmedia
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Show Woocommerce Ship to… Link for specific usersI have been playing about with this code but cannot seem to get it to work
add_filter( 'woocommerce_product_get_shipping_class_id', 'show_shipping_class_to_specific_users', 10, 2 ); function show_shipping_class_to_specific_users( $class_id, $product ) { $customer_id = get_current_user_id(); // Get the ID of the currently logged-in customer $allowed_customer_ids = array( 1, 2, 3 ); // Replace with the IDs of the customers who are allowed to see this shipping class if ( ! in_array( $customer_id, $allowed_customer_ids ) ) { return false; // Return false to hide the shipping class if the customer is not allowed to see it } return $class_id; }
Forum: Plugins
In reply to: [WooCommerce] Show Woocommerce Ship to… Link for specific usersThanks for the reply the code i was using is below.
I am wanting to hide the “ship to a different address” link and only show it to specific users, currently i was using customer roles. The code below completely removes the shipping section and i was having issues with the customers default shippiung address not coming through (only the billing address). Thanks
// Christopher's Hide Shipping to Link for users add_action('init', 'unset_shipping_address' ); function unset_shipping_address() { // user roles $user_roles = array('bronze', 'silver', 'platinum', 'gold', 'cc004592', 'cc002901', 'cc004340', 'cc003477', 'cc003419', 'cc003263', 'cc003099', 'cc003091', 'cc003087', 'cc003046', 'cc002842', 'cc002594', 'cc002207', 'cc001767', 'cc001757', 'cc001188', 'cc002731', 'cc002962', 'cc002317', 'cc003459', 'cc002593', 'cc001396', 'cc002702', 'cc005239'); // Check user roles to hide “Ship to a different address” foreach( $user_roles as $user_role ) { if ( current_user_can( sanitize_title( $user_role ) ) ) { add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false'); break; // loop stop } } }
Forum: Plugins
In reply to: [WooCommerce] Multiple logins for single accountI never received a confirmation email as the only support is through woocommerce’s website, I did submit another ticket yesterday and again did not receive a confirmation email.
Forum: Plugins
In reply to: [WooCommerce] Multiple logins for single accountThank you for your response, I did purchase this and had an issue which I did contact the support team for but never received a reply unfortunately which has put me off this plugin now.
Forum: Plugins
In reply to: [WooCommerce] Hide Cart Button Only for non logged in usersJust to let everyone know that my original code was working however something in my theme was blocking it so added the !important string and all working
/** Hides the add to cart button on the shop/category pages for all visitors */ .add_to_cart_button { display: none !important; } /** Returns the add to cart button on the shop/category pages for logged in visitors */ .logged-in .add_to_cart_button { display: inline-block !important; } /** Hides the add to cart button on the single product pages for all visitors */ .single_add_to_cart_button { display: none !important; } /** Returns the add to cart button on the single product pages for logged in visitors */ .logged-in .single_add_to_cart_button { display: inline-block !important; }
Forum: Plugins
In reply to: [WooCommerce] Product Archive Title & Price on Same LineThank you for the help, it is much appreciated and actually worked very well, I just had to add a max width to it and all is solved.
.woocommerce-loop-product__title {
float: left;
max-width: 80%;
}
.woocommerce-loop-product__title + .price {
float: right;
max-width: 20%;
}Forum: Plugins
In reply to: [WooCommerce] Product Archive Title & Price on Same LineHi,
Please see the link for an image
https://ibb.co/yXZ4sYrForum: Plugins
In reply to: [WooCommerce] Excluding the Shop Sidebar from specific woocommerce categoriesThank you for your reply, I have used this widget however its not exactly what I wanted. I am looking to remove the shop sidebar completely from specific categories not the widget within the sidebar.
Regards
Chris.Forum: Networking WordPress
In reply to: Multisite redirect www to non wwwYes, its set up correctly without the www.
Forum: Plugins
In reply to: [WooCommerce] Convert Variable Product to Simple Product.Thats is what i thought jut wanted to check if there was an automated solution.
Thanks for the reply.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product SamplesHi Amanda,
Thanks for the reply, I have looked into this however i believe you would have to create individual products for this, i am looking to have a button on the product page itself.
Thanks
Chris.Forum: Plugins
In reply to: [WooCommerce] Store with 3 Pricing OptionsHi,
Have you looked into Yith Role Based prices, i have this on one of my sites and it works good for different levels of trade account and its very easy to use.
This said the pricing is set via percentages which i suppose would make this easy.
Chris.
- This reply was modified 6 years, 8 months ago by oakwoodmedia.
Forum: Plugins
In reply to: [WooCommerce] Surcharge from product typeNot exactly that, I had a “Request Sample” button placed on specific product pages, this button uses the current product and adds a “sample” product type and removes the cost.
What i have had to do temporarily is copy all the products and move them into a sample category, i have placed a maximum limit of 5 items from this category and with the code above i have added a sample surcharge of £5 so if a product from [category sample] is in the cart charge £5 surcharge.
The method i have used is not ideal as i would rather the sample button be placed on each product page i offer a sample for.