kartikparmar
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Show Title at every descriptionYou can place below code snippet in your currently active theme’s functions.php file.
Code Snippet:
function my_the_content_filter( $content ) { if ( get_post_type() == "product" ) { wc_get_template( 'single-product/title.php' ); /*// OR $title = "<h2>". get_the_title() . "</h2>"; $content = $title.$content;*/ } return $content; } add_filter( 'the_content', 'my_the_content_filter', 10, 1 );
Please let me know if the above code snippet fulfilled your requirements or not.
You can check details on https://github.com/woocommerce/woocommerce/pull/19794 merge.
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Woocommerce Bookings – Date and start timeHi @ludogap
You can use get_booking_ids_from_order_id OR get_booking_ids_from_order_item_id functions to get the booking ids.
Functions are in the class-wc-booking-data-store.php file and the file is located at below path.
e.g $booking_ids = WC_Booking_Data_Store::get_booking_ids_from_order_id( $order_id );
Path: /plugins/woocommerce-bookings/includes/data-stores/<HERE>Using the above two functions you will get booking ids. Loop through those booking ids and use the get_wc_booking function to get the instance of the Booking. This function is in the wc-bookings-functions.php file and the same file is located at below path.
e.g
foreach( $booking_ids as $booking_id ){
$booking = get_wc_booking( $booking_id );
}
Path: /plugins/woocommerce-bookings/includes/<HERE>Inside the above loop, you can use the get_start_date and get_end_date function to get the booking data.
e.g
foreach( $booking_ids as $booking_id ){
$booking = get_wc_booking( $booking_id );
$start_date = $booking->get_start_date();
$end_date = $booking->get_end_date();
}Feel free to let me know if that above provided information was helpful to you or not.
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Warning: Invalid argument supplied for foreach()Hi @creativealvi,
The error is related to ‘Sell to specific countries’ option shown in the below screenshot. Can you please check what is the value for this field?
https://prnt.sc/luxyu9Regards,
Kartik ParmarHi @samengland,
Thank you for sharing the screenshot.
You can copy below code snippet and paste it in your currently active theme’s functions.php file to remove “Completed” and “Cancelled” filters from Orders page of WooCommerce for users who doesn’t have manage_options privileges.
Code Snippet:
add_filter( 'views_edit-shop_order', function( $views ) { if( current_user_can( 'manage_options' ) ) return $views; $remove_views = [ 'wc-completed','wc-cancelled' ]; // foreach( (array) $remove_views as $view ) { if( isset( $views[$view] ) ) unset( $views[$view] ); } return $views; } );
Please let me know if that works for you or not.
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Add quantity field in product pageHi @brayan1145,
Thank you for sharing the screenshots.
The theme which you are using is not allowing to add Quantity Selector on the WooCommerce Product page. I am not sure why. Maybe you can ask the Theme Author because they are the best person who can give you the optimal answer.
But if you want to have Quantity Selector on WooCommerce Product page then you can add below code in your currently active theme’s functions.php file.
Code Snippet:
add_filter( "woocommerce_is_sold_individually" , "woocommerce_is_sold_individually_callback", 20, 2 ); function woocommerce_is_sold_individually_callback( $status, $product ){ if ( $product->get_sold_individually() ){ return true; } return false; }
Screenshot: https://prnt.sc/lux3ue
Please let me know if that works for you or not.
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Adding Note to CustomerHi @mayank29gupta,
Yes, if you are adding Order note with ‘Note to customer’ option then the customer will get notified through email about the added note.
Email notification sent to customer: https://prnt.sc/luwcp8Also, on My Account page, the same order note will be displayed in that particular order.
Screenshot: https://prnt.sc/luwfnlRegards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Stock set to 0 not Out of StockHi @bengrech,
Can you please share the screenshots or capture video to replicate this? Because I am unable to replicate the same at my end.
Please see this screenshot: https://prnt.sc/luw97tWP Version: 5.0.1
WC Version: 3.5.2
Active Theme: StorefrontRegards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] hiding prices for non-logged in usersHi @dfcdev
The same code is working fine for me. I am using v3.5.2 of WooCommerce and Storefront theme. If you are using theme other than Storefront or default WordPress theme then try switching your theme to see if that helps to find the cause.
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Looking for the right hookHi,
You might be echoing something hence it is showing the top of the cart table. Please try the below code.
add_action( "woocommerce_after_cart_contents", "woocommerce_after_cart_contents_callback" ); function woocommerce_after_cart_contents_callback() { ?><tr><td>Your text goes here</td></tr><?php }
Regards,
Kartik ParmarForum: Plugins
In reply to: [WooCommerce] Custom Order 50+ Attributes WoocommerceHi @mattsws,
Can you please let me know that you want to show 50 orders per page? If yes, then you can set value to ‘Number of items per page’ option in the Screen Options of the Orders page.
Please let me know if I have misunderstood your requirement.
Regards,
KartikForum: Plugins
In reply to: [WooCommerce] Products in Cart have no linksHi There,
Thanks for sharing the site URL.
Kindly share the product link which will allow adding it to the cart. I visited some of the products but all were redirecting to some other page.
Can you please switch to default WordPress theme and check if the the same issue still persists on your website? Please let me know the result.
Regards,
KartikForum: Plugins
In reply to: [WooCommerce] Draft product checkout issueHi there,
You can use ‘woocommerce_check_cart_items’ hook for cart page check and ‘woocommerce_before_checkout_process’ hook for
checkour page check and write a common function which loops on items to check for the product status. If it’s status is draft then remove that product from cart.
Function: WC()->cart->remove_cart_item($cart_item_key);Please let me know if you need any further information.
Forum: Plugins
In reply to: [WooCommerce] Ajax on single product pageHi There,
Goto WooCommerce-> Settings-> Products-> ‘Enable AJAX add to cart buttons on archives’ option will do the job.