zend-framework

Filter store view based on Customer Group in Magento

微笑、不失礼 提交于 2019-12-24 08:11:51
问题 I am developing an e-commerce website where we need to have 2 store views. One for the professional customer and another for the retail customer. We need to have the same inventory but different product description, different attributes, and look and feel for wholesale/retail customer groups. 回答1: All of Magento, with its catalog management and display tools, along with themes, is designed with this scenario in mind. Generally you attach a store view with its associated catalog, pricing and

Returning missing results from many to many table

我的未来我决定 提交于 2019-12-24 08:09:18
问题 I have a table structure like following: Brands => BrandUser <= Users I need to get brands which have corresponding record in the BrandUser table and the ones which don't have corresponding record in BrandUser table... I have tried the following query: public function getUserBrands($userId) { $select = new Select(); $select->from(array('bu' => $this->table)); $select->join(array('b' => 'brands'), 'bu.brandId = b.id', array('id','name')); $select->join(array('u' => 'users'), 'u.id = bu.userId'

Zend Cache not working using Action Helper

梦想的初衷 提交于 2019-12-24 07:56:54
问题 I'm trying to implement full page static caching in my Zend Framework application. Using the Static backend coupled with the Capture frontend, whole pages can be cached, and served by a .htaccess redirect in the future, until the cache is deleted/regenerated. For reference, I've been using the section on Zend_Cache_Backend_Static in the manual, and also some further information provided by the class author. As per the example, I have configured the directories for the cache (static HTML files

Zend multiCheckbox default values bug

你。 提交于 2019-12-24 07:38:51
问题 I don't know. Simply I don't know. Why does the second codeblock work and check the checkboxes by default, but the first block isn't? I need to pre-check bitmask flags and I can't/don't want to append strings or something. // THIS isn't working?!! $test1 = array( 2 => 'tomato', 4 => 'bitmask problem' ); $test2 = array(2, 4); $form->addElement('multiCheckbox', 'flags', array( 'label' => 'Flags', 'value' => $test2, 'multiOptions' => $test1, ) ); // THIS IS WORKING: $form->addElement (

How to change the field value after 'X' minutes of the first update

╄→гoц情女王★ 提交于 2019-12-24 07:24:21
问题 I want to update my value after 10 minutes of the first update For example, I've sent this request: UPDATE client set lockclient = 1 WHERE id = 100 I want to send another request after 10 minutes, as below: UPDATE client set lockclient = 0 WHERE id = 100 I've found this example on google: DELIMITER $$ CREATE EVENT deactivation ON SCHEDULE EVERY 10 MINUTE STARTS CURRENT_TIMESTAMP DO BEGIN UPDATE tbl SET tbl.active = FALSE WHERE id =10 END; $$; But I want to update only in the first 10 min, not

Cannot send headers; headers already sent in /home/zk/public_html/lib/Zend/Cache/Backend/File.php, line 1 [duplicate]

假如想象 提交于 2019-12-24 07:19:25
问题 This question already has answers here : Magento Error: Headers already sent [duplicate] (3 answers) Closed 5 years ago . Cannot send headers; headers already sent in /home/zk/public_html/lib/Zend/Cache/Backend/File.php, line 1 Trace: #0 /home/zk/public_html/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true) #1 /home/zk/public_html/app/code/core/Mage/Core/Model/App.php(1246): Zend_Controller_Response_Abstract->setHeader('Content-Type',

Zend routing, throws resource not found

戏子无情 提交于 2019-12-24 07:16:27
问题 Ive got a url: http://dev.local/foodies/view?id=bluedaniel and ive got in my bootstrap: protected function _initRoute() { $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/routes.ini', 'production'); $router = new Zend_Controller_Router_Rewrite(); $router->addConfig($config, 'resources'); } and ive also got in my routes.ini: [production] resources.router.routes.foodies_view.route = ":foodies/:id" resources.router.routes.foodies_view.defaults.module = "foodies" resources.router.routes

Setting up Zend Layout from Bootstrap

て烟熏妆下的殇ゞ 提交于 2019-12-24 07:15:55
问题 I want to define the which Layout the Zend_Layout should use from Bootstrap class. How to do this? Like from the controller you can do something like $this->_helper->_layout = "somelayout"; I want to change the layout from the bootstrap class. 回答1: You could do it as follows: public function _initLayout() { $layout = $this->bootstrap('layout')->getResource('layout'); $layout->setLayout('somelayout'); } 回答2: You can look further into it on these pages : http://framework.zend.com/manual/en/zend

Zend Framework DbTable insert() inserting records twice

被刻印的时光 ゝ 提交于 2019-12-24 07:01:14
问题 I have a controller action as follows public function reportcommentAction() { $comment_id = $this->getRequest()->comment_id; $blockedCommentTable = new Application_Model_DbTable_BlockedComments(); $blockedCommentTable->blockComment($comment_id, $this->user_id); } which makes a call to the blockComment() dbTable model which looks like this class Application_Model_DbTable_BlockedComments extends Zend_Db_Table_Abstract { protected $_name = 'blocked_comments'; public function blockComment(

Zend_Db_Table_Abstract::_primary returns array?

回眸只為那壹抹淺笑 提交于 2019-12-24 06:59:23
问题 So I have defined a model like this: class Model extends Zend_Db_Table_Abstract { $_primary = 'modelID'; /** * * @param mixed $primaryKey * @return int */ public function delete($primaryKey) { $where = $this->getAdapter()->quoteInto($this->_primary.' = ?', $primaryKey); return parent::delete($where); } } When calling the delete method, I get a warning telling me $this->_primary is an array. Why? I have assigned a string value to $_primary property. From logs: 2012-02-05T17:41:03+00:00 INFO (6