Home Forums WoodMart support forum Issue with ERP connection and attributes

Issue with ERP connection and attributes

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #317729

    Global Touch
    Participant

    Hello woodmart,

    I have an issue with synchronizing from ERP to woocommerce. ERP send a post for attributes and is like this:

    https://greenmall.gr/wp-json/wc/v3/products/53506/variations/53507?consumer_key=ck_0c4eb377610c09944d8cc4a91539506acad012e5&consumer_secret=cs_1d2cd5a32f3b0cdf97e11887ba6c74308ce704fc&per_page=100&page=1

    {
    “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 advance

    #317734

    Artem Temos
    Keymaster

    Hello,

    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

    #318090

    Global Touch
    Participant

    Hello,

    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?

    #318342

    Artem Temos
    Keymaster

    Hi,

    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.

    #318394

    Global Touch
    Participant

    Hello 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.0

    They 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!

    #318410

    Artem Temos
    Keymaster

    Hello,

    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

    #318418

    Global Touch
    Participant

    Hello,

    they send us a json:
    https://greenmall.gr/wp-json/wc/v3/products/53506/variations/53507?consumer_key=ck_0c4eb377610c09944d8cc4a91539506acad012e5&consumer_secret=cs_1d2cd5a32f3b0cdf97e11887ba6c74308ce704fc&per_page=100&page=1

    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”
    }

    #318428

    Artem Temos
    Keymaster

    We 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.

Viewing 8 posts - 1 through 8 (of 8 total)