App reviews, troubleshooting, and recommendations
Hi everyone,
I'm currently using a cross-sell app on my Shopify (Selleasy) product pages, and I've set up a reserved space for the cross-sell widget to prevent layout shifts. Everything is working as expected in terms of the reserved space, but now I’m facing an issue where this placeholder space shows up even on product pages where no cross-sell offers are available.
Current setup:
In my main-product file, I’ve added the following placeholder div in the spot where the cross-sell widget appears:
<div class="bundle-section-placeholder"></div>
In base.css, I’ve styled this placeholder to reserve space with the following code:
.bundle-section-placeholder {
height: 420px !important;
min-height: 420px;
display: block !important;
background-color: transparent;
border: none;
margin-bottom: 20px;
}
This setup works as expected in reserving the space. However, the placeholder div still appears even on products without cross-sell offers, and I’d like to hide it on those pages.
What I need help with:
I’m looking for a way to conditionally check if a cross-sell offer exists for the specific product on the page. If no offer exists, I want to hide the placeholder div completely. Ideally, I’d like a JavaScript or Liquid solution that can dynamically verify the presence of the cross-sell offer and only display the reserved space when necessary.
Any suggestions or code snippets on how to conditionally display the placeholder only if a cross-sell offer exists would be greatly appreciated!
Thank you!
Hey @StravionShop
Welcome to Shopify Community! Can you share your Store URL so I can have a look on it? Also, if you have password enabled then please share the password as well. Your cooperation would be greatly appreciated.
Best Regards,
Moeed
Hi Moeed, thank you for reaching out! Here’s the link to my store: https://stravion.com/
Hey @StravionShop
I'm unable to locate the exact space you're talking about, can you share a screenshot to help me understand better? It will be apppreciated.
Best Regards,
Moeed
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024