Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter adwjoe

    (@adwjoe)

    The latest release doesn’t appear to have updated the API. Nothing in the release log about that.

    2.5.2 – 2021.07.21

    Fix – Product and inventory data not being synced due to duplicate/orphaned product metadata in database. PR#625
    Fix – Bypass SSL verification when checking background job processing eligibility. PR#624
    Fix – Correctly apply taxes in the Order API request and report accurate percentages. PR#559

    Thread Starter adwjoe

    (@adwjoe)

    Hi,

    Is there any update on this? Is it something that will be done in the immediate future? With the security breach in WooCommerce that was reported recently I’m now concerned for security reasons too that this API is so old.

    I paused development on the site but will be resuming again in the coming weeks.

    Cheers,
    Joe

    Thread Starter adwjoe

    (@adwjoe)

    Hi,

    Thank you for the responses and discussion on this thread!

    I’ve been busy with other matters and haven’t progressed this any further than when posted.

    Just to post where I was at. The Square changelog is here. I was starting to go through the changelog to find if there were any breaking changes between v2019-08-14 as used currently by woocommerce-square and v2021-06-16 as desired to upgrade to.

    The Square composer page is here. I have PHP and Composer installed locally and ran the following:
    ? ~ composer require square/square

    This outputted:

    Updating dependencies (including require-dev)
    Package operations: 3 installs, 0 updates, 0 removals
      - Installing apimatic/jsonmapper (v2.0.2): Loading from cache
      - Installing apimatic/unirest-php (2.0.0): Loading from cache
      - Installing square/square (12.0.0.20210616): Loading from cache

    Square now seems to have a couple of dependencies in jsonmapper and unirest-php both within the apimatic folder. My next step was to copy these vendor folders into the woocommerce-square vendor folder and see what happened next.

    vendor/
    ..apimatic/
    ..square/

    The folder apimatic does not exist in the current vendor folder so would be an addition. The square folder would replace the existing square folder. I’m not sure how I would go about updating the composer classmap or any of the other composer files within vendor but I’m sure there’s a way to do it. I would just start comparing files and updating as seemed necessary.

    Or ideally this is updated by the devs before I get to it.

    As a request, would you please ask the devs if they could leave the composer.json file within the file structure at the next release? It’s only saving a few kbs by removing, but it would be much nicer for anyone like myself trying to update API’s when they are 2 years out of date to simply update the composer.json file than having to manually attempt all these steps.

    Hopefully will hear an update soon!

    Cheers,
    Joe

    Thread Starter adwjoe

    (@adwjoe)

    Hi Phil,

    I’ve just updated to 2.16.1. Notice no longer appearing.

    Thanks!

    Joe

    Thread Starter adwjoe

    (@adwjoe)

    Hi Austin M – A11n,

    Thank you for the explanation. And thank you for the links to third party help. I have sent a request to join the Facebook group. Hopefully I can figure this out with some help there.

    Cheers,
    Joe

    Thread Starter adwjoe

    (@adwjoe)

    Hi Sol J. a11n,

    Thanks for getting back to me.

    I was specifically asking what is the safest way to update the Square API being used? It is version 2019-08-14 and I wish to update it to 2021-06-16. Is it handled through Composer or is there a WordPress specific way of handling this?

    Please can you advise on that. I need the custom attributes and cannot wait for some indeterminate point in the future until this plugin can handle it ??

    Cheers,
    Joe

    P.s. The reason why I’m asking this is that import script doesn’t even receive the custom attributes. Here is a log of the raw data as received from Square (same product) before it has been parsed in any way. You won’t find any custom attributes there.

    [0] => SquareConnect\Model\CatalogObject Object
    (
        [type:protected] => ITEM
        [id:protected] => H2I7PCDDSU6T6F5JY4Y7BUYD
        [updated_at:protected] => 2021-06-10T16:41:13.671Z
        [version:protected] => 1623343273671
        [is_deleted:protected] =>
        [catalog_v1_ids:protected] =>
        [present_at_all_locations:protected] => 1
        [present_at_location_ids:protected] =>
        [absent_at_location_ids:protected] =>
        [image_id:protected] => KXHVKSG6Z6ZZOTRVYVJPCJIT
        [item_data:protected] => SquareConnect\Model\CatalogItem Object
        (
            [name:protected] => Mesmerism
            [description:protected] => 10.0% ABV
    
    Triple IPA
    
    A mesmerisingly punchy triple IPA with a juicy explosion of flavour.
    
    Big hitting hops complement smooth malts to create a beer that's hypnotically moreish.
            [abbreviation:protected] =>
            [label_color:protected] => 593c00
            [available_online:protected] =>
            [available_for_pickup:protected] =>
            [available_electronically:protected] =>
            [category_id:protected] => 5SSRTFVDYTIXNHY3BR4TCRLW
            [tax_ids:protected] =>
            [modifier_list_info:protected] =>
            [variations:protected] => Array
            (
                [0] => SquareConnect\Model\CatalogObject Object
                (
                    [type:protected] => ITEM_VARIATION
                    [id:protected] => PN46PFCEFL53Y3YPNO3DY4CF
                    [updated_at:protected] => 2021-06-10T16:41:13.671Z
                    [version:protected] => 1623343273671
                    [is_deleted:protected] =>
                    [catalog_v1_ids:protected] =>
                    [present_at_all_locations:protected] => 1
                    [present_at_location_ids:protected] =>
                    [absent_at_location_ids:protected] =>
                    [image_id:protected] =>
                    [item_data:protected] =>
                    [category_data:protected] =>
                    [item_variation_data:protected] => SquareConnect\Model\CatalogItemVariation Object
                    (
                        [item_id:protected] => H2I7PCDDSU6T6F5JY4Y7BUYD
                        [name:protected] => Regular
                        [sku:protected] => 2106-voc-mes
                        [upc:protected] =>
                        [ordinal:protected] => 1
                        [pricing_type:protected] => FIXED_PRICING
                        [price_money:protected] => SquareConnect\Model\Money Object
                        (
                            [amount:protected] => 650
                            [currency:protected] => GBP
                        )
    
                        [location_overrides:protected] => Array
                        (
                            [0] => SquareConnect\Model\ItemVariationLocationOverrides Object
                            (
                                [location_id:protected] => LXTZYFD9F9350
                                [price_money:protected] =>
                                [pricing_type:protected] =>
                                [track_inventory:protected] => 1
                                [inventory_alert_type:protected] =>
                                [inventory_alert_threshold:protected] =>
                            )
    
                        )
    
                        [track_inventory:protected] =>
                        [inventory_alert_type:protected] =>
                        [inventory_alert_threshold:protected] =>
                        [user_data:protected] =>
                        [service_duration:protected] =>
                        [item_option_values:protected] =>
                        [measurement_unit_id:protected] =>
                    )
    
                    [tax_data:protected] =>
                    [discount_data:protected] =>
                    [modifier_list_data:protected] =>
                    [modifier_data:protected] =>
                    [time_period_data:protected] =>
                    [product_set_data:protected] =>
                    [pricing_rule_data:protected] =>
                    [image_data:protected] =>
                    [measurement_unit_data:protected] =>
                    [item_option_data:protected] =>
                    [item_option_value_data:protected] =>
                )
    
            )
    
            [product_type:protected] => REGULAR
            [skip_modifier_screen:protected] =>
            [item_options:protected] =>
        )
    
        [category_data:protected] =>
        [item_variation_data:protected] =>
        [tax_data:protected] =>
        [discount_data:protected] =>
        [modifier_list_data:protected] =>
        [modifier_data:protected] =>
        [time_period_data:protected] =>
        [product_set_data:protected] =>
        [pricing_rule_data:protected] =>
        [image_data:protected] =>
        [measurement_unit_data:protected] =>
        [item_option_data:protected] =>
        [item_option_value_data:protected] =>
    )
    • This reply was modified 3 years, 9 months ago by adwjoe.
    Thread Starter adwjoe

    (@adwjoe)

    Hi,

    Why has this been marked as resolved? It’s definitely not resolved and I would hate for this topic to be brushed over now that it’s got the resolved tag on it.

    I have submitted a feature request here while I also dig into the code and try to solve it myself, but please could you unmark this as resolved.

    Thank you.

    Cheers,
    Joe

    Thread Starter adwjoe

    (@adwjoe)

    Hi Thu P. a11n,

    Thank you for pointing me in the right direction.

    I have found the source of the problem and have posted the solution on the ideas board. I have tested it on my site and it works.

    It is simply a case of changing the WooCommerce function used on line 1311 of woocommerce-square/includes/Sync/Product_Import.php to sanitise the data from wc_clean() to wc_sanitize_textarea().

    It’s an incredibly easy fix. I hope the developers can pick up this low hanging fruit!

    Here is the thread on the ideas board:
    https://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/43646910-keep-new-lines-in-product-description

    Regards,
    Joe

    • This reply was modified 3 years, 9 months ago by adwjoe.
    Thread Starter adwjoe

    (@adwjoe)

    Line breaks entered into text areas are not HTML and they are essential for product descriptions. Even if they are HTML the fact there isn’t a condition to allow <br/> into the description is baffling me. Formatting text is a key part of selling online.

    Setting WooCommerce as the Product System of Record is an unworkable suggestion. I will be having between 500-1000 lines of constantly changing beers with a physical shop that is also selling over the counter. I need the register – Square – to be the System of Record.

    Please, please could someone point out where in the code the import is happening? I’ve had a cursory glance but I’ve got another 1001 things I’m having to get ready for this shop so haven’t dived in deep yet. I wish to manually edit the code to fix this issue. I’m aware there is a risk I may break the entire plugin but I am willing to take that risk. It’s my risk to take.

    Thank you.

    Thread Starter adwjoe

    (@adwjoe)

    I found the data in wp_posts.

    Why are the new lines being stripped out? This is really frustrating. Formatting text to add paragraphing is essential in product communication.

    In a working environment I cannot double my workload by having to enter the data twice, once in Square and again in WooCommerce. The data already exists once formatted the right way, so I just want that data formatted the same way.

    Could you point me to exactly where on the server I can find the function which handles import? I’d like to have a play around to fix this.

    Thanks!

    Thread Starter adwjoe

    (@adwjoe)

    Why are custom attributes not supported on the import? That’s such a crucial part of running an online store.

    I’ve already added the custom attributes on WooCommerce, but the idea of having to manually go through every product to add the attribute values is quite ridiculous when the data already exists on Square. That is a time-consuming job and there are so many other aspects to running the business that doing the same job twice seems like such a waste of time.

    Could you tell me exactly where on the server the import script is? And where the product data for every product is stored? I am self-hosted with complete access to the files and the database. I’ve been a web developer for the past 10 years so I want to view the scripts where this is managed to see if I can fix this issue.

    Thanks!

    Thread Starter adwjoe

    (@adwjoe)

    I’m not using HTML formatting in the description.

    I’m adding new lines in a text-area in exactly the same way as I’m adding them into this text-area that I’m typing in right now.

    This should be supported out of the box without needing to manually adjust the descriptions for each product in WooCommerce.

    Where is the data stored for each product on my server? I’ve looked through the entire MySQL database but can’t find it. Is the data stored in a file somewhere? I’m self-hosted with complete access to my server and db.

    Thread Starter adwjoe

    (@adwjoe)

    The entire description is imported into WooCommerce, but it is missing the new lines between paragraphs.

    For example, a product description on Square is:

    3.8%

    Small Pale

    Taking a bijou interval from Brobdingnagian brewage to reveal a petite pale ale of graceful proportion.

    Once imported into WooCommerce the description is now:

    3.8% Small Pale Taking a bijou interval from Brobdingnagian brewage to reveal a petite pale ale of graceful proportion.

    Thread Starter adwjoe

    (@adwjoe)

    Hi Con S.,

    Thank you for the response.

    Are there plans to support custom attributes?

    I am still learning everything but I am fairly sure I have been using variations.

    On the Item management page, when creating a new item I fill in the “Details” at the top of the page, I skip the “Options”, then fill in the “Variations” section with a single variation, the one product variation that is being sold. There won’t be more than one and the product lines will be constantly changing.

    Underneath “Variations” there is a heading “Custom Attributes”. On there I have added 3 Custom Attributes so far: ABV, Brewery, Container Size. I have applied these custom attributes to all the stock.

    I need those attributes to come over to the website and be applied to the products on WooCommerce. I need it so the information is displayed on the product page, but crucially I need it to be able to create filters for customers to search for what they are looking for. If they want to follow the hype of a particular brewery, if they want to find something of a lower ABV, and so on.

    Thank you,

    Joe

    Thread Starter adwjoe

    (@adwjoe)

    After no reply I decided to delete WordPress and start again. I don’t know what I did in the first installation but the sidebar is working ok now. This isn’t an ideal fix as once the site is live I don’t want to delete it and start again if an error occurs. There should be an easy fix to this.

    Is there any way to edit my original post to remove the link to my website? It’s a staging site and I’d rather keep it private for security reasons. Thank you.

Viewing 15 replies - 1 through 15 (of 15 total)