Why do my product variants keep disappearing?

Hello,

My product variants keep getting deleted after I refresh my page and I won’t see them anymore until I close my browser and reopen it. It also disappears from being inspected through the browser, but the code remains the same in the editor in my shopify admin account.

Any advice on why the variants are not being displayed anymore?

Thanks,

Sovel

Hello @Sovel ,

Could you please share that product URL here?

Thanks,

Ritu

Sure

https://www.sovel.ro/products/banda-led-neon-rgbic-flexibila-smart-control-prin-tuya-compatibil-alexa-si-google-home-sincronizare-pe-muzica-60-de-led-uri-pe-metru-16-milioane-de-culori-telecomanda-24-de-butoane-3-metri

Please let me know if you see the variants for the sizes, because I can’t see them with this link

Sure

https://www.sovel.ro/products/banda-led-neon-rgbic-flexibila-smart-control-prin-tuya-compatibil-alexa-si-google-home-sincronizare-pe-muzica-60-de-led-uri-pe-metru-16-milioane-de-culori-telecomanda-24-de-butoane-3-metri

Please let me know if you see the product variants with this link.

Here’s the link. I replied 2 times but can’t see any of them.

https://www.sovel.ro/products/banda-led-neon-rgbic-flexibila-smart-control-prin-tuya-compatibil-alexa-si-google-home-sincronizare-pe-muzica-60-de-led-uri-pe-metru-16-milioane-de-culori-telecomanda-24-de-butoane-3-metri

And its supposed to look like this

Hey @Sovel ,

Please add this CSS in styles.css.

#product-variants #product-selectors {
    display: block !important;
    width: 100%;
}

Hello,

Now there are 2 lines for variants.

The second one was added by the lines your provided and it doesn’t disappear, but with it the price on the page for the product doesn’t change and if I delete the first line completely, the section with " related products " disappears. Is there any way I can keep the first variant line without it disappearing?

@Sovel ,

#add-to-cart-form .option1-default .selector-wrapper:nth-child(1) {
    display: none !important;
}

Add this CSS in styles.css.

The lines made the first variant disappear completely

@Sovel ,

Both are the same that’s why I have removed the first which is not showing the first time and enabled the permanent selector variant.

That’s the only way please check all the products is it working fine or not?

Thanks,

Ritu

It works on all products, but there are 2 more issues now. If for example I select another size, the price doesn’t change and all of the related products are hidden. Is there any possibility you can help with this issue?

I fixed the variants, only the prices are the issue now

I meant the related products* sorry

@Sovel , Okay if that’s causing the issue then we can try another thing.

Add this CSS and remove above all the CSS.

#add-to-cart-form .option1-default .selector-wrapper:nth-child(1) {
    display: block !important;
}

Ok, i removed the previous lines and added the one you sent. So the bar for the variant is now smaller and it disappears after 2 refreshes.

@Sovel ,

Is it possible for you to share the collaborative access? Please PM me

I need to take a deep-dive into your code.

@Sovel

Hi all, I have been having a problem with this for about a month and have not been able to find a solution until now. I have chatted with Shopify several times and my imports have been correct per their instruction (don’t delete rows or columns). I recently spoke with someone who told me the following, which is something I have not been told by any other Shopify support member and it is not in any forums. In addition to not removing any columns or rows, you also CANNOT SORT ROWS.

Here is a copy of our conversation. I don’t know if it is helpful to anyone, but may shed some light on this problem if you feel like you are going crazy like I did.

Shopify: This issue commonly occurs when someone sorts the CSV columns or rows (e.g., sorting variant rows by inventory) before importing. Since additional variants and product images are on separate rows, sorting can break up these rows, causing variants or images to be deleted during import. In this case i would advise avoid sorting the CSV. If you have a backup CSV that hasn’t been sorted, you should import that instead.

Me: We have hundreds of SKUs and prices to update right now. I have to combine a Shopify product export with our new price list, and sort by SKU to compare and adjust. I highlight the Rows that were not part of the original Shopify product export and remove them. I keep all variants in the file, nothing from the original export is deleted.

Shopify: I understand, having 100’s of SKUs with frequent price can be challenging. I can suggest you try the follow to help manage your bulk price updates while minimizing risks:

  • Shopify’s bulk editor allows you to edit multiple products and variants directly within the admin without exporting and importing CSVs. This reduces the risk of data loss from CSV imports.
  • There are third-party apps available in the Shopify App Store designed specifically for bulk product and price management. These apps can provide more advanced filtering, sorting, and bulk update capabilities tailored for large inventories.
  • Consider apps or integrations that can automate price adjustments based on cost changes or tariff updates.
  • To handle tariffs effectively, we offers built-in tools like the duties calculator and Managed Markets, which can help calculate and display duties at checkout, ensuring pricing reflects total costs transparently.

Me: These suggestions unfortunately aren’t helpful, since I need to compare in the same spreadsheet to make these adjustments. What do others do?

Shopify: Directly sorting / rearranging the CSV before importing can cause issues like variants being wiped out. You can look to keep your original export CSV intact in one tab, and perform your sorting, filtering, and price comparison in a separate tab within the same spreadsheet. This way, you preserve the original data structure needed for import. Also in your working tab, use formulas to pull in data from the original tab. This allows you to sort and compare without altering the import-ready data.

Me: Do you have a webpage with instructions to do that and how to create the formulas? I would need something like, if SKU in other tab = XYZ, then replace with this new cell price with the matching SKU in the other tab… if that makes sense.

Shopify: Currently, there isn’t a specific Shopify help page that provides step-by-step instructions on how to keep the original CSV intact in one tab and use formulas in a separate tab for sorting and filtering without breaking the import structure. For learning how to use formulas to pull data between tabs, you can refer to general spreadsheet tutorials such as: IMPORTRANGE - Google Docs Editors Help

Shopify: To achieve this kind of conditional update where you replace prices based on matching SKUs between two tabs, you can use the VLOOKUP function in your spreadsheet software (Google Sheets or Excel).

Me: Ok, so just to be sure… If I keep the order of rows and columns the same as my export, and change data in the cells only, there shouldn’t be any problems?

Shopify: Yes, that’s correct. If you keep the order of rows and columns exactly the same as your original export CSV and only change the data within the cells (such as prices, descriptions, or inventory quantities), you should not encounter issues like variants being wiped out during import. Maintaining the original structure ensures that Shopify correctly associates each row with the right product and variant. Be sure not to sort, add, or delete rows or columns, as this can break the relationships between products and variants and cause data loss or duplication.

Hey @helenmcox6,

By any chance can you share your store url please.

Thanks