Changeset 3162720
- Timestamp:
- 10/04/2024 12:02:12 PM (16 months ago)
- Location:
- iyzico-woocommerce
- Files:
-
- 2 added
- 2 deleted
- 1 edited
-
tags/3.5.3 (deleted)
-
tags/3.5.7/includes/Common/Helpers/DataFactory.php (deleted)
-
tags/3.5.7/readme.txt (added)
-
trunk/includes/Common/Helpers/DataFactory.php (modified) (1 diff)
-
trunk/readme.txt (added)
Legend:
- Unmodified
- Added
- Removed
-
iyzico-woocommerce/trunk/includes/Common/Helpers/DataFactory.php
r3162373 r3162720 83 83 $basketItem->setName( $product->get_name() ); 84 84 85 $categories = get_the_terms( $product->get_id(), 'product_cat' ); 85 $product_id = $product->is_type( 'variation' ) ? $product->get_parent_id() : $product->get_id(); 86 $categories = get_the_terms( $product_id, 'product_cat' ); 87 88 $category1 = ''; 86 89 if ( $categories && ! is_wp_error( $categories ) ) { 87 90 $category_names = wp_list_pluck( $categories, 'name' ); 88 91 $category1 = implode( ', ', $category_names ); 89 $basketItem->setCategory1( $this->validateStringVal( $category1 ) );90 92 } 91 93 94 $basketItem->setCategory1( $this->validateStringVal( $category1 ) ); 92 95 $basketItem->setItemType( $product->is_virtual() ? BasketItemType::VIRTUAL : BasketItemType::PHYSICAL ); 93 96 $basketItem->setPrice( $item['quantity'] * $this->priceHelper->priceParser( $product->get_price() ) );
Note: See TracChangeset
for help on using the changeset viewer.