chrisblakley / Nebula

Nebula is a WordPress theme framework that focuses on enhancing development. The core features of Nebula make it a powerful tool for designing, developing, and analyzing WordPress websites consistently, yet its deliberately uncomplicated code syntax also serves as a learning resource for programmers themselves.
https://nebula.gearside.com
GNU General Public License v2.0
139 stars 36 forks source link

Update Ecommerce.php to ensure $product is an object #2251

Closed patphg closed 12 months ago

patphg commented 12 months ago

Types of change(s)

Bug fix/patch

What problem does this address?

The global $product is only an object of class WC_Product when the_post() is used. Else, it comes over as a string, causing fatal errors with the rest of the script.

What is the new behavior?

If the $product is not an object, it performs a lookup for the product by the ID before continuing.