|
|
@@ -14,6 +14,8 @@ class Studiou_WC_FPP_Single_Product {
|
|
|
// Render upload cards UI at priority 35 on single product page.
|
|
|
// Also suppress pvtfw's variant table + available-options button on FPP products.
|
|
|
add_action('wp', array($this, 'maybe_suppress_pvtfw'), 5);
|
|
|
+ // Read-only price overview rendered right above the dropzone (1.5.12+).
|
|
|
+ add_action('woocommerce_single_product_summary', array($this, 'render_variant_price_table'), 34);
|
|
|
add_action('woocommerce_single_product_summary', array($this, 'render_upload_area'), 35);
|
|
|
|
|
|
// Add a body class on FPP product pages for CSS scoping
|
|
|
@@ -67,6 +69,11 @@ class Studiou_WC_FPP_Single_Product {
|
|
|
$available_btn = PVTFW_AVAILABE_BTN::instance();
|
|
|
remove_action('woocommerce_single_product_summary', array($available_btn, 'available_options_btn'), 11);
|
|
|
}
|
|
|
+
|
|
|
+ // Hide WC's native price-range element (e.g. "10,00 Kč – 40,00 Kč") on FPP products.
|
|
|
+ // The variant price table we render at priority 34 already communicates per-variant
|
|
|
+ // pricing, and the range is visually noisy above it.
|
|
|
+ remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
|
|
|
}
|
|
|
|
|
|
public function body_class($classes) {
|
|
|
@@ -136,6 +143,23 @@ class Studiou_WC_FPP_Single_Product {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Read-only variant price/discount table rendered above the dropzone (1.5.12+).
|
|
|
+ * Customers see all variant prices and the tiered quantity discounts before uploading.
|
|
|
+ * Purely informational — no radio/select/qty/add-to-cart.
|
|
|
+ */
|
|
|
+ public function render_variant_price_table() {
|
|
|
+ global $product;
|
|
|
+ if (!$product || !Studiou_WC_FPP_Product::is_fpp_product($product->get_id())) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $variants = $this->build_variant_list($product);
|
|
|
+ if (empty($variants)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ include STUDIOU_WCFPP_PLUGIN_DIR . 'views/single-product-price-table.php';
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Produce the array of variation descriptors consumed by the upload-card JS.
|
|
|
* One entry per in-stock, purchasable variation: id, label, base_price, tiers.
|