Roots Discourse

[SOLVED] Blade Components in Sage 10 not working as expected - or are they?

I’m creating blade components for everything.

However, while working on WooCommerce, I created a Product component in Blade. And evertyhing works, except “$sale_price” - its null, I don’t understand. I created a new field ‘test’ it worked, I created ‘sage_sale_price’ - it didn’t work. As if ‘sale_price’ is breaking this and giving null.

Plus, you can see I’m putting a random text in the sale_price anyway, so the value is there 100%.

The values arne’t empty, I did output the values with var_dump and they are there.

Why do I get this issue?

Then here I put the sale_price value:

And this is how I call it:

Sale price doesn’t show, sage_sale_price wont’ show either, test will, ‘regular_price’ doesn’t show either.

What to do? Why such an issue?

After 3hours, I figured out you can’t have underscores in blade components.

I tried ‘rice’ - it worked.
I tried ‘sale’ - it worked.

I tried sale_p - it broke

So then I tried salePrice - it worked.

So it seems like you can’t have underscores in components.

1 Like