php - Getting an empty space in up sell items

admin2025-06-05  3

I have the current version of wp, and I'm using the tailor theme, and I have my up sell section set up so items show up. However, if an item is out of stock, it creates a random empty space instead of just showing the other up sell items. For example, if the second item is sold out, it will show item 1, large space, item 3. Is there a way to have it dynamically "fix" the up sell list? So in the example it would just be item 1, item 3.

I have the current version of wp, and I'm using the tailor theme, and I have my up sell section set up so items show up. However, if an item is out of stock, it creates a random empty space instead of just showing the other up sell items. For example, if the second item is sold out, it will show item 1, large space, item 3. Is there a way to have it dynamically "fix" the up sell list? So in the example it would just be item 1, item 3.

Share Improve this question edited Dec 17, 2018 at 21:11 Morgan Smith asked Dec 17, 2018 at 19:51 Morgan SmithMorgan Smith 1013 bronze badges 5
  • If you provide the code snippet that is generating the snippets you would likely get some help. Also, can you provide a URL? I am curious, maybe it is adding a class we could use to hide the sold item one. – RiddleMeThis Commented Dec 17, 2018 at 21:39
  • Can you share the URL? – RiddleMeThis Commented Dec 18, 2018 at 14:30
  • friedmans/product/simulated-diamond-stud-earrings-1-12ctw – Morgan Smith Commented Dec 18, 2018 at 15:16
  • It looks like that area is using Owl Carousel, I don't know anything about it but have you looked to see if there is any setting to hide out of stock products? I could write a script that detect if it's empty and then hide the html block but that is hacky and there is a better way – RiddleMeThis Commented Dec 18, 2018 at 15:28
  • It is using that and there is a setting to not show out of stock items for the whole site that is turned on. That's also the line of thought I was heading down, but I was wondering if there was maybe a setting I overlooked to get it to not return the empty space. I'll more into the owl carousel to see if there is a setting in there. – Morgan Smith Commented Dec 18, 2018 at 15:41
Add a comment  | 

1 Answer 1

Reset to default 0

The issue I was having was that the query calling the items was checking to see if the main item (i.e. the product the user clicked on) was in stock, not the actual up sell items. Can add code snippets later if needed

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749063974a316044.html

最新回复(0)