protected function generateProductsData() { $delimiter = ';'; $titles = array(); $id_lang = $this->use_lang; $new_path = new Sampledatainstall(); $f = fopen($new_path->sendPath() . 'output/products.vsc', 'w'); foreach ($this->product_fields as $field => $array) { $titles[] = $array['label']; } fputcsv($f, $titles, $delimiter, '"'); $products = Product::getProducts($id_lang, 0, 0, 'id_product', 'ASC', false, true); foreach ($products as $product) { $line = array(); $p = new Product($product['id_product'], true, $id_lang, 1); foreach ($this->product_fields as $field => $array) { $line[$field] = property_exists('Product', $field) && !is_array($p->{$field}) && !Tools::isEmpty($p->{$field}) ? $p->{$field} : ''; } $cats = $p->getProductCategoriesFull($p->id, 1); $cat_array = array(); foreach ($cats as $cat) { $cat_array[] = $cat['id_category']; } $line['categories'] = implode(',', $cat_array); $line['price_tex'] = $p->getPrice(false); $line['price_tin'] = $p->getPrice(true); $line['upc'] = $p->upc ? $p->upc : ''; $line['features'] = ''; $features = $p->getFrontFeatures($id_lang); $position = 1; $devider = ''; foreach ($features as $feature) { $sql = 'SELECT `id_feature` FROM ' . _DB_PREFIX_ . 'feature_lang WHERE `name` = "' . pSql($feature['name']) . '"'; $sql1 = 'SELECT `id_feature_value` FROM ' . _DB_PREFIX_ . 'feature_value_lang WHERE `value` = "' . pSql($feature['value']) . '"'; $id_feature = Db::getInstance()->getValue($sql); $id_feature_value = Db::getInstance()->getValue($sql1); $line['features'] .= $devider . $id_feature . ':' . $id_feature_value . ':' . $position; $devider = ','; $position++; } $specificPrice = SpecificPrice::getSpecificPrice($p->id, 1, 0, 0, 0, 0); $line['reduction_price'] = ''; $line['reduction_percent'] = ''; $line['reduction_from'] = ''; $line['reduction_to'] = ''; if ($specificPrice) { if ($specificPrice['reduction_type'] == 'amount') { $line['reduction_price'] = $specificPrice['reduction']; } elseif ($specificPrice['reduction_type'] == 'percent') { $line['reduction_percent'] = $specificPrice['reduction']; } if ($line['reduction_price'] !== '' || $line['reduction_percent'] !== '') { $line['reduction_from'] = $specificPrice['from']; $line['reduction_to'] = $specificPrice['to']; } } $tags = $p->getTags($id_lang); $line['tags'] = $tags; $link = new Link(); $imagelinks = array(); $images = $p->getImages($id_lang); foreach ($images as $image) { $imagelink = Tools::getShopProtocol() . $link->getImageLink($p->link_rewrite, $p->id . '-' . $image['id_image']); $this->copyConverFileName($imagelink); $imagelinks[] = $imagelink; } $line['image'] = implode(',', $imagelinks); $line['delete_existing_images'] = 0; $line['shop'] = 1; $warehouses = Warehouse::getWarehousesByProductId($p->id); $line['warehouse'] = ''; if (!empty($warehouses)) { $line['warehouse'] = implode(',', array_map("{$this->getWarehouses}", $warehouses)); } $values = array(); $accesories = $p->getAccessories($id_lang); if (isset($accesories) && $accesories && count($accesories)) { foreach ($accesories as $accesorie) { $values[] = $accesorie['id_product']; } } $line['accessories'] = $values ? implode(',', $values) : ''; $values = array(); $carriers = $p->getCarriers(); if (isset($carriers) && $carriers && count($carriers)) { foreach ($carriers as $carrier) { $values[] = $carrier['id_carrier']; } } $line['carriers'] = $values ? implode(',', $values) : ''; $values = array(); $customization_fields_ids = $p->getCustomizationFieldIds(); if (class_exists('CustomizationField') && isset($customization_fields_ids) && $customization_fields_ids && count($customization_fields_ids)) { foreach ($customization_fields_ids as $customization_field_id) { $cf = new CustomizationField($customization_field_id['id_customization_field'], $this->use_lang); $values[] = $cf->id . ':' . $cf->type . ':' . $cf->required . ':' . $cf->name; } } $line['customization_fields_ids'] = $values ? implode(',', $values) : ''; $values = array(); $attachments = $p->getAttachments($this->use_lang); if (isset($attachments) && $attachments && count($attachments)) { foreach ($attachments as $attachment) { $values[] = $attachment['id_attachment']; } } $line['attachments'] = $values ? implode(',', $values) : ''; if (!property_exists('Product', 'base_price')) { // for versions < 1.6.0.13 $line['base_price'] = !is_array($p->base_price) && !Tools::isEmpty($p->base_price) ? $p->base_price : ''; } if (!$line[$field]) { $line[$field] = ''; } fputcsv($f, $line, $delimiter, '"'); } fclose($f); }
private function getBreadCrumbs($product) { if (!method_exists('Product', 'getProductCategoriesFull')) { return ''; } $result = array(); $lang_id; if (isset($this->context)) { $lang_id = (int) $this->context->language->id; } else { global $cookie; $lang_id = (int) $cookie->id_lang; } $all_product_subs = Product::getProductCategoriesFull((int) $product->id, (int) $lang_id); if (isset($all_product_subs) && count($all_product_subs) > 0) { foreach ($all_product_subs as $subcat) { $sub_category = new Category((int) $subcat['id_category'], (int) $lang_id); $sub_category_path = $sub_category->getParentsCategories(); foreach ($sub_category_path as $key) { $result[] = $key['name']; } } } return implode(';', $result); }
public function initFormAssociations($obj) { $product = $obj; $data = $this->createTemplate($this->tpl_form); // Prepare Categories tree for display in Associations tab $root = Category::getRootCategory(); $default_category = $this->context->cookie->id_category_products_filter ? $this->context->cookie->id_category_products_filter : Context::getContext()->shop->id_category; if (!$product->id || !$product->isAssociatedToShop()) { $selected_cat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->default_form_language); } else { if (Tools::isSubmit('categoryBox')) { $selected_cat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->default_form_language); } else { $selected_cat = Product::getProductCategoriesFull($product->id, $this->default_form_language); } } // Multishop block $data->assign('feature_shop_active', Shop::isFeatureActive()); $helper = new HelperForm(); if ($this->object && $this->object->id) { $helper->id = $this->object->id; } else { $helper->id = null; } $helper->table = $this->table; $helper->identifier = $this->identifier; // Accessories block $accessories = Product::getAccessoriesLight($this->context->language->id, $product->id); if ($post_accessories = Tools::getValue('inputAccessories')) { $post_accessories_tab = explode('-', Tools::getValue('inputAccessories')); foreach ($post_accessories_tab as $accessory_id) { if (!$this->haveThisAccessory($accessory_id, $accessories) && ($accessory = Product::getAccessoryById($accessory_id))) { $accessories[] = $accessory; } } } $data->assign('accessories', $accessories); $product->manufacturer_name = Manufacturer::getNameById($product->id_manufacturer); $categories = array(); foreach ($selected_cat as $key => $category) { $categories[] = $key; } $tree = new HelperTreeCategories('associated-categories-tree', 'Associated categories'); $tree->setTemplate('tree_associated_categories.tpl')->setHeaderTemplate('tree_associated_header.tpl')->setRootCategory($root->id)->setUseCheckBox(true)->setUseSearch(true)->setSelectedCategories($categories); $data->assign(array('default_category' => $default_category, 'selected_cat_ids' => implode(',', array_keys($selected_cat)), 'selected_cat' => $selected_cat, 'id_category_default' => $product->getDefaultCategory(), 'category_tree' => $tree->render(), 'product' => $product, 'link' => $this->context->link, 'is_shop_context' => Shop::getContext() == Shop::CONTEXT_SHOP)); $this->tpl_form_vars['custom_form'] = $data->fetch(); }
function displayFormInformations($obj, $currency) { parent::displayForm(false); global $currentIndex, $cookie, $link; $default_country = new Country((int) Configuration::get('PS_COUNTRY_DEFAULT')); $iso = Language::getIsoById((int) $cookie->id_lang); $has_attribute = false; $qty_state = 'readonly'; $qty = Attribute::getAttributeQty($this->getFieldValue($obj, 'id_product')); if ($qty === false) { if (Validate::isLoadedObject($obj)) { $qty = $this->getFieldValue($obj, 'quantity'); } else { $qty = 1; } $qty_state = ''; } else { $has_attribute = true; } $cover = Product::getCover($obj->id); $this->_applyTaxToEcotax($obj); echo ' <div class="tab-page" id="step1"> <h4 class="tab">1. ' . $this->l('Info.') . '</h4> <script type="text/javascript"> $(document).ready(function() { updateCurrentText(); updateFriendlyURL(); $.ajax({ url: "' . dirname($currentIndex) . '/ajax.php", cache: false, dataType: "json", data: "ajaxProductManufacturers=1", success: function(j) { var options = $("select#id_manufacturer").html(); if (j) for (var i = 0; i < j.length; i++) options += \'<option value="\' + j[i].optionValue + \'">\' + j[i].optionDisplay + \'</option>\'; $("select#id_manufacturer").html(options); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(\'Manufacturer ajax error: \'+textStatus); } }); $.ajax({ url: "' . dirname($currentIndex) . '/ajax.php", cache: false, dataType: "json", data: "ajaxProductSuppliers=1", success: function(j) { var options = $("select#id_supplier").html(); if (j) for (var i = 0; i < j.length; i++) options += \'<option value="\' + j[i].optionValue + \'">\' + j[i].optionDisplay + \'</option>\'; $("select#id_supplier").html(options); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(\'Supplier ajax error: \'+textStatus); } }); if ($(\'#available_for_order\').is(\':checked\')){ $(\'#show_price\').attr(\'checked\', \'checked\'); $(\'#show_price\').attr(\'disabled\', \'disabled\'); } else { $(\'#show_price\').attr(\'disabled\', \'\'); } }); </script> <b>' . $this->l('Product global information') . '</b> - '; $preview_url = ''; if (isset($obj->id)) { $preview_url = $link->getProductLink($this->getFieldValue($obj, 'id'), $this->getFieldValue($obj, 'link_rewrite', $this->_defaultFormLanguage), Category::getLinkRewrite($this->getFieldValue($obj, 'id_category_default'), (int) $cookie->id_lang)); if (!$obj->active) { $admin_dir = dirname($_SERVER['PHP_SELF']); $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1); $token = Tools::encrypt('PreviewProduct' . $obj->id); $preview_url .= $obj->active ? '' : '&adtoken=' . $token . '&ad=' . $admin_dir; } echo ' <a href="index.php?tab=AdminCatalog&id_product=' . $obj->id . '&deleteproduct&token=' . $this->token . '" style="float:right;" onclick="return confirm(\'' . $this->l('Are you sure?', __CLASS__, true, false) . '\');"> <img src="../img/admin/delete.gif" alt="' . $this->l('Delete this product') . '" title="' . $this->l('Delete this product') . '" /> ' . $this->l('Delete this product') . '</a> <a href="' . $preview_url . '" target="_blank"><img src="../img/admin/details.gif" alt="' . $this->l('View product in shop') . '" title="' . $this->l('View product in shop') . '" /> ' . $this->l('View product in shop') . '</a>'; if (file_exists(_PS_MODULE_DIR_ . 'statsproduct/statsproduct.php')) { echo ' - <a href="index.php?tab=AdminStats&module=statsproduct&id_product=' . $obj->id . '&token=' . Tools::getAdminToken('AdminStats' . (int) Tab::getIdFromClassName('AdminStats') . (int) $cookie->id_employee) . '"><img src="../modules/statsproduct/logo.gif" alt="' . $this->l('View product sales') . '" title="' . $this->l('View product sales') . '" /> ' . $this->l('View product sales') . '</a>'; } } echo ' <hr class="clear"/> <br /> <table cellpadding="5" style="width: 50%; float: left; margin-right: 20px; border-right: 1px solid #E0D0B1;"> <tr> <td class="col-left">' . $this->l('Name:') . '</td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="43" type="text" id="name_' . $language['id_lang'] . '" name="name_' . $language['id_lang'] . '" value="' . stripslashes(htmlspecialchars($this->getFieldValue($obj, 'name', $language['id_lang']))) . '"' . (!$obj->id ? ' onkeyup="if (isArrowKey(event)) return; copy2friendlyURL();"' : '') . ' onkeyup="if (isArrowKey(event)) return; updateCurrentText();" onchange="updateCurrentText();" /><sup> *</sup> <span class="hint" name="help_box">' . $this->l('Invalid characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' </td> </tr> <tr> <td class="col-left">' . $this->l('Reference:') . '</td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="reference" value="' . htmlentities($this->getFieldValue($obj, 'reference'), ENT_COMPAT, 'UTF-8') . '" style="width: 130px; margin-right: 44px;" /> <span class="hint" name="help_box">' . $this->l('Special characters allowed:') . ' .-_#\\<span class="hint-pointer"> </span></span> </td> </tr> <tr> <td class="col-left">' . $this->l('Supplier Reference:') . '</td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="supplier_reference" value="' . htmlentities($this->getFieldValue($obj, 'supplier_reference'), ENT_COMPAT, 'UTF-8') . '" style="width: 130px; margin-right: 44px;" /> <span class="hint" name="help_box">' . $this->l('Special characters allowed:') . ' .-_#\\<span class="hint-pointer"> </span></span> </td> </tr> <tr> <td class="col-left">' . $this->l('EAN13 or JAN:') . '</td> <td style="padding-bottom:5px;"> <input size="55" maxlength="13" type="text" name="ean13" value="' . htmlentities($this->getFieldValue($obj, 'ean13'), ENT_COMPAT, 'UTF-8') . '" style="width: 130px; margin-right: 5px;" /> <span class="small">' . $this->l('(Europe, Japan)') . '</span> </td> </tr> <tr> <td class="col-left">' . $this->l('UPC:') . '</td> <td style="padding-bottom:5px;"> <input size="55" maxlength="12" type="text" name="upc" value="' . htmlentities($this->getFieldValue($obj, 'upc'), ENT_COMPAT, 'UTF-8') . '" style="width: 130px; margin-right: 5px;" /> <span class="small">' . $this->l('(US, Canada)') . '</span> </td> </tr> <tr> <td class="col-left">' . $this->l('Location (warehouse):') . '</td> <td style="padding-bottom:5px;"> <input size="55" type="text" name="location" value="' . htmlentities($this->getFieldValue($obj, 'location'), ENT_COMPAT, 'UTF-8') . '" style="width: 130px; margin-right: 44px;" /> </td> </tr> <tr> <td class="col-left">' . $this->l('Width ( package ) :') . '</td> <td style="padding-bottom:5px;"> <input size="6" maxlength="6" name="width" type="text" value="' . htmlentities($this->getFieldValue($obj, 'width'), ENT_COMPAT, 'UTF-8') . '" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, \'.\');" /> ' . Configuration::get('PS_DIMENSION_UNIT') . ' </td> </tr> <tr> <td class="col-left">' . $this->l('Height ( package ) :') . '</td> <td style="padding-bottom:5px;"> <input size="6" maxlength="6" name="height" type="text" value="' . htmlentities($this->getFieldValue($obj, 'height'), ENT_COMPAT, 'UTF-8') . '" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, \'.\');" /> ' . Configuration::get('PS_DIMENSION_UNIT') . ' </td> </tr> <tr> <td class="col-left">' . $this->l('Deep ( package ) :') . '</td> <td style="padding-bottom:5px;"> <input size="6" maxlength="6" name="depth" type="text" value="' . htmlentities($this->getFieldValue($obj, 'depth'), ENT_COMPAT, 'UTF-8') . '" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, \'.\');" /> ' . Configuration::get('PS_DIMENSION_UNIT') . ' </td> </tr> <tr> <td class="col-left">' . $this->l('Weight ( package ) :') . '</td> <td style="padding-bottom:5px;"> <input size="6" maxlength="6" name="weight" type="text" value="' . htmlentities($this->getFieldValue($obj, 'weight'), ENT_COMPAT, 'UTF-8') . '" onKeyUp="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, \'.\');" /> ' . Configuration::get('PS_WEIGHT_UNIT') . ' </td> </tr> </table> <table cellpadding="5" style="width: 40%; float: left; margin-left: 10px;"> <tr> <td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">' . $this->l('Status:') . '</td> <td style="padding-bottom:5px;"> <input style="float:left;" onclick="toggleDraftWarning(false);showOptions(true);" type="radio" name="active" id="active_on" value="1" ' . ($this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/> <label for="active_on" class="t"><img src="../img/admin/enabled.gif" alt="' . $this->l('Enabled') . '" title="' . $this->l('Enabled') . '" style="float:left; padding:0px 5px 0px 5px;" />' . $this->l('Enabled') . '</label> <br class="clear" /> <input style="float:left;" onclick="toggleDraftWarning(true);showOptions(false);" type="radio" name="active" id="active_off" value="0" ' . (!$this->getFieldValue($obj, 'active') ? 'checked="checked" ' : '') . '/> <label for="active_off" class="t"><img src="../img/admin/disabled.gif" alt="' . $this->l('Disabled') . '" title="' . $this->l('Disabled') . '" style="float:left; padding:0px 5px 0px 5px" />' . $this->l('Disabled') . ($obj->active ? '' : ' (<a href="' . $preview_url . '" alt="" target="_blank">' . $this->l('View product in shop') . '</a>)') . '</label> </td> </tr> <tr id="product_options" ' . (!$obj->active ? 'style="display:none"' : '') . '> <td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">' . $this->l('Options:') . '</td> <td style="padding-bottom:5px;"> <input style="float: left;" type="checkbox" name="available_for_order" id="available_for_order" value="1" ' . ($this->getFieldValue($obj, 'available_for_order') ? 'checked="checked" ' : '') . ' onclick="if ($(this).is(\':checked\')){$(\'#show_price\').attr(\'checked\', \'checked\');$(\'#show_price\').attr(\'disabled\', \'disabled\');}else{$(\'#show_price\').attr(\'disabled\', \'\');}"/> <label for="available_for_order" class="t"><img src="../img/admin/products.gif" alt="' . $this->l('available for order') . '" title="' . $this->l('available for order') . '" style="float:left; padding:0px 5px 0px 5px" />' . $this->l('available for order') . '</label> <br class="clear" /> <input style="float: left;" type="checkbox" name="show_price" id="show_price" value="1" ' . ($this->getFieldValue($obj, 'show_price') ? 'checked="checked" ' : '') . ' /> <label for="show_price" class="t"><img src="../img/admin/gold.gif" alt="' . $this->l('display price') . '" title="' . $this->l('show price') . '" style="float:left; padding:0px 5px 0px 5px" />' . $this->l('show price') . '</label> <br class="clear" /> <input style="float: left;" type="checkbox" name="online_only" id="online_only" value="1" ' . ($this->getFieldValue($obj, 'online_only') ? 'checked="checked" ' : '') . ' /> <label for="online_only" class="t"><img src="../img/admin/basket_error.png" alt="' . $this->l('online only') . '" title="' . $this->l('online only') . '" style="float:left; padding:0px 5px 0px 5px" />' . $this->l('online only (not sold in store)') . '</label> </td> </tr> <tr> <td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">' . $this->l('Condition:') . '</td> <td style="padding-bottom:5px;"> <select name="condition" id="condition"> <option value="new" ' . ($obj->condition == 'new' ? 'selected="selected"' : '') . '>' . $this->l('New') . '</option> <option value="used" ' . ($obj->condition == 'used' ? 'selected="selected"' : '') . '>' . $this->l('Used') . '</option> <option value="refurbished" ' . ($obj->condition == 'refurbished' ? 'selected="selected"' : '') . '>' . $this->l('Refurbished') . '</option> </select> </td> </tr> <tr> <td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">' . $this->l('Manufacturer:') . '</td> <td style="padding-bottom:5px;"> <select name="id_manufacturer" id="id_manufacturer"> <option value="0">-- ' . $this->l('Choose (optional)') . ' --</option>'; if ($id_manufacturer = $this->getFieldValue($obj, 'id_manufacturer')) { echo ' <option value="' . $id_manufacturer . '" selected="selected">' . Manufacturer::getNameById($id_manufacturer) . '</option> <option disabled="disabled">----------</option>'; } echo ' </select> <a href="?tab=AdminManufacturers&addmanufacturer&token=' . Tools::getAdminToken('AdminManufacturers' . (int) Tab::getIdFromClassName('AdminManufacturers') . (int) $cookie->id_employee) . '" onclick="return confirm(\'' . $this->l('Are you sure you want to delete product information entered?', __CLASS__, true, false) . '\');"><img src="../img/admin/add.gif" alt="' . $this->l('Create') . '" title="' . $this->l('Create') . '" /> <b>' . $this->l('Create') . '</b></a> </td> </tr> <tr> <td style="vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;">' . $this->l('Supplier:') . '</td> <td style="padding-bottom:5px;"> <select name="id_supplier" id="id_supplier"> <option value="0">-- ' . $this->l('Choose (optional)') . ' --</option>'; if ($id_supplier = $this->getFieldValue($obj, 'id_supplier')) { echo ' <option value="' . $id_supplier . '" selected="selected">' . Supplier::getNameById($id_supplier) . '</option> <option disabled="disabled">----------</option>'; } echo ' </select> <a href="?tab=AdminSuppliers&addsupplier&token=' . Tools::getAdminToken('AdminSuppliers' . (int) Tab::getIdFromClassName('AdminSuppliers') . (int) $cookie->id_employee) . '" onclick="return confirm(\'' . $this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false) . '\');"><img src="../img/admin/add.gif" alt="' . $this->l('Create') . '" title="' . $this->l('Create') . '" /> <b>' . $this->l('Create') . '</b></a> </td> </tr> </table> <div class="clear"></div> <table cellpadding="5" style="width: 100%;"> <tr><td colspan="2"><hr style="width:100%;" /></td></tr>'; $this->displayPack($obj); echo ' <tr><td colspan="2"><hr style="width:100%;" /></td></tr>'; /* * Form for add a virtual product like software, mp3, etc... */ $productDownload = new ProductDownload(); if ($id_product_download = $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id'))) { $productDownload = new ProductDownload($id_product_download); } ?> <script type="text/javascript"> // <![CDATA[ ThickboxI18nImage = '<?php echo $this->l('Image'); ?> '; ThickboxI18nOf = '<?php echo $this->l('of'); ?> '; ThickboxI18nClose = '<?php echo $this->l('Close'); ?> '; ThickboxI18nOrEscKey = '<?php echo $this->l('(or "Esc")'); ?> '; ThickboxI18nNext = '<?php echo $this->l('Next >'); ?> '; ThickboxI18nPrev = '<?php echo $this->l('< Previous'); ?> '; tb_pathToImage = '../img/loadingAnimation.gif'; //]]> </script> <script type="text/javascript" src="<?php echo _PS_JS_DIR_; ?> jquery/thickbox-modified.js"></script> <script type="text/javascript" src="<?php echo _PS_JS_DIR_; ?> jquery/ajaxfileupload.js"></script> <script type="text/javascript" src="<?php echo _PS_JS_DIR_; ?> date.js"></script> <style type="text/css"> <!-- @import url(<?php echo _PS_CSS_DIR_; ?> thickbox.css); --> </style> <script type="text/javascript"> //<![CDATA[ function toggleVirtualProduct(elt) { if (elt.checked) { $('#virtual_good').show('slow'); $('#virtual_good_more').show('slow'); getE('out_of_stock_1').checked = 'checked'; getE('out_of_stock_2').disabled = 'disabled'; getE('out_of_stock_3').disabled = 'disabled'; getE('label_out_of_stock_2').setAttribute('for', ''); getE('label_out_of_stock_3').setAttribute('for', ''); } else { $('#virtual_good').hide('slow'); $('#virtual_good_more').hide('slow'); getE('out_of_stock_2').disabled = false; getE('out_of_stock_3').disabled = false; getE('label_out_of_stock_2').setAttribute('for', 'out_of_stock_2'); getE('label_out_of_stock_3').setAttribute('for', 'out_of_stock_3'); } } function uploadFile() { $.ajaxFileUpload ( { url:'./uploadProductFile.php', secureuri:false, fileElementId:'virtual_product_file', dataType: 'xml', success: function (data, status) { data = data.getElementsByTagName('return')[0]; var result = data.getAttribute("result"); var msg = data.getAttribute("msg"); var fileName = data.getAttribute("filename"); if (result == "error") { $("#upload-confirmation").html('<p>error: ' + msg + '</p>'); } else { $('#virtual_product_file').remove(); $('#virtual_product_file_label').hide(); $('#file_missing').hide(); new_href = $('#delete_downloadable_product').attr('href').replace('%26deleteVirtualProduct%3Dtrue', '%26file%3D'+msg+'%26deleteVirtualProduct%3Dtrue'); $('#delete_downloadable_product').attr('href', new_href); $('#delete_downloadable_product').show(); $('#virtual_product_name').attr('value', fileName); $('#upload-confirmation').html( '<a class="link" href="get-file-admin.php?file='+msg+'&filename='+fileName+'"><?php echo $this->l('The file'); ?> "' + fileName + '" <?php echo $this->l('has successfully been uploaded'); ?> </a>' + '<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="' + msg + '" />'); } } } ); } //]]> </script> <?php echo ' <script type="text/javascript" src="../js/price.js"></script> <script type="text/javascript"> var newLabel = \'' . $this->l('New label') . '\'; var choose_language = \'' . $this->l('Choose language:') . '\'; var required = \'' . $this->l('required') . '\'; var customizationUploadableFileNumber = ' . (int) $this->getFieldValue($obj, 'uploadable_files') . '; var customizationTextFieldNumber = ' . (int) $this->getFieldValue($obj, 'text_fields') . '; var uploadableFileLabel = 0; var textFieldLabel = 0; </script>'; ?> <tr> <td colspan="2"> <p><input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" onclick="toggleVirtualProduct(this);" <?php if (($productDownload->id or Tools::getValue('is_virtual_good') == 'true') and $productDownload->active) { echo 'checked="checked"'; } ?> /> <label for="is_virtual_good" class="t bold" style="color: black;"><?php echo $this->l('Is this a downloadable product?'); ?> </label></p> <div id="virtual_good" <?php if (!$productDownload->id or !$productDownload->active) { echo 'style="display:none;"'; } ?> > <?php if (!ProductDownload::checkWritableDir()) { ?> <p class="alert"> <?php echo $this->l('Your download repository is not writable.'); ?> <br/> <?php echo realpath(_PS_DOWNLOAD_DIR_); ?> </p> <?php } else { ?> <?php if ($productDownload->id) { echo '<input type="hidden" id="virtual_product_id" name="virtual_product_id" value="' . $productDownload->id . '" />'; } ?> <p class="block"> <?php if (!$productDownload->checkFile()) { ?> <div style="padding:5px;width:50%;float:left;margin-right:20px;border-right:1px solid #E0D0B1"> <?php if ($productDownload->id) { ?> <p class="alert" id="file_missing"> <?php echo $this->l('This product is missing'); ?> :<br/> <?php echo realpath(_PS_DOWNLOAD_DIR_) . '/' . $productDownload->physically_filename; ?> </p> <?php } ?> <p><?php $max_upload = (int) ini_get('upload_max_filesize'); $max_post = (int) ini_get('post_max_size'); $upload_mb = min($max_upload, $max_post); echo $this->l('Your server\'s maximum upload file size is') . ': ' . $upload_mb . $this->l('Mb'); ?> </p> <?php if (!strval(Tools::getValue('virtual_product_filename'))) { ?> <label id="virtual_product_file_label" for="virtual_product_file" class="t"><?php echo $this->l('Upload a file'); ?> </label> <p><input type="file" id="virtual_product_file" name="virtual_product_file" onchange="uploadFile();" /></p> <?php } ?> <div id="upload-confirmation"> <?php if ($up_filename = strval(Tools::getValue('virtual_product_filename'))) { ?> <input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="<?php echo $up_filename; ?> " /> <?php } ?> </div> <a id="delete_downloadable_product" style="display:none;" href="confirm.php?height=200&width=300&modal=true&referer=<?php echo rawurlencode($_SERVER['REQUEST_URI'] . '&deleteVirtualProduct=true'); ?> " class="thickbox red" title="<?php echo $this->l('Delete this file'); ?> "><?php echo $this->l('Delete this file'); ?> </a> <?php } else { ?> <input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="<?php echo $productDownload->physically_filename; ?> " /> <?php echo $this->l('This is the link') . ': ' . $productDownload->getHtmlLink(false, true); ?> <a href="confirm.php?height=200&width=300&modal=true&referer=<?php echo rawurlencode($_SERVER['REQUEST_URI'] . '&deleteVirtualProduct=true'); ?> " class="thickbox red" title="<?php echo $this->l('Delete this file'); ?> "><?php echo $this->l('Delete this file'); ?> </a> <?php } // check if file exists ?> </p> <p class="block"> <label for="virtual_product_name" class="t"><?php echo $this->l('Filename'); ?> </label> <input type="text" id="virtual_product_name" name="virtual_product_name" style="width:200px" value="<?php echo $productDownload->id > 0 ? $productDownload->display_filename : htmlentities(Tools::getValue('virtual_product_name'), ENT_COMPAT, 'UTF-8'); ?> " /> <span class="hint" name="help_box" style="display:none;"><?php echo $this->l('The full filename with its extension (e.g., Book.pdf)'); ?> </span> </p> </div> <div id="virtual_good_more" style="<?php if (!$productDownload->id or !$productDownload->active) { echo 'display:none;'; } ?> padding:5px;width:40%;float:left;margin-left:10px"> <p class="block"> <label for="virtual_product_nb_downloable" class="t"><?php echo $this->l('Number of downloads'); ?> </label> <input type="text" id="virtual_product_nb_downloable" name="virtual_product_nb_downloable" value="<?php echo $productDownload->id > 0 ? $productDownload->nb_downloadable : htmlentities(Tools::getValue('virtual_product_nb_downloable'), ENT_COMPAT, 'UTF-8'); ?> " class="" size="6" /> <span class="hint" name="help_box" style="display:none"><?php echo $this->l('Number of authorized downloads per customer'); ?> </span> </p> <p class="block"> <label for="virtual_product_expiration_date" class="t"><?php echo $this->l('Expiration date'); ?> </label> <input type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="<?php echo $productDownload->id > 0 ? (!empty($productDownload->date_expiration) and $productDownload->date_expiration != '0000-00-00 00:00:00') ? date('Y-m-d', strtotime($productDownload->date_expiration)) : '' : htmlentities(Tools::getValue('virtual_product_expiration_date'), ENT_COMPAT, 'UTF-8'); ?> " size="11" maxlength="10" autocomplete="off" /> <?php echo $this->l('Format: YYYY-MM-DD'); ?> <span class="hint" name="help_box" style="display:none"><?php echo $this->l('No expiration date if you leave this blank'); ?> </span> </p> <p class="block"> <label for="virtual_product_nb_days" class="t"><?php echo $this->l('Number of days'); ?> </label> <input type="text" id="virtual_product_nb_days" name="virtual_product_nb_days" value="<?php echo $productDownload->id > 0 ? $productDownload->nb_days_accessible : htmlentities(Tools::getValue('virtual_product_nb_days'), ENT_COMPAT, 'UTF-8'); ?> " class="" size="4" /><sup> *</sup> <span class="hint" name="help_box" style="display:none"><?php echo $this->l('How many days this file can be accessed by customers'); ?> - <em>(<?php echo $this->l('set to zero for unlimited access'); ?> )</em></span> </p> </div> <?php } // check if download directory is writable ?> </div> </td> </tr> <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr> <script type="text/javascript"> if ($('#is_virtual_good').attr('checked')) { $('#virtual_good').show('slow'); $('#virtual_good_more').show('slow'); } </script> <?php echo ' <tr> <td class="col-left">' . $this->l('Pre-tax wholesale price:') . '</td> <td style="padding-bottom:5px;"> ' . ($currency->format % 2 != 0 ? $currency->sign . ' ' : '') . '<input size="11" maxlength="14" name="wholesale_price" type="text" value="' . htmlentities($this->getFieldValue($obj, 'wholesale_price'), ENT_COMPAT, 'UTF-8') . '" onchange="this.value = this.value.replace(/,/g, \'.\');" />' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' <span style="margin-left:10px">' . $this->l('The wholesale price at which you bought this product') . '</span> </td> </tr>'; echo ' <tr> <td class="col-left">' . $this->l('Pre-tax retail price:') . '</td> <td style="padding-bottom:5px;"> ' . ($currency->format % 2 != 0 ? $currency->sign . ' ' : '') . '<input size="11" maxlength="14" id="priceTE" name="price" type="text" value="' . htmlentities($this->getFieldValue($obj, 'price'), ENT_COMPAT, 'UTF-8') . '" onchange="this.value = this.value.replace(/,/g, \'.\');" onkeyup="if (isArrowKey(event)) return; calcPriceTI();" />' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . '<sup> *</sup> <span style="margin-left:2px">' . $this->l('The pre-tax retail price to sell this product') . '</span> </td> </tr>'; $tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true); $taxesRatesByGroup = TaxRulesGroup::getAssociatedTaxRatesByIdCountry(Country::getDefaultCountryId()); $ecotaxTaxRate = Tax::getProductEcotaxRate(); echo '<script type="text/javascript">'; echo 'noTax = ' . (Tax::excludeTaxeOption() ? 'true' : 'false'), ";\n"; echo 'taxesArray = new Array ();' . "\n"; echo 'taxesArray[0] = 0', ";\n"; foreach ($tax_rules_groups as $tax_rules_group) { $tax_rate = array_key_exists($tax_rules_group['id_tax_rules_group'], $taxesRatesByGroup) ? $taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']] : 0; echo 'taxesArray[' . $tax_rules_group['id_tax_rules_group'] . ']=' . $tax_rate . "\n"; } echo ' ecotaxTaxRate = ' . $ecotaxTaxRate / 100 . '; </script>'; echo ' <tr> <td class="col-left">' . $this->l('Tax rule:') . '</td> <td style="padding-bottom:5px;"> <span ' . (Tax::excludeTaxeOption() ? 'style="display:none;"' : '') . '> <select onChange="javascript:calcPriceTI(); unitPriceWithTax(\'unit\');" name="id_tax_rules_group" id="id_tax_rules_group" ' . (Tax::excludeTaxeOption() ? 'disabled="disabled"' : '') . '> <option value="0">' . $this->l('No Tax') . '</option>'; foreach ($tax_rules_groups as $tax_rules_group) { echo '<option value="' . $tax_rules_group['id_tax_rules_group'] . '" ' . ($this->getFieldValue($obj, 'id_tax_rules_group') == $tax_rules_group['id_tax_rules_group'] ? ' selected="selected"' : '') . '>' . Tools::htmlentitiesUTF8($tax_rules_group['name']) . '</option>'; } echo '</select> <a href="?tab=AdminTaxRulesGroup&addtax_rules_group&token=' . Tools::getAdminToken('AdminTaxRulesGroup' . (int) Tab::getIdFromClassName('AdminTaxRulesGroup') . (int) $cookie->id_employee) . '&id_product=' . (int) $obj->id . '" onclick="return confirm(\'' . $this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false) . '\');"><img src="../img/admin/add.gif" alt="' . $this->l('Create') . '" title="' . $this->l('Create') . '" /> <b>' . $this->l('Create') . '</b></a></span> '; if (Tax::excludeTaxeOption()) { echo '<span style="margin-left:10px; color:red;">' . $this->l('Taxes are currently disabled') . '</span> (<b><a href="index.php?tab=AdminTaxes&token=' . Tools::getAdminToken('AdminTaxes' . (int) Tab::getIdFromClassName('AdminTaxes') . (int) $cookie->id_employee) . '">' . $this->l('Tax options') . '</a></b>)'; echo '<input type="hidden" value="' . (int) $this->getFieldValue($obj, 'id_tax_rules_group') . '" name="id_tax_rules_group" />'; } echo '</td> </tr> '; if (Configuration::get('PS_USE_ECOTAX')) { echo ' <tr> <td class="col-left">' . $this->l('Eco-tax (tax incl.):') . '</td> <td style="padding-bottom:5px;"> ' . ($currency->format % 2 != 0 ? $currency->sign . ' ' : '') . '<input size="11" maxlength="14" id="ecotax" name="ecotax" type="text" value="' . $this->getFieldValue($obj, 'ecotax') . '" onkeyup="if (isArrowKey(event))return; calcPriceTE(); this.value = this.value.replace(/,/g, \'.\'); if (parseInt(this.value) > getE(\'priceTE\').value) this.value = getE(\'priceTE\').value; if (isNaN(this.value)) this.value = 0;" />' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' <span style="margin-left:10px">(' . $this->l('already included in price') . ')</span> </td> </tr>'; } if ($default_country->display_tax_label) { echo ' <tr ' . (Tax::excludeTaxeOption() ? 'style="display:none"' : '') . '> <td class="col-left">' . $this->l('Retail price with tax:') . '</td> <td style="padding-bottom:5px;"> ' . ($currency->format % 2 != 0 ? ' ' . $currency->sign : '') . ' <input size="11" maxlength="14" id="priceTI" type="text" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' </td> </tr>'; } else { echo '<input size="11" maxlength="14" id="priceTI" type="hidden" value="" onchange="noComma(\'priceTI\');" onkeyup="if (isArrowKey(event)) return; calcPriceTE();" />'; } echo ' <tr id="tr_unit_price"> <td class="col-left">' . $this->l('Unit price without tax:') . '</td> <td style="padding-bottom:5px;"> ' . ($currency->format % 2 != 0 ? ' ' . $currency->sign : '') . ' <input size="11" maxlength="14" id="unit_price" name="unit_price" type="text" value="' . ($this->getFieldValue($obj, 'unit_price_ratio') != 0 ? Tools::ps_round($this->getFieldValue($obj, 'price') / $this->getFieldValue($obj, 'unit_price_ratio'), 2) : 0) . '" onkeyup="if (isArrowKey(event)) return ;this.value = this.value.replace(/,/g, \'.\'); unitPriceWithTax(\'unit\');"/>' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' ' . $this->l('per') . ' <input size="6" maxlength="10" id="unity" name="unity" type="text" value="' . (Validate::isCleanHtml($this->getFieldValue($obj, 'unity')) ? htmlentities($this->getFieldValue($obj, 'unity'), ENT_QUOTES, 'UTF-8') : '') . '" onkeyup="if (isArrowKey(event)) return ;unitySecond();" onchange="unitySecond();"/>' . (Configuration::get('PS_TAX') && $default_country->display_tax_label ? '<span style="margin-left:15px">' . $this->l('or') . ' ' . ($currency->format % 2 != 0 ? ' ' . $currency->sign : '') . '<span id="unit_price_with_tax">0.00</span>' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' ' . $this->l('per') . ' <span id="unity_second">' . (Validate::isCleanHtml($this->getFieldValue($obj, 'unity')) ? htmlentities($this->getFieldValue($obj, 'unity'), ENT_QUOTES, 'UTF-8') : '') . '</span> ' . $this->l('with tax') : '') . '</span> <p>' . $this->l('Eg. $15 per Lb') . '</p> </td> </tr> <tr> <td class="col-left"> </td> <td style="padding-bottom:5px;"> <input type="checkbox" name="on_sale" id="on_sale" style="padding-top: 5px;" ' . ($this->getFieldValue($obj, 'on_sale') ? 'checked="checked"' : '') . 'value="1" /> <label for="on_sale" class="t">' . $this->l('Display "on sale" icon on product page and text on product listing') . '</label> </td> </tr> <tr> <td class="col-left"><b>' . $this->l('Final retail price:') . '</b></td> <td style="padding-bottom:5px;"> <span style="' . ($default_country->display_tax_label ? '' : 'display:none') . '"> ' . ($currency->format % 2 != 0 ? $currency->sign . ' ' : '') . '<span id="finalPrice" style="font-weight: bold;"></span>' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . '<span' . (!Configuration::get('PS_TAX') ? ' style="display:none;"' : '') . '> (' . $this->l('tax incl.') . ')</span> </span> <span' . (!Configuration::get('PS_TAX') ? ' style="display:none;"' : '') . '>'; if ($default_country->display_tax_label) { echo ' / '; } echo ($currency->format % 2 != 0 ? $currency->sign . ' ' : '') . '<span id="finalPriceWithoutTax" style="font-weight: bold;"></span>' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : '') . ' ' . ($default_country->display_tax_label ? '(' . $this->l('tax excl.') . ')' : '') . '</span> </td> </tr> <tr> <td class="col-left"> </td> <td> <div class="hint clear" style="display: block;width: 70%;">' . $this->l('You can define many discounts and specific price rules in the Prices tab') . '</div> </td> </tr> <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr>'; if ((int) Configuration::get('PS_STOCK_MANAGEMENT')) { if (!$has_attribute) { if ($obj->id) { echo ' <tr><td class="col-left">' . $this->l('Stock Movement:') . '</td> <td style="padding-bottom:5px;"> <select id="id_mvt_reason" name="id_mvt_reason"> <option value="-1">--</option>'; $reasons = StockMvtReason::getStockMvtReasons((int) $cookie->id_lang); foreach ($reasons as $reason) { echo '<option rel="' . $reason['sign'] . '" value="' . $reason['id_stock_mvt_reason'] . '" ' . (Configuration::get('PS_STOCK_MVT_REASON_DEFAULT') == $reason['id_stock_mvt_reason'] ? 'selected="selected"' : '') . '>' . $reason['name'] . '</option>'; } echo '</select> <input id="mvt_quantity" type="text" name="mvt_quantity" size="3" maxlength="10" value="0"/> <span style="display:none;" id="mvt_sign"></span> </td> </tr> <tr> <td class="col-left"> </td> <td> <div class="hint clear" style="display: block;width: 70%;">' . $this->l('Choose the reason and enter the quantity that you want to increase or decrease in your stock') . '</div> </td> </tr>'; } else { echo '<tr><td class="col-left">' . $this->l('Initial stock:') . '</td> <td style="padding-bottom:5px;"> <input size="3" maxlength="10" name="quantity" type="text" value="0" /> </td>'; } echo '<tr> <td class="col-left">' . $this->l('Minimum quantity:') . '</td> <td style="padding-bottom:5px;"> <input size="3" maxlength="10" name="minimal_quantity" id="minimal_quantity" type="text" value="' . ($this->getFieldValue($obj, 'minimal_quantity') ? $this->getFieldValue($obj, 'minimal_quantity') : 1) . '" /> <p>' . $this->l('The minimum quantity to buy this product (set to 1 to disable this feature)') . '</p> </td> </tr>'; } if ($obj->id) { echo ' <tr><td class="col-left">' . $this->l('Quantity in stock:') . '</td> <td style="padding-bottom:5px;"><b>' . $qty . '</b><input type="hidden" name="quantity" value="' . $qty . '" /></td> </tr> '; } if ($has_attribute) { echo '<tr> <td class="col-left"> </td> <td> <div class="hint clear" style="display: block;width: 70%;">' . $this->l('You used combinations, for this reason you cannot edit your stock quantity here, but in the Combinations tab') . '</div> </td> </tr>'; } } else { echo '<tr> <td colspan="2">' . $this->l('The stock management is disabled') . '</td> </tr>'; echo ' <tr> <td class="col-left">' . $this->l('Minimum quantity:') . '</td> <td style="padding-bottom:5px;"> <input size="3" maxlength="10" name="minimal_quantity" id="minimal_quantity" type="text" value="' . ($this->getFieldValue($obj, 'minimal_quantity') ? $this->getFieldValue($obj, 'minimal_quantity') : 1) . '" /> <p>' . $this->l('The minimum quantity to buy this product (set to 1 to disable this feature)') . '</p> </td> </tr> '; } echo ' <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr> <tr> <td class="col-left">' . $this->l('Additional shipping cost:') . '</td> <td style="padding-bottom:5px;"> <input type="text" name="additional_shipping_cost" value="' . Tools::safeOutput($this->getFieldValue($obj, 'additional_shipping_cost')) . '" />' . ($currency->format % 2 == 0 ? ' ' . $currency->sign : ''); if ($default_country->display_tax_label) { echo ' (' . $this->l('tax excl.') . ')'; } echo '<p>' . $this->l('Carrier tax will be applied.') . '</p> </td> </tr> <tr> <td class="col-left">' . $this->l('Displayed text when in-stock:') . '</td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="30" type="text" id="available_now_' . $language['id_lang'] . '" name="available_now_' . $language['id_lang'] . '" value="' . stripslashes(htmlentities($this->getFieldValue($obj, 'available_now', $language['id_lang']), ENT_COMPAT, 'UTF-8')) . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' </td> </tr> <tr> <td class="col-left">' . $this->l('Displayed text when allowed to be back-ordered:') . '</td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="30" type="text" id="available_later_' . $language['id_lang'] . '" name="available_later_' . $language['id_lang'] . '" value="' . stripslashes(htmlentities($this->getFieldValue($obj, 'available_later', $language['id_lang']), ENT_COMPAT, 'UTF-8')) . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' </td> </tr> <script type="text/javascript"> calcPriceTI(); </script> <tr> <td class="col-left">' . $this->l('When out of stock:') . '</td> <td style="padding-bottom:5px;"> <input type="radio" name="out_of_stock" id="out_of_stock_1" value="0" ' . ((int) $this->getFieldValue($obj, 'out_of_stock') == 0 ? 'checked="checked"' : '') . '/> <label for="out_of_stock_1" class="t" id="label_out_of_stock_1">' . $this->l('Deny orders') . '</label> <br /><input type="radio" name="out_of_stock" id="out_of_stock_2" value="1" ' . ($this->getFieldValue($obj, 'out_of_stock') == 1 ? 'checked="checked"' : '') . '/> <label for="out_of_stock_2" class="t" id="label_out_of_stock_2">' . $this->l('Allow orders') . '</label> <br /><input type="radio" name="out_of_stock" id="out_of_stock_3" value="2" ' . ($this->getFieldValue($obj, 'out_of_stock') == 2 ? 'checked="checked"' : '') . '/> <label for="out_of_stock_3" class="t" id="label_out_of_stock_3">' . $this->l('Default:') . ' <i>' . $this->l((int) Configuration::get('PS_ORDER_OUT_OF_STOCK') ? 'Allow orders' : 'Deny orders') . '</i> (' . $this->l('as set in') . ' <a href="index.php?tab=AdminPPreferences&token=' . Tools::getAdminToken('AdminPPreferences' . (int) Tab::getIdFromClassName('AdminPPreferences') . (int) $cookie->id_employee) . '" onclick="return confirm(\'' . $this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false) . '\');">' . $this->l('Preferences') . '</a>)</label> </td> </tr> <tr> <td colspan="2" style="padding-bottom:5px;"> <hr style="width:100%;" /> </td> </tr> <tr> <td class="col-left"><label for="id_category_default" class="t">' . $this->l('Default category:') . '</label></td> <td> <div id="no_default_category" style="color: red;font-weight: bold;display: none;">' . $this->l('Please check a category in order to select the default category.') . '</div> <script type="text/javascript"> var post_selected_cat; </script>'; $default_category = Tools::getValue('id_category', 1); if (!$obj->id) { $selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage); echo ' <script type="text/javascript"> post_selected_cat = \'' . implode(',', array_keys($selectedCat)) . '\'; </script>'; } else { if (Tools::isSubmit('categoryBox')) { $selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage); } else { $selectedCat = Product::getProductCategoriesFull($obj->id, $this->_defaultFormLanguage); } } echo '<select id="id_category_default" name="id_category_default">'; foreach ($selectedCat as $cat) { echo '<option value="' . $cat['id_category'] . '" ' . ($obj->id_category_default == $cat['id_category'] ? 'selected' : '') . '>' . $cat['name'] . '</option>'; } echo '</select> </td> </tr> <tr id="tr_categories"> <td colspan="2"> '; // Translations are not automatic for the moment ;) $trads = array('Home' => $this->l('Home'), 'selected' => $this->l('selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All')); echo Helper::renderAdminCategorieTree($trads, $selectedCat) . ' </td> </tr> <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr> <tr><td colspan="2"> <span onclick="$(\'#seo\').slideToggle();" style="cursor: pointer"><img src="../img/admin/arrow.gif" alt="' . $this->l('SEO') . '" title="' . $this->l('SEO') . '" style="float:left; margin-right:5px;"/>' . $this->l('Click here to improve product\'s rank in search engines (SEO)') . '</span><br /> <div id="seo" style="display: none; padding-top: 15px;"> <table> <tr> <td class="col-left">' . $this->l('Meta title:') . '</td> <td class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="55" type="text" id="meta_title_' . $language['id_lang'] . '" name="meta_title_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' <p class="clear">' . $this->l('Product page title; leave blank to use product name') . '</p> </td> </tr> <tr> <td class="col-left">' . $this->l('Meta description:') . '</td> <td class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="55" type="text" id="meta_description_' . $language['id_lang'] . '" name="meta_description_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_description', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' <p class="clear">' . $this->l('A single sentence for HTML header') . '</p> </td> </tr> <tr> <td class="col-left">' . $this->l('Meta keywords:') . '</td> <td class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="55" type="text" id="meta_keywords_' . $language['id_lang'] . '" name="meta_keywords_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'meta_keywords', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' <>;=#{}<span class="hint-pointer"> </span></span> </div>'; } echo ' <p class="clear">' . $this->l('Keywords for HTML header, separated by a comma') . '</p> </td> </tr> <tr> <td class="col-left">' . $this->l('Friendly URL:') . '</td> <td class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="55" type="text" id="link_rewrite_' . $language['id_lang'] . '" name="link_rewrite_' . $language['id_lang'] . '" value="' . htmlentities($this->getFieldValue($obj, 'link_rewrite', $language['id_lang']), ENT_COMPAT, 'UTF-8') . '" onkeyup="if (isArrowKey(event)) return ;updateFriendlyURL();" onchange="updateFriendlyURL();" /><sup> *</sup> <span class="hint" name="help_box">' . $this->l('Only letters and the "less" character are allowed') . '<span class="hint-pointer"> </span></span> </div>'; } echo ' <p class="clear" style="padding:10px 0 0 0">' . '<a style="cursor:pointer" class="button" onmousedown="updateFriendlyURLByName();">' . $this->l('Generate') . '</a> ' . $this->l('Friendly-url from product\'s name.') . '<br /><br />'; echo ' ' . $this->l('Product link will look like this:') . ' ' . (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . '/<b>id_product</b>-<span id="friendly-url"></span>.html</p> </td> </tr>'; echo '</td></tr></table> </div> </td></tr> <tr><td colspan="2" style="padding-bottom:5px;"><hr style="width:100%;" /></td></tr> <tr> <td class="col-left">' . $this->l('Short description:') . '<br /><br /><i>(' . $this->l('appears in the product lists and on the top of the product page') . ')</i></td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . ';float: left;"> <textarea class="rte" cols="100" rows="10" id="description_short_' . $language['id_lang'] . '" name="description_short_' . $language['id_lang'] . '">' . htmlentities(stripslashes($this->getFieldValue($obj, 'description_short', $language['id_lang'])), ENT_COMPAT, 'UTF-8') . '</textarea> </div>'; } echo ' </td> </tr> <tr> <td class="col-left">' . $this->l('Description:') . '<br /><br /><i>(' . $this->l('appears in the body of the product page') . ')</i></td> <td style="padding-bottom:5px;" class="translatable">'; foreach ($this->_languages as $language) { echo ' <div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . ';float: left;"> <textarea class="rte" cols="100" rows="20" id="description_' . $language['id_lang'] . '" name="description_' . $language['id_lang'] . '">' . htmlentities(stripslashes($this->getFieldValue($obj, 'description', $language['id_lang'])), ENT_COMPAT, 'UTF-8') . '</textarea> </div>'; } echo ' </td> </tr>'; echo ' <tr> <td class="col-left">' . $this->l('Tags:') . '</td> <td style="padding-bottom:5px;" class="translatable">'; if ($obj->id) { $obj->tags = Tag::getProductTags((int) $obj->id); } foreach ($this->_languages as $language) { echo '<div class="lang_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none') . '; float: left;"> <input size="55" type="text" id="tags_' . $language['id_lang'] . '" name="tags_' . $language['id_lang'] . '" value="' . htmlentities(Tools::getValue('tags_' . $language['id_lang'], $obj->getTags($language['id_lang'], true)), ENT_COMPAT, 'UTF-8') . '" /> <span class="hint" name="help_box">' . $this->l('Forbidden characters:') . ' !<>;?=+#"°{}_$%<span class="hint-pointer"> </span></span> </div>'; } echo ' <p class="clear">' . $this->l('Tags separated by commas (e.g., dvd, dvd player, hifi)') . '</p> </td> </tr>'; $accessories = Product::getAccessoriesLight((int) $cookie->id_lang, $obj->id); if ($postAccessories = Tools::getValue('inputAccessories')) { $postAccessoriesTab = explode('-', Tools::getValue('inputAccessories')); foreach ($postAccessoriesTab as $accessoryId) { if (!$this->haveThisAccessory($accessoryId, $accessories) and $accessory = Product::getAccessoryById($accessoryId)) { $accessories[] = $accessory; } } } echo ' <tr> <td class="col-left">' . $this->l('Accessories:') . '<br /><br /><i>' . $this->l('(Do not forget to Save the product afterward)') . '</i></td> <td style="padding-bottom:5px;"> <div id="divAccessories">'; foreach ($accessories as $accessory) { echo htmlentities($accessory['name'], ENT_COMPAT, 'UTF-8') . (!empty($accessory['reference']) ? ' (' . $accessory['reference'] . ')' : '') . ' <span onclick="delAccessory(' . $accessory['id_product'] . ');" style="cursor: pointer;"><img src="../img/admin/delete.gif" class="middle" alt="" /></span><br />'; } echo '</div> <input type="hidden" name="inputAccessories" id="inputAccessories" value="'; foreach ($accessories as $accessory) { echo (int) $accessory['id_product'] . '-'; } echo '" /> <input type="hidden" name="nameAccessories" id="nameAccessories" value="'; foreach ($accessories as $accessory) { echo htmlentities($accessory['name'], ENT_COMPAT, 'UTF-8') . '¤'; } echo '" /> <script type="text/javascript"> var formProduct; var accessories = new Array(); </script> <link rel="stylesheet" type="text/css" href="' . __PS_BASE_URI__ . 'css/jquery.autocomplete.css" /> <script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/jquery/jquery.autocomplete.js"></script> <div id="ajax_choose_product" style="padding:6px; padding-top:2px; width:600px;"> <p class="clear">' . $this->l('Begin typing the first letters of the product name, then select the product from the drop-down list:') . '</p> <input type="text" value="" id="product_autocomplete_input" /> <img onclick="$(this).prev().search();" style="cursor: pointer;" src="../img/admin/add.gif" alt="' . $this->l('Add an accessory') . '" title="' . $this->l('Add an accessory') . '" /> </div> <script type="text/javascript"> urlToCall = null; /* function autocomplete */ $(function() { $(\'#product_autocomplete_input\') .autocomplete(\'ajax_products_list.php\', { minChars: 1, autoFill: true, max:20, matchContains: true, mustMatch:true, scroll:false, cacheLength:0, formatItem: function(item) { return item[1]+\' - \'+item[0]; } }).result(addAccessory); $(\'#product_autocomplete_input\').setOptions({ extraParams: {excludeIds : getAccessorieIds()} }); }); </script> </td> </tr> <tr><td colspan="2" style="padding-bottom:10px;"><hr style="width:100%;" /></td></tr> <tr> <td colspan="2" style="text-align:center;"> <input type="submit" value="' . $this->l('Save') . '" name="submitAdd' . $this->table . '" class="button" /> <input type="submit" value="' . $this->l('Save and stay') . '" name="submitAdd' . $this->table . 'AndStay" class="button" /></td> </tr> </table> <br /> </div>'; // TinyMCE global $cookie; $iso = Language::getIsoById((int) $cookie->id_lang); $isoTinyMCE = file_exists(_PS_ROOT_DIR_ . '/js/tiny_mce/langs/' . $iso . '.js') ? $iso : 'en'; $ad = dirname($_SERVER["PHP_SELF"]); echo ' <script type="text/javascript"> var iso = \'' . $isoTinyMCE . '\' ; var pathCSS = \'' . _THEME_CSS_DIR_ . '\' ; var ad = \'' . $ad . '\' ; </script> <script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/tiny_mce/tiny_mce.js"></script> <script type="text/javascript" src="' . __PS_BASE_URI__ . 'js/tinymce.inc.js"></script> <script type="text/javascript"> toggleVirtualProduct(getE(\'is_virtual_good\')); unitPriceWithTax(\'unit\'); </script>'; $categoryBox = Tools::getValue('categoryBox', array()); }
function content_546105797ea627_61357006($_smarty_tpl) { if (!is_callable('smarty_modifier_escape')) { include '/srv/www/helveti/tools/smarty/plugins/modifier.escape.php'; } if (!is_callable('smarty_modifier_date_format')) { include '/srv/www/helveti/tools/smarty/plugins/modifier.date_format.php'; } if (!is_callable('smarty_function_counter')) { include '/srv/www/helveti/tools/smarty/plugins/function.counter.php'; } ?> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./errors.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0); ?> <?php if (count($_smarty_tpl->tpl_vars['errors']->value) == 0) { ?> <script type="text/javascript"> // <![CDATA[ // PrestaShop internal settings var currencySign = '<?php echo html_entity_decode($_smarty_tpl->tpl_vars['currencySign']->value, 2, "UTF-8"); ?> '; var currencyRate = '<?php echo floatval($_smarty_tpl->tpl_vars['currencyRate']->value); ?> '; var currencyFormat = '<?php echo intval($_smarty_tpl->tpl_vars['currencyFormat']->value); ?> '; var currencyBlank = '<?php echo intval($_smarty_tpl->tpl_vars['currencyBlank']->value); ?> '; var taxRate = <?php echo floatval($_smarty_tpl->tpl_vars['tax_rate']->value); ?> ; var jqZoomEnabled = <?php if ($_smarty_tpl->tpl_vars['jqZoomEnabled']->value) { ?> true<?php } else { ?> false<?php } ?> ; //JS Hook var oosHookJsCodeFunctions = new Array(); // Parameters var id_product = '<?php echo intval($_smarty_tpl->tpl_vars['product']->value->id); ?> '; var productHasAttributes = <?php if (isset($_smarty_tpl->tpl_vars['groups']->value)) { ?> true<?php } else { ?> false<?php } ?> ; var quantitiesDisplayAllowed = <?php if ($_smarty_tpl->tpl_vars['display_qties']->value == 1) { ?> true<?php } else { ?> false<?php } ?> ; var quantityAvailable = <?php if ($_smarty_tpl->tpl_vars['display_qties']->value == 1 && $_smarty_tpl->tpl_vars['product']->value->quantity) { echo $_smarty_tpl->tpl_vars['product']->value->quantity; } else { ?> 0<?php } ?> ; var allowBuyWhenOutOfStock = <?php if ($_smarty_tpl->tpl_vars['allow_oosp']->value == 1) { ?> true<?php } else { ?> false<?php } ?> ; var availableNowValue = '<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->available_now, 'quotes', 'UTF-8'); ?> '; var availableLaterValue = '<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->available_later, 'quotes', 'UTF-8'); ?> '; var productPriceTaxExcluded = <?php echo ($tmp = @$_smarty_tpl->tpl_vars['product']->value->getPriceWithoutReduct(true)) === null || $tmp === '' ? 'null' : $tmp; ?> - <?php echo $_smarty_tpl->tpl_vars['product']->value->ecotax; ?> ; var productBasePriceTaxExcluded = <?php echo $_smarty_tpl->tpl_vars['product']->value->base_price; ?> - <?php echo $_smarty_tpl->tpl_vars['product']->value->ecotax; ?> ; var reduction_percent = <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction'] && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'percentage') { echo $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction'] * 100; } else { ?> 0<?php } ?> ; var reduction_price = <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction'] && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'amount') { echo floatval($_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction']); } else { ?> 0<?php } ?> ; var specific_price = <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['price']) { echo $_smarty_tpl->tpl_vars['product']->value->specificPrice['price']; } else { ?> 0<?php } ?> ; var product_specific_price = new Array(); <?php $_smarty_tpl->tpl_vars['specific_price_value'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['specific_price_value']->_loop = false; $_smarty_tpl->tpl_vars['key_specific_price'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['product']->value->specificPrice; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['specific_price_value']->key => $_smarty_tpl->tpl_vars['specific_price_value']->value) { $_smarty_tpl->tpl_vars['specific_price_value']->_loop = true; $_smarty_tpl->tpl_vars['key_specific_price']->value = $_smarty_tpl->tpl_vars['specific_price_value']->key; ?> product_specific_price['<?php echo $_smarty_tpl->tpl_vars['key_specific_price']->value; ?> '] = '<?php echo $_smarty_tpl->tpl_vars['specific_price_value']->value; ?> '; <?php } ?> var specific_currency = <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['id_currency']) { ?> true<?php } else { ?> false<?php } ?> ; var group_reduction = '<?php echo $_smarty_tpl->tpl_vars['group_reduction']->value; ?> '; var default_eco_tax = <?php echo $_smarty_tpl->tpl_vars['product']->value->ecotax; ?> ; var ecotaxTax_rate = <?php echo $_smarty_tpl->tpl_vars['ecotaxTax_rate']->value; ?> ; var currentDate = '<?php echo smarty_modifier_date_format(time(), '%Y-%m-%d %H:%M:%S'); ?> '; var maxQuantityToAllowDisplayOfLastQuantityMessage = <?php echo $_smarty_tpl->tpl_vars['last_qties']->value; ?> ; var noTaxForThisProduct = <?php if ($_smarty_tpl->tpl_vars['no_tax']->value == 1) { ?> true<?php } else { ?> false<?php } ?> ; var displayPrice = <?php echo $_smarty_tpl->tpl_vars['priceDisplay']->value; ?> ; var productReference = '<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->reference, 'htmlall', 'UTF-8'); ?> '; var productAvailableForOrder = <?php if (isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && $_smarty_tpl->tpl_vars['restricted_country_mode']->value || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> '0'<?php } else { ?> '<?php echo $_smarty_tpl->tpl_vars['product']->value->available_for_order; ?> '<?php } ?> ; var productShowPrice = '<?php if (!$_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { echo $_smarty_tpl->tpl_vars['product']->value->show_price; } else { ?> 0<?php } ?> '; var productUnitPriceRatio = '<?php echo $_smarty_tpl->tpl_vars['product']->value->unit_price_ratio; ?> '; var idDefaultImage = <?php if (isset($_smarty_tpl->tpl_vars['cover']->value['id_image_only'])) { echo $_smarty_tpl->tpl_vars['cover']->value['id_image_only']; } else { ?> 0<?php } ?> ; var stock_management = <?php echo intval($_smarty_tpl->tpl_vars['stock_management']->value); ?> ; <?php if (!isset($_smarty_tpl->tpl_vars['priceDisplayPrecision']->value)) { ?> <?php $_smarty_tpl->tpl_vars['priceDisplayPrecision'] = new Smarty_variable(2, null, 0); } if (!$_smarty_tpl->tpl_vars['priceDisplay']->value || $_smarty_tpl->tpl_vars['priceDisplay']->value == 2) { ?> <?php $_smarty_tpl->tpl_vars['productPrice'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value->getPrice(true, @constant('NULL'), $_smarty_tpl->tpl_vars['priceDisplayPrecision']->value), null, 0); ?> <?php $_smarty_tpl->tpl_vars['productPriceWithoutReduction'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value->getPriceWithoutReduct(false, @constant('NULL')), null, 0); } elseif ($_smarty_tpl->tpl_vars['priceDisplay']->value == 1) { ?> <?php $_smarty_tpl->tpl_vars['productPrice'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value->getPrice(false, @constant('NULL'), $_smarty_tpl->tpl_vars['priceDisplayPrecision']->value), null, 0); ?> <?php $_smarty_tpl->tpl_vars['productPriceWithoutReduction'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value->getPriceWithoutReduct(true, @constant('NULL')), null, 0); } ?> var productPriceWithoutReduction = '<?php echo $_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value; ?> '; var productPrice = '<?php echo $_smarty_tpl->tpl_vars['productPrice']->value; ?> '; // Customizable field var img_ps_dir = '<?php echo $_smarty_tpl->tpl_vars['img_ps_dir']->value; ?> '; var customizationFields = new Array(); <?php $_smarty_tpl->tpl_vars['imgIndex'] = new Smarty_variable(0, null, 0); $_smarty_tpl->tpl_vars['textFieldIndex'] = new Smarty_variable(0, null, 0); $_smarty_tpl->tpl_vars['field'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field']->_loop = false; $_from = $_smarty_tpl->tpl_vars['customizationFields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) { $_smarty_tpl->tpl_vars['field']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index']++; ?> <?php $_smarty_tpl->tpl_vars["key"] = new Smarty_variable("pictures_" . (string) $_smarty_tpl->tpl_vars['product']->value->id . "_" . (string) $_smarty_tpl->tpl_vars['field']->value['id_customization_field'], null, 0); ?> customizationFields[<?php echo intval($_smarty_tpl->getVariable('smarty')->value['foreach']['customizationFields']['index']); ?> ] = new Array(); customizationFields[<?php echo intval($_smarty_tpl->getVariable('smarty')->value['foreach']['customizationFields']['index']); ?> ][0] = '<?php if (intval($_smarty_tpl->tpl_vars['field']->value['type']) == 0) { ?> img<?php echo $_smarty_tpl->tpl_vars['imgIndex']->value++; } else { ?> textField<?php echo $_smarty_tpl->tpl_vars['textFieldIndex']->value++; } ?> '; customizationFields[<?php echo intval($_smarty_tpl->getVariable('smarty')->value['foreach']['customizationFields']['index']); ?> ][1] = <?php if (intval($_smarty_tpl->tpl_vars['field']->value['type']) == 0 && isset($_smarty_tpl->tpl_vars['pictures']->value[$_smarty_tpl->tpl_vars['key']->value]) && $_smarty_tpl->tpl_vars['pictures']->value[$_smarty_tpl->tpl_vars['key']->value]) { ?> 2<?php } else { echo intval($_smarty_tpl->tpl_vars['field']->value['required']); } ?> ; <?php } ?> // Images var img_prod_dir = '<?php echo $_smarty_tpl->tpl_vars['img_prod_dir']->value; ?> '; var combinationImages = new Array(); <?php if (isset($_smarty_tpl->tpl_vars['combinationImages']->value)) { ?> <?php $_smarty_tpl->tpl_vars['combination'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['combination']->_loop = false; $_smarty_tpl->tpl_vars['combinationId'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['combinationImages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['combination']->key => $_smarty_tpl->tpl_vars['combination']->value) { $_smarty_tpl->tpl_vars['combination']->_loop = true; $_smarty_tpl->tpl_vars['combinationId']->value = $_smarty_tpl->tpl_vars['combination']->key; ?> combinationImages[<?php echo $_smarty_tpl->tpl_vars['combinationId']->value; ?> ] = new Array(); <?php $_smarty_tpl->tpl_vars['image'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['image']->_loop = false; $_from = $_smarty_tpl->tpl_vars['combination']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['f_combinationImage']['index'] = -1; 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['smarty']->value['foreach']['f_combinationImage']['index']++; ?> combinationImages[<?php echo $_smarty_tpl->tpl_vars['combinationId']->value; ?> ][<?php echo $_smarty_tpl->getVariable('smarty')->value['foreach']['f_combinationImage']['index']; ?> ] = <?php echo intval($_smarty_tpl->tpl_vars['image']->value['id_image']); ?> ; <?php } ?> <?php } } ?> combinationImages[0] = new Array(); <?php if (isset($_smarty_tpl->tpl_vars['images']->value)) { ?> <?php $_smarty_tpl->tpl_vars['image'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['image']->_loop = false; $_from = $_smarty_tpl->tpl_vars['images']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['f_defaultImages']['index'] = -1; 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['smarty']->value['foreach']['f_defaultImages']['index']++; ?> combinationImages[0][<?php echo $_smarty_tpl->getVariable('smarty')->value['foreach']['f_defaultImages']['index']; ?> ] = <?php echo $_smarty_tpl->tpl_vars['image']->value['id_image']; ?> ; <?php } } ?> // Translations var doesntExist = '<?php echo smartyTranslate(array('s' => 'This combination does not exist for this product. Please select another combination.', 'js' => 1), $_smarty_tpl); ?> '; var doesntExistNoMore = '<?php echo smartyTranslate(array('s' => 'This product is no longer in stock', 'js' => 1), $_smarty_tpl); ?> '; var doesntExistNoMoreBut = '<?php echo smartyTranslate(array('s' => 'with those attributes but is available with others.', 'js' => 1), $_smarty_tpl); ?> '; var uploading_in_progress = '<?php echo smartyTranslate(array('s' => 'Uploading in progress, please be patient.', 'js' => 1), $_smarty_tpl); ?> '; var fieldRequired = '<?php echo smartyTranslate(array('s' => 'Please fill in all the required fields before saving your customization.', 'js' => 1), $_smarty_tpl); ?> '; <?php if (isset($_smarty_tpl->tpl_vars['groups']->value)) { ?> // Combinations <?php $_smarty_tpl->tpl_vars['combination'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['combination']->_loop = false; $_smarty_tpl->tpl_vars['idCombination'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['combinations']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['combination']->key => $_smarty_tpl->tpl_vars['combination']->value) { $_smarty_tpl->tpl_vars['combination']->_loop = true; $_smarty_tpl->tpl_vars['idCombination']->value = $_smarty_tpl->tpl_vars['combination']->key; ?> var specific_price_combination = new Array(); var available_date = new Array(); specific_price_combination['reduction_percent'] = <?php if ($_smarty_tpl->tpl_vars['combination']->value['specific_price'] && $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction'] && $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction_type'] == 'percentage') { echo $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction'] * 100; } else { ?> 0<?php } ?> ; specific_price_combination['reduction_price'] = <?php if ($_smarty_tpl->tpl_vars['combination']->value['specific_price'] && $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction'] && $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction_type'] == 'amount') { echo $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction']; } else { ?> 0<?php } ?> ; specific_price_combination['price'] = <?php if ($_smarty_tpl->tpl_vars['combination']->value['specific_price'] && $_smarty_tpl->tpl_vars['combination']->value['specific_price']['price']) { echo $_smarty_tpl->tpl_vars['combination']->value['specific_price']['price']; } else { ?> 0<?php } ?> ; specific_price_combination['reduction_type'] = '<?php if ($_smarty_tpl->tpl_vars['combination']->value['specific_price']) { echo $_smarty_tpl->tpl_vars['combination']->value['specific_price']['reduction_type']; } ?> '; specific_price_combination['id_product_attribute'] = <?php if ($_smarty_tpl->tpl_vars['combination']->value['specific_price']) { echo intval($_smarty_tpl->tpl_vars['combination']->value['specific_price']['id_product_attribute']); } else { ?> 0<?php } ?> ; available_date['date'] = '<?php echo $_smarty_tpl->tpl_vars['combination']->value['available_date']; ?> '; available_date['date_formatted'] = '<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['combination']->value['available_date'], 'full' => false), $_smarty_tpl); ?> '; addCombination(<?php echo intval($_smarty_tpl->tpl_vars['idCombination']->value); ?> , new Array(<?php echo $_smarty_tpl->tpl_vars['combination']->value['list']; ?> ), <?php echo $_smarty_tpl->tpl_vars['combination']->value['quantity']; ?> , <?php echo $_smarty_tpl->tpl_vars['combination']->value['price']; ?> , <?php echo $_smarty_tpl->tpl_vars['combination']->value['ecotax']; ?> , <?php echo $_smarty_tpl->tpl_vars['combination']->value['id_image']; ?> , '<?php echo addslashes($_smarty_tpl->tpl_vars['combination']->value['reference']); ?> ', <?php echo $_smarty_tpl->tpl_vars['combination']->value['unit_impact']; ?> , <?php echo $_smarty_tpl->tpl_vars['combination']->value['minimal_quantity']; ?> , available_date, specific_price_combination); <?php } } ?> <?php if (isset($_smarty_tpl->tpl_vars['attributesCombinations']->value)) { ?> // Combinations attributes informations var attributesCombinations = new Array(); <?php $_smarty_tpl->tpl_vars['aC'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['aC']->_loop = false; $_smarty_tpl->tpl_vars['id'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['attributesCombinations']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['aC']->key => $_smarty_tpl->tpl_vars['aC']->value) { $_smarty_tpl->tpl_vars['aC']->_loop = true; $_smarty_tpl->tpl_vars['id']->value = $_smarty_tpl->tpl_vars['aC']->key; ?> tabInfos = new Array(); tabInfos['id_attribute'] = '<?php echo intval($_smarty_tpl->tpl_vars['aC']->value['id_attribute']); ?> '; tabInfos['attribute'] = '<?php echo $_smarty_tpl->tpl_vars['aC']->value['attribute']; ?> '; tabInfos['group'] = '<?php echo $_smarty_tpl->tpl_vars['aC']->value['group']; ?> '; tabInfos['id_attribute_group'] = '<?php echo intval($_smarty_tpl->tpl_vars['aC']->value['id_attribute_group']); ?> '; attributesCombinations.push(tabInfos); <?php } } ?> //]]> </script> <div class="primary_block_obal block clearfix"> <div id="primary_block" class="clearfix"> <?php if (isset($_smarty_tpl->tpl_vars['adminActionDisplay']->value) && $_smarty_tpl->tpl_vars['adminActionDisplay']->value) { ?> <div id="admin-action"> <p><?php echo smartyTranslate(array('s' => 'This product is not visible to your customers.'), $_smarty_tpl); ?> <input type="hidden" id="admin-action-product-id" value="<?php echo $_smarty_tpl->tpl_vars['product']->value->id; ?> " /> <input type="submit" value="<?php echo smartyTranslate(array('s' => 'Publish'), $_smarty_tpl); ?> " class="exclusive" onclick="submitPublishProduct('<?php echo $_smarty_tpl->tpl_vars['base_dir']->value; echo smarty_modifier_escape($_GET['ad'], 'htmlall', 'UTF-8'); ?> ', 0, '<?php echo smarty_modifier_escape($_GET['adtoken'], 'htmlall', 'UTF-8'); ?> ')"/> <input type="submit" value="<?php echo smartyTranslate(array('s' => 'Back'), $_smarty_tpl); ?> " class="exclusive" onclick="submitPublishProduct('<?php echo $_smarty_tpl->tpl_vars['base_dir']->value; echo smarty_modifier_escape($_GET['ad'], 'htmlall', 'UTF-8'); ?> ', 1, '<?php echo smarty_modifier_escape($_GET['adtoken'], 'htmlall', 'UTF-8'); ?> ')"/> </p> <p id="admin-action-result"></p> </p> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['confirmation']->value) && $_smarty_tpl->tpl_vars['confirmation']->value) { ?> <p class="confirmation"> <?php echo $_smarty_tpl->tpl_vars['confirmation']->value; ?> </p> <?php } ?> <!-- right infos--> <div id="pb-right-column" class="col-sm-5 col-xs-12"> <!-- product img--> <div id="image-block"> <?php if ($_smarty_tpl->tpl_vars['have_image']->value) { ?> <span id="view_full_size"> <img src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getImageLink($_smarty_tpl->tpl_vars['product']->value->link_rewrite, $_smarty_tpl->tpl_vars['cover']->value['id_image'], 'large_default'), ENT_QUOTES, 'UTF-8', true); ?> " class="<?php if ($_smarty_tpl->tpl_vars['jqZoomEnabled']->value && $_smarty_tpl->tpl_vars['have_image']->value) { ?> jqzoom<?php } ?> img-responsive" title="<?php if (!empty($_smarty_tpl->tpl_vars['cover']->value['legend'])) { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['cover']->value['legend'], 'htmlall', 'UTF-8'); } else { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->name, 'htmlall', 'UTF-8'); } ?> " alt="<?php if (!empty($_smarty_tpl->tpl_vars['cover']->value['legend'])) { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['cover']->value['legend'], 'htmlall', 'UTF-8'); } else { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->name, 'htmlall', 'UTF-8'); } ?> " id="bigpic" width="<?php echo $_smarty_tpl->tpl_vars['largeSize']->value['width']; ?> " height="<?php echo $_smarty_tpl->tpl_vars['largeSize']->value['height']; ?> "/> <?php if ($_smarty_tpl->tpl_vars['product']->value->top200) { ?> <span class="product_tag toptag"><?php echo smartyTranslate(array('s' => 'TOP'), $_smarty_tpl); ?> </span> <?php } ?> <div class="img-product-tags"> <?php ob_start(); echo Product::skladovost($_smarty_tpl->tpl_vars['product']->value->id, "skladem"); $_tmp1 = ob_get_clean(); if ($_tmp1) { ?> <span class="product_tag skladem"><?php echo smartyTranslate(array('s' => 'Skladem'), $_smarty_tpl); ?> </span><br /><?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'percentage') { ?> <span class="product_tag hot"><?php echo smartyTranslate(array('s' => 'Reduced price!'), $_smarty_tpl); ?> -<?php echo $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction'] * 100; ?> %</span><br /> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'amount') { ?> <span class="product_tag hot"><?php echo smartyTranslate(array('s' => 'Reduced price!'), $_smarty_tpl); ?> -<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value - floatval($_smarty_tpl->tpl_vars['productPrice']->value)), $_smarty_tpl); ?> </span><br /> <?php } ?> <?php if (Product::jeNovinka($_smarty_tpl->tpl_vars['product']->value->id)) { ?> <span class="product_tag new"><?php echo smartyTranslate(array('s' => 'Novinka'), $_smarty_tpl); ?> </span><br /><?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->top200) { ?> <span class="product_tag nejprodavanejsi"><?php echo smartyTranslate(array('s' => 'Nejprodavanější'), $_smarty_tpl); ?> </span><br /> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->condition == "used") { ?> <span class="product_tag bazar"><?php echo smartyTranslate(array('s' => 'Bazar'), $_smarty_tpl); ?> </span><br /> <?php } ?> </div> </span> <?php } else { ?> <span id="view_full_size"> <img src="<?php echo $_smarty_tpl->tpl_vars['img_prod_dir']->value; echo $_smarty_tpl->tpl_vars['lang_iso']->value; ?> -default-large_default.jpg" id="bigpic" alt="" title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->name, 'htmlall', 'UTF-8'); ?> " /> <span class="span_link"><?php echo smartyTranslate(array('s' => 'Maximize'), $_smarty_tpl); ?> </span> </span> <?php } ?> </div> <?php if (isset($_smarty_tpl->tpl_vars['images']->value) && count($_smarty_tpl->tpl_vars['images']->value) > 0) { ?> <!-- thumbnails --> <div id="views_block" class="clearfix <?php if (isset($_smarty_tpl->tpl_vars['images']->value) && count($_smarty_tpl->tpl_vars['images']->value) < 2) { ?> hidden<?php } ?> "> <div id="thumbs_list"> <ul id="thumbs_list_frame-2"> <?php if (isset($_smarty_tpl->tpl_vars['images']->value)) { ?> <?php $_smarty_tpl->tpl_vars['image'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['image']->_loop = false; $_from = $_smarty_tpl->tpl_vars['images']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['image']->index = -1; 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['image']->index++; $_smarty_tpl->tpl_vars['image']->first = $_smarty_tpl->tpl_vars['image']->index === 0; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['thumbnails']['first'] = $_smarty_tpl->tpl_vars['image']->first; ?> <?php $_smarty_tpl->tpl_vars['imageIds'] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['product']->value->id . "-" . (string) $_smarty_tpl->tpl_vars['image']->value['id_image'], null, 0); ?> <?php if (!empty($_smarty_tpl->tpl_vars['image']->value['legend'])) { ?> <?php $_smarty_tpl->tpl_vars['imageTitlte'] = new Smarty_variable(smarty_modifier_escape($_smarty_tpl->tpl_vars['image']->value['legend'], 'htmlall', 'UTF-8'), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['imageTitlte'] = new Smarty_variable(smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->name, 'htmlall', 'UTF-8'), null, 0); ?> <?php } ?> <li id="thumbnail_<?php echo $_smarty_tpl->tpl_vars['image']->value['id_image']; ?> " class="miniatura-img"> <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getImageLink($_smarty_tpl->tpl_vars['product']->value->link_rewrite, $_smarty_tpl->tpl_vars['imageIds']->value, 'thickbox_default'), ENT_QUOTES, 'UTF-8', true); ?> " rel="other-views" class="thickbox<?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['thumbnails']['first']) { ?> shown<?php } ?> " title="<?php echo $_smarty_tpl->tpl_vars['imageTitlte']->value; ?> "> <img id="thumb_<?php echo $_smarty_tpl->tpl_vars['image']->value['id_image']; ?> " src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getImageLink($_smarty_tpl->tpl_vars['product']->value->link_rewrite, $_smarty_tpl->tpl_vars['imageIds']->value, 'medium_default'), ENT_QUOTES, 'UTF-8', true); ?> " alt="<?php echo $_smarty_tpl->tpl_vars['imageTitlte']->value; ?> " title="<?php echo $_smarty_tpl->tpl_vars['imageTitlte']->value; ?> " height="<?php echo $_smarty_tpl->tpl_vars['mediumSize']->value['height']; ?> " width="<?php echo $_smarty_tpl->tpl_vars['mediumSize']->value['width']; ?> " /> </a> </li> <?php } ?> <?php } ?> </ul> </div> <?php if (isset($_smarty_tpl->tpl_vars['images']->value) && count($_smarty_tpl->tpl_vars['images']->value) > 4) { ?> <span id="dalsi-fotografie" title="<?php echo smartyTranslate(array('s' => 'Další fotografie'), $_smarty_tpl); ?> "> <span id="fotografie-zabaleno"><?php echo smartyTranslate(array('s' => 'Další fotografie'), $_smarty_tpl); ?> <i class="fa fa-chevron-down"></i></span> <span id="fotografie-rozbaleno" style="display: none;"><?php echo smartyTranslate(array('s' => 'Méně fotografií'), $_smarty_tpl); ?> <i class="fa fa-chevron-up"></i></span> </span><?php } ?> </div> <?php } ?> </div> <!-- left infos--> <div id="pb-left-column" class="col-sm-7 col-xs-12"> <h1><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['product']->value->name, 'htmlall', 'UTF-8'); ?> </h1> <?php if ($_smarty_tpl->tpl_vars['product']->value->description_short || count($_smarty_tpl->tpl_vars['packItems']->value) > 0) { ?> <div id="short_description_block"> <?php if ($_smarty_tpl->tpl_vars['product']->value->description_short) { ?> <div id="short_description_content" class="rte align_justify short_description_content"><p class=""></p><?php echo $_smarty_tpl->tpl_vars['product']->value->description_short; ?> <a href="javascript:{}" class="button vice"><?php echo smartyTranslate(array('s' => 'More details'), $_smarty_tpl); ?> </a></div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->description) { ?> <p class="buttons_bottom_block"><a href="javascript:{}" class="button"><?php echo smartyTranslate(array('s' => 'More details'), $_smarty_tpl); ?> </a></p> <?php } ?> <?php if (count($_smarty_tpl->tpl_vars['packItems']->value) > 0) { ?> <div class="short_description_pack"> <h3><?php echo smartyTranslate(array('s' => 'Pack content'), $_smarty_tpl); ?> </h3> <?php $_smarty_tpl->tpl_vars['packItem'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['packItem']->_loop = false; $_from = $_smarty_tpl->tpl_vars['packItems']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['packItem']->key => $_smarty_tpl->tpl_vars['packItem']->value) { $_smarty_tpl->tpl_vars['packItem']->_loop = true; ?> <div class="pack_content"> <?php echo $_smarty_tpl->tpl_vars['packItem']->value['pack_quantity']; ?> x <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getProductLink($_smarty_tpl->tpl_vars['packItem']->value['id_product'], $_smarty_tpl->tpl_vars['packItem']->value['link_rewrite'], $_smarty_tpl->tpl_vars['packItem']->value['category']), ENT_QUOTES, 'UTF-8', true); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['packItem']->value['name'], 'htmlall', 'UTF-8'); ?> </a> <p><?php echo $_smarty_tpl->tpl_vars['packItem']->value['description_short']; ?> </p> </div> <?php } ?> </div> <?php } ?> </div> <?php } ?> <ul class="productcats"> <?php $_smarty_tpl->tpl_vars['cat'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['cat']->_loop = false; $_from = Product::getProductCategoriesFull(Tools::getValue('id_product')); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['cat']->key => $_smarty_tpl->tpl_vars['cat']->value) { $_smarty_tpl->tpl_vars['cat']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['cat']->value['id_category'] != 2) { ?> <li><a href="<?php ob_start(); echo $_smarty_tpl->tpl_vars['cat']->value['id_category']; $_tmp2 = ob_get_clean(); echo $_smarty_tpl->tpl_vars['link']->value->getCategoryLink($_tmp2); ?> " title="<?php echo $_smarty_tpl->tpl_vars['cat']->value['name']; ?> "><?php echo $_smarty_tpl->tpl_vars['cat']->value['name']; ?> </a></li> <?php } ?> <?php } ?> </ul> <?php $_smarty_tpl->tpl_vars['pocet_hodnoceni'] = new Smarty_variable(Product::pocetHeurekaHvezd($_smarty_tpl->tpl_vars['product']->value->id, 'pocet_hodnoceni'), null, 0); ?> <?php $_smarty_tpl->tpl_vars['pocet_hvezd_na_desetinu'] = new Smarty_variable(Product::pocetHeurekaHvezd($_smarty_tpl->tpl_vars['product']->value->id, 'hvezdy_na_desetinu'), null, 0); ?> <?php $_smarty_tpl->tpl_vars['pocet_hvezd'] = new Smarty_variable(Product::pocetHeurekaHvezd($_smarty_tpl->tpl_vars['product']->value->id, 'hvezdy'), null, 0); ?> <div class="produkt-dalsi-info"> <div class="box_prodejce"><img src="<?php echo $_smarty_tpl->tpl_vars['img_dir']->value; ?> helveti/autorizovany-prodejce-<?php echo mb_strtolower($_smarty_tpl->tpl_vars['product']->value->manufacturer_name, 'UTF-8'); ?> .png" alt="Autorizovaný prodejce značky Wenger"></div> <div class="box_heureka"><img src="<?php echo $_smarty_tpl->tpl_vars['img_dir']->value; ?> /helveti/heureka-male-logo.png" alt="Heureka logo"><div class="box_heureka_txt"><span class="pocet_hodnoceni_heureka"><?php echo NoxHome::hodnoceniEshopu(); ?> % </span><br><span class="pocet_hodnoceni_heureka_popis">Hodnocení</span><br /> <span class="pocet_hodnoceni_heureka_popis2">zákazníků</span></div></div> <div class="box_hodnoceni"> <div class="rating_box heureka-ratign"> <?php $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['i']->step = 1; $_smarty_tpl->tpl_vars['i']->total = (int) ceil(($_smarty_tpl->tpl_vars['i']->step > 0 ? 5 + 1 - 1 : 1 - 5 + 1) / abs($_smarty_tpl->tpl_vars['i']->step)); if ($_smarty_tpl->tpl_vars['i']->total > 0) { for ($_smarty_tpl->tpl_vars['i']->value = 1, $_smarty_tpl->tpl_vars['i']->iteration = 1; $_smarty_tpl->tpl_vars['i']->iteration <= $_smarty_tpl->tpl_vars['i']->total; $_smarty_tpl->tpl_vars['i']->value += $_smarty_tpl->tpl_vars['i']->step, $_smarty_tpl->tpl_vars['i']->iteration++) { $_smarty_tpl->tpl_vars['i']->first = $_smarty_tpl->tpl_vars['i']->iteration == 1; $_smarty_tpl->tpl_vars['i']->last = $_smarty_tpl->tpl_vars['i']->iteration == $_smarty_tpl->tpl_vars['i']->total; ?> <i class="fa fa-star<?php if ($_smarty_tpl->tpl_vars['i']->value > $_smarty_tpl->tpl_vars['pocet_hvezd']->value) { ?> -o<?php } ?> "></i> <?php } } ?> </div> (<?php echo $_smarty_tpl->tpl_vars['pocet_hvezd_na_desetinu']->value; ?> / 5 bodů)<br /> <?php echo $_smarty_tpl->tpl_vars['pocet_hodnoceni']->value; ?> uživatelů hodnotilo </div> </div> <?php if ($_smarty_tpl->tpl_vars['product']->value->show_price && !isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) || isset($_smarty_tpl->tpl_vars['groups']->value) || $_smarty_tpl->tpl_vars['product']->value->reference || isset($_smarty_tpl->tpl_vars['HOOK_PRODUCT_ACTIONS']->value) && $_smarty_tpl->tpl_vars['HOOK_PRODUCT_ACTIONS']->value) { ?> <!-- add to cart form--> <form id="buy_block" <?php if ($_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value && !isset($_smarty_tpl->tpl_vars['groups']->value) && $_smarty_tpl->tpl_vars['product']->value->quantity > 0) { ?> class="hidden"<?php } ?> action="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('cart'), ENT_QUOTES, 'UTF-8', true); ?> " method="post"> <!-- hidden datas --> <p class="hidden"> <input type="hidden" name="token" value="<?php echo $_smarty_tpl->tpl_vars['static_token']->value; ?> " /> <input type="hidden" name="id_product" value="<?php echo intval($_smarty_tpl->tpl_vars['product']->value->id); ?> " id="product_page_product_id" /> <input type="hidden" name="add" value="1" /> <input type="hidden" name="id_product_attribute" id="idCombination" value="" /> </p> <div class="product_attributes"> <?php if (isset($_smarty_tpl->tpl_vars['groups']->value)) { ?> <!-- attributes --> <div id="attributes"> <div class="clear"></div> <?php $_smarty_tpl->tpl_vars['group'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group']->_loop = false; $_smarty_tpl->tpl_vars['id_attribute_group'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['groups']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['group']->key => $_smarty_tpl->tpl_vars['group']->value) { $_smarty_tpl->tpl_vars['group']->_loop = true; $_smarty_tpl->tpl_vars['id_attribute_group']->value = $_smarty_tpl->tpl_vars['group']->key; ?> <?php if (count($_smarty_tpl->tpl_vars['group']->value['attributes'])) { ?> <fieldset class="attribute_fieldset"> <label class="attribute_label" for="group_<?php echo intval($_smarty_tpl->tpl_vars['id_attribute_group']->value); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['group']->value['name'], 'htmlall', 'UTF-8'); ?> : </label> <?php $_smarty_tpl->tpl_vars["groupName"] = new Smarty_variable("group_" . (string) $_smarty_tpl->tpl_vars['id_attribute_group']->value, null, 0); ?> <div class="attribute_list"> <?php if ($_smarty_tpl->tpl_vars['group']->value['group_type'] == 'select') { ?> <select name="<?php echo $_smarty_tpl->tpl_vars['groupName']->value; ?> " id="group_<?php echo intval($_smarty_tpl->tpl_vars['id_attribute_group']->value); ?> " class="attribute_select form-control" onchange="findCombination();getProductAttribute();"> <?php $_smarty_tpl->tpl_vars['group_attribute'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group_attribute']->_loop = false; $_smarty_tpl->tpl_vars['id_attribute'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['group']->value['attributes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['group_attribute']->key => $_smarty_tpl->tpl_vars['group_attribute']->value) { $_smarty_tpl->tpl_vars['group_attribute']->_loop = true; $_smarty_tpl->tpl_vars['id_attribute']->value = $_smarty_tpl->tpl_vars['group_attribute']->key; ?> <option value="<?php echo intval($_smarty_tpl->tpl_vars['id_attribute']->value); ?> "<?php if (isset($_GET[$_smarty_tpl->tpl_vars['groupName']->value]) && intval($_GET[$_smarty_tpl->tpl_vars['groupName']->value]) == $_smarty_tpl->tpl_vars['id_attribute']->value || $_smarty_tpl->tpl_vars['group']->value['default'] == $_smarty_tpl->tpl_vars['id_attribute']->value) { ?> selected="selected"<?php } ?> title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['group_attribute']->value, 'htmlall', 'UTF-8'); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['group_attribute']->value, 'htmlall', 'UTF-8'); ?> </option> <?php } ?> </select> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['group_type'] == 'color') { ?> <ul id="color_to_pick_list" class="clearfix"> <?php $_smarty_tpl->tpl_vars["default_colorpicker"] = new Smarty_variable('', null, 0); ?> <?php $_smarty_tpl->tpl_vars['group_attribute'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group_attribute']->_loop = false; $_smarty_tpl->tpl_vars['id_attribute'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['group']->value['attributes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['group_attribute']->key => $_smarty_tpl->tpl_vars['group_attribute']->value) { $_smarty_tpl->tpl_vars['group_attribute']->_loop = true; $_smarty_tpl->tpl_vars['id_attribute']->value = $_smarty_tpl->tpl_vars['group_attribute']->key; ?> <li<?php if ($_smarty_tpl->tpl_vars['group']->value['default'] == $_smarty_tpl->tpl_vars['id_attribute']->value) { ?> class="selected"<?php } ?> > <a id="color_<?php echo intval($_smarty_tpl->tpl_vars['id_attribute']->value); ?> " class="color_pick<?php if ($_smarty_tpl->tpl_vars['group']->value['default'] == $_smarty_tpl->tpl_vars['id_attribute']->value) { ?> selected<?php } ?> " style="background: <?php echo $_smarty_tpl->tpl_vars['colors']->value[$_smarty_tpl->tpl_vars['id_attribute']->value]['value']; ?> ;" title="<?php echo $_smarty_tpl->tpl_vars['colors']->value[$_smarty_tpl->tpl_vars['id_attribute']->value]['name']; ?> " onclick="colorPickerClick(this);getProductAttribute();"> <?php if (file_exists($_smarty_tpl->tpl_vars['col_img_dir']->value . $_smarty_tpl->tpl_vars['id_attribute']->value . '.jpg')) { ?> <img src="<?php echo $_smarty_tpl->tpl_vars['img_col_dir']->value; echo $_smarty_tpl->tpl_vars['id_attribute']->value; ?> .jpg" alt="<?php echo $_smarty_tpl->tpl_vars['colors']->value[$_smarty_tpl->tpl_vars['id_attribute']->value]['name']; ?> " width="20" height="20" /><br /> <?php } ?> </a> </li> <?php if ($_smarty_tpl->tpl_vars['group']->value['default'] == $_smarty_tpl->tpl_vars['id_attribute']->value) { ?> <?php $_smarty_tpl->tpl_vars['default_colorpicker'] = new Smarty_variable($_smarty_tpl->tpl_vars['id_attribute']->value, null, 0); ?> <?php } ?> <?php } ?> </ul> <input type="hidden" class="color_pick_hidden" name="<?php echo $_smarty_tpl->tpl_vars['groupName']->value; ?> " value="<?php echo $_smarty_tpl->tpl_vars['default_colorpicker']->value; ?> " /> <?php } elseif ($_smarty_tpl->tpl_vars['group']->value['group_type'] == 'radio') { ?> <ul> <?php $_smarty_tpl->tpl_vars['group_attribute'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['group_attribute']->_loop = false; $_smarty_tpl->tpl_vars['id_attribute'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['group']->value['attributes']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['group_attribute']->key => $_smarty_tpl->tpl_vars['group_attribute']->value) { $_smarty_tpl->tpl_vars['group_attribute']->_loop = true; $_smarty_tpl->tpl_vars['id_attribute']->value = $_smarty_tpl->tpl_vars['group_attribute']->key; ?> <li> <input type="radio" class="attribute_radio" name="<?php echo $_smarty_tpl->tpl_vars['groupName']->value; ?> " value="<?php echo $_smarty_tpl->tpl_vars['id_attribute']->value; ?> " <?php if ($_smarty_tpl->tpl_vars['group']->value['default'] == $_smarty_tpl->tpl_vars['id_attribute']->value) { ?> checked="checked"<?php } ?> onclick="findCombination();getProductAttribute();" /> <span><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['group_attribute']->value, 'htmlall', 'UTF-8'); ?> </span> </li> <?php } ?> </ul> <?php } ?> </div> </fieldset> <?php } ?> <?php } ?> </div> <?php } ?> <!-- minimal quantity wanted --> <p id="minimal_quantity_wanted_p"<?php if ($_smarty_tpl->tpl_vars['product']->value->minimal_quantity <= 1 || !$_smarty_tpl->tpl_vars['product']->value->available_for_order || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> style="display: none;"<?php } ?> > <?php echo smartyTranslate(array('s' => 'This product is not sold individually. You must select at least'), $_smarty_tpl); ?> <b id="minimal_quantity_label"><?php echo $_smarty_tpl->tpl_vars['product']->value->minimal_quantity; ?> </b> <?php echo smartyTranslate(array('s' => 'quantity for this product.'), $_smarty_tpl); ?> </p> <?php if ($_smarty_tpl->tpl_vars['product']->value->minimal_quantity > 1) { ?> <script type="text/javascript"> checkMinimalQuantity(); </script> <?php } ?> </div> <!-- prices --> <?php if ($_smarty_tpl->tpl_vars['product']->value->show_price && !isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && !$_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->online_only) { ?> <p class="online_only"><?php echo smartyTranslate(array('s' => 'Online only'), $_smarty_tpl); ?> </p> <?php } ?> <div class="price<?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice || $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction']) { ?> price-sleva<?php } ?> "> <div id="blok_slevy"> <p id="reduction_percent" <?php if (!$_smarty_tpl->tpl_vars['product']->value->specificPrice || $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] != 'percentage') { ?> style="display:none;"<?php } ?> ><span id="reduction_percent_display"><?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'percentage') { ?> -<?php echo $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction'] * 100; ?> %<?php } ?> </span></p> <p id="reduction_amount" <?php if (!$_smarty_tpl->tpl_vars['product']->value->specificPrice || $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] != 'amount' || intval($_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction']) == 0) { ?> style="display:none"<?php } ?> > <span id="reduction_amount_display"> <?php if ($_smarty_tpl->tpl_vars['product']->value->specificPrice && $_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction_type'] == 'amount' && intval($_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction']) != 0) { ?> -<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value - floatval($_smarty_tpl->tpl_vars['productPrice']->value)), $_smarty_tpl); ?> <?php } ?> </span> </p> </div> <div id="blok_ceny"> <p class="our_price_display"> <?php if ($_smarty_tpl->tpl_vars['priceDisplay']->value >= 0 && $_smarty_tpl->tpl_vars['priceDisplay']->value <= 2) { ?> <span id="our_price_display"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPrice']->value), $_smarty_tpl); ?> </span> <!--<?php if ($_smarty_tpl->tpl_vars['tax_enabled']->value && (isset($_smarty_tpl->tpl_vars['display_tax_label']->value) && $_smarty_tpl->tpl_vars['display_tax_label']->value == 1 || !isset($_smarty_tpl->tpl_vars['display_tax_label']->value))) { ?> <?php if ($_smarty_tpl->tpl_vars['priceDisplay']->value == 1) { echo smartyTranslate(array('s' => 'tax excl.'), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'tax incl.'), $_smarty_tpl); } ?> <?php } ?> --> <?php } ?> </p> </div> <div id="blok_ceny_ostatni"> <span id="old_price"<?php if (!$_smarty_tpl->tpl_vars['product']->value->specificPrice || !$_smarty_tpl->tpl_vars['product']->value->specificPrice['reduction']) { ?> class="hidden"<?php } ?> > <?php if ($_smarty_tpl->tpl_vars['priceDisplay']->value >= 0 && $_smarty_tpl->tpl_vars['priceDisplay']->value <= 2) { ?> <span id="old_price_display"><?php if ($_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value > $_smarty_tpl->tpl_vars['productPrice']->value) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value), $_smarty_tpl); } ?> </span> <!-- <?php if ($_smarty_tpl->tpl_vars['tax_enabled']->value && $_smarty_tpl->tpl_vars['display_tax_label']->value == 1) { if ($_smarty_tpl->tpl_vars['priceDisplay']->value == 1) { echo smartyTranslate(array('s' => 'tax excl.'), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'tax incl.'), $_smarty_tpl); } } ?> --> | <span id="usetrite"><?php echo smartyTranslate(array('s' => 'Ušetříte'), $_smarty_tpl); ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPriceWithoutReduction']->value - $_smarty_tpl->tpl_vars['productPrice']->value), $_smarty_tpl); ?> </span> <?php } ?> </span> </div> </div> <?php } ?> <div class="content_prices clearfix kosik_box"> <?php if ($_smarty_tpl->tpl_vars['product']->value->quantity <= 0 && !$_smarty_tpl->tpl_vars['product']->value->available_later || $_smarty_tpl->tpl_vars['product']->value->quantity > 0 && !$_smarty_tpl->tpl_vars['product']->value->available_now || !$_smarty_tpl->tpl_vars['product']->value->available_for_order || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> <p class="barva_neskladem nelze_koupit"><strong>Hodinky nelze zakoupit.</strong></p> <p class="nelze_koupit_kontakt">Vyberte si prosím jiné nebo nás <a href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getCMSLink('8'); ?> ">kontaktujte</a>.</p> <?php } ?> <!-- availability --> <p id="availability_statut"<?php if ($_smarty_tpl->tpl_vars['product']->value->quantity <= 0 && !$_smarty_tpl->tpl_vars['product']->value->available_later && $_smarty_tpl->tpl_vars['allow_oosp']->value || $_smarty_tpl->tpl_vars['product']->value->quantity > 0 && !$_smarty_tpl->tpl_vars['product']->value->available_now || !$_smarty_tpl->tpl_vars['product']->value->available_for_order || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> style="display: none;"<?php } ?> > <span class="availability_skladovost <?php echo Product::skladovost($_smarty_tpl->tpl_vars['product']->value->id, "barva"); ?> "><?php echo Product::skladovost($_smarty_tpl->tpl_vars['product']->value->id, "text"); ?> - </span> <span class="btn-tooltip availability_dodani" data-html="true" data-placement="right" data-original-title="<?php echo Product::skladovost($_smarty_tpl->tpl_vars['product']->value->id, "tooltip"); ?> "><?php echo Product::skladovost($_smarty_tpl->tpl_vars['product']->value->id, "datum"); ?> </span>, doprava zdarma </p> <p id="availability_date"<?php if ($_smarty_tpl->tpl_vars['product']->value->quantity > 0 || !$_smarty_tpl->tpl_vars['product']->value->available_for_order || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value || !isset($_smarty_tpl->tpl_vars['product']->value->available_date) || $_smarty_tpl->tpl_vars['product']->value->available_date < smarty_modifier_date_format(time(), '%Y-%m-%d')) { ?> style="display: none;"<?php } ?> > <span id="availability_date_label"><?php echo smartyTranslate(array('s' => 'Availability date:'), $_smarty_tpl); ?> </span> <span id="availability_date_value"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['product']->value->available_date, 'full' => false), $_smarty_tpl); ?> </span> </p> <!-- Out of stock hook --> <div id="oosHook"<?php if ($_smarty_tpl->tpl_vars['product']->value->quantity > 0) { ?> style="display: none;"<?php } ?> > <?php echo $_smarty_tpl->tpl_vars['HOOK_PRODUCT_OOS']->value; ?> </div> <p id="add_to_cart" <?php if (!$_smarty_tpl->tpl_vars['allow_oosp']->value && $_smarty_tpl->tpl_vars['product']->value->quantity <= 0 || !$_smarty_tpl->tpl_vars['product']->value->available_for_order || isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && $_smarty_tpl->tpl_vars['restricted_country_mode']->value || $_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> style="display:none"<?php } ?> class="buttons_bottom_block"> <span></span> <input type="submit" name="Submit" value="<?php echo smartyTranslate(array('s' => 'Add to cart'), $_smarty_tpl); ?> " class="exclusive" /> </p> </div> <div class="produkt-iconky"> <a href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getCMSLink('39'); ?> "><span class="produkt-iconky-pojisteni produkt-iconky-icon"> Pojištění hodinek </span></a> <a href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getCMSLink('1'); ?> "><span class="produkt-iconky-doprava produkt-iconky-icon"> Doprava zdarma </span></a> <a href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getCMSLink('40'); ?> "><span class="produkt-iconky-zaruka produkt-iconky-icon"> 3-letá záruka </span></a> </div> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_PRODUCT_ACTIONS']->value) && $_smarty_tpl->tpl_vars['HOOK_PRODUCT_ACTIONS']->value) { echo $_smarty_tpl->tpl_vars['HOOK_PRODUCT_ACTIONS']->value; } ?> <div class="clear"></div> </form> <?php } ?> <!-- usefull links--> <div id="usefull_link_block" class="links"> <div class="email-product-share"> <?php if ($_smarty_tpl->tpl_vars['HOOK_EXTRA_LEFT']->value) { echo $_smarty_tpl->tpl_vars['HOOK_EXTRA_LEFT']->value; } ?> <?php if ($_smarty_tpl->tpl_vars['have_image']->value && !$_smarty_tpl->tpl_vars['jqZoomEnabled']->value) { ?> <?php } ?> </div> <div class="google-product-share"> <div class="g-plusone" data-size="tall"></div> </div> <div class="facebook-product-share"> <iframe src="//www.facebook.com/plugins/like.php?locale=en_GB&href=<?php echo $_smarty_tpl->tpl_vars['base_dir']->value; echo $_smarty_tpl->tpl_vars['current_url']->value; ?> &width&layout=box_count&action=like&show_faces=false&share=false&height=65&appId=1526409284245153" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:50px; height:65px;" allowTransparency="true"></iframe> </div> <div class="clearfix"> </div> </div> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_EXTRA_RIGHT']->value) && $_smarty_tpl->tpl_vars['HOOK_EXTRA_RIGHT']->value) { echo $_smarty_tpl->tpl_vars['HOOK_EXTRA_RIGHT']->value; } ?> </div> </div> <?php if (isset($_smarty_tpl->tpl_vars['quantity_discounts']->value) && count($_smarty_tpl->tpl_vars['quantity_discounts']->value) > 0) { ?> <!-- quantity discount --> <ul class="idTabs clearfix"> <li><a href="#discount" style="cursor: pointer" class="selected"><?php echo smartyTranslate(array('s' => 'Sliding scale pricing'), $_smarty_tpl); ?> </a></li> </ul> <div id="quantityDiscount"> <table class="std"> <thead> <tr> <th><?php echo smartyTranslate(array('s' => 'Product'), $_smarty_tpl); ?> </th> <th><?php echo smartyTranslate(array('s' => 'From (qty)'), $_smarty_tpl); ?> </th> <th><?php if (Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')) { echo smartyTranslate(array('s' => 'Price'), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'Discount'), $_smarty_tpl); } ?> </th> </tr> </thead> <tbody> <?php $_smarty_tpl->tpl_vars['quantity_discount'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['quantity_discount']->_loop = false; $_from = $_smarty_tpl->tpl_vars['quantity_discounts']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['quantity_discount']->key => $_smarty_tpl->tpl_vars['quantity_discount']->value) { $_smarty_tpl->tpl_vars['quantity_discount']->_loop = true; ?> <tr id="quantityDiscount_<?php echo $_smarty_tpl->tpl_vars['quantity_discount']->value['id_product_attribute']; ?> " class="quantityDiscount_<?php echo $_smarty_tpl->tpl_vars['quantity_discount']->value['id_product_attribute']; ?> "> <td> <?php if (isset($_smarty_tpl->tpl_vars['quantity_discount']->value['attributes']) && $_smarty_tpl->tpl_vars['quantity_discount']->value['attributes']) { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value->getProductName($_smarty_tpl->tpl_vars['quantity_discount']->value['id_product'], $_smarty_tpl->tpl_vars['quantity_discount']->value['id_product_attribute']); ?> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['product']->value->getProductName($_smarty_tpl->tpl_vars['quantity_discount']->value['id_product']); ?> <?php } ?> </td> <td><?php echo intval($_smarty_tpl->tpl_vars['quantity_discount']->value['quantity']); ?> </td> <td> <?php if ($_smarty_tpl->tpl_vars['quantity_discount']->value['price'] >= 0 || $_smarty_tpl->tpl_vars['quantity_discount']->value['reduction_type'] == 'amount') { ?> <?php if (Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPrice']->value - floatval($_smarty_tpl->tpl_vars['quantity_discount']->value['real_value'])), $_smarty_tpl); ?> <?php } else { ?> -<?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => floatval($_smarty_tpl->tpl_vars['quantity_discount']->value['real_value'])), $_smarty_tpl); ?> <?php } ?> <?php } else { ?> <?php if (Configuration::get('PS_DISPLAY_DISCOUNT_PRICE')) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPrice'][0][0]->convertPrice(array('price' => $_smarty_tpl->tpl_vars['productPrice']->value - floatval($_smarty_tpl->tpl_vars['productPrice']->value * $_smarty_tpl->tpl_vars['quantity_discount']->value['reduction'])), $_smarty_tpl); ?> <?php } else { ?> -<?php echo floatval($_smarty_tpl->tpl_vars['quantity_discount']->value['real_value']); ?> % <?php } ?> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> <!-- description and features --> <?php if (isset($_smarty_tpl->tpl_vars['product']->value) && $_smarty_tpl->tpl_vars['product']->value->description || isset($_smarty_tpl->tpl_vars['features']->value) && $_smarty_tpl->tpl_vars['features']->value || isset($_smarty_tpl->tpl_vars['accessories']->value) && $_smarty_tpl->tpl_vars['accessories']->value || isset($_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB']->value) && $_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB']->value || isset($_smarty_tpl->tpl_vars['attachments']->value) && $_smarty_tpl->tpl_vars['attachments']->value || isset($_smarty_tpl->tpl_vars['product']->value) && $_smarty_tpl->tpl_vars['product']->value->customizable) { ?> <div id="more_info_block" class="clear"> <ul id="more_info_tabs" class="idTabs idTabsShort clearfix"> <?php if ($_smarty_tpl->tpl_vars['product']->value->description) { ?> <li><a id="more_info_tab_more_info" href="#idTab1"><?php echo smartyTranslate(array('s' => 'More info'), $_smarty_tpl); ?> </a></li><?php } ?> <?php if ($_smarty_tpl->tpl_vars['attachments']->value) { ?> <li><a id="more_info_tab_attachments" href="#idTab9"><?php echo smartyTranslate(array('s' => 'Download'), $_smarty_tpl); ?> </a></li><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['accessories']->value) && $_smarty_tpl->tpl_vars['accessories']->value) { ?> <li><a href="#idTab4"><?php echo smartyTranslate(array('s' => 'Accessories'), $_smarty_tpl); ?> </a></li><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['product']->value) && $_smarty_tpl->tpl_vars['product']->value->customizable) { ?> <li><a href="#idTab10"><?php echo smartyTranslate(array('s' => 'Product customization'), $_smarty_tpl); ?> </a></li><?php } ?> <?php echo $_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB']->value; ?> </ul> <div id="more_info_sheets" class="sheets align_justify"> <?php if (isset($_smarty_tpl->tpl_vars['product']->value) && $_smarty_tpl->tpl_vars['product']->value->description) { ?> <!-- full description --> <div id="idTab1" class="rte"> <?php echo $_smarty_tpl->tpl_vars['product']->value->description; ?> <?php if (isset($_smarty_tpl->tpl_vars['features']->value) && $_smarty_tpl->tpl_vars['features']->value) { ?> <h3>Parametry</h3> <!-- product's features --> <table> <?php $_smarty_tpl->tpl_vars['feature'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['feature']->_loop = false; $_from = $_smarty_tpl->tpl_vars['features']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['feature']->key => $_smarty_tpl->tpl_vars['feature']->value) { $_smarty_tpl->tpl_vars['feature']->_loop = true; ?> <?php if (isset($_smarty_tpl->tpl_vars['feature']->value['value'])) { ?> <?php if (!strstr($_smarty_tpl->tpl_vars['feature']->value['name'], "FILTRACE")) { ?> <tr><td><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['feature']->value['name'], 'htmlall', 'UTF-8'); ?> </td><td> <?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['feature']->value['value'], 'htmlall', 'UTF-8'); ?> </td></tr> <?php } ?> <?php } ?> <?php } ?> </table> <?php } ?> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['attachments']->value) && $_smarty_tpl->tpl_vars['attachments']->value) { ?> <ul id="idTab9" class="bullet"> <?php $_smarty_tpl->tpl_vars['attachment'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['attachment']->_loop = false; $_from = $_smarty_tpl->tpl_vars['attachments']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['attachment']->key => $_smarty_tpl->tpl_vars['attachment']->value) { $_smarty_tpl->tpl_vars['attachment']->_loop = true; ?> <li><a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('attachment', true, null, "id_attachment=" . (string) $_smarty_tpl->tpl_vars['attachment']->value['id_attachment']), ENT_QUOTES, 'UTF-8', true); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['attachment']->value['name'], 'htmlall', 'UTF-8'); ?> </a><br /><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['attachment']->value['description'], 'htmlall', 'UTF-8'); ?> </li> <?php } ?> </ul> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['accessories']->value) && $_smarty_tpl->tpl_vars['accessories']->value) { ?> <!-- accessories --> <div id="idTab4" class="bullet row"> <div class="products_block accessories_block clearfix"> <div class="block_content"> <?php $_smarty_tpl->tpl_vars["acclimit"] = new Smarty_variable(1, null, 0); ?> <?php $_smarty_tpl->tpl_vars["columnpage"] = new Smarty_variable(3, null, 0); ?> <?php $_smarty_tpl->tpl_vars['accessory'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['accessory']->_loop = false; $_from = $_smarty_tpl->tpl_vars['accessories']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['accessory']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['accessory']->iteration = 0; foreach ($_from as $_smarty_tpl->tpl_vars['accessory']->key => $_smarty_tpl->tpl_vars['accessory']->value) { $_smarty_tpl->tpl_vars['accessory']->_loop = true; $_smarty_tpl->tpl_vars['accessory']->iteration++; $_smarty_tpl->tpl_vars['accessory']->last = $_smarty_tpl->tpl_vars['accessory']->iteration === $_smarty_tpl->tpl_vars['accessory']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['accessories_list']['last'] = $_smarty_tpl->tpl_vars['accessory']->last; ?> <?php if (($_smarty_tpl->tpl_vars['accessory']->value['allow_oosp'] || $_smarty_tpl->tpl_vars['accessory']->value['quantity_all_versions'] > 0 || $_smarty_tpl->tpl_vars['accessory']->value['quantity'] > 0) && $_smarty_tpl->tpl_vars['accessory']->value['available_for_order'] && !isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value)) { ?> <?php $_smarty_tpl->tpl_vars['accessoryLink'] = new Smarty_variable($_smarty_tpl->tpl_vars['link']->value->getProductLink($_smarty_tpl->tpl_vars['accessory']->value['id_product'], $_smarty_tpl->tpl_vars['accessory']->value['link_rewrite'], $_smarty_tpl->tpl_vars['accessory']->value['category']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['acclimit']->value % $_smarty_tpl->tpl_vars['columnpage']->value == 1) { ?> <div class="row products-item "> <?php } ?> <div class="col-xs-6 col-md-4 product_block ajax_block_product product_accessories_description"> <div class="product-container clearfix"> <div class="center_block"> <a href="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessoryLink']->value, 'htmlall', 'UTF-8'); ?> " title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['legend'], 'htmlall', 'UTF-8'); ?> " class="product_image"> <img class="img-responsive" src="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getImageLink($_smarty_tpl->tpl_vars['accessory']->value['link_rewrite'], $_smarty_tpl->tpl_vars['accessory']->value['id_image'], 'home_default'), ENT_QUOTES, 'UTF-8', true); ?> " alt="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['legend'], 'htmlall', 'UTF-8'); ?> " /> <span class="product-additional" rel="<?php echo $_smarty_tpl->tpl_vars['accessory']->value['id_product']; ?> "></span> </a> </div> <div class="right_block"> <h4 class="name"> <a href="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessoryLink']->value, 'htmlall', 'UTF-8'); ?> " title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['name'], 'htmlall', 'UTF-8'); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['name'], 'htmlall', 'UTF-8'); ?> </a> </h4> <div class="content_price"> <?php if ($_smarty_tpl->tpl_vars['accessory']->value['show_price'] && !isset($_smarty_tpl->tpl_vars['restricted_country_mode']->value) && !$_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value) { ?> <span class="price"><?php if ($_smarty_tpl->tpl_vars['priceDisplay']->value != 1) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPrice'][0][0]->displayWtPrice(array('p' => $_smarty_tpl->tpl_vars['accessory']->value['price']), $_smarty_tpl); } else { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPrice'][0][0]->displayWtPrice(array('p' => $_smarty_tpl->tpl_vars['accessory']->value['price_tax_exc']), $_smarty_tpl); } ?> </span><?php } ?> </div> <div class="product_desc"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate(preg_replace('!<[^>]*?>!', ' ', $_smarty_tpl->tpl_vars['accessory']->value['description_short']), 80, '...'); ?> </div> <a class="rating_box leo-rating-<?php echo $_smarty_tpl->tpl_vars['accessory']->value['id_product']; ?> " href="#" rel="<?php echo $_smarty_tpl->tpl_vars['accessory']->value['id_product']; ?> " style="display:none"> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> <i class="fa fa-star-o"></i> </a> <?php if (!$_smarty_tpl->tpl_vars['PS_CATALOG_MODE']->value && ($_smarty_tpl->tpl_vars['accessory']->value['allow_oosp'] || $_smarty_tpl->tpl_vars['accessory']->value['quantity'] > 0)) { ?> <a class="button ajax_add_to_cart_button exclusive pull-left" href="<?php ob_start(); echo intval($_smarty_tpl->tpl_vars['accessory']->value['id_product']); $_tmp3 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('cart', true, null, "qty=1&id_product=" . $_tmp3 . "&token=" . (string) $_smarty_tpl->tpl_vars['static_token']->value . "&add"), ENT_QUOTES, 'UTF-8', true); ?> " rel="ajax_id_product_<?php echo intval($_smarty_tpl->tpl_vars['accessory']->value['id_product']); ?> " title="<?php echo smartyTranslate(array('s' => 'Add to cart'), $_smarty_tpl); ?> "><?php echo smartyTranslate(array('s' => 'Add to cart'), $_smarty_tpl); ?> </a> <?php } ?> <a href="#" id="wishlist_button<?php echo $_smarty_tpl->tpl_vars['accessory']->value['id_product']; ?> " class="btn-tooltip button wishlist-compare fa fa-heart" onclick="LeoWishlistCart('wishlist_block_list', 'add', '<?php echo $_smarty_tpl->tpl_vars['accessory']->value['id_product']; ?> ', $('#idCombination').val(), 1 ); return false;" title="<?php echo smartyTranslate(array('s' => 'Add to wishlist'), $_smarty_tpl); ?> "></a> <a class="quick-view btn-tooltip button wishlist-compare fa fa-arrows-alt" title="<?php echo smartyTranslate(array('s' => 'Quick View'), $_smarty_tpl); ?> " href="<?php if (strpos($_smarty_tpl->tpl_vars['accessory']->value['link'], "?")) { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['link'] . "&content_only=1", 'htmlall', 'UTF-8'); } else { echo smarty_modifier_escape($_smarty_tpl->tpl_vars['accessory']->value['link'] . "?content_only=1", 'htmlall', 'UTF-8'); } ?> "></a> </div> </div> </div> <?php if ($_smarty_tpl->tpl_vars['acclimit']->value % $_smarty_tpl->tpl_vars['columnpage']->value == 0 || $_smarty_tpl->getVariable('smarty')->value['foreach']['accessories_list']['last']) { ?> </div> <?php } ?> <?php $_smarty_tpl->tpl_vars['acclimit'] = new Smarty_variable($_smarty_tpl->tpl_vars['acclimit']->value + 1, null, 0); ?> <?php } ?> <?php } ?> </div> </div> </div> <?php } ?> <!-- Customizable products --> <?php if (isset($_smarty_tpl->tpl_vars['product']->value) && $_smarty_tpl->tpl_vars['product']->value->customizable) { ?> <div id="idTab10" class="bullet customization_block"> <form method="post" action="<?php echo $_smarty_tpl->tpl_vars['customizationFormTarget']->value; ?> " enctype="multipart/form-data" id="customizationForm" class="clearfix"> <p class="infoCustomizable"> <?php echo smartyTranslate(array('s' => 'After saving your customized product, remember to add it to your cart.'), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['product']->value->uploadable_files) { ?> <br /><?php echo smartyTranslate(array('s' => 'Allowed file formats are: GIF, JPG, PNG'), $_smarty_tpl); } ?> </p> <?php if (intval($_smarty_tpl->tpl_vars['product']->value->uploadable_files)) { ?> <div class="customizableProductsFile"> <h3><?php echo smartyTranslate(array('s' => 'Pictures'), $_smarty_tpl); ?> </h3> <ul id="uploadable_files" class="clearfix"> <?php echo smarty_function_counter(array('start' => 0, 'assign' => 'customizationField'), $_smarty_tpl); ?> <?php $_smarty_tpl->tpl_vars['field'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field']->_loop = false; $_from = $_smarty_tpl->tpl_vars['customizationFields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) { $_smarty_tpl->tpl_vars['field']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index']++; ?> <?php if ($_smarty_tpl->tpl_vars['field']->value['type'] == 0) { ?> <li class="customizationUploadLine<?php if ($_smarty_tpl->tpl_vars['field']->value['required']) { ?> required<?php } ?> "><?php $_smarty_tpl->tpl_vars['key'] = new Smarty_variable('pictures_' . $_smarty_tpl->tpl_vars['product']->value->id . '_' . $_smarty_tpl->tpl_vars['field']->value['id_customization_field'], null, 0); ?> <?php if (isset($_smarty_tpl->tpl_vars['pictures']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <div class="customizationUploadBrowse"> <img src="<?php echo $_smarty_tpl->tpl_vars['pic_dir']->value; echo $_smarty_tpl->tpl_vars['pictures']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> _small" alt="" /> <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getProductDeletePictureLink($_smarty_tpl->tpl_vars['product']->value, $_smarty_tpl->tpl_vars['field']->value['id_customization_field']), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Delete'), $_smarty_tpl); ?> " > <img src="<?php echo $_smarty_tpl->tpl_vars['img_dir']->value; ?> icon/delete.gif" alt="<?php echo smartyTranslate(array('s' => 'Delete'), $_smarty_tpl); ?> " class="customization_delete_icon" width="11" height="13" /> </a> </div> <?php } ?> <div class="customizationUploadBrowse"> <label class="customizationUploadBrowseDescription"><?php if (!empty($_smarty_tpl->tpl_vars['field']->value['name'])) { echo $_smarty_tpl->tpl_vars['field']->value['name']; } else { echo smartyTranslate(array('s' => 'Please select an image file from your computer'), $_smarty_tpl); } if ($_smarty_tpl->tpl_vars['field']->value['required']) { ?> <sup>*</sup><?php } ?> </label> <input type="file" name="file<?php echo $_smarty_tpl->tpl_vars['field']->value['id_customization_field']; ?> " id="img<?php echo $_smarty_tpl->tpl_vars['customizationField']->value; ?> " class="customization_block_input <?php if (isset($_smarty_tpl->tpl_vars['pictures']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> filled<?php } ?> " /> </div> </li> <?php echo smarty_function_counter(array(), $_smarty_tpl); ?> <?php } ?> <?php } ?> </ul> </div> <?php } ?> <?php if (intval($_smarty_tpl->tpl_vars['product']->value->text_fields)) { ?> <div class="customizableProductsText"> <h3><?php echo smartyTranslate(array('s' => 'Text'), $_smarty_tpl); ?> </h3> <ul id="text_fields"> <?php echo smarty_function_counter(array('start' => 0, 'assign' => 'customizationField'), $_smarty_tpl); ?> <?php $_smarty_tpl->tpl_vars['field'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field']->_loop = false; $_from = $_smarty_tpl->tpl_vars['customizationFields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['field']->key => $_smarty_tpl->tpl_vars['field']->value) { $_smarty_tpl->tpl_vars['field']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['customizationFields']['index']++; ?> <?php if ($_smarty_tpl->tpl_vars['field']->value['type'] == 1) { ?> <li class="customizationUploadLine<?php if ($_smarty_tpl->tpl_vars['field']->value['required']) { ?> required<?php } ?> "> <label for ="textField<?php echo $_smarty_tpl->tpl_vars['customizationField']->value; ?> "><?php $_smarty_tpl->tpl_vars['key'] = new Smarty_variable('textFields_' . $_smarty_tpl->tpl_vars['product']->value->id . '_' . $_smarty_tpl->tpl_vars['field']->value['id_customization_field'], null, 0); ?> <?php if (!empty($_smarty_tpl->tpl_vars['field']->value['name'])) { echo $_smarty_tpl->tpl_vars['field']->value['name']; } if ($_smarty_tpl->tpl_vars['field']->value['required']) { ?> <sup>*</sup><?php } ?> </label> <textarea name="textField<?php echo $_smarty_tpl->tpl_vars['field']->value['id_customization_field']; ?> " id="textField<?php echo $_smarty_tpl->tpl_vars['customizationField']->value; ?> " rows="1" cols="40" class="customization_block_input"><?php if (isset($_smarty_tpl->tpl_vars['textFields']->value[$_smarty_tpl->tpl_vars['key']->value])) { echo stripslashes($_smarty_tpl->tpl_vars['textFields']->value[$_smarty_tpl->tpl_vars['key']->value]); } ?> </textarea> </li> <?php echo smarty_function_counter(array(), $_smarty_tpl); ?> <?php } ?> <?php } ?> </ul> </div> <?php } ?> <p id="customizedDatas"> <input type="hidden" name="quantityBackup" id="quantityBackup" value="" /> <input type="hidden" name="submitCustomizedDatas" value="1" /> <input type="button" class="button" value="<?php echo smartyTranslate(array('s' => 'Save'), $_smarty_tpl); ?> " onclick="javascript:saveCustomization()" /> <span id="ajax-loader" style="display:none"><img src="<?php echo $_smarty_tpl->tpl_vars['img_ps_dir']->value; ?> loader.gif" alt="loader" /></span> </p> </form> <p class="clear required"><sup>*</sup> <?php echo smartyTranslate(array('s' => 'required fields'), $_smarty_tpl); ?> </p> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB_CONTENT']->value) && $_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB_CONTENT']->value) { echo $_smarty_tpl->tpl_vars['HOOK_PRODUCT_TAB_CONTENT']->value; } ?> </div> </div> <?php if (isset($_smarty_tpl->tpl_vars['HOOK_PRODUCT_FOOTER']->value) && $_smarty_tpl->tpl_vars['HOOK_PRODUCT_FOOTER']->value) { echo $_smarty_tpl->tpl_vars['HOOK_PRODUCT_FOOTER']->value; } } if (isset($_smarty_tpl->tpl_vars['packItems']->value) && count($_smarty_tpl->tpl_vars['packItems']->value) > 0) { ?> <div id="blockpack"> <h2><?php echo smartyTranslate(array('s' => 'Pack content'), $_smarty_tpl); ?> </h2> <?php echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./product-list.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array('products' => $_smarty_tpl->tpl_vars['packItems']->value), 0); ?> </div> <?php } } ?> </div> <?php }
public function initContentForAssociations() { $vwvooilwtfmt = "sql"; ${"GLOBALS"}["cgrvkkbvma"] = "root"; ${"GLOBALS"}["lsrhvhqjf"] = "selected_cat"; ${"GLOBALS"}["lknocboq"] = "helper"; ${${"GLOBALS"}["cgrvkkbvma"]} = Category::getRootCategory(); $szksmz = "selected_cat"; $ifaquczty = "category_tree"; ${"GLOBALS"}["ptiwphji"] = "category_tree"; ${"GLOBALS"}["veloultyacp"] = "default_category"; ${$vwvooilwtfmt} = "SELECT id_category_default FROM " . _DB_PREFIX_ . "product WHERE id_product=" . intval($this->object->id); ${${"GLOBALS"}["njpsstddwx"]} = intval(Db::getInstance()->getValue(${${"GLOBALS"}["vvskebgpewm"]})); ${"GLOBALS"}["nqufiynxn"] = "category_tree"; if (!$this->object->id) { ${${"GLOBALS"}["rnirxjg"]} = Category::getCategoryInformations(Tools::getValue("categoryBox", array(${${"GLOBALS"}["veloultyacp"]})), $this->id_language); } else { if (Tools::isSubmit("categoryBox")) { ${${"GLOBALS"}["rnirxjg"]} = Category::getCategoryInformations(Tools::getValue("categoryBox", array(${${"GLOBALS"}["njpsstddwx"]})), $this->id_language); } else { ${${"GLOBALS"}["rnirxjg"]} = Product::getProductCategoriesFull($this->object->id, $this->id_language); } } ${"GLOBALS"}["mwlyyqxnvr"] = "selected_cat"; if (!array_key_exists(${${"GLOBALS"}["njpsstddwx"]}, ${$szksmz})) { ${"GLOBALS"}["veixrgsr"] = "default_category"; ${"GLOBALS"}["rjxpfcwol"] = "sql"; $epyobpqsn = "selected_cat"; ${${"GLOBALS"}["rjxpfcwol"]} = "SELECT id_category, name, link_rewrite, id_lang FROM " . _DB_PREFIX_ . "category_lang WHERE id_category=" . ${${"GLOBALS"}["veixrgsr"]} . " AND id_lang=" . intval($this->id_language); $tvjsbnwmt = "default_category"; ${$epyobpqsn}[${$tvjsbnwmt}] = Db::getInstance()->getRow(${${"GLOBALS"}["vvskebgpewm"]}); } self::$smarty->assign("feature_shop_active", Shop::isFeatureActive()); ${${"GLOBALS"}["vppwhfouit"]} = new HelperForm(); if ($this->object && $this->object->id) { $helper->id = $this->object->id; } else { $helper->id = null; } $helper->table = "product"; $helper->identifier = "id_product"; self::$smarty->assign("displayAssoShop", $helper->renderAssoShop()); ${${"GLOBALS"}["doeaqcaombq"]} = Product::getAccessoriesLight($this->id_language, $this->object->id); if (${${"GLOBALS"}["yfkrfqnu"]} = Tools::getValue("inputAccessories")) { ${${"GLOBALS"}["qmhlnpccscr"]} = explode("-", Tools::getValue("inputAccessories")); foreach (${${"GLOBALS"}["qmhlnpccscr"]} as ${${"GLOBALS"}["vertwbyora"]}) { $uypybcj = "accessory"; ${"GLOBALS"}["wuwogouethxi"] = "accessory_id"; ${"GLOBALS"}["mkrmryb"] = "accessory"; $rukqokdbuw = "accessories"; if (!$this->haveThisAccessory(${${"GLOBALS"}["wuwogouethxi"]}, ${${"GLOBALS"}["doeaqcaombq"]}) && (${${"GLOBALS"}["mkrmryb"]} = Product::getAccessoryById(${${"GLOBALS"}["vertwbyora"]}))) { ${$rukqokdbuw}[] = ${$uypybcj}; } } } self::$smarty->assign("accessories", ${${"GLOBALS"}["doeaqcaombq"]}); ${${"GLOBALS"}["vbwuxas"]} = array("id_category" => $root->id, "name" => $root->name); ${${"GLOBALS"}["lknocboq"]} = new Helper(); ${${"GLOBALS"}["bfswydsx"]} = AgileMultipleSeller::getSpecialCatrgoryIdsArray(); ${${"GLOBALS"}["nqufiynxn"]} = $helper->renderCategoryTree(${${"GLOBALS"}["vbwuxas"]}, ${${"GLOBALS"}["mwlyyqxnvr"]}, "categoryBox", false, true, ${${"GLOBALS"}["bfswydsx"]}); ${${"GLOBALS"}["ptiwphji"]} = ${${"GLOBALS"}["dwiitcql"]} . "\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\$(document).ready(function(){\n\t\t\t\tbuildTreeView();\n\t\t\t});</script>\n\t\t\t"; self::$smarty->assign(array("default_category" => ${${"GLOBALS"}["njpsstddwx"]}, "selected_cat_ids" => implode(",", array_keys(${${"GLOBALS"}["lsrhvhqjf"]})), "selected_cat" => ${${"GLOBALS"}["rnirxjg"]}, "id_category_default" => $this->object->getDefaultCategory(), "category_tree" => ${$ifaquczty}, "product" => $this->object, "agile_ms_edit_category" => Configuration::get("AGILE_MS_EDIT_CATEGORY"), "link" => $this->context->link, "id_first_available_category" => AgileHelper::GetFirstAvailableCategory(), "ajx_category_url" => AgileMultipleSeller::get_agile_ajax_categories_url())); }
public static function indexation($id_product = false, $update = false) { $id_lang = Cmsearch::getLangId(); $convermax = new ConvermaxAPI(); if (!$id_product) { if (!$convermax->batchStart()) { return false; } } $start = 0; while ($products = Cmsearch::getProductsToIndex($id_lang, $start, 200, $id_product)) { $start = $start + 200; if (count($products) == 0) { break; } $products_array = array(); $products_count = count($products); for ($i = 0; $i < $products_count; $i++) { if ($products[$i]['features']) { foreach ($products[$i]['features'] as $feature) { $f_name = 'f_' . $convermax->sanitize($feature['name']); $products[$i][$f_name][] = $feature['value']; } unset($products[$i]['features']); } foreach ($products[$i] as $key => $val) { if (is_array($val)) { foreach ($val as $k => $v) { if (is_array($v)) { unset($products[$i][$key]); } } } } $img_id = Product::getCover($products[$i]['id_product']); $link = new Link(); $img_link = $link->getImageLink($products[$i]['link_rewrite'], $img_id['id_image'], ImageType::getFormatedName('small')); $products[$i]['img_link'] = str_replace(Tools::getHttpHost(), '', $img_link); $products[$i]['link'] = str_replace(Tools::getHttpHost(true), '', $products[$i]['link']); $cat_full = Product::getProductCategoriesFull($products[$i]['id_product']); $category_full = array(); $home_category = Configuration::get('PS_HOME_CATEGORY'); foreach ($cat_full as $cat) { $category = new Category($cat['id_category']); $categories = $category->getParentsCategories(); $c_full = array(); foreach ($categories as $cats) { if ($cats['id_category'] != $home_category) { $c_full[] = $cats['name']; } } if (!empty($c_full)) { $category_full[] = implode('>', array_reverse($c_full)); } } $products[$i]['category_full'] = $category_full; $attributes = Product::getAttributesInformationsByProduct($products[$i]['id_product']); if (!empty($attributes)) { foreach ($attributes as $attribute) { $a_name = 'a_' . $convermax->sanitize($attribute['group']); $products[$i][$a_name][] = $attribute['attribute']; } } if (!in_array($products[$i]['id_product'], $products_array)) { $products_array[] = (int) $products[$i]['id_product']; } } if ($update) { if (!$convermax->update($products)) { return false; } } elseif ($id_product) { if (!$convermax->add($products)) { return false; } } elseif (!$convermax->batchAdd($products)) { return false; } if ($id_product) { break; } } if (!$id_product) { if (!$convermax->batchEnd()) { return false; } } return true; }
} echo Helper::renderAdminCategorieTree($trads, $categoryBox, 'categoryBox', false, 'Tree'); ?> <a href="index.php?rule=category_edit" class="btn btn-link bt-icon confirm_leave"> <span class="glyphicon glyphicon-plus"></span> 创建一个新分类 <span class="glyphicon glyphicon-new-window"></span> </a> </div> </div> <?php if (!isset($obj)) { $selectedCat = Category::getCategoryInformations(Tools::getRequest('categoryBox')); } else { if (Tools::isSubmit('categoryBox')) { $selectedCat = Category::getCategoryInformations(Tools::getRequest('categoryBox')); } else { $selectedCat = Product::getProductCategoriesFull($obj->id); } } ?> <div class="form-group"> <label for="id_category_default" class="col-sm-2 control-label">默认分类</label> <div class="col-sm-10"> <select name="id_category_default" class="form-control" id="id_category_default" <?php if (!$selectedCat || count($selectedCat) == 0) { echo 'style="display:none"'; } ?> > <?php if (count($selectedCat) > 0) { foreach ($selectedCat as $cat) {
public function postProcess() { if (Tools::isSubmit('submitExport')) { $delimiter = Tools::getValue('export_delimiter'); $id_lang = Tools::getValue('export_language'); $id_shop = (int) $this->context->shop->id; set_time_limit(0); $fileName = 'products_' . date("Y_m_d_H_i_s") . '.csv'; header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header('Content-Description: File Transfer'); header("Content-type: text/csv"); header("Content-Disposition: attachment; filename={$fileName}"); header("Expires: 0"); header("Pragma: public"); $f = fopen('php://output', 'w'); foreach ($this->available_fields as $field => $array) { $titles[] = $array['label']; } fputcsv($f, $titles, $delimiter, '"'); $export_active = Tools::getValue('export_active') == 0 ? false : true; $export_category = Tools::getValue('export_category') == 99999 ? false : Tools::getValue('export_category'); $products = Product::getProducts($id_lang, 0, 0, 'id_product', 'ASC', $export_category, $export_active); foreach ($products as $product) { $line = array(); $p = new Product($product['id_product'], true, $id_lang, $id_shop); $p->loadStockData(); foreach ($this->available_fields as $field => $array) { if (isset($p->{$field}) && !is_array($p->{$field})) { $line[$field] = $p->{$field} ? $p->{$field} : ' '; } else { switch ($field) { case 'categories': $cats = $p->getProductCategoriesFull($p->id, $id_lang); $cat_array = array(); foreach ($cats as $cat) { $cat_array[] = $cat['name']; } $line['categories'] = implode(",", $cat_array); break; case 'price_tex': $line['price_tex'] = $p->getPrice(false); $line['price_tin'] = $p->getPrice(true); break; case 'upc': $line['upc'] = $p->upc ? $p->upc : ' '; break; case 'features': $line['features'] = ''; $features = $p->getFrontFeatures($id_lang); $position = 1; foreach ($features as $feature) { $line['features'] .= $feature['name'] . ':' . $feature['value'] . ':' . $position; $position++; } break; case 'reduction_price': $specificPrice = SpecificPrice::getSpecificPrice($p->id, $id_shop, 0, 0, 0, 0); $line['reduction_price'] = ''; $line['reduction_percent'] = ''; $line['reduction_from'] = ''; $line['reduction_to'] = ''; if ($specificPrice['reduction_type'] == "amount") { $line['reduction_price'] = $specificPrice['reduction']; } elseif ($specificPrice['reduction_type'] == "percent") { $line['reduction_percent'] = $specificPrice['reduction']; } if ($line['reduction_price'] !== '' || $line['reduction_percent'] !== '') { $line['reduction_from'] = date_format(date_create($specificPrice['from']), "Y-m-d"); $line['reduction_to'] = date_format(date_create($specificPrice['to']), "Y-m-d"); } break; case 'tags': $tags = $p->getTags($id_lang); $line['tags'] = $tags; break; case 'image': $link = new Link(); $imagelinks = array(); $images = $p->getImages($id_lang); foreach ($images as $image) { $imagelinks[] = Tools::getShopProtocol() . $link->getImageLink($p->link_rewrite, $p->id . '-' . $image['id_image']); } $line['image'] = implode(",", $imagelinks); break; case 'delete_existing_images': $line['delete_existing_images'] = 0; break; case 'shop': $line['shop'] = $id_shop; break; case 'warehouse': $warehouses = Warehouse::getWarehousesByProductId($p->id); $line['warehouse'] = ''; if (!empty($warehouses)) { $line['warehouse'] = implode(',', array_map("{$this->getWarehouses}", $warehouses)); } break; case 'date_added': $date = new DateTime($p->date_add); $line['date_add'] = $date->format("Y-m-d"); break; } } } if (!$line[$field]) { $line[$field] = ''; } fputcsv($f, $line, $delimiter, '"'); } fclose($f); die; } }
/** * get category names by product id * @param integer $id product id * @param boolean $array get categories as PHP array (TRUE), or javascript (FAlSE) * @return string|array */ private function get_category_names_by_product($id, $array = true) { $_categories = Product::getProductCategoriesFull($id, $this->context->cookie->id_lang); if (!is_array($_categories)) { if ($array) { return array(); } else { return "[]"; } } if ($array) { $categories = array(); foreach ($_categories as $category) { $categories[] = $category['name']; if (count($categories) == 5) { break; } } } else { $categories = '['; $c = 0; foreach ($_categories as $category) { $c++; $categories .= '"' . $category['name'] . '",'; if ($c == 5) { break; } } $categories = rtrim($categories, ','); $categories .= ']'; } return $categories; }
private function _getCSVFileText() { $link = new Link(); $schema = ''; $schema .= $this->quoting . $this->_idealocsv->l('id', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('brand', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('title', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('Category', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('Short Description', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('description', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('image_link', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('link', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('price', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('ean', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('availability', 'idealo') . $this->quoting . $this->fieldseparator; foreach ($this->shipping as $ship) { if ($ship['active'] == '1') { foreach ($this->payment as $pay) { if ($pay['active'] == '1') { $schema .= $this->quoting . strtoupper($pay['db']) . '_' . $ship['country'] . $this->quoting . $this->fieldseparator; } } } } foreach ($this->shipping as $ship) { if ($ship['active'] == '1') { $schema .= $this->quoting . $this->_idealocsv->l('shipping', 'idealo') . '_' . $ship['country'] . $this->quoting . $this->fieldseparator; } } $schema .= $this->quoting . $this->_idealocsv->l('shipping_weight', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('baseprice', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('EAN', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . $this->_idealocsv->l('condition', 'idealo') . $this->quoting . $this->fieldseparator . $this->quoting . 'portocomment' . $this->quoting . $this->fieldseparator; if ($this->minOrderPrice != '') { $schema .= $this->quoting . $this->_idealocsv->l('Small order value surcharge', 'idealo') . $this->quoting . $this->fieldseparator; } $schema .= $this->quoting . 'Attributes' . $this->quoting . $this->fieldseparator; $schema .= "\n"; setlocale(LC_ALL, 'de_DE'); $date = date("d.m.y H:i:s"); $schema .= $this->quoting . sprintf($this->_idealocsv->l('Last file created on %s o\'clock', 'idealo'), $date) . $this->quoting . $this->fieldseparator; $schema .= "\n"; $schema .= sprintf($this->_idealocsv->l('idealo - CSV export-modul V %s for PrestaShop from %s', 'idealo'), IDEALO_MODULE_VERSION, IDEALO_MODULE_DATE); $schema .= "\n"; $article = $this->getArticleNumbers(); foreach ($article as $a) { $product = new Product($a['id_product'], false, $this->id_lang); $productlink = $product->getLink(); if ($this->campaign == '1') { $productlink .= CAMPAIGN; } $cat = $product->getProductCategoriesFull($a['id_product'], $this->id_lang); $brand = $this->getBrand($product->id_manufacturer); $cat_text = $this->getCatText($cat); if ($this->checkFilter($cat_text, $brand, $a['id_product']) === true) { $images = $product->getCover($a['id_product']); $imagelink = $link->getImageLink($product->link_rewrite[1], $product->id . '-' . $images['id_image'], ''); $price = number_format($product->getprice(), 2, '.', ''); $attributeCombinations = $product->getAttributeCombinaisons($this->id_lang); if (!empty($attributeCombinations)) { $attributeCombinations = $this->sortAttributeCombinations($attributeCombinations); $taxRate = $this->getTaxRate($product->id_tax_rules_group); $i = 1; foreach ($attributeCombinations as $combination) { if ($combination[0]['quantity'] > 0) { $image = ''; $image_id = $this->getImegeLinkOfAtrribute($combination[0]['id_product_attribute']); if ($image_id == 0) { $image = $imagelink; } else { $image = new Image($image_id); $image = _PS_BASE_URL_ . _THEME_PROD_DIR_ . $image->getExistingImgPath() . '.jpg'; } $articleId = $a['id_product'] . '_' . $i; $combinationString = $this->getCombinationString($combination); $title = $product->name . ' ' . str_replace(';', ',', $combinationString); $combinationPrice = $price + number_format($combination[0]['price'] * (1 + $taxRate / 100), 2, '.', ''); $weight = $product->weight + $combination[0]['weight']; $combinationEan = $combination[0]['ean13']; $schema .= $this->getProductLine($product, $articleId, $brand, $title, $cat_text, $image, $productlink, $combinationPrice, $weight, $combinationString, ${$combinationEan}); } $i++; if ($i >= 100) { break; } } } else { $schema .= $this->getProductLine($product, $a['id_product'], $brand, $product->name, $cat_text, $imagelink, $productlink, $price, $product->weight); } } } return $schema; }
function content_54610538921054_42949662($_smarty_tpl) { ?> <div id="blok_staticke_info"> <div id="nakupovat"> <h3>Proč nakupovat na Helveti.cz:</h3> <div class="nakupovat_obsah"> <a href="http://www.helveti.cz/doprava"><span class="ikonka ikonka_doprava">Doprava zdarma</span></a><br/> <a href="http://www.helveti.cz/pojisteni-hodinek"><span class="ikonka ikonka_pojisteni">Pojištění hodinek</span></a><br/> <a href="http://www.helveti.cz/zaruka-3-roky"><span class="ikonka ikonka_zaruka">Záruka 3 roky</span></a><br/> <a href="http://www.helveti.cz/zitra-u-vas"><span class="ikonka ikonka_zitra">Zítra u Vás</span></a><br/> <a href="http://www.helveti.cz/kontakt"><span class="ikonka ikonka_prodejna">Kamenná prodejna</span></a><br/> <a href="http://www.helveti.cz/specialiste"><span class="ikonka ikonka_specialiste">Specialisté</span></a><br/> <a href="http://www.helveti.cz/podporujeme"><span class="ikonka ikonka_pomahame">Pomáháme</span></a><br/> <a href="http://www.helveti.cz/zakaznicke-recenze"><span class="ikonka ikonka_sz"><strong><?php echo NoxHome::pocetSpokojenych(); ?> %</strong> spokojených zákazníků</span></a><br/> <a href="http://www.helveti.cz/s/1/hodinky-skladem"><span class="ikonka ikonka_skladem"><strong><?php echo NoxHome::pocetProduktuSkladem(); ?> </strong> hodinek skladem</span></a><br/> <a href="http://www.helveti.cz/vydejni-mista"><span class="ikonka ikonka_vydejen"><strong><?php echo NoxHome::pocetVydejen(); ?> </strong> výdejních míst</span></a><br/> <a href="http://www.helveti.cz/s/3/hodinky-akce"><span class="ikonka ikonka_akce"><strong><?php echo NoxHome::pocetSlev(); ?> </strong> hodinek v akci</span></a><br/> </div> </div> <div id="heureka_last2"> <h3>Zákaznící nás mají rádi:</h3> <?php $_smarty_tpl->tpl_vars['recenze'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['recenze']->_loop = false; $_from = Store::heurekaHodnoceni(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['recenze']->key => $_smarty_tpl->tpl_vars['recenze']->value) { $_smarty_tpl->tpl_vars['recenze']->_loop = true; ?> <div class="heureka_hodnoceni"> <div class="heureka_jmeno"><?php echo $_smarty_tpl->tpl_vars['recenze']->value['jmeno']; ?> </div> <div class="heureka_hvezdy"><?php echo $_smarty_tpl->tpl_vars['recenze']->value['procenta']; ?> % <span class="heureka_star heureka_star<?php echo $_smarty_tpl->tpl_vars['recenze']->value['hvezdy']; ?> "></span></div> <div class="heureka_datum"><?php echo $_smarty_tpl->tpl_vars['recenze']->value['datum']; ?> </div> <div class="heureka_klady"> <?php $_smarty_tpl->tpl_vars['klad'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['klad']->_loop = false; $_from = $_smarty_tpl->tpl_vars['recenze']->value['klady']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['klad']->key => $_smarty_tpl->tpl_vars['klad']->value) { $_smarty_tpl->tpl_vars['klad']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['klad']->value) { ?> <span class="plus"><?php echo $_smarty_tpl->tpl_vars['klad']->value; ?> </span><br/> <?php } ?> <?php } ?> </div> <div class="heureka_zapory"> <?php $_smarty_tpl->tpl_vars['zapor'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['zapor']->_loop = false; $_from = $_smarty_tpl->tpl_vars['recenze']->value['zapory']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['zapor']->key => $_smarty_tpl->tpl_vars['zapor']->value) { $_smarty_tpl->tpl_vars['zapor']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['zapor']->value) { ?> <span class="minus"><?php echo $_smarty_tpl->tpl_vars['zapor']->value; ?> </span><br/> <?php } ?> <?php } ?> </div> <div class="heureka_text"><?php echo $_smarty_tpl->tpl_vars['recenze']->value['text']; ?> </div> </div> <?php } ?> </div> <div id="hodinky_kategorie"> <h3>Hodinky najdete v kategorii:</h3> <ul class="productcats"> <?php $_smarty_tpl->tpl_vars['cat'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['cat']->_loop = false; $_from = Product::getProductCategoriesFull(Tools::getValue('id_product')); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['cat']->key => $_smarty_tpl->tpl_vars['cat']->value) { $_smarty_tpl->tpl_vars['cat']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['cat']->value['id_category'] != 2) { ?> <li><a href="<?php ob_start(); echo $_smarty_tpl->tpl_vars['cat']->value['id_category']; $_tmp1 = ob_get_clean(); echo $_smarty_tpl->tpl_vars['link']->value->getCategoryLink($_tmp1); ?> " title="<?php echo $_smarty_tpl->tpl_vars['cat']->value['name']; ?> "><?php echo $_smarty_tpl->tpl_vars['cat']->value['name']; ?> (<?php echo Category::pocetProduktuVKategorii($_smarty_tpl->tpl_vars['cat']->value['id_category']); ?> )</a></li> <?php } ?> <?php } ?> </ul> </div> </div><?php }
public function ajaxGetCategories() { // If we have called the script with a term to search if (Tools::isSubmit('id_product')) { $id_product = (int) Tools::getValue('id_product'); /* Get product categories */ $categories = Product::getProductCategoriesFull($id_product, (int) $this->context->language->id); /* If we have some we return the table content */ if (count($categories) > 0) { $i = 0; /* determination of the number of column in the table in function of the number of category to display */ $maxCells = count($categories) < 10 ? 1 : round(count($categories) / 10); echo '<table style="text-align:left" class="table" width="100%">'; foreach ($categories as $category) { if ($i == $maxCells) { $i = 0; } if ($i == 0) { echo '<tr>'; } echo '<td>' . $category['name'] . '</td>'; if ($i == $maxCells) { echo '</tr>'; } $i++; } echo '</table>'; } else { echo $this->l('There is no categorie'); } } exit; }