• Resolved jaydisc

    (@jaydisc)


    I would like some help understanding the single variant / attribute limitation of this plugin.

    I have a site that sells collectible toys and I use Attributes for metadata to help with searching. Each Product has at least one value for these three Attributes: Class (size), Condition and Manufacturer:

    This allows visitors to filer views by any of those Attributes:

    For some Products, there might be multiple entries for any of these Attributes, eg to represent multiple toys of varying size/condition in a bundle, or a manufacturer collaboration.

    So, these Attributes don’t represent Product Variations…. Just Product metadata.

    So, how does this affect Square?

    In v1.x, this setup made no difference. Everything correctly appeared in Square as one product, and there was no notice of Attributes in Square anywhere This was good.

    In WooCommerce Square, as recent as v2.0.5, all products seemingly were synced, but had this strange appearance:

    I have no idea what it means or represents. Is this a Variation? Is this caused by my Attributes? If I attempt to edit either Product in Square, there’s no mention of Attributes/Variations, and all of the data is the same.

    So, what is Woo actually doing here? How can I prevent it? And if I can’t, and just decide to Disconnect Woo, can I then fix the Product in Square without wrecking the sales history?

    • This topic was modified 5 years ago by jaydisc.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    I have no idea what it means or represents. Is this a Variation? Is this caused by my Attributes? If I attempt to edit either Product in Square, there’s no mention of Attributes/Variations, and all of the data is the same.

    The product you sync has three attributes. I am note sure how exactly then handles the incoming data but it looks like it simply creates additional products and attaches them to the original product. You will need to ask Square support for details.

    So, what is Woo actually doing here?

    It is taking the variation products which are a custom post type and sends them.

    How can I prevent it?

    The only thing you can do to avoid this is to change your product structure to one attribute.

    And if I can’t, and just decide to Disconnect Woo, can I then fix the Product in Square without wrecking the sales history?

    We can’t say how the product relation get configured, since we know that multiple attributes are not supported. I would test this by creating a dummy product with the same structure and see how it reacts.

    Kind regards,

    Thread Starter jaydisc

    (@jaydisc)

    But why is it interpreting an Attribute as a Variation? Isn’t an Attribute just a bit of metadata? Am I completely missing other more common use cases for Attributes?

    Are people just using Attributes in a completely different way that I am? Because this choice to interpret an Attribute as a Variation (is a variation a different product?) just boggles my mind.

    And the most incredible part of any of this, is I can’t see Attributes ANYWHERE in Square?

    And of course, my final question is the same as in all these 2.x threads: Why break what previously worked? What has been gained in return?

    Thread Starter jaydisc

    (@jaydisc)

    Wait a sec, does this apply to Simple Products? (that’s all I use). Maybe this is limitation is in relation to Variable Products, which I know nothing of, which is why this makes no sense to me?

    Thread Starter jaydisc

    (@jaydisc)

    You will need to ask Square support for details.

    As expected, Square says Woo is the developer and will not talk to me:

    Thanks for writing in.

    Although Square integrates with WooCommerce to process payments, the integration is operated and managed by WooCommerce. For help with WooCommerce-specific questions, you’ll
    need to submit a ticket with their Support team.

    The WooCommerce Customer Support team will be able to help you with all Square integration related questions.

    Please let me know if you have any further questions. I’m happy to help.

    Can anyone PLEASE explain what is seen here:

    Plugin Support con

    (@conschneider)

    Engineer

    Hi again,

    > But why is it interpreting an Attribute as a Variation?

    Because that is what it is for WooCommerce.

    > Isn’t an Attribute just a bit of metadata?

    It is a custom taxonomy. Which is also a post, but that is irrelevant. You are using a variation.

    > Am I completely missing other more common use cases for Attributes?

    No. You are making a difference for the wrong area.
    This is not an attribute. You are talking about variations.

    > Are people just using Attributes in a completely different way that I am? Because this choice to interpret an Attribute as a Variation (is a variation a different product?) just boggles my mind.

    It is actually just that Attributes are not used directly. Only your variation is.

    > And the most incredible part of any of this, is I can’t see Attributes ANYWHERE in Square?

    That is because they are not there. They are part of the product in Square.

    > Wait a sec, does this apply to Simple Products? (that’s all I use).

    Not at all. This is all for variable products.

    > Maybe this is limitation is in relation to Variable Products, which I know nothing of, which is why this makes no sense to me?

    Makes perfect sense yes.

    > Can anyone PLEASE explain what is seen here:

    Show us your product setup in WooCommerce as well.

    Kind regards,

    Thread Starter jaydisc

    (@jaydisc)

    OK, thank you for enduring. I think then that this is indeed a bug you might want to look at. Square is saying that if it presents visually like a variation, but can’t be seen/deleted as a variation, it is likely a bug in the way it was created. So, here’s some detailed screens of one product in Woo, and the same product in Square:




    Now Square:


    So I thought I’d manually add a Variant to see what happened and it showed up as a sibling to the Variant that Woo has seemingly created:


    I guess I’m wondering why Woo is creating a single Square Variant for a Simple Product. It’s certainly not the outcome I’d prefer. It seems quite clumsy.

    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi there @jaydisc,

    This is how simple products appear for me as well in my Square account. They aren’t variations, but there happens to be what appears to be a top level product and then sub products for them.

    This is my Sunglasses product that has no attributes or variations at all.


    Link to image: https://cld.wthms.co/h1bpGy

    From what I can tell Square just calls them Variations, even though they aren’t what you think of as Variations in WooCommerce. The only thing I can then assume is that it’s used for different locations? Would you have multiple locations setup in your Square account? For example, here is a product I have between two Woo stores.


    Link to image: https://cld.wthms.co/fW86cs

    Thread Starter jaydisc

    (@jaydisc)

    OK, so it’s consistent. But why is it like this now? It wasn’t like this under 1.0.x. With that version, one product at Woo synced to one product at Square, no variations, no confusion.

    Is this a bug, or is it by design?

    I do have two Locations. Well, more like one active location, and one archived location, but as you can see my screenshots, the issue happens regardless of location.

    • This reply was modified 5 years ago by jaydisc.
    Plugin Support Ryan Ray, a11n

    (@ryanr14)

    Hi @jaydisc,

    That’s a good question that I don’t know the answer to right now. I am going to try to find out right now though. Give me a few moments here while I ask my colleagues and devs as to why these items show up with variations.

    Thread Starter jaydisc

    (@jaydisc)

    How did you go?

    Plugin Support con

    (@conschneider)

    Engineer

    Hi again,

    Sorry for the delay. From what I see this happens because of either of two reasons.

    a) Using attributes in a simple product. Square can only handle attributes with variations. If you use attributes Square will always create a variation.

    b) One product being used in multiple locations. In order to link / track stock Square will always create a variation.

    Kind regards,

    @conschneider Neither of those is the reason why square shows the simple product as a variation. The reason is very simple, its because of how the variation is named.

    In sqaure there is no concept of simple vs variable products. All products have a “top level” product and must have at least one variation. If a product has only one variation AND the name of the variation is exactly “Regular” then the UI in square will not show the dropdown and will make it seem like a simple product even though internally it’s still a top level product with one variation.

    Square also has no concept of attributes either, variations simply have “names”. The old version of the square plugin used to not set a name for simple products when they were uploaded to the square api and so they by default were named “Regular” and they didn’t show a dropdown in the square UI. The new version of the plugin now sets the name of the variation to the product title and so that is why the square UI is showing a dropdown.

    This is also why in previous versions of the square plugin the variations would not have the product title in the prefix where now they do.

    Here is code u can add to your functions.php to set simple product variations to “Regular” so that the dropdown in the square UI is removed.

    
    add_filter( 'wc_square_update_catalog_item_variation', function( $catalog_object, $product ) {
    	if ( $product->is_type( 'variation' ) ) {
    		// attribute summary is a comma seperated list in the format of "attribute_name: attribute_value"
    		$catalog_object['item_variation_data']['name'] = $product->get_attribute_summary();
    	} elseif ( ! $product->get_parent_id() && ! $product->has_child() ) {
    		// Products that have only one variation with the name "Regular" do not show a dropdown in square
    		$catalog_object['item_variation_data']['name'] = 'Regular';
    	}
    	return $catalog_object;
    }, 10, 2 );
    
    Plugin Support con

    (@conschneider)

    Engineer

    @gbroochian Excellent. Thank you very much.

    Thread Starter jaydisc

    (@jaydisc)

    @gbroochian

    @conschneider Neither of those is the reason why square shows the simple product as a variation. The reason is very simple, its because of how the variation is named.

    Fan-bloody-tastic! That’s exactly the kind of info I’m looking for. Thank you. I can even go into Square and rename the existing variants to “Regular” and it goes back to normal. THANK YOU!

    • This reply was modified 4 years, 11 months ago by jaydisc.
    Plugin Support con

    (@conschneider)

    Engineer

    Neat.
    Closing.

    Thanks again everyone for pitching in. Especially @gbroochian.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Trying to understand Attributes and Variations’ is closed to new replies.