App reviews, troubleshooting, and recommendations
Hey I need some help
When I am creating a product which have one variant it is created successfully,But when I am creating a product which have multiple variants it shows me this error
"ShopifySharp.Infrastructure.ShopifyHttpException: '(422 Unprocessable Entity) base: The variant 'Default Title' already exists.'"
Since I am giving different title of variants
this is my code
"
public async Task<ActionResult> Index()
{
try
{
var shopifyService = new ShopifyClient(ShopDomain, Token);
// Create first product with two variants
var product1 = new ShopifySharp.Product()
{
Title = "Obama Grocery",
BodyHtml = "Description for Product 1",
Variants = new List<ShopifySharp.ProductVariant>
{
new ShopifySharp.ProductVariant { SKU = "P1-Variant1-SKU", Title = "Obama-Shoes", Price = 10.99m },
new ShopifySharp.ProductVariant { SKU = "P1-Variant2-SKU", Title = "Obama-Shirt", Price = 15.99m }
}
};
// Create the product asynchronously
await shopifyService.CreateProductAsync(product1);
}
catch (Exception ex)
{
// Log the exception
ViewBag.ErrorMessage = "An error occurred while creating products: " + ex.Message;
}
return View();
"
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024