Skip to content

Commit

Permalink
fix attributes object vs variation items
Browse files Browse the repository at this point in the history
  • Loading branch information
faisal-alvi committed Dec 6, 2024
1 parent 4256504 commit d9833b9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/Handlers/Product/Woo_SOR.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ public static function update_catalog_variation( CatalogObject $catalog_object,
if ( 'variation' === $product->get_type() ) {
$options_data_transient = get_transient( 'wc_square_options_data' );
$parent_product = wc_get_product( $product->get_parent_id() );
$variation_items = $parent_product->get_attributes();
$attributes = $parent_product->get_attributes();
$variation_items = $product->get_attributes();
$variation_item_values = array();

if ( 1 === count( $variation_items ) ) {
if ( 1 === count( $attributes ) ) {
// Set the name of the variation if it's a single variation.
$variation_data->setName( reset( $variation_items ) );
} else {
Expand Down

0 comments on commit d9833b9

Please sign in to comment.