Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ public function retrieve_options_data( $cursor = '', $refresh = false ) {
$option_name = $this->get_item_option_name_from_catalog_object( $object );
$options_data[ $object->getId() ]['name'] = $option_name;

$option_values_object = $object->getItemOptionData()->getValues();
$option_values_object = $object->getItemOptionData() ? $object->getItemOptionData()->getValues() : array();
$option_values = array();
$option_values_ids = array();

Expand Down Expand Up @@ -680,7 +680,7 @@ public function create_options_and_values( $option_id = false, $attribute_name =
$option = $response->get_data()->getObject();

// Filter out the existing option values from the attribute values.
$square_existing_option_objects = $option->getItemOptionData()->getValues();
$square_existing_option_objects = $option->getItemOptionData() ? $option->getItemOptionData()->getValues() : array();
$options_value_data = $square_existing_option_objects;

$square_existing_option_values = array();
Expand Down Expand Up @@ -726,7 +726,7 @@ public function create_options_and_values( $option_id = false, $attribute_name =
$response = $this->retrieve_catalog_object( $option_id );
$option = $response->get_data()->getObject();

$option_values_object = $option->getItemOptionData()->getValues();
$option_values_object = $option->getItemOptionData() ? $option->getItemOptionData()->getValues() : array();
$option_value_ids = array();
$option_values = array();

Expand Down
2 changes: 1 addition & 1 deletion includes/Handlers/Product/Woo_SOR.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public static function update_catalog_variation( CatalogObject $catalog_object,
$option_id = $option->getId();

// Get the Square ID of the attribute value.
$updated_option_values = $option->getItemOptionData()->getValues();
$updated_option_values = $option->getItemOptionData() ? $option->getItemOptionData()->getValues() : array();
foreach ( $updated_option_values as $option_value ) {
if ( $option_value->getItemOptionValueData()->getName() === $attribute_value ) {
$option_value_id = $option_value->getId();
Expand Down
Loading