Combobox Populating Cities in Magento

1

I have a combox that I created in PHP that populates cities from a JSON file and is running 100%. I need to embed this combobox in a Magento page but I can not because I have several JS, Jquery, JSON and PHP files in it. I tried to insert via Static Block

<? echo $this->getLayout()->createBlock('cms/block')->setBlockId('nome_do_bloco')->toHtml(); ?> 

I do not know the right way to make js and includes .php calls in Magento

The question is the best way to call this block within Magento?

Thank you!

    
asked by anonymous 09.12.2014 / 13:26

1 answer

0

You can put your combobox in a file and call it anywhere like this:

<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('page/html/pagina.phtml')->toHtml();?>
<?php echo $this->getChildHtml('pagina'); ?>

Create a file wherever you want and call, in the example above a page was created.phtml in template/page/html , getChildHtml('pagina') is the name of the page without extension.

Now if you want to save the information in the database, you need to create an attribute, and mount the combobox on the desired form.

    
10.12.2014 / 11:51