This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function saveAction() | |
{ | |
if ($data = $this->getRequest()->getPost()) { | |
try { | |
$model = $this->_initModel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
... | |
public function newAction() | |
{ | |
$this->_initModel(); | |
$this->loadLayout(); | |
$this->renderLayout(); | |
return $this; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Mdg_Giftregistry_IndexController extends Mage_Core_Controller_Front_Action | |
{ | |
public function preDispatch() | |
{ | |
parent::preDispatch(); | |
if (!Mage::getSingleton('customer/session')->authenticate($this)) { | |
$this->getResponse()->setRedirect(Mage::helper('customer')->getLoginUrl()); | |
$this->setFlag('', self::FLAG_NO_DISPATCH, true); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<layout version="0.1.0"> | |
... | |
<mdg_giftregistry_index_new> | |
<reference name="content"> | |
<block name="giftregistry.new" type="core/template" template="mdg/form.phtml" as="giftregistry_new"/> | |
</reference> | |
</mdg_giftregistry_index_new> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$helper = Mage::helper('mdg_giftregistry'); | |
$loadedRegistry = Mage::registry('current_giftregistry') | |
?> | |
<?php if($loadedRegistry): ?> | |
<form action="<?php echo $this->getUrl('giftregistry/index/save/') ?>" method="post" id="form-validate"> | |
<fieldset> | |
<?php echo $this->getBlockHtml('formkey')?> | |
<input type="hidden" name="registry_id" id="registry_id" value="<?php echo $loadedRegistry->getEntityId(); ?>"/> | |
<input type="hidden" name="type_id" id="type_id" value="<?php echo $loadedRegistry->getTypeId(); ?>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $registry = Mage::registry('loaded_registry'); ?> | |
<?php if($registry->getId()): ?> | |
<h3><?php echo $registry->getEventName(); ?></h3> | |
<p><strong><?php $this->__('Event Date:') ?> <?php echo $registry->getEventDate(); ?></strong></p> | |
<p><strong><?php $this->__('Event Location:') ?> <?php echo $registry->getEventLocation(); ?></strong></p> | |
<?php else: ?> | |
<h3>There was an error, the requested registry does not exist.</h3> | |
<?php endif; ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delimiter ;; | |
drop procedure if exists build_catalog;; | |
create procedure build_catalog(IN categories INT, IN products INT) | |
begin | |
SET @category_count = 1; | |
SET @CATNAMEPREFIX = "Category "; | |
SET @CATURLKEYPREFIX = "cat-"; | |
SET @CATURLPATHPREFIX = "catpath-"; | |
SET @ROOTCATEGORY = 2; | |
SET @INCLUDEINMENU = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Magento\Catalog\Model; | |
class Product extends \Magento\Catalog\Model\AbstractModel | |
{ | |
... | |
/** | |
* @param \Magento\Core\Model\Context $context | |
* @param \Magento\Core\Model\Registry $registry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Mage_Catalog_Model_Product extends Mage_Catalog_Model_Abstract | |
{ | |
/** | |
* Initialize resources | |
*/ | |
protected function _construct() | |
{ | |
$this->_init('catalog/product'); |