Today i’m sharing with you some useful codes for creating WooCommerce orders at backend side, via your own code.
Let’s get started:
Continue reading “Some Useful Codes on Programmatically Creating New Order in Woocommerce”Today i’m sharing with you some useful codes for creating WooCommerce orders at backend side, via your own code.
Let’s get started:
Continue reading “Some Useful Codes on Programmatically Creating New Order in Woocommerce”wp_remote_get() and wp_remote_post() functions helps us to fetch data from external source: grabbing websites, getting data from public sources, API’s etc.
Sometimes using default headers causes suspect at external side. Too often requests can cause asking a captcha, or blocking your IP.
To escape from such problems we need to insert real visitor like user agents to our requests. And not only one, but randomly chosen ones.
Here is sample code for WordPress
Continue reading “Random user agents for WordPress Remote Requests”
Most WooCommerce store owners just ignores their website’s search section and lose a lot of potential customers due to this. That’s why they keep their theme’s poor search module unchanged. Or in best case they use simple live ajax search, which is not much effective and which is really slow.(in each simple typing a website sends request to server, then server processes the query and returns the needed results)
But E-Commerce search module should be fast, smart, effective and interactive. It should be some kind of bot-assistant which offers your products to customers with all possible ways. It doesn’t matter what they types – search module should recognize their typed words, analyize it, correct it if there is any misspelling and finally suggest related products.
Even if there is no any related product, it should offer some popular items in website – may be a visitor would like to purchase.
WooCommerce Search Box plugin does exactly so. It has unique search algorythm which works at both front-end and backend sides.
When user types something – related products appear lightning fast, without ajax server request. Everything works so fast.
And then, if the visitor makes a typo misspelling, the plugin recognizes it with similarity algorithm and gives the results for auto-corrected keyword.
What happens when a visitor presses enter and leaves the window with live search suggestions. Backend search results comes from theme’s backend code, that’s why it is not smart and it can not show same smart results which was available in live suggestions box. And that would be bad. That’s why WooCommerce Search Box filters backend results with WordPress hooks and forces website to show same smart results with live suggestions box, which is really great.
Or what if a visitor types synonym word instead of the one in product name? (for example, a visitor can type bike instead of bicycle.) You see, there are so many cases where we lose potential customers and their purchases via poor search results. That’s why e-commerce search module should be as much better as it is possible.
2 days ago we, Totheme Labs team released new plugin for WooCommerce, called “Recently Viewed Products for WooCommerce”.
It is beautiful product history plugin for WooCommerce. Shop owner can create separated page, widget, footer popups to display this data to his customers.
Once it is activated, it collects the customer visit data, and shows his history as beautiful charts.
The solution would be useful for shop owners who want to increase sales at their WooCommerce Store.
For example, Amazon.com has been successfully used similar module in the latest several years.
So if you are WooCommerce shop owner, you can easily get similar solution for your web store.
As we know WordPress 4.7 was released at 6th December, 2016.
In official website they listed all news and changes in the new version.
I would like to list the most important ones for developer side:
That’s all new important changes for me.
May be the title sounds a little contradictious, as WordPress nonces are not storable data, so they don’t need to be expired. They are just hashed functions which are used for anti-CSRF purposes.
But for some special cases we may need to make nonce “to be expired”.
I mean, at first request it should work, after second request it should return false. Or it should work this day, since tomorrow it should return invalid.
This operation smells anti-bruteforce attempt, rather than anti-CSRF. Because anti-CSRF technology doesn’t have any relation with time and expiration.
So, our aim is to create a form which works only one time or temporary. This solution may be useful when we do ajax requests which should run only at once via setTimeout. So after
Let’s do that. (i write sample for ajax nonces. But same method can be used with input, url nonces too.)
Usually WooCommerce themes have their own search forms, from simple “input-submit” to advanced “input-filter1-filter2-…-checkbox1-submit” ones.
But sometimes shop owners meet a such problem: Their search form takes the visitor to WP search results page instead of WooCommerce rich search result one.
What is the difference between these two results page?
WP Search results page is simple – it shows all results (in most cases its UI has simple bloggy style, and yeah, bloggy view in WooCommerce search is not suitable UI)
WooCommerce Search Results page is more complitated – Usually it has a product category, parameter filter at sidebar, and its UI is not bloggy, it has normal grid which is important for product view.
Why does it happen? It happens only when there is missing post_type parameter in url.
When search form submit takes you to shopsite.com/?s=productname it will show you default WP search view. When search form submit takes you to shopsite.com/?s=productname&post_type=product it will show you correct UI. Normal shop search results page.
So we just need to add missing parameter to search forms, and everything will be ok.
To add this we need very simple script at the footer.
P.S. You may also want to have smart search suggestion box to the WooCommerce with this plugin.