Skip to content

Instantly share code, notes, and snippets.

@apeschar
Created September 13, 2022 15:24
Show Gist options
  • Save apeschar/fe0a1a2dc2ace0b9b30e306e76d09b01 to your computer and use it in GitHub Desktop.
Save apeschar/fe0a1a2dc2ace0b9b30e306e76d09b01 to your computer and use it in GitHub Desktop.
--- /tmp/raq/request-quote-table-old.php 2022-09-13 15:21:33.046041261 +0000
+++ /tmp/raq/request-quote-table-new.php 2022-09-13 15:21:25.442164874 +0000
@@ -122,6 +122,12 @@
if ( ! empty( $attributes ) ) {
foreach ( $attributes as $name => $value ) {
+ if ( $value instanceof WC_Product_Attribute ) {
+ $value = array_map( function ( $term ) {
+ return $term->name;
+ }, $value->get_terms() );
+ $value = implode( ', ', $value );
+ }
$raq_data[ 'attribute_' . $name ] = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment