Disable Snippet on mobile devices
-
Hi,
I am running a snippet that adds a product table to the single product page in woocommerce (see link to product), however I would like to disbale this snippet when viewing the single products on a mobile device and reverts back to the standard woocommerce add to cart button, is this possible?
Thanks in advance
The snippet I am using is this
function barn2media_product_table_after_short_desc($short_description) { global $product; if (!is_single() || !is_callable(array($product, 'get_id'))) { return $short_description; } $product_id = $product->get_id(); $shortcode = "[product_table include='{$product_id}' variations='separate' lazy_load='false' columns='sku,name,price,add-to-cart' description_length='15' column_breakpoints='default, desktop, all, default' cart_button='checkbox' show_quantity='true' links='none' page_length='false' search_box='false' reset_button='false' totals='false' ]"; return $short_description . $shortcode; } add_filter( 'woocommerce_short_description', 'barn2media_product_table_after_short_desc', 1 );
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Disable Snippet on mobile devices’ is closed to new replies.