Foros del Web » Programando para Internet » PHP »

Problema theme Magento

Estas en el tema de Problema theme Magento en el foro de PHP en Foros del Web. Hola, qué tal? Estoy modificando un theme para Magento y de un momento para otro la parte donde podes buscar secciones se desconfiguró. El problema ...
  #1 (permalink)  
Antiguo 18/12/2014, 12:35
 
Fecha de Ingreso: enero-2010
Mensajes: 17
Antigüedad: 14 años, 3 meses
Puntos: 1
Problema theme Magento

Hola, qué tal?

Estoy modificando un theme para Magento y de un momento para otro la parte donde podes buscar secciones se desconfiguró. El problema es que es solo en parte principal, cuando entro a cualquier categoría o sección, funciona perfecto. Tiene un dropmenu donde están las diferentes categorías y sub-categorías. A continuación muestro las imágenes:


Diferencias del código fuente del explorador:

Página principal

Código HTML:
Ver original
  1. <div class="col-xs-12 col-md-6 col-sm-12">
  2.                             <div class="header-box">
  3.                                     <div class="search-container">
  4.                                    
  5. <form id="search_mini_form" action="http://pruebasc.servidoronline.net/catalogsearch/result/" method="get">
  6.     <div class="form-search">
  7.         <label for="search">Search:</label>
  8.         <div class="box-select">
  9.         <div class="header-select">
  10.             <select class="selectpicker" id="cat" name="cat">
  11.                 <option value="">Categorías</option>
  12.                                     <option value="11">XXXX</option>
  13.                                                                                                                                                         <option value="3">XXXX</option>
  14.                                                                                                                                                         <option value="4">XXXX</option>
  15.                                                                                                                                                         <option value="5">XXXX</option>
  16.                                                                                                                                                         <option value="7">XXXXX</option>
  17.                                                                                                                                                         <option value="6">XXXXX</option>
  18.                                                                                                                                                         <option value="8">XXXXX</option>
  19.                                                                                                                                                 </select>
  20.         </div>
  21.         </div>
  22.         <div class="header-input"><input id="search" type="text" name="q" class="input-text" autocomplete="off"></div>
  23.         <button type="submit" title="Buscar" class="button"><span><span>Buscar</span></span></button>
  24.         <!--<div id="search_autocomplete" class="search-autocomplete"></div>-->
  25.     </div>
  26. </form>
  27. <script type="text/javascript">
  28. //<![CDATA[
  29.    var searchForm = new Varien.searchForm('search_mini_form', 'search', '¿Qué estás buscando?');
  30.    searchForm.initAutocomplete('http://pruebasc.servidoronline.net/catalogsearch/ajax/suggest/', 'search_autocomplete');
  31. //]]>
  32.                                     </div>
  33.                                    
  34.                             </div>
  35.                     </div>

Código fuente otras secciones

Código HTML:
Ver original
  1. <div class="header-box">
  2.                                     <div class="search-container">
  3.                                    
  4. <form id="search_mini_form" action="http://pruebasc.servidoronline.net/catalogsearch/result/" method="get">
  5.     <div class="form-search">
  6.         <label for="search">Search:</label>
  7.         <div class="box-select">
  8.         <div class="header-select">
  9.             <select class="selectpicker" id="cat" name="cat" style="display: none;">
  10.                 <option value="">Categorías</option>
  11.                                     <option value="11">xxxxx</option>
  12.                                                                                                                                                         <option value="3">xxxxx</option>
  13.                                                                                                                                                         <option value="4">xxxxx</option>
  14.                                                                                                                                                         <option value="5">xxxxx</option>
  15.                                                                                                                                                         <option value="7">xxxxx</option>
  16.                                                                                                                                                         <option value="6">xxxxx</option>
  17.                                                                                                                                                         <option value="8">xxxxx</option>
  18.                                                                                                                                                 </select><div class="btn-group bootstrap-select"><button type="button" class="btn dropdown-toggle selectpicker btn-default" data-toggle="dropdown" data-id="cat" title="Categorías"><span class="filter-option pull-left">Categorías</span>&nbsp;<span class="caret"></span></button><div class="dropdown-menu open"><ul class="dropdown-menu inner selectpicker" role="menu"><li rel="0" class="selected"><a tabindex="0" class="" style=""><span class="text">Categorías</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="1"><a tabindex="0" class="" style=""><span class="text">Vibradores</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="2"><a tabindex="0" class="" style=""><span class="text">xxxxx</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="3"><a tabindex="0" class="" style=""><span class="text">xxxxx</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="4"><a tabindex="0" class="" style=""><span class="text">xxxxx</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="5"><a tabindex="0" class="" style=""><span class="text">xxxxx</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="6"><a tabindex="0" class="" style=""><span class="text">xxxxx</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li><li rel="7"><a tabindex="0" class="" style=""><span class="text">Lencería</span><i class="glyphicon glyphicon-ok icon-ok check-mark"></i></a></li></ul></div></div>
  19.         </div>
  20.         </div>
  21.         <div class="header-input"><input id="search" type="text" name="q" class="input-text" autocomplete="off"></div>
  22.         <button type="submit" title="Buscar" class="button"><span><span>Buscar</span></span></button>
  23.         <!--<div id="search_autocomplete" class="search-autocomplete"></div>-->
  24.     </div>
  25. </form>
  26. <script type="text/javascript">
  27. //<![CDATA[
  28.    Event.observe(window, 'load', function(){
  29.        $$('select#cat option').each(function(o) {
  30.            if (o.value == '11') {
  31.                o.selected = true;
  32.                throw $break;
  33.            }
  34.        });
  35.        escapedQueryText = '';
  36.        if (escapedQueryText !== '') {
  37.            $('search').value = escapedQueryText;
  38.        }
  39.    });
  40.    var searchForm = new Varien.searchForm('search_mini_form', 'search', '¿Qué estás buscando?');
  41.    searchForm.initAutocomplete('http://pruebasc.servidoronline.net/catalogsearch/ajax/suggest/', 'search_autocomplete');
  42. //]]>
  43.                                     </div>
  44.                                    
  45.                             </div>

Capaz haya tocado algo pero estuve subiendo originales, siempre haciendo backup y no pasa nada.

Muchas gracias, perdonen por tanto código.

Saludos
  #2 (permalink)  
Antiguo 18/12/2014, 12:36
 
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>

Etiquetas: magento, select, theme
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:17.