<?php $loop = new WP_Query( array( 'post_type' => 'NAME_OF_THE_POST_TYPE', 'posts_per_page' => 100 ) ); ?>
<ul>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title( '<li><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></li>' ); ?>
<?php endwhile; ?>
</ul>
<?php $loop = new WP_Query( array( 'post_type' => 'product', 'posts_per_page' => 100 ) ); ?>
<ul>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title( '<li><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></li>' ); ?>
<?php endwhile; ?>
</ul>
How To Allow Users To Remove Products On Checkout Page in WooCommerce
/**
* Allows to remove products in checkout page.
*
* @param string $product_name
* @param array $cart_item
* @param string $cart_item_key
* @return string
*/
function lionplugins_woocommerce_checkout_remove_item( $product_name, $cart_item, $cart_item_key ) {
if ( is_checkout() ) {
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
$product_id = apply_filters( 'woocommerce_cart_item_product_id', $cart_item['product_id'], $cart_item, $cart_item_key );
$remove_link = apply_filters( 'woocommerce_cart_item_remove_link', sprintf(
'<a href="%s" class="remove" aria-label="%s" data-product_id="%s" data-product_sku="%s">×</a>',
esc_url( WC()->cart->get_remove_url( $cart_item_key ) ),
__( 'Remove this item', 'woocommerce' ),
esc_attr( $product_id ),
esc_attr( $_product->get_sku() )
), $cart_item_key );
return '<span>' . $remove_link . '</span> <span>' . $product_name . '</span>';
}
return $product_name;
}
add_filter( 'woocommerce_cart_item_name', 'lionplugins_woocommerce_checkout_remove_item', 10, 3 );
Fuente: https://lionplugins.com/blog/remove-products-checkout-page/
Desinstalar y remover datos Woocommerce
How to Uninstall and completely remove WooCommerce
- Open your WordPress install’s
wp-config.php
file - Right before where it says “* That’s all, stop editing! Happy blogging. */” insert a new line, and add the following code
define ('WC_REMOVE_ALL_DATA', true);
– then save your file; - Deactivate WooCommerce at WP-admin > plugins
- Delete WooCommerce at WP-admin > plugins
- That’s it!
define('WC_REMOVE_ALL_DATA', true);
Eliminar comentario litespeed cache
define( 'LSCACHE_ESI_SILENCE', true );
Nombre de categorías en Woocommerce
<?php
if( is_shop() ) {
echo '<h1 class="clase">Título para shop page</h1>';
} else {
echo '<h1 class="clase">' . get_the_archive_title() . '</h1>';
}
?>
Mostrando X de Y en archive Woocommerce
<?php
echo woocommerce_result_count();
?>
Cerrar sesión
<a href="<?php echo esc_url( wp_logout_url() ); ?>">Logout</a>
Comentarios recientes