shop changes

This commit is contained in:
2025-06-25 16:04:19 -07:00
parent 8d33ce2dc7
commit b0635919b1
30 changed files with 550 additions and 144 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Actions;
use Helpers\McCansHelpers;
use ofc\RadAction;
class WooCommerceProductTile extends RadAction
{
protected string $hookName = "woocommerce_shop_loop_item_title";
protected bool $wrapInit = true;
public function callback()
{
global $product;
$data = site()->getPost($product->id, [
"url",
"id",
"title",
"thumbnail",
"woocommerce.price",
"woocommerce.attribute.msrp",
"woocommerce.cartUrl",
"woocommerce.sku",
]);
$data["savings"] = McCansHelpers::calcDifference($data["price"], $data["msrp"]);
echo site()->render("product-tile", $data);
}
}