How to display WooCommerce product tag names on home and category pages

I think get_the_tag_list is only used for the default WordPress tags. WooCommerce product tags are a custom taxonomy called product_tag. Therefore you cannot use this function to return these tags. (anyone please correct me if I am wrong here) Instead you could use the WordPress get_the_terms() function, to get a “similar” result. Bare bones: // … Read more

how to scrolling image on single product page

You simply need to set a height of the containing element that contain the image. And then set that element in css to overflow-y: scroll in the css. Just basic. Then your image will be shown using scroll.. More specifically for woocommerce .. you can set this css to your style.css .product-images{overflow-y:scroll; background:url(yourimageurl) no-repeat; width:widthof … Read more

I want hide view more button if price is blank

Instead of eliminating the loop/add-to-cart.php template all together, why not hook into the price html Woocommerce hooks? /* * Remove price HTML if stock is null * * Sources: * http://woocommerce.wp-a2z.org/oik_api/wc_productget_stock_quantity/ */ add_filter( “woocommerce_get_price_html”, “wphelpsanjay_remove_price_if_no_stock”, 10, 2 ); add_filter( “woocommerce_variable_price_html”, “wphelpsanjay_remove_price_if_no_stock”, 10, 2 ); function wphelpsanjay_remove_price_if_no_stock( $price, $product ) { if ( null === $product->get_stock_quantity()) … Read more

Woocomerce pulling wrong time from server -5 hrs difference

For the date Woocommerce CODE function wc_string_to_datetime( $time_string ) { // Strings are defined in local WP timezone. Convert to UTC. if ( 1 === preg_match( ‘/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|((-|\+)\d{2}:\d{2}))$/’, $time_string, $date_bits ) ) { $offset = ! empty( $date_bits[7] ) ? iso8601_timezone_to_offset( $date_bits[7] ) : wc_timezone_offset(); $timestamp = gmmktime( $date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1] ) – … Read more

How can I override wp_price woocommerce function in my theme

Hmm how about this? function return_custom_price($price, $product) { global $post, $blog_id; $price = get_post_meta($post->ID, ‘_regular_price’); $post_id = $post->ID; $price = ($price[0]*2.5); return $price; } add_filter(‘woocommerce_get_price’, ‘return_custom_price’, 10, 2); Taken from here:https://sceptermarketing.com/how-to-change-the-woocommerce-price-via-functions-php/

Add to cart – button should be disabled

This behavior is being applied by your theme’s javascript. There’s a global variable being set in the head of the page by the theme: <script type=”text/javascript”> /* <![CDATA[ */ var edgeGlobalVars = {“vars”:{“edgeAddForAdminBar”:0,”edgeElementAppearAmount”:-100,”edgeAddingToCartLabel”:”Adding to Cart…”,”edgeTopBarHeight”:0,”edgeStickyHeaderHeight”:0,”edgeStickyHeaderTransparencyHeight”:60,”edgeLogoAreaHeight”:0,”edgeMenuAreaHeight”:96,”edgeMobileHeaderHeight”:60}}; var edgePerPageVars = {“vars”:{“edgeStickyScrollAmount”:0,”edgeHeaderTransparencyHeight”:0}}; /* ]]> */ </script> and a call to a minified/aggregate compiled theme js file: <script type=”text/javascript” … Read more

override the default WooCommerce products search form

Exists the template product-searchform.php, you have to override it in your theme. More information here about how to override WooCommerce templates from your theme. Basically the WooCommerce search forms returns only products and not also other post types because the product post type is specified in an hidden input: <input type=”hidden” name=”post_type” value=”product” />

how to change the “return to shop” button text? [closed]

If you browse the source code of the plugin, you’ll see “return to shop” is used three times in: includes/class-we-checkout.php:956 includes/class-wc-ajax.php:257 templates/car/cart-empty.php:33 for the first two, the classes – there’s no hooks or filters to change that text. There’s no function that conjurors that text either. It is, as it is. However, you can do … Read more