null, 'showImage' => true, 'showDescription' => true, 'showPrice' => true, 'showButton' => true, 'buttonText' => __('Buy Now', 'fluent-crm'), 'backgroundColor' => '#fffeeb', 'contentColor' => '', 'pricingColor' => '', 'template' => 'left', ]; $attrs = isset($data['attrs']) && is_array($data['attrs']) ? $data['attrs'] : []; $atts = wp_parse_args($attrs, $defaultAtts); $productId = absint($atts['productId']); if (!$productId) { return ''; } $product = self::getProductData($productId); if (!$product) { return ''; } $template = self::normalizeTemplate(Arr::get($atts, 'template', 'left')); $showImage = RenderValueHelper::normalizeBool(Arr::get($atts, 'showImage'), true); $showDescription = RenderValueHelper::normalizeBool(Arr::get($atts, 'showDescription'), true); $showPrice = RenderValueHelper::normalizeBool(Arr::get($atts, 'showPrice'), true); $showButton = RenderValueHelper::normalizeBool(Arr::get($atts, 'showButton'), true); $tableStyle = 'border-radius: 5px;'; $contentColorStyle = ''; if ($bgColor = Arr::get($atts, 'backgroundColor')) { $tableStyle .= 'background-color:' . sanitize_text_field($bgColor) . ';'; } if ($contentColor = Arr::get($atts, 'contentColor')) { $safeContentColor = sanitize_text_field($contentColor); $tableStyle .= 'color:' . $safeContentColor . ';'; $contentColorStyle = 'color:' . $safeContentColor . ';'; } $priceStyle = ''; if ($pricingColor = Arr::get($atts, 'pricingColor')) { $priceStyle = 'color:' . sanitize_text_field($pricingColor) . ';'; } $contentHtml = sprintf( '
| ' . $contentHtml . ' |