If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
March 6, 2012 at 12:14 am #9999
1)I need to place Product Search button into header, instead of whole Site Search button.
I tried to change a search form directly in the theme file by copying the formula from Product Search Woocomerce widget it seems to work ok. The problem is that when i type a product name that i want to find, this whole list scrolls down and it doesn’t look very nice ( it looks kind of rough). As much as i read your posts i figured i propably need some styling i tried few but it’s not working. Is that right ? Or maybe i put wrong formula in searchform file ? Can You please suggest something that could resolve that ?
2) And a different problem that i’ve got is with products price. I managed to change a color of all prices but the amount doesn’t show figures after decimal point.
for an exaple:
Instead of : 60,65 PLN (Polish currency) it shows only round number of 65,00 PLN evanthough i set Number of decimals for 2
When i trim zeroes in woocommerce settings it just comes as 65 PLN, evanthough i set every product price, while adding it, correctly
Thanks and i hope it doeasn’t cause You much trouble :)March 8, 2012 at 3:29 pm #66533
1.) Can you post a link to your site and enable the search fnctioanlliy so we can try it for ourselfs?
2.) I am afraid I am not sure why this happens. you might want to consider contacting the woocommerce team directly and try to get some information on this :) http://www.woothemes.com/support-forum/?viewforum=150
KriesiMarch 8, 2012 at 3:55 pm #66534
alante, regarding your second point – I had a similar problem some time ago. If I remember it right, it was because of a logical glitch in WooCommerce.
The prices are shown on the website in the correct format that is defined in the WooC settings (e.g. using a comma for decimals), but you still have to enter the price in US format with a dot before the decimals in the backend. If you use a comma there, price is shown as zero OR decimals are just cut off, as you experienced it.
Try entering the prices for your products in 19.99 format instead of 19,99 – maybe they still have that glitch in the current release…
MartinMarch 8, 2012 at 8:08 pm #66535
1) The problem resolved itself, i was working on my localhost sever before and somehow it determined this rough look. As soon as I paste and uploaded the formula code to my original web page sever it started working perfectly. So in future to all users if you want change a searchform in header button called Search Site find the abundance theme catalog by going to : wp-content/themes/abundance/searchform.php and change code for search form. This is code that I copied from Woocommerce Search Product widget :
<form action=”<?php echo home_url( ‘/’ ); ?>” id=”searchform” method=”get”>
<label class=”screen-reader-text” for=”s”><?php _e(‘Search for:’, ‘woocommerce’); ?></label>
<input type=”text” value=”<?php the_search_query(); ?>” name=”s” id=”s” placeholder=”<?php _e(‘Search for products’, ‘woocommerce’); ?>” />
<input type=”submit” id=”searchsubmit” value=”<?php _e(‘Search’, ‘woocommerce’); ?>” />
<input type=”hidden” name=”post_type” value=”product” />
</form><!– end searchform–>
It let the visitor find a pruduct instead of wordpress posts. You can see the result over here: http://cafe.coco.net.pl/?s=vergnano+&post_type=product
Now I’m satified with that result so please don’t trouable with changeing that. The only suggestion that i would make is to try finding a formula wich woud search for products and product categories – maybe few sites would benefit from that knoledge.
2) Dear Martin from WaldWort digital publishing,
Thank You vary much for Your help. You were right!! By typing an original product price with a “.” instead of “,” shows full price perfectly :)
Thanks againMarch 9, 2012 at 2:45 pm #66536
I think the best solution is to use an additional plugin. I’d install Relevanssi, then activate it and go to Settings > Relevanssi. Deselect all post types except the products post type and create the search index. You don’t need to modify searchform.php in this case :)March 12, 2012 at 10:03 pm #66537March 13, 2012 at 8:10 am #66538
The topic ‘Product Search into Header’ is closed to new replies.