ChatGPT & WooCommerce: 5 Ways to Use AI in Your Online Store

Set Up Woocommerce
Chatgpt woocommerce.There are a lot of ways to leverage ChatGPT for WooCommerce. However, if you aren’t well-versed in using AI tools – in particular ChatGPT – it can be hard to get a grip on how things work. For example, you might still be in the dark about some cool plugins and integrations that are possible between ChatGPT and WooCommerce. In this article, we’ll go over some interesting ways you can use ChatGPT in WooCommerce to optimize and improve your store. Let’s get to it!

Resizing Images On-The-Fly

Category Image 052

As a web architect, one of the many issues is asset management. And the most significant issue in assets is images. A naive approach would be to set an image and let the browser resize the image via CSS:

CSS
 
img {
    height: 100%;
    width: 100%;
    object-fit: contain;
}


Chris’ Corner: Swinging For It

Category Image 052

New year, new local code editor? It’s maybe worth a peak at Zed, at least. They do a good job in the one-sentence pitch:

Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

All tech things have to be fast, so check. No shade either, speed is vital in all things tech, especially something you use heavily all day. Their main competition is clearly VS Code, which already gets some flack for slowness (feels fast to me 🤷), so leaning into a comparison that shows them some 4x faster on startup is sensible marketing.

“Multiplayer”… eh. I’m skepitcal about how much teams really care about this. VS Code did a whole “live share” thing a while back and I don’t think it struck much of a chord. I’m not against it as a feature, it’s just more like table stakes these days rather than a killer feature.

The last one… “from the creates of Atom and Tree-sitter” is a great pitch. People loved Atom. People are not happy Atom went away, so you get those people right out of the gate. Even if you didn’t use it, I think a lot of people respected it. Then Tree-sitter is this best-of-breed code parsing tool that all sorts of stuff uses (the new version of CodePen that will be out this year uses it heavily).

Will I actually switch? No idea. I’m always down to try new things. But I’ve written about this before, and I have my own criteria on switching code editors. For me, the new one needs to be able to behave essentially like the old one. If anything is too obnoxious, I’ll just switch back. If I can switch without terrible annoyances, then I’m happy to explore changes and different features and such.

And to keep me (and I think this is generally true, not just for me) it needs killer features. Maybe that is speed, but I don’t think the competition in this area is slow enough for that to be the big thing.

Maybe the AI stuff will be one of the killer features. AI is such a big thing these days, but VS Code has Github Copilot, which is great and a huge competitive advantage. Except… Zed supports GitHub Copilot! Nice move. And check out the video where they’ve integrated GPT-4 into the editor, and you invoke it by highlighting a block of text and typing a prompt. Very classy, I think.

It appears as if they are really making a swing for it with Zed and that’s good for everyone. Making a business out of it is going to be tricky too. Looks like they already have a team of 10. I can tell you that 10 world-class developers aren’t cheap. It doesn’t look like Zed is open source yet, so best guess is the plan is to make it paid. That’s tough in a world where VS Code is free (although Copilot is not). Panic makes it work with Nova though, so it’s not uncharted territory. I think developers are happy to throw bucks at tools that are even a little bit better, so I would bet on Zed doing pretty decently, myself. The good design of their landing page makes me feel like they have their heads screwed on straight.

Gotta love companies making a big swing on things. I feel like that’s what Arc has been doing since the beginning with their new web browser. They are constantly shipping and taking risks on big features. And it has all the hallmarks of big swings: some big hits, some big misses. I think Arc has massive potential as being the best web browser out there, but it seems like that’s not where they are headed. In a vague end-of-year where-we’re-headed video, they say they actually want to build a whole new computer. That seems like a wildly different task and set of skills needed, but hey, a big swing is a big swing. They are kind of “pre-money” so I guess it’s more of a pivot.

I feel like another company that is trying to make a swing for it in a crowded market this year is Bun. A brand new JavaScript runtime in a totally different language is a big endeavor. Competition in this space feels warranted and good for everyone. And also like the business model is just as nebulous as all the other companies mentioned here. There was some pretty pointed pushback about Bun, which both feels fair and like that’s exactly what you’d expect when you’re doing something new and bold.

ChatGPT Functions: Observations, Tips, and Tricks

Category Image 062

Recently introduced ChatGPT functions represent a huge leap forward that lets ChatGPT use your local files, data, and system services. So, if you supply proper functions to ChatGPT, you can ask it something like “Email Kate Bell with birthday greetings” and see a new email message pop up with correct email address, correct subject and generated email text with birthday best wishes. 

Pretty cool, right?  

Chris’ Corner: More Like CSBest

Typography Definitions Cover

We gotta talk about CSS! That’s my favorite thing! It’s always on the table for a good Chris’ Corner edition, but sometimes focusing on it entirely is best.

Klint Finley called it “The modern web’s underrated powerhouse” for GitHub’s publication The ReadME Project back in February, and I’m inclined to agree. Although the days of CSS being considered underrated are waning. I get the sense that plenty of people find it complicated or generally just don’t like it, but those same people still respect its power. There is also one big undeniable fact: every website uses it. All of ’em. And it controls nearly every Aspect of how a website looks, which, ya know, if you care at all about how successfully your website does what it sets out to do, matters a whole heck of a lot.

Anyway, rather than listen to me prattle on about how good CSS is, let’s look at some interesting ideas pulled off in CSS, new things coming to CSS, dealing with browser support, and future ideas.


It used to be that if you used CSS to set the width and height of an image and the Aspect ratio that those two numbers formed didn’t match the Aspect ratio of the image, it would squish the image awkwardly. Almost certainly not the effect you want. But now we’ve got the object-fit property in CSS, and specifically the cover and contain values, which prevent the squishing. With cover, the image might crop, so you’re sending more image data than you needed to, perhaps, but you’ll be achieving the design you’re after.

With that as a foundation, let me let Henry Desroches take over in Using Focal Points, Aspect Ratio & Object-Fit To Crop Images Correctly. In conjunction with object-fit there is object-position which allows you to set an XY coordinate from where the image scales.

Try clicking different positions on the source image and see how the sized images change which part of the image they show. This is just good to know. If you’re ultimately cropping images, you don’t have to settle for the defaults.


You’d think “position this element over by this other element” would be easy peasy for CSS, but you’d be wrong. There has been no mechanism for that up until now. The new thing is called anchor positioning, and Jhey Tompkins has the scoop in Tether elements to each other with CSS anchor positioning.

The big obvious use case to all this for me is basically: tooltips powered by footnotes. Essentially I want bits of UI (a phrase, link, or [?] button) that can be hovered or otherwise interacted with to reveal a bit more information. But that information is elsewhere in the DOM. Wherever I want in the DOM that makes sense for my project. Finally, I’ll be able to do that (once is supported across all browsers or if I use the polyfill).

I had a little play with this myself, thanks to Jhey’s guidance in this post.

I didn’t get into all the scrolling stuff you have to think about or the @try style positioning, but I do think all that is very cool. Edge detection stuff is another thing that we’d have to lean on JavaScript to do normally, but never love having to do so.


As good as CSS has been lately with new features working across browsers, it’s still a thing we have to think about. Fortunately, CSS saw this coming long ago and has @supports rules that can help us conditionally apply CSS in supporting (or not) situations.

Stephanie Eckles has the most up-to-date information on all this in Testing Feature Support for Modern CSS.

An example I can think of is the kick-ass :has() selector. As I write, :has() isn’t supported in Firefox yet. So if we wanted to know that in CSS before we use it, we could do:

@supports selector(:has(a)) {
  /* styles when :has() is supported */
}

It is useful to think about what your plan is for detection, though. Like does it matter if Firefox doesn’t support :has() for what you are trying to do? Are you prepared to do it some other way if it’s not? As an example, I was talking to Eric Meyer the other day, and somehow table row/column highlighting came up, and he made a demo with :has().

Now you’d have to decide: how important is that effect? As written, in Firefox, just the cell you hover over highlights, so you could decide that’s fine, and then you don’t need any feature detection at all; you just let it fail. Alternatively, you could decide to use a @supports query in CSS and highlight the entire row if :has() isn’t supported, which is a similar effect (if not quite as cool).

Another decision you could make is to do the test in JavaScript and use a JavaScript-powered fallback if necessary. Good news, Stephanie has a JavaScript testing tool just for this. It uses a number of different techniques to report if a feature is supported or not. Ultimately you could use it for our :has() test like:

<script type="module">
  import * as SupportsCSS from "https://cdn.skypack.dev/supports-css@0.1.5";
  const tests = ["has"];
  SupportsCSS.init({ tests });

  if (!SupportsCSSTests.results.has) {
    document.head.insertAdjacentHTML(
      "beforeend",
      "<style>tr:hover { background: rgba(255,0,0,0.33); }</style>"
    );
  }
</script>

Ya know, just while we’re talking about feature detection in CSS, a typography-specific feature tester crossed my desk the other day, font-tech and font-format:

@supports font-tech(palettes) {
  .palette {
    display: block;
  }
}

@supports font-format(woff2) {
  div {
    display: block;
  }
}

Just interesting to me; I’ve never seen those specific functions before.


Wait, wait, I gotta do one more about feature detection. There are some things that you cannot detect in CSS, and is kind of a pain in the butt to detect in JavaScript also. Ahmad Shadeed made this point in Do we need CSS flex-wrap detection? The point has been made again and again that we need certain state detections like a :stuck selector for position: sticky; elements, and it sounds likely we’ll get that. But “is wrapped or not” is another form of state, I’d say. Ahmad’s use case was like… if a line in a flexbox layout wraps, it’s saying: “there isn’t room for these on one line”. But where that is is totally arbitrary based on content and element size. But if we knew exactly when that break was, we could, for example, use that exact moment to break a line of navigation into a hamburger rather than guessing at some magic number size. Strong point, I think.


I have an unnatural affinity for the “yellow fade technique”. It’s this idea that works with the :target selector in CSS and on-page anchor links. Imagine a table of contents where you click a link, and it jumps the page down (or scrolls, I suppose if you use scroll-behavior: smooth). How do you know exactly where the page is trying to take you to and draw your attention toward? The element is probably at the top of the page, but it might not be if the page is too short. The yellow fade technique just makes it way more clear. When that jump happens, that element becomes the :target, and you apply a background-color animation to it (light yellow!) that draws attention to it. It’s just nice, I think. There are some classic examples on CodePen, naturally.

The idea can also be applied to an element being added to the DOM, drawing attention to the fact that it just appeared. That’s what Bramus Van Damme does in The Yellow Fade Technique with Modern CSS using @starting-style.

Erm… @starting-style, what’s that? It’s basically built for the yellow fade technique. 😍.

div {
  transition: background-color 0.5s;
  background-color: transparent;

  @starting-style {
    background-color: yellow;
  }
}

With that, you don’t need a once-running @keyframes which ends up being more verbose and harder to understand. This way the transition essentially runs once on <div>s being added to the DOM. So I guess it’s not as perfect for the table of contents use-case, but it’s still pretty cool. Now I’m thinking about other DOM-entrance animations, like list items that slide in, or modals that fade in.


Sometimes we get new CSS stuff, and it’s just great right on the surface. Oh, the oklch() color function? Neat, it can do vibrant P3 colors. Neat, it has perceptually uniform lightness. Neat, the gradient interpolation is arguably nicer for some color pairings.

But then, over time, it turns out it’s how the new CSS feature is combined and interacts with other features that makes that feature shine even more. Aww, that was sweet, wasn’t it? We’re all better with a little help from our friends.

That’s what I was thinking about reading Adam Argyle’s A color-contrast() strategy for complimentary translucent backgrounds. If you haven’t seen color-contrast() yet, it’s a function that will pick the most visually contrasting color from a list of colors against a given color. That given color is probably a --custom-property meaning it can change and thus you don’t know ahead of time what the most contrasting color is. That’s awesome! But Adam takes it a little bit further. He wants to kick up the contrast even more by putting a slightly transparent black or white color behind the text.

html {
  --bg: hsl(var(--hue) 50% 50%);
}
  
h1 {
  --text: color-contrast(var(--bg) vs black, white);
  color: var(--text);
  background: hsl(0 0% 0% / 40%);
}
  
@supports (background: hsl(from red h s l)) {
  h1 {
    background: oklch(from color-contrast(var(--text) vs black,white) l c h / 40%);
  }
}

So cool. So individually, color-contrast() is neat, OKLCH is neat, @supports is neat, and the relative color syntax is neat, but combined, they really shine.

How to Fix the WordPress “White Screen of Death” (WSoD)

Featured Imgs 21
WordPress white screen of death.The WordPress White Screen of Death (WSoD) is arguably one of the most infuriating errors on the platform. Getting no indication of what has happened means you have to put in the work to find a fix. The error is also one that can cause some panic and anxiety. While you have the error, your site will be out of commission. Because of this, you need to work quickly and methodically to put everything right again. Fortunately, that’s where this tutorial comes in.