tkorsa
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseNo problem and good luck!
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseNo problem at all.
I’m not that experienced with .NET but so I’ll have to leave that to someone else. I guess you would be using HttpClient with the WebAPI client libraries and post the product data thru “PostAsJsonAsync”. Any .NET rockstars here?
As for your dealer he/she or you could..
A.
Write a script that receives the JSON data from you and update the product. Check this SO answer on creating a product with code. It should get you going. But please please please don’t forget to add security and validation.B.
Wait for the 2.2 release which should be around the corner. The milestone is 96% complete and the code for the products API is merged.I would wait for the 2.2 release since you get the security and don’t need to write the script for the dealer store yourself.
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseI [quack]ed up..
I totally missed that the endpoint “edit_product” in the new REST API is not implemented until WooCommerce 2.2. Let me come up with another solution for you.
I hate giving bad suggestions, my friday is yours.
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseOk, here we go. You can use the new REST API.
What your dealer must do
- Enable the REST API in the WooCommerce settings.
- Create a new user for you.
- Generate API keys (Read/Write) in the user profile for that user.
That’s pretty much it for the dealer side.
What you must do
I can’t give you any specific details since I don’t know what platform you are running. But the steps are pretty much the same on any platform.- Find the most logical way to send a REST request when a product is updated.
- Write code that collects the new product data and send it to the REST API.
And that’s pretty much it for you.
The most logical way to send the request depends on the platform and the code behind. If you would be using WordPress you could add a hook and send the request with AJAX to your custom script when updating the product.
Another way could be a button in the products list. When clicking on the button it fires an AJAX request to you custom script.
Your custom script should get the product data (based on product id) from your database, process it, and then send it to your dealers REST API.
If you’re running a PHP based store you should take a look at the REST client for WooCommerce by Gerhard Potgieter. It’s missing the end point you need (edit_product) but the base is there and it’s a good starting point.
What platform are you running?
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseCool, i’ll write an answer in an hour, give or take. I have an interview with a new front end developer now, oh yes, he will be in pain. ??
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseHi,
Do your dealer have WooCommerce 2.1?
Forum: Plugins
In reply to: [WooCommerce] Order Form CustomizationIt depends on what you want to do. Check this link, https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Product shordcode alignementHi,
Do you have a link to the site? It’s pretty hard to “imagine” how the layout is.
https://www.bootply.com/W62WRahTly , is it something like this?
Forum: Plugins
In reply to: [WooCommerce] synchronize external database with woocommerce databaseHey,
I think you need to clarify you question a bit.
A. You have a WooCommerce store and when you update a product several other stores(your dealers) should update also.
B. You have a store and when you update a product several other WooCommerce stores(your dealers) should update also.
What I want to know is that if you have a WooCommerce store or if your dealers have WooCommerce stores.
If A..
Since you have a “big market” i’m guessing you have alot of products. Letting your dealers “pull” your store with a cron job to check if any product is updated is a bad idea. I guess the only option is that your store pushes the new data to your dealers when you’re updating a product.This requires that your dealers have a script on their server that can receive the data and process it.
- You’re updating a product in your own WooCommerce store.
- An update hook posts the new data to a script on your dealers servers.
- Your dealers process the data (database update).
If B..
Pretty much the same thing except that since WooCommerce 2.1 there’s an API available for you to work with. If your dealers have WooCommerce stores you can push the new data thru the API of each store.- You’re updating a product in your own store.
- When saving, your store pushes the data to all the WooCommerce stores thru the API.
Cheers!
Forum: Plugins
In reply to: [WooCommerce] Hide main product description field in adminAdd this to your functions.php
function remove_product_editor() { remove_post_type_support( 'product', 'editor' ); } add_action( 'init', 'remove_product_editor' );