Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/12/2014, 12:36
dgtotero
 
Fecha de Ingreso: enero-2010
Mensajes: 17
Antigüedad: 14 años, 3 meses
Puntos: 1
Respuesta: Problema theme Magento

Estos son los dos archivos que creo, influyen esa zona del theme: (originales del theme)

contents.phtml
Código PHP:
<?php $helper $this->helper('searchbycaterory'); ?>

<form id="search_mini_form" action="<?php echo $this->helper('catalogsearch')->getResultUrl() ?>" method="get">
    <div class="form-search">
        <label for="search"><?php echo $this->__('Search:'?></label>
        <div class="box-select">
        <div class="header-select">
            <select class="selectpicker" id="<?php echo $helper->getCategoryParamName() ?>" name="<?php echo $helper->getCategoryParamName() ?>">
                <option value=""><?php echo $this->__('Categorías'?></option>
                <?php foreach ($this->getSearchableCategories() as $mainCategory): ?>
                    <option value="<?php echo $mainCategory->getEntityId() ?>"><?php echo $mainCategory->getName() ?></option>
                    <?php if ($helper->showSubCategories()): ?>
                        <?php if ($helper->getSubCategoriesLevel() >= 2): ?>
                            <?php foreach ($this->getSearchableSubCategories($mainCategory) as $category) : ?>
                                <option value="<?php echo $category->getEntityId() ?>"><?php echo $helper->getIndentationText() . $category->getName() ?></option>
                                <?php if ($helper->getSubCategoriesLevel() >= 3): ?>
                                    <?php foreach ($this->getSearchableSubCategories($category) as $subcategory3) : ?>
                                        <option value="<?php echo $subcategory3->getEntityId() ?>"><?php echo $helper->getIndentationText() . "&nbsp;" $helper->getIndentationText() . $subcategory3->getName() ?></option>
                                        <?php if ($helper->getSubCategoriesLevel() >= 4): ?>
                                            <?php foreach ($this->getSearchableSubCategories($subcategory3) as $subcategory4) : ?>
                                                <option value="<?php echo $subcategory4->getEntityId() ?>"><?php echo $helper->getIndentationText() . "&nbsp;" $helper->getIndentationText() . "&nbsp;" $helper->getIndentationText() . $subcategory4->getName() ?></option>
                                            <?php endforeach; ?>
                                        <?php endif ?>
                                    <?php endforeach; ?>
                                <?php endif ?>
                            <?php endforeach; ?>
                        <?php endif ?>
                    <?php endif ?>
                <?php endforeach; ?>
            </select>
        </div>
        </div>
        <div class="header-input"><input id="search" type="text" name="<?php echo $this->helper('catalogsearch')->getQueryParamName() ?>" class="input-text" /></div>
        <button type="submit" title="<?php echo $this->__('Buscar'?>" class="button"><span><span><?php echo $this->__('Search'?></span></span></button>
        <div id="search_autocomplete" class="search-autocomplete"></div>
    </div>
</form>
form.phtml
Código PHP:
<?php echo $this->getChildHtml(); ?>
<?php
    $className 
Mage::getConfig()->getBlockClassName('searchbycaterory/form');
    
$block = new $className();
?>
<script type="text/javascript">
//<![CDATA[
<?php if ($this->helper('searchbycaterory')->isCategoryPage() || $this->helper('searchbycaterory')->isSearchResultsPage()) : ?>
    Event.observe(window, 'load', function(){
        $$('select#<?php echo $this->helper('searchbycaterory')->getCategoryParamName() ?> option').each(function(o) {
            if (o.value == '<?php echo $block->getCurrentlySelectedCategoryId() ?>') {
                o.selected = true;
                throw $break;
            }
        });
        escapedQueryText = '<?php echo $this->helper('catalogsearch')->getEscapedQueryText() ?>';
        if (escapedQueryText !== '') {
            $('search').value = escapedQueryText;
        }
    });
<?php endif; ?>
    var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('¿Qué estás buscando?'?>');
    searchForm.initAutocomplete('<?php echo $this->helper('catalogsearch')->getSuggestUrl() ?>', 'search_autocomplete');
//]]>
</script>