Support

Account

Home Forums Backend Issues (wp-admin) How do I add WooCommerce Attributes? Reply To: How do I add WooCommerce Attributes?

  • Hi @william-alexander

    Well first of your client is an idiot but fine! 😉

    The attributes in WooCommerce is saved as an multidimensional array in the wp_postmeta table and looks like this:

    
    array (
      'testattribute' => 
      array (
        'name' => 'testattribute',
        'value' => 'attributevalue',
        'position' => '0',
        'is_visible' => 1,
        'is_variation' => 0,
        'is_taxonomy' => 0,
      ),
    )
    

    So you would have to try to replicate that using your own custom fields.
    I think it might be possible to do using nested repeater fields but you’ll not really end up with an easier way of input and the client wont be able to just hit “save attributes” but would have to update the whole product post each time they alter an attribute.

    Really you should tell your client you can attempt to do your own solution but will have to add x hours to the invoice (probably atleast 4-5h) and in the end the solution might not be easier than the default. There’s a reason why WooCommerce have it as it is and they have multiple devs working SOLELY on optimising every aspect of WooCommerce and millions of users liking it as it is.

    It all comes down to my first reaction, your client is an idiot 😉