Home › Forums › WoodMart support forum › Issue with ERP connection and attributes
Issue with ERP connection and attributes
- This topic has 7 replies, 2 voices, and was last updated 3 years, 5 months ago by
Artem Temos.
-
AuthorPosts
-
September 10, 2021 at 1:18 pm #317729
Global TouchParticipantHello woodmart,
I have an issue with synchronizing from ERP to woocommerce. ERP send a post for attributes and is like this:
{
“attributes”: [
{
“id”: 2,
“option”: “Πράσινο”
}
],
“regular_price”: “6.6”,
“stock_quantity”: “5”,
“stock_status”: “instock”,
“manage_stock”: true,
“weight”: “1000.0000”,
“sale_price”: “”,
“on_sale”: “false”
}The system doesn’t display any error but it doesn’t work.
I have already add this snippet which have seen from your forum to functions.php, but nothing changed:
add_action( ‘woocommerce_attribute_updated’, ‘woodmart_wc_attribute_update’, 20, 3);
function woodmart_wc_attribute_update( $attribute_id, $attribute, $old_attribute_name ) {
update_option( ‘woodmart_pa_’ . $attribute[‘attribute_name’] . ‘_swatch_size’, $_POST[‘attribute_swatch_size’] );
update_option( ‘woodmart_pa_’ . $attribute[‘attribute_name’] . ‘_show_on_product’, $_POST[‘attribute_show_on_product’] );// Change value of selected option
if( function_exists( ‘woodmart_admin_scripts_localize’ ) )
woodmart_admin_scripts_localize();
}Please help,
Thanks in advanceSeptember 10, 2021 at 1:43 pm #317734
Artem TemosKeymasterHello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not?
Regards
September 13, 2021 at 7:13 am #318090
Global TouchParticipantHello,
We deactivated woodmart theme, but he still have issue.
He had the same issue before adding the code in function.php for attributes. When we add it was OK for 1 day, but then we have problem again!
What can we do?
September 14, 2021 at 6:01 am #318342
Artem TemosKeymasterHi,
Please, describe to us your problems in a bit more detail. Attach some screenshots and provide us with a list of steps on how to reproduce them on your website. We need to be able to check this problem ourselves.
Thank you in advance.
September 14, 2021 at 7:53 am #318394
Global TouchParticipantHello again and thank you for your quick response.
So, we can’t reproduce the problem because a colleague of ERP Platform make these POSTS.
I have one POST from our website logs, when he tries to add one attribute to a product ->
POST /wp-json/wc/v3/products/53506/variations/53507?consumer_key=ck_0c4eb377610c09944d8cc4a91539506acad012e5&consumer_secret=cs_1d2cd5a32f3b0cdf97e11887ba6c74308ce704fc&per_page=100&page=1 HTTP/1.0They have issue when they try to add attributes from ERP, maybe synchronization problem.
Check and function.php, I have add a code from your forum of issue with attributes and ERP sync.
It works, but only for 1 day!I am going to provide you credentials to login, maybe helps!
September 14, 2021 at 8:25 am #318410
Artem TemosKeymasterHello,
To check this problem we need to be able to send such API requests ourselves. Please, ask your colleague to provide all the instructions about how to send this request. We can perform it even without ERP system.
Kind Regards
September 14, 2021 at 8:43 am #318418
Global TouchParticipantHello,
and this:
{
“attributes”: [
{
“id”: 2,
“option”: “Πράσινο”
}
],
“regular_price”: “6.6”,
“stock_quantity”: “5”,
“stock_status”: “instock”,
“manage_stock”: true,
“weight”: “1000.0000”,
“sale_price”: “”,
“on_sale”: “false”
}September 14, 2021 at 9:12 am #318428
Artem TemosKeymasterWe have tested this request and it returns a valid response. Here is a screenshot https://gyazo.com/6644419631510142dfdcb74463fb90a0
What exactly is wrong with that? Please, compare responses between our theme and default WordPress theme and specify the difference so we can understand the issue. -
AuthorPosts
- You must be logged in to create new topics. Login / Register