diff --git a/admin-spa/src/routes/Products/New.tsx b/admin-spa/src/routes/Products/New.tsx index d694d93..d04aa2d 100644 --- a/admin-spa/src/routes/Products/New.tsx +++ b/admin-spa/src/routes/Products/New.tsx @@ -27,12 +27,8 @@ export default function ProductNew() { toast.success(__('Product created successfully')); queryClient.invalidateQueries({ queryKey: ['products'] }); - // Navigate to product detail or edit page - if (response?.id) { - navigate(`/products/${response.id}`); - } else { - navigate('/products'); - } + // Navigate back to products index + navigate('/products'); }, onError: (error: any) => { toast.error(error.message || __('Failed to create product')); diff --git a/admin-spa/src/routes/Products/index.tsx b/admin-spa/src/routes/Products/index.tsx index 4a0f165..ad53cc8 100644 --- a/admin-spa/src/routes/Products/index.tsx +++ b/admin-spa/src/routes/Products/index.tsx @@ -382,8 +382,16 @@ export default function Products() { - - {product.type} + + {product.price_html ? ( + + ) : product.regular_price ? ( + ${parseFloat(product.regular_price).toFixed(2)} + ) : ( + + )} + + {product.type || '—'} {__('Edit')} diff --git a/includes/Api/ProductsController.php b/includes/Api/ProductsController.php index 00c382a..df14609 100644 --- a/includes/Api/ProductsController.php +++ b/includes/Api/ProductsController.php @@ -493,6 +493,9 @@ class ProductsController { $data['tags'] = $product->get_tag_ids(); $data['image_id'] = $product->get_image_id(); $data['gallery_image_ids'] = $product->get_gallery_image_ids(); + $data['virtual'] = $product->is_virtual(); + $data['downloadable'] = $product->is_downloadable(); + $data['featured'] = $product->is_featured(); // Gallery images $gallery = [];