$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>php - Getting an empty space in up sell items|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - Getting an empty space in up sell items

matteradmin11PV0评论

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

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far