function fn_exim_mailru_get_product_features($product_id, $lang_code = CART_LANGUAGE)
{
    static $features;
    if (!isset($features[$lang_code])) {
        list($features[$lang_code]) = fn_get_product_features(array('plain' => true), 0, $lang_code);
    }
    //params
    $main_category = db_get_field('SELECT category_id FROM ?:products_categories WHERE product_id = ?i AND link_type = ?s', $product_id, 'M');
    $product = array('product_id' => $product_id, 'main_category' => $main_category);
    $product_features = fn_get_product_features_list($product, 'A', $lang_code);
    $result = array();
    if (!empty($product_features)) {
        foreach ($product_features as $f) {
            $display_on_catalog = $features[$lang_code][$f['feature_id']]['display_on_catalog'];
            $display_on_product = $features[$lang_code][$f['feature_id']]['display_on_product'];
            if ($display_on_catalog == "Y" || $display_on_product == "Y") {
                if ($f['feature_type'] == "C") {
                    $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => $f['value'] == "Y" ? __("yes") : __("no"));
                } elseif ($f['feature_type'] == "S" && !empty($f['variant'])) {
                    $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($f['variant']));
                } elseif ($f['feature_type'] == "T" && !empty($f['value'])) {
                    $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($f['value']));
                } elseif ($f['feature_type'] == "M") {
                    if (!empty($f['variants'])) {
                        $_value = '';
                        $counter = count($f['variants']);
                        foreach ($f['variants'] as $_variant) {
                            if ($counter > 1) {
                                $_value .= $_variant['variant'] . ', ';
                            } else {
                                $_value = $_variant['variant'];
                            }
                        }
                        $_value = $counter > 1 ? substr($_value, 0, -2) : $_value;
                        $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($_value));
                    }
                } elseif ($f['feature_type'] == "N") {
                    $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($f['variant']));
                } elseif ($f['feature_type'] == "O") {
                    $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($f['value_int']));
                }
            } elseif ($f['feature_type'] == "E") {
                $result[] = array('description' => fn_exim_mailru_get_product_info($f['description']), 'value' => fn_exim_mailru_get_product_info($f['variant']));
            }
        }
    }
    return !empty($result) ? $result : '';
}
Ejemplo n.º 2
0
 /**
  * Export product features
  */
 protected function getProductFeatures($product)
 {
     static $features;
     $lang_code = $this->lang_code;
     if (!isset($features[$lang_code])) {
         list($features[$lang_code]) = fn_get_product_features(array('plain' => true), 0, $lang_code);
     }
     $product = array('product_id' => $product['product_id'], 'main_category' => $product['category_id']);
     $product_features = fn_get_product_features_list($product, 'A', $lang_code);
     $result = array();
     if (!empty($product_features)) {
         foreach ($product_features as $f) {
             $display_on_catalog = $features[$lang_code][$f['feature_id']]['display_on_catalog'];
             $display_on_product = $features[$lang_code][$f['feature_id']]['display_on_product'];
             if ($display_on_catalog == "Y" || $display_on_product == "Y") {
                 if ($f['feature_type'] == "C") {
                     $result[] = array('description' => $f['description'], 'value' => $f['value'] == "Y" ? __("yes") : __("no"));
                 } elseif ($f['feature_type'] == "S" && !empty($f['variant'])) {
                     $result[] = array('description' => $f['description'], 'value' => $f['variant']);
                 } elseif ($f['feature_type'] == "T" && !empty($f['value'])) {
                     $result[] = array('description' => $f['description'], 'value' => $f['value']);
                 } elseif ($f['feature_type'] == "M") {
                     if (!empty($f['variants'])) {
                         $_value = '';
                         $counter = count($f['variants']);
                         foreach ($f['variants'] as $_variant) {
                             if ($counter > 1) {
                                 $_value .= $_variant['variant'] . ', ';
                             } else {
                                 $_value = $_variant['variant'];
                             }
                         }
                         $_value = $counter > 1 ? substr($_value, 0, -2) : $_value;
                         $result[] = array('description' => $f['description'], 'value' => $_value);
                     }
                 } elseif ($f['feature_type'] == "N") {
                     $result[] = array('description' => $f['description'], 'value' => $f['variant']);
                 } elseif ($f['feature_type'] == "O") {
                     $result[] = array('description' => $f['description'], 'value' => $f['value_int']);
                 } elseif ($f['feature_type'] == "E") {
                     $result[] = array('description' => $f['description'], 'value' => $f['variant']);
                 }
             }
         }
     }
     return !empty($result) ? $result : '';
 }
Ejemplo n.º 3
0
/**
 * Gets additional products data
 *
 * @param array $products Array with products
 * @param array $params Array of flags which determines which data should be gathered
 * @return array Array of products with additional information
 */
function fn_gather_additional_products_data(&$products, $params)
{
    /**
     * Change parameters for gathering additional products data
     *
     * @param array $products List of products
     * @param array $params   Parameters for gathering data
     */
    fn_set_hook('gather_additional_products_data_pre', $products, $params);
    if (empty($products)) {
        return;
    }
    // Set default values to input params
    $default_params = array('get_icon' => false, 'get_detailed' => false, 'get_additional' => false, 'get_options' => true, 'get_discounts' => true, 'get_features' => false, 'get_extra' => false, 'get_taxed_prices' => true, 'get_for_one_product' => !is_array(reset($products)) ? true : false, 'detailed_params' => true, 'features_display_on' => 'C', 'ls_category_page' => false);
    $params = array_merge($default_params, $params);
    $auth =& $_SESSION['auth'];
    $allow_negative_amount = Registry::get('settings.General.allow_negative_amount');
    $inventory_tracking = Registry::get('settings.General.inventory_tracking');
    if ($params['get_for_one_product']) {
        $products = array($products);
    }
    $product_ids = array();
    foreach ($products as $v) {
        $product_ids[] = $v['product_id'];
    }
    if ($params['get_icon'] || $params['get_detailed']) {
        $products_images = fn_get_image_pairs($product_ids, 'product', 'M', $params['get_icon'], $params['get_detailed'], CART_LANGUAGE);
    }
    if ($params['get_additional']) {
        $additional_images = fn_get_image_pairs($product_ids, 'product', 'A', true, true, CART_LANGUAGE);
        //uncoment me
    }
    if ($params['get_options']) {
        $product_options = fn_get_product_options($product_ids, CART_LANGUAGE);
    } else {
        $has_product_options = db_get_hash_array("SELECT a.option_id, a.product_id FROM ?:product_options AS a WHERE a.product_id IN (?n) AND a.status = 'A'", 'product_id', $product_ids);
        $has_product_options_links = db_get_hash_array("SELECT c.option_id, c.product_id FROM ?:product_global_option_links AS c LEFT JOIN ?:product_options AS a ON a.option_id = c.option_id WHERE a.status = 'A' AND c.product_id IN (?n)", 'product_id', $product_ids);
    }
    /**
     * Changes before gathering additional products data
     *
     * @param array $product_ids               Array of product identifiers
     * @param array $params                    Parameteres for gathering data
     * @param array $products                  Array of products
     * @param mixed $auth                      Array of user authentication data
     * @param array $products_images           Array with product main images
     * @param array $additional_images         Array with product additional images
     * @param array $product_options           Array with product options
     * @param array $has_product_options       Array of flags determines if product has options
     * @param array $has_product_options_links Array of flags determines if product has option links
     */
    fn_set_hook('gather_additional_products_data_params', $product_ids, $params, $products, $auth, $products_images, $additional_images, $product_options, $has_product_options, $has_product_options_links);
    // foreach $products
    foreach ($products as &$_product) {
        $product = $_product;
        //var_dump($product['product_options']);echo"<br/>";
        $featureVariants = array();
        $product_image_pairs_extra = array();
        $product_id = $product['product_id'];
        // Get images
        if ($params['get_icon'] == true || $params['get_detailed'] == true) {
            if (empty($product['main_pair']) && !empty($products_images[$product_id])) {
                $product['main_pair'] = reset($products_images[$product_id]);
            }
        }
        if ($params['get_additional'] == true) {
            if (empty($product['image_pairs']) && !empty($additional_images[$product_id])) {
                $product['image_pairs'] = $additional_images[$product_id];
            }
            //generate images for filters - saved in backend caracteristics
            /*  if($params["ls_category_page"]) {
                            $featureVariants = db_get_fields("  SELECT c.variant_id
                                                                FROM  ?:product_features AS a
                                                                  JOIN  ?:product_feature_variants AS b ON a.feature_id = b.feature_id
                                                                    JOIN  ?:product_features_values AS c ON b.variant_id = c.variant_id
                                                                WHERE c.product_id =?i
                                                                GROUP BY c.variant_id",$product_id);
                //            //var_dump($featureVariants);echo "<br/>__<br/>";
                            if(!empty($featureVariants)){
                                $product_image_pairs_extra = fn_get_image_pairs($featureVariants, 'p_feature_var_extra', 'M', true, true, $lang_code);
                                foreach($product_image_pairs_extra as $key12=>$product_image_pair_extra){
                                    if(!empty($product_image_pair_extra)){
                                        foreach($product_image_pair_extra as $k1=>$v1){
                                            $product['image_pairs'][$k1] = $v1; 
                                            $product['image_pairs'][$k1]['pair_id_class'] = 'V'.$key12;
                                        }
                                    }
                                }
                            }
                           
                       } */
        }
        if (!isset($product['base_price'])) {
            $product['base_price'] = $product['price'];
            // save base price (without discounts, etc...)
        }
        /**
         * Changes before gathering product options
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_before_options', $product, $auth, $params);
        // Convert product categories
        if (!empty($product['category_ids']) && !is_array($product['category_ids'])) {
            list($product['category_ids'], $product['main_category']) = fn_convert_categories($product['category_ids']);
        }
        $product['selected_options'] = empty($product['selected_options']) ? array() : $product['selected_options'];
        //var_dump($product['selected_options']);
        // Get product options
        if ($params['get_options'] && !empty($product_options[$product['product_id']])) {
            if (!isset($product['options_type']) || !isset($product['exceptions_type'])) {
                $types = db_get_row('SELECT options_type, exceptions_type FROM ?:products WHERE product_id = ?i', $product['product_id']);
                $product['options_type'] = $types['options_type'];
                $product['exceptions_type'] = $types['exceptions_type'];
            }
            $product['product_options'] = $product_options[$product['product_id']];
            if (empty($product['product_options'])) {
                if (!empty($product['combination'])) {
                    $selected_options = fn_get_product_options_by_combination($product['combination']);
                }
                $product['product_options'] = !empty($selected_options) ? fn_get_selected_product_options($product['product_id'], $selected_options, CART_LANGUAGE) : $product_options[$product_id];
            }
            $o_data_variants_disabled = db_get_array("SELECT * FROM ?:product_option_variants_disabled WHERE product_id=?i ", $product_id);
            if (!empty($o_data_variants_disabled)) {
                foreach ($o_data_variants_disabled as $o_data_variant_disabled) {
                    if ($product['product_options'][$o_data_variant_disabled['option_id']] && $product['product_options'][$o_data_variant_disabled['option_id']]['variants'][$o_data_variant_disabled['variant_id']]) {
                        unset($product['product_options'][$o_data_variant_disabled['option_id']]['variants'][$o_data_variant_disabled['variant_id']]);
                    }
                }
            }
            $product = fn_apply_options_rules($product);
            if ((!empty($params['get_icon']) || !empty($params['get_detailed'])) && !$params["ls_category_page"]) {
                // Get product options images
                if (!empty($product['combination_hash']) && !empty($product['product_options'])) {
                    $image = fn_get_image_pairs($product['combination_hash'], 'product_option', 'M', $params['get_icon'], $params['get_detailed'], CART_LANGUAGE);
                    if (!empty($image)) {
                        //$oldMainImage = $product['main_pair'];
                        //$oldMainImageId = $product['pair_id'];
                        $product['main_pair'] = $image;
                    }
                    $add_image = fn_get_image_pairs($product['combination_hash'], 'product_option', 'A', $params['get_icon'], $params['get_detailed'], CART_LANGUAGE);
                    if (!empty($add_image)) {
                        //$old_image_pairs = $product['image_pairs'];
                        $product['image_pairs'] = $add_image;
                        //                        if(!empty($image)) $product['image_pairs'][$oldMainImageId] = $oldMainImage;
                        //                        foreach($old_image_pairs as $key1=>$old_image_pair){
                        //                            $product['image_pairs'][$key1] = $old_image_pair;
                        //                        }
                    }
                }
            }
            //var_dump($product['image_pairs']);
            $product_image_pairs_extra = array();
            if ($_REQUEST['features_hash']) {
                list($av_ids, $ranges_ids, $fields_ids, $slider_vals, $fields_ids_revert) = fn_parse_features_hash($_REQUEST['features_hash']);
                if (empty($product_image_pairs_extra) && !empty($av_ids)) {
                    $product_image_pairs_extra = fn_get_image_pairs($av_ids, 'p_feature_var_extra', 'M', true, true, $lang_code, $product_id, false);
                    //var_dump($product_id);echo" ===> ";var_dump($product_image_pairs_extra);echo"<br/>______________________<br/>";
                    if ($params["ls_category_page"]) {
                        //remove main picture on category page on filter search
                        $product['main_pair'] = array();
                        if (!isset($product['image_pairs'])) {
                            $product['image_pairs'] = array();
                        }
                        //add to product['image_pairs'] extra images from backend/characteristics
                        $ls_images_paths = array();
                        foreach ($product_image_pairs_extra as $k0 => $v0) {
                            foreach ($v0 as $k1 => $v1) {
                                $v1['detailed'] = $v1['icon'];
                                if (in_array($v1['icon']["image_path"], $ls_images_paths)) {
                                    continue;
                                } else {
                                    $ls_images_paths[] = $v1['icon']["image_path"];
                                }
                                array_unshift($product['image_pairs'], $v1);
                            }
                            //  array_unshift($product['image_pairs'],$v1);
                        }
                    } else {
                        foreach ($product_image_pairs_extra as $key12 => $product_image_pair_extra) {
                            //                        if(!empty($product_image_pair_extra)){
                            //                            foreach($product_image_pair_extra as $k1=>$v1){
                            //                                $product['image_pairs'][$k1] = $v1;
                            //                                $product['image_pairs'][$k1]['pair_id_class'] = 'V'.$key12;
                            //                            }
                            //                        }
                            $keys = array_keys($product_image_pair_extra);
                            $product['main_pair'] = $product_image_pair_extra[$keys[0]];
                        }
                    }
                }
            }
            //var_dump($product_id);echo"   ==============>    ";var_dump($product['main_pair']);echo"<br/>________________________________________________________________________________________________<br/>";
            $product['has_options'] = !empty($product['product_options']);
            if (!fn_allowed_for('ULTIMATE:FREE')) {
                $product = fn_apply_exceptions_rules($product);
            }
            // Change price
            $selected_options = isset($product['selected_options']) ? $product['selected_options'] : array();
            foreach ($product['product_options'] as $option) {
                if (!empty($option['disabled'])) {
                    unset($selected_options[$option['option_id']]);
                }
            }
            //var_dump($product_id);echo" =======>";var_dump($selected_options);echo" ----> ";
            $selected_options = fn_get_new_default_product_selected_options($product_id, $selected_options);
            //var_dump($selected_options);echo"<br/>";
            if ($product['extra'] && $product['extra']['product_options']) {
                $selected_options = $product['extra']['product_options'];
            }
            $product['selected_options'] = $selected_options;
            if (empty($product['modifiers_price'])) {
                $addon_price_calculation_price = fn_get_price_by_selected_options($product_id, $product, $selected_options);
                //var_dump($product_id);echo" ====>";var_dump($selected_options);echo" ----- ";var_dump($addon_price_calculation_price);echo"<br/>------<br/>";
                if (intval($addon_price_calculation_price) > 0) {
                    $product['base_modifier'] = 0;
                    $product['original_price'] = $addon_price_calculation_price;
                    $product['price'] = $addon_price_calculation_price;
                    $product['base_price'] = $product['price'];
                    $old_price = $product['price'];
                } else {
                    $product['base_modifier'] = fn_apply_options_modifiers($selected_options, $product['base_price'], 'P', array(), array('product_data' => $product));
                    $old_price = $product['price'];
                    //var_dump($product['base_modifier']);
                    $product['price'] = fn_apply_options_modifiers($selected_options, $product['price'], 'P', array(), array('product_data' => $product));
                    if (empty($product['original_price'])) {
                        $product['original_price'] = $old_price;
                    }
                    $product['original_price'] = fn_apply_options_modifiers($selected_options, $product['original_price'], 'P', array(), array('product_data' => $product));
                }
                $product['modifiers_price'] = $product['price'] - $old_price;
                if (!empty($product['list_price'])) {
                    $product['list_price'] = fn_apply_options_modifiers($selected_options, $product['list_price'], 'P', array(), array('product_data' => $product));
                }
                if (!empty($product['prices']) && is_array($product['prices'])) {
                    foreach ($product['prices'] as $pr_k => $pr_v) {
                        $product['prices'][$pr_k]['price'] = fn_apply_options_modifiers($selected_options, $pr_v['price'], 'P', array(), array('product_data' => $product));
                    }
                }
            }
            //echo"1 ===>pid: ";var_dump($product['product_id']);echo" --->op: ";var_dump($product['original_price']);echo" =>p: ";var_dump($product['price']);echo"<br/>";
        } else {
            $product['has_options'] = !empty($has_product_options[$product_id]) || !empty($has_product_options_links[$product_id]) ? true : false;
            $product['product_options'] = empty($product['product_options']) ? array() : $product['product_options'];
        }
        unset($selected_options);
        /**
         * Changes before gathering product discounts
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_before_discounts', $product, $auth, $params);
        //var_dump($product['exclude_from_calculate']);echo"<br/>";
        // Get product discounts
        if ($params['get_discounts'] && !isset($product['exclude_from_calculate'])) {
            //echo"1 ===> ";var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
            fn_promotion_apply('catalog', $product, $auth);
            //echo"2 ===> ";var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
            //var_dump($product['product_id']);echo" ---> ";var_dump($product['promotion_use_color']);echo"<br/>___<br/>";
            if (!empty($product['prices']) && is_array($product['prices'])) {
                $product_copy = $product;
                foreach ($product['prices'] as $pr_k => $pr_v) {
                    $product_copy['base_price'] = $product_copy['price'] = $pr_v['price'];
                    fn_promotion_apply('catalog', $product_copy, $auth);
                    $product['prices'][$pr_k]['price'] = $product_copy['price'];
                }
            }
            if (empty($product['discount']) && !empty($product['list_price']) && !empty($product['price']) && floatval($product['price']) && $product['list_price'] > $product['price']) {
                $product['list_discount'] = fn_format_price($product['list_price'] - $product['price']);
                $product['list_discount_prc'] = sprintf('%d', round($product['list_discount'] * 100 / $product['list_price']));
            }
        }
        //echo"2 ===> ";var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
        //        if($product['product_id']==2372){
        //            var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
        //        }
        // FIXME: old product options scheme
        $product['discounts'] = array('A' => 0, 'P' => 0);
        if (!empty($product['promotions'])) {
            foreach ($product['promotions'] as $v) {
                foreach ($v['bonuses'] as $a) {
                    if ($a['discount_bonus'] == 'to_fixed') {
                        $product['discounts']['A'] += $a['discount'];
                    } elseif ($a['discount_bonus'] == 'by_fixed') {
                        $product['discounts']['A'] += $a['discount_value'];
                    } elseif ($a['discount_bonus'] == 'to_percentage') {
                        $product['discounts']['P'] += 100 - $a['discount_value'];
                    } elseif ($a['discount_bonus'] == 'by_percentage') {
                        $product['discounts']['P'] += $a['discount_value'];
                    }
                }
            }
        }
        //echo"2 ===> ";var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
        // Add product prices with taxes and without taxes
        if ($params['get_taxed_prices'] && AREA != 'A' && Registry::get('settings.Appearance.show_prices_taxed_clean') == 'Y' && $auth['tax_exempt'] != 'Y') {
            fn_get_taxed_and_clean_prices($product, $auth);
        }
        if ($params['get_features'] && !isset($product['product_features'])) {
            $product['product_features'] = fn_get_product_features_list($product, $params['features_display_on']);
        }
        if ($params['get_extra'] && !empty($product['is_edp']) && $product['is_edp'] == 'Y') {
            $product['agreement'] = array(fn_get_edp_agreements($product['product_id']));
        }
        $product['qty_content'] = fn_get_product_qty_content($product, $allow_negative_amount, $inventory_tracking);
        if ($params['detailed_params']) {
            $product['detailed_params'] = empty($product['detailed_params']) ? $params : array_merge($product['detailed_params'], $params);
        }
        /**
         * Add additional data to product
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_post', $product, $auth, $params);
        //echo"2 ===> ";var_dump($product['product_id']);echo" ---> ";var_dump($product['original_price']);echo" => ";var_dump($product['price']);echo"<br/>";
        $_product = $product;
    }
    // \foreach $products
    /**
     * Add additional data to products after gathering additional products data
     *
     * @param array $product_ids Array of product identifiers
     * @param array $params      Parameteres for gathering data
     * @param array $products    Array of products
     * @param mixed $auth        Array of user authentication data
     */
    fn_set_hook('gather_additional_products_data_post', $product_ids, $params, $products, $auth);
    if ($params['get_for_one_product'] == true) {
        $products = array_shift($products);
    }
}
function fn_exim_get_product_features($product_id, $features_delimiter, $lang_code = CART_LANGUAGE)
{
    static $features;
    if (!isset($features[$lang_code])) {
        list($features[$lang_code]) = fn_get_product_features(array('plain' => true), 0, $lang_code);
    }
    $main_category = db_get_field('SELECT category_id FROM ?:products_categories WHERE product_id = ?i AND link_type = ?s', $product_id, 'M');
    $product = array('product_id' => $product_id, 'main_category' => $main_category);
    $product_features = fn_get_product_features_list($product, 'A', $lang_code);
    $pair_delimiter = ':';
    $set_delimiter = ';';
    $result = array();
    if (!empty($product_features)) {
        foreach ($product_features as $f) {
            $parent = '';
            if (!empty($f['parent_id'])) {
                $parent = '(' . str_replace($set_delimiter, '\\\\' . $set_delimiter, $features[$lang_code][$f['parent_id']]['description']) . ') ';
            }
            $f['value_int'] = empty($f['value_int']) ? 0 : floatval($f['value_int']);
            if (!empty($f['value']) || !empty($f['value_int'])) {
                $result[] = $parent . "{$f['description']}{$pair_delimiter} {$f['feature_type']}[" . (!empty($f['value']) ? $f['value'] : $f['value_int']) . ']';
            } else {
                $_params = array('feature_id' => $f['feature_id'], 'product_id' => $product_id, 'feature_type' => $f['feature_type'], 'selected_only' => true);
                list($variants) = fn_get_product_feature_variants($_params, 0, $lang_code);
                if ($variants) {
                    $values = array();
                    foreach ($variants as $v) {
                        $values[] = str_replace($set_delimiter, '\\\\' . $set_delimiter, $v['variant']);
                    }
                    $feature_description = str_replace($set_delimiter, '\\\\' . $set_delimiter, $f['description']);
                    $result[] = $parent . "{$feature_description}{$pair_delimiter} {$f['feature_type']}[" . implode($features_delimiter, $values) . ']';
                }
            }
        }
    }
    return !empty($result) ? implode($set_delimiter . ' ', $result) : '';
}
    function content_55dc759f729bc0_59760313($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_enum')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.enum.php';
        }
        if (!is_callable('smarty_block_hook')) {
            include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_function_live_edit')) {
            include '/var/www/html/market/app/functions/smarty_plugins/function.live_edit.php';
        }
        if (!is_callable('smarty_modifier_truncate')) {
            include '/var/www/html/market/app/functions/smarty_plugins/modifier.truncate.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/var/www/html/market/app/functions/smarty_plugins/function.set_id.php';
        }
        fn_preload_lang_vars(array('text_combination_out_of_stock', 'text_out_of_stock', 'sku', 'select_options', 'notify_when_back_in_stock', 'email', 'enter_email', 'enter_email', 'go', 'old_price', 'list_price', 'enter_your_price', 'contact_us_for_price', 'sign_in_to_view_price', 'inc_tax', 'including_tax', 'you_save', 'you_save', 'save_discount', 'availability', 'items', 'in_stock', 'availability', 'in_stock', 'availability', 'quantity', 'text_cart_min_qty', 'text_edp_product', 'text_combination_out_of_stock', 'text_out_of_stock', 'sku', 'select_options', 'notify_when_back_in_stock', 'email', 'enter_email', 'enter_email', 'go', 'old_price', 'list_price', 'enter_your_price', 'contact_us_for_price', 'sign_in_to_view_price', 'inc_tax', 'including_tax', 'you_save', 'you_save', 'save_discount', 'availability', 'items', 'in_stock', 'availability', 'in_stock', 'availability', 'quantity', 'text_cart_min_qty', 'text_edp_product'));
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['product']->value['tracking'] == smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["out_of_stock_text"] = new Smarty_variable($_smarty_tpl->__("text_combination_out_of_stock"), null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["out_of_stock_text"] = new Smarty_variable($_smarty_tpl->__("text_out_of_stock"), null, 0);
            }
            ?>

<?php 
            if ((floatval($_smarty_tpl->tpl_vars['product']->value['price']) || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "P" || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A" || !floatval($_smarty_tpl->tpl_vars['product']->value['price']) && $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R") && !($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id'])) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["show_price_values"] = new Smarty_variable(true, null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["show_price_values"] = new Smarty_variable(false, null, 0);
            }
            $_smarty_tpl->_capture_stack[0][] = array("show_price_values", null, null);
            ob_start();
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
            $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(false, null, 0);
            $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['show_qty']->value) === null || $tmp === '' ? true : $tmp, null, 0);
            $_smarty_tpl->tpl_vars["obj_id"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['obj_id']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['product_id'] : $tmp, null, 0);
            $_smarty_tpl->tpl_vars["product_amount"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['product']->value['inventory_amount']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['amount'] : $tmp, null, 0);
            if (!$_smarty_tpl->tpl_vars['config']->value['tweaks']['disable_dhtml'] && !$_smarty_tpl->tpl_vars['no_ajax']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["is_ajax"] = new Smarty_variable(true, null, 0);
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("form_open_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if (!$_smarty_tpl->tpl_vars['hide_form']->value) {
                ?>
<form action="<?php 
                echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                ?>
" method="post" name="product_form_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" enctype="multipart/form-data" class="cm-disable-empty-files <?php 
                if ($_smarty_tpl->tpl_vars['is_ajax']->value) {
                    ?>
 cm-ajax cm-ajax-full-render cm-ajax-status-middle<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['form_meta']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['form_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
">
<input type="hidden" name="result_ids" value="cart_status*,wish_list*,checkout*,account_info*" />
<?php 
                if (!$_smarty_tpl->tpl_vars['stay_in_cart']->value) {
                    ?>
<input type="hidden" name="redirect_url" value="<?php 
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['redirect_url']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['config']->value['current_url'] : $tmp, ENT_QUOTES, 'UTF-8');
                    ?>
" />
<?php 
                }
                ?>
<input type="hidden" name="product_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
][product_id]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                ?>
" />
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("form_open_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("name_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_name"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_name"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['show_name']->value) {
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
<strong><?php 
                    } else {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                        ?>
" class="product-title" <?php 
                        echo smarty_function_live_edit(array('name' => "product:product:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['product']), $_smarty_tpl);
                        ?>
><?php 
                    }
                    echo $_smarty_tpl->tpl_vars['product']->value['product'];
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
</strong><?php 
                    } else {
                        ?>
</a><?php 
                    }
                    ?>
    <?php 
                } elseif ($_smarty_tpl->tpl_vars['show_trunc_name']->value) {
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
<strong><?php 
                    } else {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                        ?>
" class="product-title" title="<?php 
                        echo htmlspecialchars(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['product']->value['product']), ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        echo smarty_function_live_edit(array('name' => "product:product:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['product']), $_smarty_tpl);
                        ?>
><?php 
                    }
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['product']->value['product'], 44, "...", true);
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
</strong><?php 
                    } else {
                        ?>
</a><?php 
                    }
                    ?>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_name"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("name_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("sku_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_sku']->value) {
                ?>
        <div class="ty-control-group ty-sku-item cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                if (!$_smarty_tpl->tpl_vars['product']->value['product_code']) {
                    ?>
 hidden<?php 
                }
                ?>
" id="sku_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_sku]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_sku']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <label class="ty-control-group__label" id="sku_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("sku");
                ?>
:</label>
            <span class="ty-control-group__item" id="product_code_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_code'], ENT_QUOTES, 'UTF-8');
                ?>
</span>
        <!--sku_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("sku_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("rating_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:data_block"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:data_block"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:data_block"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("rating_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("add_to_cart_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['show_add_to_cart']->value) {
                ?>
<div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
 <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['add_to_cart_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="add_to_cart_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
<input type="hidden" name="appearance[show_add_to_cart]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_add_to_cart']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[show_list_buttons]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_list_buttons']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[but_role]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_role']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[quick_view]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['quick_view']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("buttons_product", null, null);
                ob_start();
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:add_to_cart"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:add_to_cart"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    if ($_smarty_tpl->tpl_vars['product']->value['has_options'] && !$_smarty_tpl->tpl_vars['show_product_options']->value && !$_smarty_tpl->tpl_vars['details_page']->value) {
                        if ($_smarty_tpl->tpl_vars['but_role']->value == "text") {
                            $_smarty_tpl->tpl_vars['opt_but_role'] = new Smarty_variable("text", null, 0);
                        } else {
                            $_smarty_tpl->tpl_vars['opt_but_role'] = new Smarty_variable("action", null, 0);
                        }
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "button_cart_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_text' => __("select_options"), 'but_href' => "products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'but_role' => $_smarty_tpl->tpl_vars['opt_but_role']->value, 'but_name' => '', 'but_meta' => "ty-btn__primary ty-btn__big"), 0);
                    } else {
                        if ($_smarty_tpl->tpl_vars['extra_button']->value) {
                            echo $_smarty_tpl->tpl_vars['extra_button']->value;
                            ?>
&nbsp;<?php 
                        }
                        echo $_smarty_tpl->getSubTemplate("buttons/add_to_cart.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "button_cart_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_name' => "dispatch[checkout.add.." . (string) $_smarty_tpl->tpl_vars['obj_id']->value . "]", 'but_role' => $_smarty_tpl->tpl_vars['but_role']->value, 'block_width' => $_smarty_tpl->tpl_vars['block_width']->value, 'obj_id' => $_smarty_tpl->tpl_vars['obj_id']->value, 'product' => $_smarty_tpl->tpl_vars['product']->value, 'but_meta' => $_smarty_tpl->tpl_vars['add_to_cart_meta']->value), 0);
                        $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(true, null, 0);
                    }
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:add_to_cart"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:buttons_block"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:buttons_block"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    if (!($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R" && $_smarty_tpl->tpl_vars['product']->value['price'] == 0) && !($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" && (($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y") || $_smarty_tpl->tpl_vars['product']->value['has_options'] && !$_smarty_tpl->tpl_vars['show_product_options']->value) {
                        if (trim(Smarty::$_smarty_vars['capture']['buttons_product']) != '&nbsp;') {
                            if ($_smarty_tpl->tpl_vars['product']->value['avail_since'] <= @constant('TIME') || $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME') && $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "B") {
                                echo Smarty::$_smarty_vars['capture']['buttons_product'];
                            }
                        }
                    } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" && (($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y") {
                        $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(false, null, 0);
                        if (!$_smarty_tpl->tpl_vars['details_page']->value) {
                            if (!$_smarty_tpl->tpl_vars['product']->value['hide_stock_info'] && !(($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME'))) {
                                ?>
<span class="ty-qty-out-of-stock ty-control-group__item" id="out_of_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                ?>
</span><?php 
                            }
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "S" && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
                            ?>
<div class="ty-control-group"><label for="sw_product_notify_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" class="ty-strong"><input id="sw_product_notify_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" type="checkbox" class="checkbox cm-switch-availability cm-switch-visibility" name="product_notify" <?php 
                            if ($_smarty_tpl->tpl_vars['product_notification_enabled']->value == "Y") {
                                ?>
checked="checked"<?php 
                            }
                            ?>
 onclick="<?php 
                            if (!$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
if (!this.checked) {Tygh.$.ceAjax('request', '<?php 
                                echo htmlspecialchars(fn_url("products.product_notifications?enable="), ENT_QUOTES, 'UTF-8');
                                ?>
' + 'N&amp;product_id=<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
&amp;email=' + $('#product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
').get(0).value, <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
cache: false<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
);}<?php 
                            } else {
                                ?>
Tygh.$.ceAjax('request', '<?php 
                                echo htmlspecialchars(fn_url("products.product_notifications?enable="), ENT_QUOTES, 'UTF-8');
                                ?>
' + (this.checked ? 'Y' : 'N') + '&amp;product_id=' + '<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
', <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
cache: false<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
);<?php 
                            }
                            ?>
"/><?php 
                            echo $_smarty_tpl->__("notify_when_back_in_stock");
                            ?>
</label></div><?php 
                            if (!$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
<div class="ty-control-group ty-input-append ty-product-notify-email <?php 
                                if ($_smarty_tpl->tpl_vars['product_notification_enabled']->value != "Y") {
                                    ?>
hidden<?php 
                                }
                                ?>
" id="product_notify_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><input type="hidden" name="enable" value="Y" disabled /><input type="hidden" name="product_id" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" disabled /><label id="product_notify_email_label" for="product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" class="cm-required cm-email hidden"><?php 
                                echo $_smarty_tpl->__("email");
                                ?>
</label><input type="text" name="email" id="product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" size="20" value="<?php 
                                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_notification_email']->value) === null || $tmp === '' ? $_smarty_tpl->__("enter_email") : $tmp, ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-product-notify-email__input cm-hint" title="<?php 
                                echo $_smarty_tpl->__("enter_email");
                                ?>
" disabled /><button class="ty-btn-go cm-ajax" type="submit" name="dispatch[products.product_notifications]" title="<?php 
                                echo $_smarty_tpl->__("go");
                                ?>
"><i class="ty-btn-go__icon ty-icon-right-dir"></i></button></div><?php 
                            }
                        }
                    }
                    if ($_smarty_tpl->tpl_vars['show_list_buttons']->value) {
                        $_smarty_tpl->_capture_stack[0][] = array("product_buy_now_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
                        ob_start();
                        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:buy_now"));
                        $_block_repeat = true;
                        echo smarty_block_hook(array('name' => "products:buy_now"), null, $_smarty_tpl, $_block_repeat);
                        while ($_block_repeat) {
                            ob_start();
                            if ($_smarty_tpl->tpl_vars['product']->value['feature_comparison'] == "Y") {
                                echo $_smarty_tpl->getSubTemplate("buttons/add_to_compare_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id']), 0);
                            }
                            $_block_content = ob_get_clean();
                            $_block_repeat = false;
                            echo smarty_block_hook(array('name' => "products:buy_now"), $_block_content, $_smarty_tpl, $_block_repeat);
                        }
                        array_pop($_smarty_tpl->smarty->_tag_stack);
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        $_smarty_tpl->tpl_vars["capture_buy_now"] = new Smarty_variable("product_buy_now_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        if (trim(Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_buy_now']->value])) {
                            echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_buy_now']->value];
                        }
                    }
                    if ($_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME')) {
                        echo $_smarty_tpl->getSubTemplate("common/coming_soon_notice.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('avail_date' => $_smarty_tpl->tpl_vars['product']->value['avail_since'], 'add_to_cart' => $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions']), 0);
                    }
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:buttons_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

<!--add_to_cart_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
            if (Smarty::$_smarty_vars['capture']['cart_button_exists']) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(true, null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("add_to_cart_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_features_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_features"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_features"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['show_features']->value) {
                    ?>
        <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" id="product_features_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
            <input type="hidden" name="appearance[show_features]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['show_features']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
            <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_features_short_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('features' => fn_get_product_features_list($_smarty_tpl->tpl_vars['product']->value), 'no_container' => true), 0);
                    ?>

        <!--product_features_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_features"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_features_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("prod_descr_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_descr']->value) {
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['short_description']) {
                    ?>
            <div <?php 
                    echo smarty_function_live_edit(array('name' => "product:short_description:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), $_smarty_tpl);
                    ?>
><?php 
                    echo $_smarty_tpl->tpl_vars['product']->value['short_description'];
                    ?>
</div>
        <?php 
                } else {
                    ?>
            <div <?php 
                    echo smarty_function_live_edit(array('name' => "product:full_description:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['full_description']), $_smarty_tpl);
                    ?>
><?php 
                    echo smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['product']->value['full_description']), 160);
                    ?>
</div>
        <?php 
                }
                ?>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("prod_descr_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("old_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_old_price']->value) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="old_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:old_price"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:old_price"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                        ?>
                <span class="ty-list-price ty-nowrap" id="line_old_price_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        if ($_smarty_tpl->tpl_vars['details_page']->value) {
                            echo $_smarty_tpl->__("old_price");
                            ?>
: <?php 
                        }
                        ?>
<span class="ty-strike"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => ($tmp = @$_smarty_tpl->tpl_vars['product']->value['original_price']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['base_price'] : $tmp, 'span_id' => "old_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                        ?>
</span></span>
            <?php 
                    } elseif ($_smarty_tpl->tpl_vars['product']->value['list_discount']) {
                        ?>
                <span class="ty-list-price ty-nowrap" id="line_list_price_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        if ($_smarty_tpl->tpl_vars['details_page']->value) {
                            ?>
<span class="list-price-label"><?php 
                            echo $_smarty_tpl->__("list_price");
                            ?>
:</span> <?php 
                        }
                        ?>
<span class="ty-strike"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['list_price'], 'span_id' => "list_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                        ?>
</span></span>
            <?php 
                    }
                    ?>
            <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:old_price"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

        <!--old_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("old_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <span class="cm-reload-<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-price-update" id="price_update_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
        <input type="hidden" name="appearance[show_price_values]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
            ?>
" />
        <input type="hidden" name="appearance[show_price]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price']->value, ENT_QUOTES, 'UTF-8');
            ?>
" />
        <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value) {
                ?>
            <?php 
                if ($_smarty_tpl->tpl_vars['show_price']->value) {
                    ?>
            <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:prices_block"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "products:prices_block"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

                <?php 
                        if (floatval($_smarty_tpl->tpl_vars['product']->value['price']) || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "P" || $_smarty_tpl->tpl_vars['hide_add_to_cart_button']->value == "Y" && $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A") {
                            ?>
                    <span class="ty-price<?php 
                            if (!floatval($_smarty_tpl->tpl_vars['product']->value['price']) && !$_smarty_tpl->tpl_vars['product']->value['zero_price_action']) {
                                ?>
 hidden<?php 
                            }
                            ?>
" id="line_discounted_price_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"><?php 
                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['price'], 'span_id' => "discounted_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-price-num", 'live_editor_name' => "product:price:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'live_editor_phrase' => $_smarty_tpl->tpl_vars['product']->value['base_price']), 0);
                            ?>
</span>
                <?php 
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A" && $_smarty_tpl->tpl_vars['show_add_to_cart']->value) {
                            ?>
                    <?php 
                            $_smarty_tpl->tpl_vars["base_currency"] = new Smarty_variable($_smarty_tpl->tpl_vars['currencies']->value[@constant('CART_PRIMARY_CURRENCY')], null, 0);
                            ?>
                    <span class="ty-price-curency"><span class="ty-price-curency__title"><?php 
                            echo $_smarty_tpl->__("enter_your_price");
                            ?>
:</span>
                    <div class="ty-price-curency-input">
                        <?php 
                            if ($_smarty_tpl->tpl_vars['base_currency']->value['after'] != "Y") {
                                echo $_smarty_tpl->tpl_vars['base_currency']->value['symbol'];
                            }
                            ?>
                        <input class="ty-price-curency__input" type="text" size="3" name="product_data[<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
][price]" value="" />
                        <?php 
                            if ($_smarty_tpl->tpl_vars['base_currency']->value['after'] == "Y") {
                                echo $_smarty_tpl->tpl_vars['base_currency']->value['symbol'];
                            }
                            ?>
                    </div>
                    </span>

                <?php 
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R") {
                            ?>
                    <span class="ty-no-price"><?php 
                            echo $_smarty_tpl->__("contact_us_for_price");
                            ?>
</span>
                    <?php 
                            $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(false, null, 0);
                            ?>
                <?php 
                        }
                        ?>
            <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "products:prices_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

            <?php 
                }
                ?>
        <?php 
            } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                ?>
            <span class="ty-price"><?php 
                echo $_smarty_tpl->__("sign_in_to_view_price");
                ?>
</span>
        <?php 
            }
            ?>
    <!--price_update_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></span>
<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("clean_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_clean_price']->value && $_smarty_tpl->tpl_vars['settings']->value['Appearance']['show_prices_taxed_clean'] == "Y" && $_smarty_tpl->tpl_vars['product']->value['taxed_price']) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="clean_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_price_values]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <input type="hidden" name="appearance[show_clean_price]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_clean_price']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['clean_price'] != $_smarty_tpl->tpl_vars['product']->value['taxed_price'] && $_smarty_tpl->tpl_vars['product']->value['included_tax']) {
                    ?>
                <span class="ty-list-price ty-nowrap" id="line_product_price_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">(<?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['taxed_price'], 'span_id' => "product_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                    ?>
 <?php 
                    echo $_smarty_tpl->__("inc_tax");
                    ?>
)</span>
            <?php 
                } elseif ($_smarty_tpl->tpl_vars['product']->value['clean_price'] != $_smarty_tpl->tpl_vars['product']->value['taxed_price'] && !$_smarty_tpl->tpl_vars['product']->value['included_tax']) {
                    ?>
                <span class="ty-list-price ty-nowrap ty-tax-include">(<?php 
                    echo $_smarty_tpl->__("including_tax");
                    ?>
)</span>
            <?php 
                }
                ?>
        <!--clean_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("clean_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("list_discount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_list_discount']->value && $_smarty_tpl->tpl_vars['details_page']->value) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="line_discount_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_price_values]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <input type="hidden" name="appearance[show_list_discount]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_list_discount']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                    ?>
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->__("you_save");
                    ?>
: <?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['discount'], 'span_id' => "discount_value_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                    ?>
&nbsp;(<span id="prc_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="ty-list-price ty-nowrap"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['discount_prc'], ENT_QUOTES, 'UTF-8');
                    ?>
</span>%)</span>
            <?php 
                } elseif ($_smarty_tpl->tpl_vars['product']->value['list_discount']) {
                    ?>
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"> <?php 
                    echo $_smarty_tpl->__("you_save");
                    ?>
: <?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['list_discount'], 'span_id' => "discount_value_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value), 0);
                    ?>
&nbsp;(<span id="prc_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['list_discount_prc'], ENT_QUOTES, 'UTF-8');
                    ?>
</span>%)</span>
            <?php 
                }
                ?>
        <!--line_discount_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("list_discount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("discount_label_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_discount_label']->value && ($_smarty_tpl->tpl_vars['product']->value['discount_prc'] || $_smarty_tpl->tpl_vars['product']->value['list_discount_prc']) && $_smarty_tpl->tpl_vars['show_price_values']->value) {
                ?>
        <span class="ty-discount-label cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="discount_label_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <span class="ty-discount-label__item" id="line_prc_discount_value_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><span class="ty-discount-label__value" id="prc_discount_value_label_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("save_discount");
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['discount_prc'], ENT_QUOTES, 'UTF-8');
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['list_discount_prc'], ENT_QUOTES, 'UTF-8');
                }
                ?>
%</span></span>
        <!--discount_label_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("discount_label_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_amount"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_amount"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<?php 
                if ($_smarty_tpl->tpl_vars['show_product_amount']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                    ?>
    <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
 stock-wrap" id="product_amount_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
        <input type="hidden" name="appearance[show_product_amount]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['show_product_amount']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
        <?php 
                    if (!$_smarty_tpl->tpl_vars['product']->value['hide_stock_info']) {
                        ?>
            <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['in_stock_field'] == "Y") {
                            ?>
                <?php 
                            if ($_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) {
                                ?>
                    <?php 
                                if ($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" || $_smarty_tpl->tpl_vars['details_page']->value) {
                                    ?>
                        <?php 
                                    if ($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                                        ?>
                            <div class="ty-control-group product-list-field">
                                <label class="ty-control-group__label"><?php 
                                        echo $_smarty_tpl->__("availability");
                                        ?>
:</label>
                                <span id="qty_in_stock_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
" class="ty-qty-in-stock ty-control-group__item">
                                    <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_amount']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
&nbsp;<?php 
                                        echo $_smarty_tpl->__("items");
                                        ?>

                                </span>
                            </div>
                        <?php 
                                    } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y") {
                                        ?>
                            <div class="ty-control-group product-list-field">
                                <label class="ty-control-group__label"><?php 
                                        echo $_smarty_tpl->__("in_stock");
                                        ?>
:</label>
                                <span class="ty-qty-out-of-stock ty-control-group__item"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
</span>
                            </div>
                        <?php 
                                    }
                                    ?>
                    <?php 
                                }
                                ?>
                <?php 
                            }
                            ?>
            <?php 
                        } else {
                            ?>
                <?php 
                            if (($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] || $_smarty_tpl->tpl_vars['product']->value['tracking'] == smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] == "Y") {
                                ?>
                    <div class="ty-control-group product-list-field">
                        <label class="ty-control-group__label"><?php 
                                echo $_smarty_tpl->__("availability");
                                ?>
:</label>
                        <span class="ty-qty-in-stock ty-control-group__item" id="in_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo $_smarty_tpl->__("in_stock");
                                ?>
</span>
                    </div>
                <?php 
                            } elseif ($_smarty_tpl->tpl_vars['details_page']->value && ($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y") {
                                ?>
                    <div class="ty-control-group product-list-field">
                        <label class="ty-control-group__label"><?php 
                                echo $_smarty_tpl->__("availability");
                                ?>
:</label>
                        <span class="ty-qty-out-of-stock ty-control-group__item" id="out_of_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                ?>
</span>
                    </div>
                <?php 
                            }
                            ?>
            <?php 
                        }
                        ?>
        <?php 
                    }
                    ?>
    <!--product_amount_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
<?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_amount"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_product_options']->value) {
                ?>
    <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="product_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
        <input type="hidden" name="appearance[show_product_options]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_product_options']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_option_content"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:product_option_content"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    if ($_smarty_tpl->tpl_vars['disable_ids']->value) {
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["_disable_ids"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['disable_ids']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        ?>
            <?php 
                    } else {
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["_disable_ids"] = new Smarty_variable('', null, 0);
                        ?>
            <?php 
                    }
                    ?>
            <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_options.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['obj_id']->value, 'product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options'], 'name' => "product_data", 'capture_options_vs_qty' => $_smarty_tpl->tpl_vars['capture_options_vs_qty']->value, 'disable_ids' => $_smarty_tpl->tpl_vars['_disable_ids']->value), 0);
                    ?>

        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:product_option_content"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    <!--product_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("advanced_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_product_options']->value) {
                ?>
        <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="advanced_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <?php 
                echo $_smarty_tpl->getSubTemplate("views/companies/components/product_company_data.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('company_name' => $_smarty_tpl->tpl_vars['product']->value['company_name'], 'company_id' => $_smarty_tpl->tpl_vars['product']->value['company_id']), 0);
                ?>

            <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:options_advanced"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:options_advanced"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:options_advanced"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

        <!--advanced_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("advanced_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:qty"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:qty"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

        <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="qty_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
        <input type="hidden" name="appearance[show_qty]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_qty']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <input type="hidden" name="appearance[capture_options_vs_qty]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['capture_options_vs_qty']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <?php 
                if (!empty($_smarty_tpl->tpl_vars['product']->value['selected_amount'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['selected_amount'], null, 0);
                    ?>
        <?php 
                } elseif (!empty($_smarty_tpl->tpl_vars['product']->value['min_qty'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['min_qty'], null, 0);
                    ?>
        <?php 
                } elseif (!empty($_smarty_tpl->tpl_vars['product']->value['qty_step'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['qty_step'], null, 0);
                    ?>
        <?php 
                } else {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable("1", null, 0);
                    ?>
        <?php 
                }
                ?>

        <?php 
                if ($_smarty_tpl->tpl_vars['show_qty']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] !== "Y" && $_smarty_tpl->tpl_vars['cart_button_exists']->value == true && ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "allow_shopping" || $_smarty_tpl->tpl_vars['auth']->value['user_id']) && $_smarty_tpl->tpl_vars['product']->value['avail_since'] <= @constant('TIME') || $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME') && $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "B") {
                    ?>
            <div class="ty-qty clearfix<?php 
                    if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                        ?>
 changer<?php 
                    }
                    ?>
" id="qty_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
                <?php 
                    if (!$_smarty_tpl->tpl_vars['hide_qty_label']->value) {
                        ?>
<label class="ty-control-group__label" for="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['quantity_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("quantity") : $tmp, ENT_QUOTES, 'UTF-8');
                        ?>
:</label><?php 
                    }
                    ?>
                <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['qty_content'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                        ?>
                <select name="product_data[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][amount]" id="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
">
                <?php 
                        $_smarty_tpl->tpl_vars["a_name"] = new Smarty_variable("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["selected_amount"] = new Smarty_variable(false, null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["var"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["var"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['product']->value['qty_content'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars["var"]->key => $_smarty_tpl->tpl_vars["var"]->value) {
                            $_smarty_tpl->tpl_vars["var"]->_loop = true;
                            ?>
                    <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            if ($_smarty_tpl->tpl_vars['product']->value['selected_amount'] && ($_smarty_tpl->tpl_vars['product']->value['selected_amount'] == $_smarty_tpl->tpl_vars['var']->value || $_smarty_tpl->getVariable('smarty')->value['foreach'][$_smarty_tpl->tpl_vars['a_name']->value]['last'] && !$_smarty_tpl->tpl_vars['selected_amount']->value)) {
                                $_smarty_tpl->tpl_vars["selected_amount"] = new Smarty_variable(true, null, 0);
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value, ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                <?php 
                        }
                        ?>
                </select>
                <?php 
                    } else {
                        ?>
                <div class="ty-center ty-value-changer cm-value-changer">
                    <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                            ?>
                        <a class="cm-increase ty-value-changer__increase">&#43;</a>
                    <?php 
                        }
                        ?>
                    <input type="text" size="5" class="ty-value-changer__input cm-amount" id="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
" name="product_data[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][amount]" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['default_amount']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                        if ($_smarty_tpl->tpl_vars['product']->value['qty_step'] > 1) {
                            ?>
 data-ca-step="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['qty_step'], ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 data-ca-min-qty="1" />
                    <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                            ?>
                        <a class="cm-decrease ty-value-changer__decrease">&minus;</a>
                    <?php 
                        }
                        ?>
                </div>
                <?php 
                    }
                    ?>
            </div>
            <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['prices']) {
                        ?>
                <?php 
                        echo $_smarty_tpl->getSubTemplate("views/products/components/products_qty_discounts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                        ?>

            <?php 
                    }
                    ?>
        <?php 
                } elseif (!$_smarty_tpl->tpl_vars['bulk_add']->value) {
                    ?>
            <input type="hidden" name="product_data[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
][amount]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['default_amount']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
        <?php 
                }
                ?>
        <!--qty_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:qty"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("min_qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['min_qty']->value && $_smarty_tpl->tpl_vars['product']->value['min_qty']) {
                ?>
        <p class="ty-min-qty-description"><?php 
                echo $_smarty_tpl->__("text_cart_min_qty", array("[product]" => $_smarty_tpl->tpl_vars['product']->value['product'], "[quantity]" => $_smarty_tpl->tpl_vars['product']->value['min_qty']));
                ?>
.</p>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("min_qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_edp_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_edp']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] == "Y") {
                ?>
        <p class="ty-edp-description"><?php 
                echo $_smarty_tpl->__("text_edp_product");
                ?>
.</p>
        <input type="hidden" name="product_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
][is_edp]" value="Y" />
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_edp_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("form_close_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if (!$_smarty_tpl->tpl_vars['hide_form']->value) {
                ?>
</form>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("form_close_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->tpl_vars["image"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["image"]->_loop = false;
            $_smarty_tpl->tpl_vars["object_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['images']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["image"]->key => $_smarty_tpl->tpl_vars["image"]->value) {
                $_smarty_tpl->tpl_vars["image"]->_loop = true;
                $_smarty_tpl->tpl_vars["object_id"]->value = $_smarty_tpl->tpl_vars["image"]->key;
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:list_images_block"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:list_images_block"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

    <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['obj_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
        <?php 
                    if ($_smarty_tpl->tpl_vars['image']->value['link']) {
                        ?>
            <a href="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['link'], ENT_QUOTES, 'UTF-8');
                        ?>
">
            <input type="hidden" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['link'], ENT_QUOTES, 'UTF-8');
                        ?>
" name="image[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][link]" />
        <?php 
                    }
                    ?>
        <input type="hidden" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['obj_id'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['width'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['height'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['type'], ENT_QUOTES, 'UTF-8');
                    ?>
" name="image[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
][data]" />
        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => $_smarty_tpl->tpl_vars['image']->value['width'], 'image_height' => $_smarty_tpl->tpl_vars['image']->value['height'], 'obj_id' => $_smarty_tpl->tpl_vars['object_id']->value, 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair']), 0);
                    ?>

        <?php 
                    if ($_smarty_tpl->tpl_vars['image']->value['link']) {
                        ?>
            </a>
        <?php 
                    }
                    ?>
    <!--<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
<?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:list_images_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_data"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_data"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_data"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="common/product_data.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "common/product_data.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            if ($_smarty_tpl->tpl_vars['product']->value['tracking'] == smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["out_of_stock_text"] = new Smarty_variable($_smarty_tpl->__("text_combination_out_of_stock"), null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["out_of_stock_text"] = new Smarty_variable($_smarty_tpl->__("text_out_of_stock"), null, 0);
            }
            ?>

<?php 
            if ((floatval($_smarty_tpl->tpl_vars['product']->value['price']) || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "P" || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A" || !floatval($_smarty_tpl->tpl_vars['product']->value['price']) && $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R") && !($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id'])) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["show_price_values"] = new Smarty_variable(true, null, 0);
            } else {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["show_price_values"] = new Smarty_variable(false, null, 0);
            }
            $_smarty_tpl->_capture_stack[0][] = array("show_price_values", null, null);
            ob_start();
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
            $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(false, null, 0);
            $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['show_qty']->value) === null || $tmp === '' ? true : $tmp, null, 0);
            $_smarty_tpl->tpl_vars["obj_id"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['obj_id']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['product_id'] : $tmp, null, 0);
            $_smarty_tpl->tpl_vars["product_amount"] = new Smarty_variable(($tmp = @$_smarty_tpl->tpl_vars['product']->value['inventory_amount']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['amount'] : $tmp, null, 0);
            if (!$_smarty_tpl->tpl_vars['config']->value['tweaks']['disable_dhtml'] && !$_smarty_tpl->tpl_vars['no_ajax']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["is_ajax"] = new Smarty_variable(true, null, 0);
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("form_open_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if (!$_smarty_tpl->tpl_vars['hide_form']->value) {
                ?>
<form action="<?php 
                echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
                ?>
" method="post" name="product_form_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" enctype="multipart/form-data" class="cm-disable-empty-files <?php 
                if ($_smarty_tpl->tpl_vars['is_ajax']->value) {
                    ?>
 cm-ajax cm-ajax-full-render cm-ajax-status-middle<?php 
                }
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['form_meta']->value) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['form_meta']->value, ENT_QUOTES, 'UTF-8');
                }
                ?>
">
<input type="hidden" name="result_ids" value="cart_status*,wish_list*,checkout*,account_info*" />
<?php 
                if (!$_smarty_tpl->tpl_vars['stay_in_cart']->value) {
                    ?>
<input type="hidden" name="redirect_url" value="<?php 
                    echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['redirect_url']->value) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['config']->value['current_url'] : $tmp, ENT_QUOTES, 'UTF-8');
                    ?>
" />
<?php 
                }
                ?>
<input type="hidden" name="product_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
][product_id]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                ?>
" />
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("form_open_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("name_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_name"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_name"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['show_name']->value) {
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
<strong><?php 
                    } else {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                        ?>
" class="product-title" <?php 
                        echo smarty_function_live_edit(array('name' => "product:product:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['product']), $_smarty_tpl);
                        ?>
><?php 
                    }
                    echo $_smarty_tpl->tpl_vars['product']->value['product'];
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
</strong><?php 
                    } else {
                        ?>
</a><?php 
                    }
                    ?>
    <?php 
                } elseif ($_smarty_tpl->tpl_vars['show_trunc_name']->value) {
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
<strong><?php 
                    } else {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                        ?>
" class="product-title" title="<?php 
                        echo htmlspecialchars(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['product']->value['product']), ENT_QUOTES, 'UTF-8');
                        ?>
" <?php 
                        echo smarty_function_live_edit(array('name' => "product:product:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['product']), $_smarty_tpl);
                        ?>
><?php 
                    }
                    echo smarty_modifier_truncate($_smarty_tpl->tpl_vars['product']->value['product'], 44, "...", true);
                    if ($_smarty_tpl->tpl_vars['hide_links']->value) {
                        ?>
</strong><?php 
                    } else {
                        ?>
</a><?php 
                    }
                    ?>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_name"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("name_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("sku_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_sku']->value) {
                ?>
        <div class="ty-control-group ty-sku-item cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                if (!$_smarty_tpl->tpl_vars['product']->value['product_code']) {
                    ?>
 hidden<?php 
                }
                ?>
" id="sku_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_sku]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_sku']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <label class="ty-control-group__label" id="sku_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("sku");
                ?>
:</label>
            <span class="ty-control-group__item" id="product_code_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_code'], ENT_QUOTES, 'UTF-8');
                ?>
</span>
        <!--sku_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("sku_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("rating_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:data_block"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:data_block"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:data_block"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("rating_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("add_to_cart_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if ($_smarty_tpl->tpl_vars['show_add_to_cart']->value) {
                ?>
<div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
 <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['add_to_cart_class']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="add_to_cart_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
<input type="hidden" name="appearance[show_add_to_cart]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_add_to_cart']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[show_list_buttons]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_list_buttons']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[but_role]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['but_role']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
<input type="hidden" name="appearance[quick_view]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['quick_view']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />

<?php 
                $_smarty_tpl->_capture_stack[0][] = array("buttons_product", null, null);
                ob_start();
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:add_to_cart"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:add_to_cart"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    if ($_smarty_tpl->tpl_vars['product']->value['has_options'] && !$_smarty_tpl->tpl_vars['show_product_options']->value && !$_smarty_tpl->tpl_vars['details_page']->value) {
                        if ($_smarty_tpl->tpl_vars['but_role']->value == "text") {
                            $_smarty_tpl->tpl_vars['opt_but_role'] = new Smarty_variable("text", null, 0);
                        } else {
                            $_smarty_tpl->tpl_vars['opt_but_role'] = new Smarty_variable("action", null, 0);
                        }
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "button_cart_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_text' => __("select_options"), 'but_href' => "products.view?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'but_role' => $_smarty_tpl->tpl_vars['opt_but_role']->value, 'but_name' => '', 'but_meta' => "ty-btn__primary ty-btn__big"), 0);
                    } else {
                        if ($_smarty_tpl->tpl_vars['extra_button']->value) {
                            echo $_smarty_tpl->tpl_vars['extra_button']->value;
                            ?>
&nbsp;<?php 
                        }
                        echo $_smarty_tpl->getSubTemplate("buttons/add_to_cart.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "button_cart_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_name' => "dispatch[checkout.add.." . (string) $_smarty_tpl->tpl_vars['obj_id']->value . "]", 'but_role' => $_smarty_tpl->tpl_vars['but_role']->value, 'block_width' => $_smarty_tpl->tpl_vars['block_width']->value, 'obj_id' => $_smarty_tpl->tpl_vars['obj_id']->value, 'product' => $_smarty_tpl->tpl_vars['product']->value, 'but_meta' => $_smarty_tpl->tpl_vars['add_to_cart_meta']->value), 0);
                        $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(true, null, 0);
                    }
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:add_to_cart"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                if (!empty($_capture_buffer)) {
                    if (isset($_capture_assign)) {
                        $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                    }
                    if (isset($_capture_append)) {
                        $_smarty_tpl->append($_capture_append, ob_get_contents());
                    }
                    Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                } else {
                    $_smarty_tpl->capture_error();
                }
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:buttons_block"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:buttons_block"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    if (!($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R" && $_smarty_tpl->tpl_vars['product']->value['price'] == 0) && !($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" && (($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y") || $_smarty_tpl->tpl_vars['product']->value['has_options'] && !$_smarty_tpl->tpl_vars['show_product_options']->value) {
                        if (trim(Smarty::$_smarty_vars['capture']['buttons_product']) != '&nbsp;') {
                            if ($_smarty_tpl->tpl_vars['product']->value['avail_since'] <= @constant('TIME') || $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME') && $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "B") {
                                echo Smarty::$_smarty_vars['capture']['buttons_product'];
                            }
                        }
                    } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" && (($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y") {
                        $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(false, null, 0);
                        if (!$_smarty_tpl->tpl_vars['details_page']->value) {
                            if (!$_smarty_tpl->tpl_vars['product']->value['hide_stock_info'] && !(($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME'))) {
                                ?>
<span class="ty-qty-out-of-stock ty-control-group__item" id="out_of_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                ?>
</span><?php 
                            }
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "S" && $_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::TRACK_WITH_OPTIONS")) {
                            ?>
<div class="ty-control-group"><label for="sw_product_notify_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" class="ty-strong"><input id="sw_product_notify_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" type="checkbox" class="checkbox cm-switch-availability cm-switch-visibility" name="product_notify" <?php 
                            if ($_smarty_tpl->tpl_vars['product_notification_enabled']->value == "Y") {
                                ?>
checked="checked"<?php 
                            }
                            ?>
 onclick="<?php 
                            if (!$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
if (!this.checked) {Tygh.$.ceAjax('request', '<?php 
                                echo htmlspecialchars(fn_url("products.product_notifications?enable="), ENT_QUOTES, 'UTF-8');
                                ?>
' + 'N&amp;product_id=<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
&amp;email=' + $('#product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
').get(0).value, <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
cache: false<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
);}<?php 
                            } else {
                                ?>
Tygh.$.ceAjax('request', '<?php 
                                echo htmlspecialchars(fn_url("products.product_notifications?enable="), ENT_QUOTES, 'UTF-8');
                                ?>
' + (this.checked ? 'Y' : 'N') + '&amp;product_id=' + '<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
', <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
cache: false<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8');
                                ?>
);<?php 
                            }
                            ?>
"/><?php 
                            echo $_smarty_tpl->__("notify_when_back_in_stock");
                            ?>
</label></div><?php 
                            if (!$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                                ?>
<div class="ty-control-group ty-input-append ty-product-notify-email <?php 
                                if ($_smarty_tpl->tpl_vars['product_notification_enabled']->value != "Y") {
                                    ?>
hidden<?php 
                                }
                                ?>
" id="product_notify_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><input type="hidden" name="enable" value="Y" disabled /><input type="hidden" name="product_id" value="<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_id'], ENT_QUOTES, 'UTF-8');
                                ?>
" disabled /><label id="product_notify_email_label" for="product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" class="cm-required cm-email hidden"><?php 
                                echo $_smarty_tpl->__("email");
                                ?>
</label><input type="text" name="email" id="product_notify_email_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
" size="20" value="<?php 
                                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['product_notification_email']->value) === null || $tmp === '' ? $_smarty_tpl->__("enter_email") : $tmp, ENT_QUOTES, 'UTF-8');
                                ?>
" class="ty-product-notify-email__input cm-hint" title="<?php 
                                echo $_smarty_tpl->__("enter_email");
                                ?>
" disabled /><button class="ty-btn-go cm-ajax" type="submit" name="dispatch[products.product_notifications]" title="<?php 
                                echo $_smarty_tpl->__("go");
                                ?>
"><i class="ty-btn-go__icon ty-icon-right-dir"></i></button></div><?php 
                            }
                        }
                    }
                    if ($_smarty_tpl->tpl_vars['show_list_buttons']->value) {
                        $_smarty_tpl->_capture_stack[0][] = array("product_buy_now_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
                        ob_start();
                        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:buy_now"));
                        $_block_repeat = true;
                        echo smarty_block_hook(array('name' => "products:buy_now"), null, $_smarty_tpl, $_block_repeat);
                        while ($_block_repeat) {
                            ob_start();
                            if ($_smarty_tpl->tpl_vars['product']->value['feature_comparison'] == "Y") {
                                echo $_smarty_tpl->getSubTemplate("buttons/add_to_compare_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_id' => $_smarty_tpl->tpl_vars['product']->value['product_id']), 0);
                            }
                            $_block_content = ob_get_clean();
                            $_block_repeat = false;
                            echo smarty_block_hook(array('name' => "products:buy_now"), $_block_content, $_smarty_tpl, $_block_repeat);
                        }
                        array_pop($_smarty_tpl->smarty->_tag_stack);
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        $_smarty_tpl->tpl_vars["capture_buy_now"] = new Smarty_variable("product_buy_now_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        if (trim(Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_buy_now']->value])) {
                            echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_buy_now']->value];
                        }
                    }
                    if ($_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME')) {
                        echo $_smarty_tpl->getSubTemplate("common/coming_soon_notice.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('avail_date' => $_smarty_tpl->tpl_vars['product']->value['avail_since'], 'add_to_cart' => $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions']), 0);
                    }
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:buttons_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

<!--add_to_cart_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            ?>

<?php 
            if (Smarty::$_smarty_vars['capture']['cart_button_exists']) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["cart_button_exists"] = new Smarty_variable(true, null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("add_to_cart_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_features_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_features"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_features"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

    <?php 
                if ($_smarty_tpl->tpl_vars['show_features']->value) {
                    ?>
        <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" id="product_features_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
            <input type="hidden" name="appearance[show_features]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['show_features']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
            <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_features_short_list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('features' => fn_get_product_features_list($_smarty_tpl->tpl_vars['product']->value), 'no_container' => true), 0);
                    ?>

        <!--product_features_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
    <?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_features"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_features_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("prod_descr_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_descr']->value) {
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['short_description']) {
                    ?>
            <div <?php 
                    echo smarty_function_live_edit(array('name' => "product:short_description:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), $_smarty_tpl);
                    ?>
><?php 
                    echo $_smarty_tpl->tpl_vars['product']->value['short_description'];
                    ?>
</div>
        <?php 
                } else {
                    ?>
            <div <?php 
                    echo smarty_function_live_edit(array('name' => "product:full_description:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'phrase' => $_smarty_tpl->tpl_vars['product']->value['full_description']), $_smarty_tpl);
                    ?>
><?php 
                    echo smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['product']->value['full_description']), 160);
                    ?>
</div>
        <?php 
                }
                ?>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("prod_descr_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("old_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_old_price']->value) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="old_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:old_price"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:old_price"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                        ?>
                <span class="ty-list-price ty-nowrap" id="line_old_price_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        if ($_smarty_tpl->tpl_vars['details_page']->value) {
                            echo $_smarty_tpl->__("old_price");
                            ?>
: <?php 
                        }
                        ?>
<span class="ty-strike"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => ($tmp = @$_smarty_tpl->tpl_vars['product']->value['original_price']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['product']->value['base_price'] : $tmp, 'span_id' => "old_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                        ?>
</span></span>
            <?php 
                    } elseif ($_smarty_tpl->tpl_vars['product']->value['list_discount']) {
                        ?>
                <span class="ty-list-price ty-nowrap" id="line_list_price_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        if ($_smarty_tpl->tpl_vars['details_page']->value) {
                            ?>
<span class="list-price-label"><?php 
                            echo $_smarty_tpl->__("list_price");
                            ?>
:</span> <?php 
                        }
                        ?>
<span class="ty-strike"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['list_price'], 'span_id' => "list_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                        ?>
</span></span>
            <?php 
                    }
                    ?>
            <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:old_price"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

        <!--old_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("old_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <span class="cm-reload-<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
 ty-price-update" id="price_update_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
        <input type="hidden" name="appearance[show_price_values]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
            ?>
" />
        <input type="hidden" name="appearance[show_price]" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price']->value, ENT_QUOTES, 'UTF-8');
            ?>
" />
        <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value) {
                ?>
            <?php 
                if ($_smarty_tpl->tpl_vars['show_price']->value) {
                    ?>
            <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:prices_block"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "products:prices_block"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

                <?php 
                        if (floatval($_smarty_tpl->tpl_vars['product']->value['price']) || $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "P" || $_smarty_tpl->tpl_vars['hide_add_to_cart_button']->value == "Y" && $_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A") {
                            ?>
                    <span class="ty-price<?php 
                            if (!floatval($_smarty_tpl->tpl_vars['product']->value['price']) && !$_smarty_tpl->tpl_vars['product']->value['zero_price_action']) {
                                ?>
 hidden<?php 
                            }
                            ?>
" id="line_discounted_price_<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
"><?php 
                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['price'], 'span_id' => "discounted_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-price-num", 'live_editor_name' => "product:price:" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id'], 'live_editor_phrase' => $_smarty_tpl->tpl_vars['product']->value['base_price']), 0);
                            ?>
</span>
                <?php 
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "A" && $_smarty_tpl->tpl_vars['show_add_to_cart']->value) {
                            ?>
                    <?php 
                            $_smarty_tpl->tpl_vars["base_currency"] = new Smarty_variable($_smarty_tpl->tpl_vars['currencies']->value[@constant('CART_PRIMARY_CURRENCY')], null, 0);
                            ?>
                    <span class="ty-price-curency"><span class="ty-price-curency__title"><?php 
                            echo $_smarty_tpl->__("enter_your_price");
                            ?>
:</span>
                    <div class="ty-price-curency-input">
                        <?php 
                            if ($_smarty_tpl->tpl_vars['base_currency']->value['after'] != "Y") {
                                echo $_smarty_tpl->tpl_vars['base_currency']->value['symbol'];
                            }
                            ?>
                        <input class="ty-price-curency__input" type="text" size="3" name="product_data[<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                            ?>
][price]" value="" />
                        <?php 
                            if ($_smarty_tpl->tpl_vars['base_currency']->value['after'] == "Y") {
                                echo $_smarty_tpl->tpl_vars['base_currency']->value['symbol'];
                            }
                            ?>
                    </div>
                    </span>

                <?php 
                        } elseif ($_smarty_tpl->tpl_vars['product']->value['zero_price_action'] == "R") {
                            ?>
                    <span class="ty-no-price"><?php 
                            echo $_smarty_tpl->__("contact_us_for_price");
                            ?>
</span>
                    <?php 
                            $_smarty_tpl->tpl_vars["show_qty"] = new Smarty_variable(false, null, 0);
                            ?>
                <?php 
                        }
                        ?>
            <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "products:prices_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

            <?php 
                }
                ?>
        <?php 
            } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "hide_price_and_add_to_cart" && !$_smarty_tpl->tpl_vars['auth']->value['user_id']) {
                ?>
            <span class="ty-price"><?php 
                echo $_smarty_tpl->__("sign_in_to_view_price");
                ?>
</span>
        <?php 
            }
            ?>
    <!--price_update_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
            echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
            ?>
--></span>
<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("clean_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_clean_price']->value && $_smarty_tpl->tpl_vars['settings']->value['Appearance']['show_prices_taxed_clean'] == "Y" && $_smarty_tpl->tpl_vars['product']->value['taxed_price']) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="clean_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_price_values]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <input type="hidden" name="appearance[show_clean_price]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_clean_price']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['clean_price'] != $_smarty_tpl->tpl_vars['product']->value['taxed_price'] && $_smarty_tpl->tpl_vars['product']->value['included_tax']) {
                    ?>
                <span class="ty-list-price ty-nowrap" id="line_product_price_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">(<?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['taxed_price'], 'span_id' => "product_price_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                    ?>
 <?php 
                    echo $_smarty_tpl->__("inc_tax");
                    ?>
)</span>
            <?php 
                } elseif ($_smarty_tpl->tpl_vars['product']->value['clean_price'] != $_smarty_tpl->tpl_vars['product']->value['taxed_price'] && !$_smarty_tpl->tpl_vars['product']->value['included_tax']) {
                    ?>
                <span class="ty-list-price ty-nowrap ty-tax-include">(<?php 
                    echo $_smarty_tpl->__("including_tax");
                    ?>
)</span>
            <?php 
                }
                ?>
        <!--clean_price_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("clean_price_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("list_discount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_price_values']->value && $_smarty_tpl->tpl_vars['show_list_discount']->value && $_smarty_tpl->tpl_vars['details_page']->value) {
                ?>
        <span class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="line_discount_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <input type="hidden" name="appearance[show_price_values]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_price_values']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <input type="hidden" name="appearance[show_list_discount]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_list_discount']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
            <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                    ?>
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->__("you_save");
                    ?>
: <?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['discount'], 'span_id' => "discount_value_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'class' => "ty-list-price ty-nowrap"), 0);
                    ?>
&nbsp;(<span id="prc_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="ty-list-price ty-nowrap"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['discount_prc'], ENT_QUOTES, 'UTF-8');
                    ?>
</span>%)</span>
            <?php 
                } elseif ($_smarty_tpl->tpl_vars['product']->value['list_discount']) {
                    ?>
                <span class="ty-list-price ty-save-price ty-nowrap" id="line_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"> <?php 
                    echo $_smarty_tpl->__("you_save");
                    ?>
: <?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['product']->value['list_discount'], 'span_id' => "discount_value_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value), 0);
                    ?>
&nbsp;(<span id="prc_discount_value_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['list_discount_prc'], ENT_QUOTES, 'UTF-8');
                    ?>
</span>%)</span>
            <?php 
                }
                ?>
        <!--line_discount_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("list_discount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>


<?php 
            $_smarty_tpl->_capture_stack[0][] = array("discount_label_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_discount_label']->value && ($_smarty_tpl->tpl_vars['product']->value['discount_prc'] || $_smarty_tpl->tpl_vars['product']->value['list_discount_prc']) && $_smarty_tpl->tpl_vars['show_price_values']->value) {
                ?>
        <span class="ty-discount-label cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="discount_label_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <span class="ty-discount-label__item" id="line_prc_discount_value_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><span class="ty-discount-label__value" id="prc_discount_value_label_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("save_discount");
                ?>
 <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['discount']) {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['discount_prc'], ENT_QUOTES, 'UTF-8');
                } else {
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['list_discount_prc'], ENT_QUOTES, 'UTF-8');
                }
                ?>
%</span></span>
        <!--discount_label_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></span>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("discount_label_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_amount"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_amount"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

<?php 
                if ($_smarty_tpl->tpl_vars['show_product_amount']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] != "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                    ?>
    <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
 stock-wrap" id="product_amount_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
        <input type="hidden" name="appearance[show_product_amount]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['show_product_amount']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
        <?php 
                    if (!$_smarty_tpl->tpl_vars['product']->value['hide_stock_info']) {
                        ?>
            <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['in_stock_field'] == "Y") {
                            ?>
                <?php 
                            if ($_smarty_tpl->tpl_vars['product']->value['tracking'] != smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) {
                                ?>
                    <?php 
                                if ($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" || $_smarty_tpl->tpl_vars['details_page']->value) {
                                    ?>
                        <?php 
                                    if ($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                                        ?>
                            <div class="ty-control-group product-list-field">
                                <label class="ty-control-group__label"><?php 
                                        echo $_smarty_tpl->__("availability");
                                        ?>
:</label>
                                <span id="qty_in_stock_<?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
" class="ty-qty-in-stock ty-control-group__item">
                                    <?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['product_amount']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
&nbsp;<?php 
                                        echo $_smarty_tpl->__("items");
                                        ?>

                                </span>
                            </div>
                        <?php 
                                    } elseif ($_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y") {
                                        ?>
                            <div class="ty-control-group product-list-field">
                                <label class="ty-control-group__label"><?php 
                                        echo $_smarty_tpl->__("in_stock");
                                        ?>
:</label>
                                <span class="ty-qty-out-of-stock ty-control-group__item"><?php 
                                        echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                        ?>
</span>
                            </div>
                        <?php 
                                    }
                                    ?>
                    <?php 
                                }
                                ?>
                <?php 
                            }
                            ?>
            <?php 
                        } else {
                            ?>
                <?php 
                            if (($_smarty_tpl->tpl_vars['product_amount']->value > 0 && $_smarty_tpl->tpl_vars['product_amount']->value >= $_smarty_tpl->tpl_vars['product']->value['min_qty'] || $_smarty_tpl->tpl_vars['product']->value['tracking'] == smarty_modifier_enum("ProductTracking::DO_NOT_TRACK")) && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] == "Y") {
                                ?>
                    <div class="ty-control-group product-list-field">
                        <label class="ty-control-group__label"><?php 
                                echo $_smarty_tpl->__("availability");
                                ?>
:</label>
                        <span class="ty-qty-in-stock ty-control-group__item" id="in_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo $_smarty_tpl->__("in_stock");
                                ?>
</span>
                    </div>
                <?php 
                            } elseif ($_smarty_tpl->tpl_vars['details_page']->value && ($_smarty_tpl->tpl_vars['product_amount']->value <= 0 || $_smarty_tpl->tpl_vars['product_amount']->value < $_smarty_tpl->tpl_vars['product']->value['min_qty']) && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y" && $_smarty_tpl->tpl_vars['settings']->value['General']['allow_negative_amount'] != "Y") {
                                ?>
                    <div class="ty-control-group product-list-field">
                        <label class="ty-control-group__label"><?php 
                                echo $_smarty_tpl->__("availability");
                                ?>
:</label>
                        <span class="ty-qty-out-of-stock ty-control-group__item" id="out_of_stock_info_<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                                ?>
"><?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['out_of_stock_text']->value, ENT_QUOTES, 'UTF-8');
                                ?>
</span>
                    </div>
                <?php 
                            }
                            ?>
            <?php 
                        }
                        ?>
        <?php 
                    }
                    ?>
    <!--product_amount_update_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
<?php 
                }
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_amount"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_product_options']->value) {
                ?>
    <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="product_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
        <input type="hidden" name="appearance[show_product_options]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_product_options']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_option_content"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:product_option_content"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    if ($_smarty_tpl->tpl_vars['disable_ids']->value) {
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["_disable_ids"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['disable_ids']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        ?>
            <?php 
                    } else {
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["_disable_ids"] = new Smarty_variable('', null, 0);
                        ?>
            <?php 
                    }
                    ?>
            <?php 
                    echo $_smarty_tpl->getSubTemplate("views/products/components/product_options.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => $_smarty_tpl->tpl_vars['obj_id']->value, 'product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options'], 'name' => "product_data", 'capture_options_vs_qty' => $_smarty_tpl->tpl_vars['capture_options_vs_qty']->value, 'disable_ids' => $_smarty_tpl->tpl_vars['_disable_ids']->value), 0);
                    ?>

        <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:product_option_content"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

    <!--product_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("advanced_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_product_options']->value) {
                ?>
        <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="advanced_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
            <?php 
                echo $_smarty_tpl->getSubTemplate("views/companies/components/product_company_data.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('company_name' => $_smarty_tpl->tpl_vars['product']->value['company_name'], 'company_id' => $_smarty_tpl->tpl_vars['product']->value['company_id']), 0);
                ?>

            <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:options_advanced"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:options_advanced"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

            <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:options_advanced"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

        <!--advanced_options_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("advanced_options_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:qty"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:qty"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

        <div class="cm-reload-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
" id="qty_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
">
        <input type="hidden" name="appearance[show_qty]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['show_qty']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <input type="hidden" name="appearance[capture_options_vs_qty]" value="<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['capture_options_vs_qty']->value, ENT_QUOTES, 'UTF-8');
                ?>
" />
        <?php 
                if (!empty($_smarty_tpl->tpl_vars['product']->value['selected_amount'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['selected_amount'], null, 0);
                    ?>
        <?php 
                } elseif (!empty($_smarty_tpl->tpl_vars['product']->value['min_qty'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['min_qty'], null, 0);
                    ?>
        <?php 
                } elseif (!empty($_smarty_tpl->tpl_vars['product']->value['qty_step'])) {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['qty_step'], null, 0);
                    ?>
        <?php 
                } else {
                    ?>
            <?php 
                    $_smarty_tpl->tpl_vars["default_amount"] = new Smarty_variable("1", null, 0);
                    ?>
        <?php 
                }
                ?>

        <?php 
                if ($_smarty_tpl->tpl_vars['show_qty']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] !== "Y" && $_smarty_tpl->tpl_vars['cart_button_exists']->value == true && ($_smarty_tpl->tpl_vars['settings']->value['General']['allow_anonymous_shopping'] == "allow_shopping" || $_smarty_tpl->tpl_vars['auth']->value['user_id']) && $_smarty_tpl->tpl_vars['product']->value['avail_since'] <= @constant('TIME') || $_smarty_tpl->tpl_vars['product']->value['avail_since'] > @constant('TIME') && $_smarty_tpl->tpl_vars['product']->value['out_of_stock_actions'] == "B") {
                    ?>
            <div class="ty-qty clearfix<?php 
                    if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                        ?>
 changer<?php 
                    }
                    ?>
" id="qty_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
                <?php 
                    if (!$_smarty_tpl->tpl_vars['hide_qty_label']->value) {
                        ?>
<label class="ty-control-group__label" for="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['quantity_text']->value) === null || $tmp === '' ? $_smarty_tpl->__("quantity") : $tmp, ENT_QUOTES, 'UTF-8');
                        ?>
:</label><?php 
                    }
                    ?>
                <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['qty_content'] && $_smarty_tpl->tpl_vars['settings']->value['General']['inventory_tracking'] == "Y") {
                        ?>
                <select name="product_data[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][amount]" id="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
">
                <?php 
                        $_smarty_tpl->tpl_vars["a_name"] = new Smarty_variable("product_amount_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["selected_amount"] = new Smarty_variable(false, null, 0);
                        ?>
                <?php 
                        $_smarty_tpl->tpl_vars["var"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["var"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['product']->value['qty_content'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars["var"]->key => $_smarty_tpl->tpl_vars["var"]->value) {
                            $_smarty_tpl->tpl_vars["var"]->_loop = true;
                            ?>
                    <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value, ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            if ($_smarty_tpl->tpl_vars['product']->value['selected_amount'] && ($_smarty_tpl->tpl_vars['product']->value['selected_amount'] == $_smarty_tpl->tpl_vars['var']->value || $_smarty_tpl->getVariable('smarty')->value['foreach'][$_smarty_tpl->tpl_vars['a_name']->value]['last'] && !$_smarty_tpl->tpl_vars['selected_amount']->value)) {
                                $_smarty_tpl->tpl_vars["selected_amount"] = new Smarty_variable(true, null, 0);
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['var']->value, ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                <?php 
                        }
                        ?>
                </select>
                <?php 
                    } else {
                        ?>
                <div class="ty-center ty-value-changer cm-value-changer">
                    <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                            ?>
                        <a class="cm-increase ty-value-changer__increase">&#43;</a>
                    <?php 
                        }
                        ?>
                    <input type="text" size="5" class="ty-value-changer__input cm-amount" id="qty_count_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
" name="product_data[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][amount]" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['default_amount']->value, ENT_QUOTES, 'UTF-8');
                        ?>
"<?php 
                        if ($_smarty_tpl->tpl_vars['product']->value['qty_step'] > 1) {
                            ?>
 data-ca-step="<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['qty_step'], ENT_QUOTES, 'UTF-8');
                            ?>
"<?php 
                        }
                        ?>
 data-ca-min-qty="1" />
                    <?php 
                        if ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['quantity_changer'] == "Y") {
                            ?>
                        <a class="cm-decrease ty-value-changer__decrease">&minus;</a>
                    <?php 
                        }
                        ?>
                </div>
                <?php 
                    }
                    ?>
            </div>
            <?php 
                    if ($_smarty_tpl->tpl_vars['product']->value['prices']) {
                        ?>
                <?php 
                        echo $_smarty_tpl->getSubTemplate("views/products/components/products_qty_discounts.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);
                        ?>

            <?php 
                    }
                    ?>
        <?php 
                } elseif (!$_smarty_tpl->tpl_vars['bulk_add']->value) {
                    ?>
            <input type="hidden" name="product_data[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
][amount]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['default_amount']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" />
        <?php 
                }
                ?>
        <!--qty_update_<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8');
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
--></div>
    <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:qty"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("min_qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['min_qty']->value && $_smarty_tpl->tpl_vars['product']->value['min_qty']) {
                ?>
        <p class="ty-min-qty-description"><?php 
                echo $_smarty_tpl->__("text_cart_min_qty", array("[product]" => $_smarty_tpl->tpl_vars['product']->value['product'], "[quantity]" => $_smarty_tpl->tpl_vars['product']->value['min_qty']));
                ?>
.</p>
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("min_qty_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("product_edp_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['show_edp']->value && $_smarty_tpl->tpl_vars['product']->value['is_edp'] == "Y") {
                ?>
        <p class="ty-edp-description"><?php 
                echo $_smarty_tpl->__("text_edp_product");
                ?>
.</p>
        <input type="hidden" name="product_data[<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_id']->value, ENT_QUOTES, 'UTF-8');
                ?>
][is_edp]" value="Y" />
    <?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("product_edp_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->_capture_stack[0][] = array("form_close_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, null);
            ob_start();
            if (!$_smarty_tpl->tpl_vars['hide_form']->value) {
                ?>
</form>
<?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if ($_smarty_tpl->tpl_vars['no_capture']->value) {
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["capture_name"] = new Smarty_variable("form_close_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, null, 0);
                ?>
    <?php 
                echo Smarty::$_smarty_vars['capture'][$_smarty_tpl->tpl_vars['capture_name']->value];
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->tpl_vars["image"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["image"]->_loop = false;
            $_smarty_tpl->tpl_vars["object_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['images']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["image"]->key => $_smarty_tpl->tpl_vars["image"]->value) {
                $_smarty_tpl->tpl_vars["image"]->_loop = true;
                $_smarty_tpl->tpl_vars["object_id"]->value = $_smarty_tpl->tpl_vars["image"]->key;
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:list_images_block"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "products:list_images_block"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

    <div class="cm-reload-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['obj_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" id="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
">
        <?php 
                    if ($_smarty_tpl->tpl_vars['image']->value['link']) {
                        ?>
            <a href="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['link'], ENT_QUOTES, 'UTF-8');
                        ?>
">
            <input type="hidden" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['link'], ENT_QUOTES, 'UTF-8');
                        ?>
" name="image[<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
][link]" />
        <?php 
                    }
                    ?>
        <input type="hidden" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['obj_id'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['width'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['height'], ENT_QUOTES, 'UTF-8');
                    ?>
,<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['image']->value['type'], ENT_QUOTES, 'UTF-8');
                    ?>
" name="image[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
][data]" />
        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/image.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('image_width' => $_smarty_tpl->tpl_vars['image']->value['width'], 'image_height' => $_smarty_tpl->tpl_vars['image']->value['height'], 'obj_id' => $_smarty_tpl->tpl_vars['object_id']->value, 'images' => $_smarty_tpl->tpl_vars['product']->value['main_pair']), 0);
                    ?>

        <?php 
                    if ($_smarty_tpl->tpl_vars['image']->value['link']) {
                        ?>
            </a>
        <?php 
                    }
                    ?>
    <!--<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
--></div>
<?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "products:list_images_block"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

<?php 
            }
            ?>

<?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "products:product_data"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "products:product_data"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "products:product_data"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

<?php 
        }
    }
Ejemplo n.º 6
0
/**
 * Gets additional products data
 *
 * @param array $products Array with products
 * @param array $params Array of flags which determines which data should be gathered
 * @return array Array of products with additional information
 */
function fn_gather_additional_products_data(&$products, $params)
{
    /**
     * Change parameters for gathering additional products data
     *
     * @param array $products List of products
     * @param array $params   Parameters for gathering data
     */
    fn_set_hook('gather_additional_products_data_pre', $products, $params);
    if (empty($products)) {
        return;
    }
    // Set default values to input params
    $default_params = array('get_icon' => false, 'get_detailed' => false, 'get_additional' => false, 'get_options' => true, 'get_discounts' => true, 'get_features' => false, 'get_extra' => false, 'get_taxed_prices' => true, 'get_for_one_product' => !is_array(reset($products)) ? true : false, 'detailed_params' => true, 'features_display_on' => 'C');
    $params = array_merge($default_params, $params);
    $auth =& $_SESSION['auth'];
    $allow_negative_amount = Registry::get('settings.General.allow_negative_amount');
    $inventory_tracking = Registry::get('settings.General.inventory_tracking');
    if ($params['get_for_one_product']) {
        $products = array($products);
    }
    $product_ids = array();
    foreach ($products as $v) {
        $product_ids[] = $v['product_id'];
    }
    if ($params['get_icon'] || $params['get_detailed']) {
        $products_images = fn_get_image_pairs($product_ids, 'product', 'M', $params['get_icon'], $params['get_detailed'], CART_LANGUAGE);
    }
    if ($params['get_additional']) {
        $additional_images = fn_get_image_pairs($product_ids, 'product', 'A', true, true, CART_LANGUAGE);
    }
    if ($params['get_options']) {
        $product_options = fn_get_product_options($product_ids, CART_LANGUAGE);
    } else {
        $has_product_options = db_get_hash_array("SELECT a.option_id, a.product_id FROM ?:product_options AS a WHERE a.product_id IN (?n) AND a.status = 'A'", 'product_id', $product_ids);
        $has_product_options_links = db_get_hash_array("SELECT c.option_id, c.product_id FROM ?:product_global_option_links AS c LEFT JOIN ?:product_options AS a ON a.option_id = c.option_id WHERE a.status = 'A' AND c.product_id IN (?n)", 'product_id', $product_ids);
    }
    /**
     * Changes before gathering additional products data
     *
     * @param array $product_ids               Array of product identifiers
     * @param array $params                    Parameteres for gathering data
     * @param array $products                  Array of products
     * @param mixed $auth                      Array of user authentication data
     * @param array $products_images           Array with product main images
     * @param array $additional_images         Array with product additional images
     * @param array $product_options           Array with product options
     * @param array $has_product_options       Array of flags determines if product has options
     * @param array $has_product_options_links Array of flags determines if product has option links
     */
    fn_set_hook('gather_additional_products_data_params', $product_ids, $params, $products, $auth, $products_images, $additional_images, $product_options, $has_product_options, $has_product_options_links);
    // foreach $products
    foreach ($products as &$_product) {
        $product = $_product;
        $product_id = $product['product_id'];
        // Get images
        if ($params['get_icon'] == true || $params['get_detailed'] == true) {
            if (empty($product['main_pair']) && !empty($products_images[$product_id])) {
                $product['main_pair'] = reset($products_images[$product_id]);
            }
        }
        if ($params['get_additional'] == true) {
            if (empty($product['image_pairs']) && !empty($additional_images[$product_id])) {
                $product['image_pairs'] = $additional_images[$product_id];
            }
        }
        if (!isset($product['base_price'])) {
            $product['base_price'] = $product['price'];
            // save base price (without discounts, etc...)
        }
        /**
         * Changes before gathering product options
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_before_options', $product, $auth, $params);
        // Convert product categories
        if (!empty($product['category_ids']) && !is_array($product['category_ids'])) {
            list($product['category_ids'], $product['main_category']) = fn_convert_categories($product['category_ids']);
        }
        $product['selected_options'] = empty($product['selected_options']) ? array() : $product['selected_options'];
        // Get product options
        if ($params['get_options'] && !empty($product_options[$product['product_id']])) {
            if (!isset($product['options_type']) || !isset($product['exceptions_type'])) {
                $types = db_get_row('SELECT options_type, exceptions_type FROM ?:products WHERE product_id = ?i', $product['product_id']);
                $product['options_type'] = $types['options_type'];
                $product['exceptions_type'] = $types['exceptions_type'];
            }
            if (empty($product['product_options'])) {
                if (!empty($product['combination'])) {
                    $selected_options = fn_get_product_options_by_combination($product['combination']);
                }
                $product['product_options'] = !empty($selected_options) ? fn_get_selected_product_options($product['product_id'], $selected_options, CART_LANGUAGE) : $product_options[$product_id];
            }
            $product = fn_apply_options_rules($product);
            if (!empty($params['get_icon']) || !empty($params['get_detailed'])) {
                // Get product options images
                if (!empty($product['combination_hash']) && !empty($product['product_options'])) {
                    $image = fn_get_image_pairs($product['combination_hash'], 'product_option', 'M', $params['get_icon'], $params['get_detailed'], CART_LANGUAGE);
                    if (!empty($image)) {
                        $product['main_pair'] = $image;
                    }
                }
            }
            $product['has_options'] = !empty($product['product_options']);
            if (!fn_allowed_for('ULTIMATE:FREE')) {
                $product = fn_apply_exceptions_rules($product);
            }
            //var_dump($product['product_options']);die();
            //var_dump($selected_options);
            // Change price
            $selected_options = isset($product['selected_options']) ? $product['selected_options'] : array();
            foreach ($product['product_options'] as $option) {
                if (!empty($option['disabled'])) {
                    unset($selected_options[$option['option_id']]);
                }
            }
            $product['selected_options'] = $selected_options;
            if (empty($product['modifiers_price'])) {
                $product['base_modifier'] = fn_apply_options_modifiers($selected_options, $product['base_price'], 'P', array(), array('product_data' => $product));
                $old_price = $product['price'];
                $product['price'] = fn_apply_options_modifiers($selected_options, $product['price'], 'P', array(), array('product_data' => $product));
                if (empty($product['original_price'])) {
                    $product['original_price'] = $old_price;
                }
                $product['original_price'] = fn_apply_options_modifiers($selected_options, $product['original_price'], 'P', array(), array('product_data' => $product));
                $product['modifiers_price'] = $product['price'] - $old_price;
            }
            if (!empty($product['list_price'])) {
                $product['list_price'] = fn_apply_options_modifiers($selected_options, $product['list_price'], 'P', array(), array('product_data' => $product));
            }
            if (!empty($product['prices']) && is_array($product['prices'])) {
                foreach ($product['prices'] as $pr_k => $pr_v) {
                    $product['prices'][$pr_k]['price'] = fn_apply_options_modifiers($selected_options, $pr_v['price'], 'P', array(), array('product_data' => $product));
                }
            }
        } else {
            $product['has_options'] = !empty($has_product_options[$product_id]) || !empty($has_product_options_links[$product_id]) ? true : false;
            $product['product_options'] = empty($product['product_options']) ? array() : $product['product_options'];
        }
        unset($selected_options);
        /**
         * Changes before gathering product discounts
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_before_discounts', $product, $auth, $params);
        // Get product discounts
        if ($params['get_discounts'] && !isset($product['exclude_from_calculate'])) {
            fn_promotion_apply('catalog', $product, $auth);
            if (!empty($product['prices']) && is_array($product['prices'])) {
                $product_copy = $product;
                foreach ($product['prices'] as $pr_k => $pr_v) {
                    $product_copy['base_price'] = $product_copy['price'] = $pr_v['price'];
                    fn_promotion_apply('catalog', $product_copy, $auth);
                    $product['prices'][$pr_k]['price'] = $product_copy['price'];
                }
            }
            if (empty($product['discount']) && !empty($product['list_price']) && !empty($product['price']) && floatval($product['price']) && $product['list_price'] > $product['price']) {
                $product['list_discount'] = fn_format_price($product['list_price'] - $product['price']);
                $product['list_discount_prc'] = sprintf('%d', round($product['list_discount'] * 100 / $product['list_price']));
            }
        }
        // FIXME: old product options scheme
        $product['discounts'] = array('A' => 0, 'P' => 0);
        if (!empty($product['promotions'])) {
            foreach ($product['promotions'] as $v) {
                foreach ($v['bonuses'] as $a) {
                    if ($a['discount_bonus'] == 'to_fixed') {
                        $product['discounts']['A'] += $a['discount'];
                    } elseif ($a['discount_bonus'] == 'by_fixed') {
                        $product['discounts']['A'] += $a['discount_value'];
                    } elseif ($a['discount_bonus'] == 'to_percentage') {
                        $product['discounts']['P'] += 100 - $a['discount_value'];
                    } elseif ($a['discount_bonus'] == 'by_percentage') {
                        $product['discounts']['P'] += $a['discount_value'];
                    }
                }
            }
        }
        // Add product prices with taxes and without taxes
        if ($params['get_taxed_prices'] && AREA != 'A' && Registry::get('settings.Appearance.show_prices_taxed_clean') == 'Y' && $auth['tax_exempt'] != 'Y') {
            fn_get_taxed_and_clean_prices($product, $auth);
        }
        if ($params['get_features'] && !isset($product['product_features'])) {
            $product['product_features'] = fn_get_product_features_list($product, $params['features_display_on']);
        }
        if ($params['get_extra'] && !empty($product['is_edp']) && $product['is_edp'] == 'Y') {
            $product['agreement'] = array(fn_get_edp_agreements($product['product_id']));
        }
        $product['qty_content'] = fn_get_product_qty_content($product, $allow_negative_amount, $inventory_tracking);
        if ($params['detailed_params']) {
            $product['detailed_params'] = empty($product['detailed_params']) ? $params : array_merge($product['detailed_params'], $params);
        }
        /**
         * Add additional data to product
         *
         * @param array $product Product data
         * @param mixed $auth Array of user authentication data
         * @param array $params Parameteres for gathering data
         */
        fn_set_hook('gather_additional_product_data_post', $product, $auth, $params);
        $_product = $product;
    }
    // \foreach $products
    /**
     * Add additional data to products after gathering additional products data
     *
     * @param array $product_ids Array of product identifiers
     * @param array $params      Parameteres for gathering data
     * @param array $products    Array of products
     * @param mixed $auth        Array of user authentication data
     */
    fn_set_hook('gather_additional_products_data_post', $product_ids, $params, $products, $auth);
    if ($params['get_for_one_product'] == true) {
        $products = array_shift($products);
    }
}
Ejemplo n.º 7
0
function fn_gather_additional_product_data(&$product, $get_icon = false, $get_detailed = false, $get_options = true, $get_discounts = true, $get_features = false)
{
    $auth =& $_SESSION['auth'];
    if ($get_icon == true || $get_detailed == true) {
        if (empty($product['main_pair'])) {
            $product['main_pair'] = fn_get_image_pairs($product['product_id'], 'product', 'M', $get_icon, $get_detailed, CART_LANGUAGE);
            if (Registry::get('settings.General.enable_thumbnail_new_stamp') == "Y") {
                $threshold = strtotime("-" . Registry::get('settings.General.new_stamp_time_threshold') . " days");
            } else {
                $threshold = time();
            }
            if (strtotime($product['timestamp']) > $threshold && $product['main_pair']['new'] == 0) {
                //new product - update thumbnails and check "new" flag
                $product['main_pair']['force'] = 'new';
                db_query('UPDATE ?:images_links SET new=1 WHERE pair_id=?i', $product['main_pair']['pair_id']);
            } elseif (strtotime($product['timestamp']) < $threshold && $product['main_pair']['new'] == 1) {
                //old product - update thumbnails and uncheck "new" flag
                $product['main_pair']['force'] = 'old';
                db_query('UPDATE ?:images_links SET new=0 WHERE pair_id=?i', $product['main_pair']['pair_id']);
            }
        }
    }
    if (!isset($product['base_price'])) {
        $product['base_price'] = $product['price'];
        // save base price (without discounts, etc...)
    }
    // Convert product categories
    if (!empty($product['category_ids']) && !is_array($product['category_ids'])) {
        $product['category_ids'] = fn_convert_categories($product['category_ids']);
    }
    $product['selected_options'] = empty($product['selected_options']) ? array() : $product['selected_options'];
    // Get product options
    if ($get_options == true) {
        if (!isset($product['options_type']) || !isset($product['exceptions_type'])) {
            $types = db_get_row('SELECT options_type, exceptions_type FROM ?:products WHERE product_id = ?i', $product['product_id']);
            $product['options_type'] = $types['options_type'];
            $product['exceptions_type'] = $types['exceptions_type'];
        }
        if (empty($product['product_options'])) {
            if (!empty($product['combination'])) {
                $selected_options = fn_get_product_options_by_combination($product['combination']);
            }
            $product['product_options'] = !empty($selected_options) ? fn_get_selected_product_options($product['product_id'], $selected_options, CART_LANGUAGE) : fn_get_product_options($product['product_id'], CART_LANGUAGE);
        }
        $product = fn_apply_options_rules($product);
        if ($get_icon == true || $get_detailed == true) {
            // Get product options images
            if (!empty($product['combination_hash'])) {
                $image = fn_get_image_pairs($product['combination_hash'], 'product_option', 'M', $get_icon, $get_detailed, CART_LANGUAGE);
                if (!empty($image)) {
                    $product['main_pair'] = $image;
                }
            }
        }
        $product['has_options'] = !empty($product['product_options']);
        $product = fn_apply_exceptions_rules($product);
    } else {
        $product['has_options'] = db_get_field("SELECT COUNT(*) FROM ?:product_options as a LEFT JOIN ?:product_global_option_links as c ON c.option_id = a.option_id WHERE (a.product_id = ?i OR c.product_id = ?i) AND a.status = 'A'", $product['product_id'], $product['product_id']);
    }
    fn_set_hook('get_additional_product_data_before_discounts', $product, $auth, $get_options);
    // Get product discounts
    if ($get_discounts == true && !isset($product['exclude_from_calculate'])) {
        fn_promotion_apply('catalog', $product, $auth);
        if (!empty($product['prices']) && is_array($product['prices'])) {
            $product_copy = $product;
            foreach ($product['prices'] as $pr_k => $pr_v) {
                $product_copy['base_price'] = $product_copy['price'] = $pr_v['price'];
                fn_promotion_apply('catalog', $product_copy, $auth);
                $product['prices'][$pr_k]['price'] = $product_copy['price'];
            }
        }
        if (empty($product['discount']) && !empty($product['list_price']) && !empty($product['price']) && floatval($product['price']) && $product['list_price'] > $product['price']) {
            $product['list_discount'] = fn_format_price($product['list_price'] - $product['price']);
            $product['list_discount_prc'] = sprintf('%d', round($product['list_discount'] * 100 / $product['list_price']));
        }
    }
    // FIXME: old product options scheme
    $product['discounts'] = array('A' => 0, 'P' => 0);
    if (!empty($product['promotions'])) {
        foreach ($product['promotions'] as $v) {
            foreach ($v['bonuses'] as $a) {
                if ($a['discount_bonus'] == 'to_fixed') {
                    $product['discounts']['A'] += $a['discount'];
                } elseif ($a['discount_bonus'] == 'by_fixed') {
                    $product['discounts']['A'] += $a['discount_value'];
                } elseif ($a['discount_bonus'] == 'to_percentage') {
                    $product['discounts']['P'] += 100 - $a['discount_value'];
                } elseif ($a['discount_bonus'] == 'by_percentage') {
                    $product['discounts']['P'] += $a['discount_value'];
                }
            }
        }
    }
    // Add product prices with taxes and without taxes
    if (!empty($product) && AREA != 'A' && Registry::get('settings.Appearance.show_prices_taxed_clean') == 'Y' && $auth['tax_exempt'] != 'Y') {
        fn_get_taxed_and_clean_prices($product, $auth);
    }
    if (!isset($product['product_features']) && $get_features == true) {
        $product['product_features'] = fn_get_product_features_list($product['product_id']);
    }
    if (!empty($product['is_edp']) && $product['is_edp'] == 'Y') {
        $product['agreement'] = array(fn_get_edp_agreements($product['product_id']));
    }
    $qty_content = array();
    if (!empty($product['qty_step'])) {
        $per_item = 0;
        if (Registry::get('settings.General.allow_negative_amount') == 'Y' && !empty($product['max_qty'])) {
            $amount = $product['max_qty'];
        } else {
            $amount = isset($product['in_stock']) ? $product['in_stock'] : (isset($product['inventory_amount']) ? $product['inventory_amount'] : $product['amount']);
        }
        for ($i = 1; $per_item <= $amount - $product['qty_step']; $i++) {
            $per_item = $product['qty_step'] * $i;
            if (!empty($product['list_qty_count']) && $i > $product['list_qty_count']) {
                break;
            }
            if (!empty($product['max_qty']) && $per_item > $product['max_qty'] || !empty($product['min_qty']) && $per_item < $product['min_qty']) {
                continue;
            }
            $qty_content[$i] = $per_item;
        }
    }
    $product['qty_content'] = $qty_content;
    $product['detailed_params'] = empty($product['detailed_params']) ? array() : $product['detailed_params'];
    $product['detailed_params'] = array_merge($product['detailed_params'], array('get_icon' => $get_icon, 'get_detailed' => $get_detailed, 'get_options' => $get_options, 'get_discounts' => $get_discounts, 'get_features' => $get_features));
    fn_set_hook('get_additional_product_data', $product, $auth, $get_options);
}