if (window.customCardProps?.custom_pc) { window.run_product_card = function (_this) { let lang = document.documentElement.getAttribute("lang"); const remained = salla.lang.get("pages.products.remained"); const donationPH = salla.lang.get("pages.products.donation_placeholder"); const startingPrice = salla.lang.get("pages.products.starting_price"); const outOfStock = salla.lang.get("pages.products.out_of_stock"); const calories = salla.lang.get("pages.products.calories"); _this.product_preview_down = window.customCardProps?.product_preview_down; _this.p_atc_btn_hidden = window.customCardProps?.p_atc_btn_hidden; _this.product_preview_icon_hide = window.customCardProps?.product_preview_icon_hide; _this.preview_text = window.customCardProps?.preview_text; _this.is_price_ratio_on = window.customCardProps?.is_price_ratio_on; _this.price_ratio_place = window.customCardProps?.price_ratio_place; _this.price_ratio_word = window.customCardProps?.price_ratio_word; _this.price_ratio_after_word = window.customCardProps?.price_ratio_after_word; _this.small_atc = window.customCardProps?.small_atc; _this.show_pc_ratings = window.customCardProps?.show_pc_ratings; if (_this.show_pc_ratings === "hide") { _this.show_pc_ratings = false; } if (!_this.config) { _this.config = {}; if (window.product_options_in_pc) { if (window.single_option_new_shape) { _this.config["single-option"] = { type: "button" }; } if (window.multiple_option_new_shape) { _this.config["multiple-option"] = { type: "button" }; } } } let product_ration_html; if (_this?.product?.is_on_sale) { _this.product_ratio_percent = Math.round( ((_this.product?.regular_price - _this.product?.sale_price) / _this.product?.regular_price) * 100 ); product_ration_html = `
${
_this.product_preview_down
? ""
: `