المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : ووردبريس WordPress ووكومرس WooCommerce ازالة رابط Remove product description Link



Rise Company
20-04-2021, 04:52
ووردبريس WordPress ووكومرس WooCommerce ازالة رابط Remove product description Link
woocommerce remove product details link - Prevent clickable image in product page
skip the single product page - disable the single product page in WooCommerce?
plugins to hide or disable the WooCommerce product page
hide/disable single product page

https://www.rise.company/upload/uploads/162009990574761.png

هذا الكود هيزيل رابط الدخول على تفاصيل المنتج من على الصورة و عنوان الصورة و من اى ماكن اخر


// Remove links from thumbnails
add_action( 'init', function() {

// Woo core hooks
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );

// Theme hooks
remove_action( 'wpex_woocommerce_loop_thumbnail_before', 'woocommerce_template_loop_product_link_open', 0 );
remove_action( 'wpex_woocommerce_loop_thumbnail_after', 'woocommerce_template_loop_product_link_close', 11 );

} );

// Custom heading output
if ( ! function_exists( 'woocommerce_template_loop_product_title' ) ) {
function woocommerce_template_loop_product_title() {
echo '<h2 class="woocommerce-loop-product__title">' . get_the_title() . '</h2>';
}
}

---------------------------------------------
طريقة اخرى من خلال css ناجحة
---------------------------------------------
Try this to remove the link to the product page except the Add to cart button:


body.archive .woocommerce-loop-product__link {
pointer-events: none;
cursor: default;
}
Try this instead to remove the link to the entire product box (also to the Add to Cart button):


body.archive ul.products li {
pointer-events: none;
cursor: default;
}


المرجع:
https://stackoverflow.com/questions/66929017/removing-woocommerce-product-link-single-product-page
https://wpexplorer-themes.com/total/snippets/remove-woo-entry-links (https://wpexplorer-themes.com/total/snippets/remove-woo-entry-links/)

Rise Company
05-05-2021, 18:23
to remove product page links you can use this:




remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );