Want to Remove Woocommerce Shipping in checkout Page [duplicate] - wordpress

This question already has answers here:
How can I remove Shipping from a WooCommerce cart? [closed]
(2 answers)
Shipping methods only enabled in checkout page on Woocommerce
(1 answer)
Closed 2 years ago.
Want to Remove Woocommerce Shipping in checkout Page
I have attacked an Image Please check it
https://prnt.sc/waue9w

You can use the following code to remove shipping in checkout page:
function disable_shipping_calc_on_cart( $show_shipping ) {
if (is_checkout()){
return false;
}
return $show_shipping;
}
add_filter( 'woocommerce_cart_ready_to_calc_shipping', 'disable_shipping_calc_on_cart', 99 );

Related

Is there any hook available in woocommerce to add additional line items in admin order details section [duplicate]

This question already has answers here:
Add extra details Woocommerce order edit pages in admin
(2 answers)
Closed 11 months ago.
I am saving some extra products to order meta during checkout and I want to show those products into woocommerce admin order details section and it need to look like regular products.
I am looking for any woocommerce hooks available to acheive this task without customization woocommerce core file.
I'm not sure I totally understand but is this what you mean?:
add_action( 'woocommerce_after_order_itemmeta', 'custom_info_after_order_itemmeta', 20, 3 );
function custom_info_after_order_itemmeta( $item_id, $item, $product ) {
//echo stuff here
}

Add dimensions under product title product overview Woocommerce [duplicate]

This question already has an answer here:
Display ACF field/image below the product title in WooCommerce archive pages
(1 answer)
Closed last year.
For the website that i'am building i try to get the dimensions of the product directly under the product title on the overview.
Here i want the dimensions
in ACF i made a field called 'productkaart_afmetingen' were i can fill in the dimensions data at every product. But i can't manage to load it in under the product title.
i tried adding
the_field('productkaart_afmetingen');
to the content-product.php in my child theme folder but this made the dimensions appear above the title and i can't manage to get is under the title
Code goes in functions.php
add_action( 'woocommerce_product_thumbnails', 'display_acf_field_under_images', 30 );
  
function display_acf_field_under_images() {
  echo '<b>ACF Field:</b> ' . get_field('productkaart_afmetingen');
  // Note: 'productkaart_afmetingen' is the slug of the ACF
}

Wordpress post date hook [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I still can't get my head around hooks but I assume a hook might do what I need.
Currently using WP Show Posts to short code into a home page, that uses WPBakery as the page builder.
WP Show Posts can pull in post header, date, excerpt and button link.
I want to hook the date (post publish date) to the post Advanced Custom Field i.e. event date. this is the development site https://dev.itassetalliance.com/
Webinars category post. changing default wordpress the_date() to
Yes you should be able to use get_the_date filter, more here. Below is a quick example of how you might do this:
<?php
// hook into get_the_date filter
add_filter('get_the_date', function ($post_date) {
// get event date
$event_date = get_field('event_date');
// may need to use some other check here
// but this if we have $event_date return
// it in place of the default post date
if ($event_date) {
return $event_date;
}
// if we did not return an event date
// then return the default date
return $post_date;
});
?>

How can I remove full cart feature from Woocommerce? [duplicate]

This question already has answers here:
Only one currently added product into Woocommerce cart?
(2 answers)
WooCommerce - Skip cart page redirecting to checkout page
(1 answer)
Closed 4 years ago.
I am trying to remove the full cart feature from WooCommerce. I want when some one click on the buy now button they should go directly to the checkout page.
** I have tried few plugins but those don't remove the full cart feature. They just redirect to the checkout page.
** So with the plugins my problem was if someone leave from the checkout page and try to buy the same product or an another product the previous product was in the cart. and in the checkout page there was 2 products.
Can someone tell me how can i remove the full cart feature from the woo-commerce? Is it possible?
So if you want to always have only one item in your cart you add this to your functions.php
add_filter( 'woocommerce_add_to_cart_validation', 'remove_cart_item_before_add_to_cart', 20, 3 );
function remove_cart_item_before_add_to_cart( $passed, $product_id, $quantity ) {
if( ! WC()->cart->is_empty())
WC()->cart->empty_cart();
return $passed;
}
It will empty your cart before adding the new item to it. And you can keep your plugin that is redirecting you to checkout or code it in php probably with something like that :
add_action( 'template_redirect', 'redirect_cart_to_checkout' );
function redirect_cart_to_checkout() {
if( is_cart()){
wp_redirect(wc_get_checkout_url());
die;
}
}

Wordpress Woocommerce shop page [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need help adding VIEW and ADD button into my Woocommerce Shop page. Do you have any plugins or codes that I can add into my functions.php?
You can try this code to add add to cart and view button in shop page
//// to add cart buttton
function add_cart_to_shop () {
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10 );
}
add_action( 'after_setup_theme', 'add_cart_to_shop' );
//// to add view buttton
function add_view_to_shop() {
echo 'View';
}
add_action( 'woocommerce_after_shop_loop_item', 'add_view_to_shop', 8 );
Try this then let me know the result.
You need css code to design it yourself.
Thanks

Resources