Combobox Populating Cities in Magento

Asked

Viewed 159 times

1

I have a Combox that I created in PHP that populates cities of a JSON file and is working 100%. I needed to embed this combobox in a Magento page but I’m not getting it because I have several JS, Jquery, JSON and includes files from PHP inside it. I tried to insert via Statico Block

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

I don’t know the right way to make js and includes . php calls in Magento

The question is how best to call this block inside the Magento?

Thank you!

1 answer

0


You can put your combobox in a file and call where you want that way:

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

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

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

  • Thank you for sure!!

  • Accept the answer, so your question is not open, below the score of my question have a 'visa' click on it. @BJJ

Browser other questions tagged

You are not signed in. Login or sign up in order to post.