Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mage_Wishlist - DOC block update #742

Merged
merged 2 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/code/core/Mage/Wishlist/Block/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function _getWishlist()
* Prepare additional conditions to collection
*
* @param Mage_Wishlist_Model_Resource_Item_Collection $collection
* @return Mage_Wishlist_Block_Customer_Wishlist
* @return $this
*/
protected function _prepareCollection($collection)
{
Expand Down Expand Up @@ -151,8 +151,8 @@ public function getWishlistInstance()
/**
* Back compatibility retrieve wishlist product items
*
* @return Mage_Wishlist_Model_Resource_Item_Collection
* @deprecated after 1.4.2.0
* @return Mage_Wishlist_Model_Mysql4_Item_Collection
*/
public function getWishlist()
{
Expand Down
9 changes: 4 additions & 5 deletions app/code/core/Mage/Wishlist/Block/Customer/Sharing.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ class Mage_Wishlist_Block_Customer_Sharing extends Mage_Core_Block_Template
/**
* Entered Data cache
*
* @param array
* @var array
*/
protected $_enteredData = null;
protected $_enteredData = null;

/**
* Prepare Global Layout
*
* @return $this
* @return void
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -79,8 +79,7 @@ public function getEnteredData($key)

if (!$this->_enteredData || !isset($this->_enteredData[$key])) {
return null;
}
else {
} else {
return $this->escapeHtml($this->_enteredData[$key]);
}
}
Expand Down
6 changes: 2 additions & 4 deletions app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public function getTitle()
/**
* Add sidebar conditions to collection
*
* @param Mage_Wishlist_Model_Resource_Item_Collection $collection
* @return Mage_Wishlist_Block_Customer_Wishlist
* @param Mage_Wishlist_Model_Resource_Item_Collection $collection
* @return $this
*/
protected function _prepareCollection($collection)
{
Expand Down Expand Up @@ -157,6 +157,4 @@ public function getCacheTags()
}
return parent::getCacheTags();
}


}
4 changes: 2 additions & 2 deletions app/code/core/Mage/Wishlist/Block/Customer/Wishlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected function _prepareCollection($collection)
/**
* Preparing global layout
*
* @return $this
* @return void
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -99,7 +99,7 @@ public function getOptionsRenderCfgs()
return $this->_optionsCfg;
}

/*
/**
* Adds config for rendering product type options
*
* @deprecated after 1.6.2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
* @package Mage_Wishlist
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Comment
extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column
class Mage_Wishlist_Block_Customer_Wishlist_Item_Column_Comment extends Mage_Wishlist_Block_Customer_Wishlist_Item_Column
{
/**
* Retrieve column javascript code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
* @category Mage
* @package Mage_Wishlist
* @author Magento Core Team <core@magentocommerce.com>
*
* @method Mage_Wishlist_Model_Item getItem()
* @method $this setOptionList(array $value)
*/
class Mage_Wishlist_Block_Customer_Wishlist_Item_Options extends Mage_Wishlist_Block_Abstract
{
Expand All @@ -52,7 +55,7 @@ public function __construct()
Mage::dispatchEvent('product_option_renderer_init', array('block' => $this));
}

/*
/**
* Adds config for rendering product type options
*
* @param string $productType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function getColumns()
$columns = array();
foreach ($this->getSortedChildren() as $code) {
$child = $this->getChild($code);
if ($child->isEnabled()){
if ($child->isEnabled()) {
$columns[] = $child;
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Wishlist/Block/Item/Configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function getWishlistItem()
/**
* Configure product view blocks
*
* @return $this
* @inheritDoc
*/
protected function _prepareLayout()
{
Expand Down
8 changes: 4 additions & 4 deletions app/code/core/Mage/Wishlist/Block/Links.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,18 @@ protected function _createLabel($count)
{
if ($count > 1) {
return $this->__('My Wishlist (%d items)', $count);
} else if ($count == 1) {
} elseif ($count == 1) {
return $this->__('My Wishlist (%d item)', $count);
} else {
return $this->__('My Wishlist');
}
}

/**
* @deprecated after 1.4.2.0
* @return Mage_Wishlist_Block_Links
* @see Mage_Wishlist_Block_Links::__construct
*
* @return array
* @deprecated after 1.4.2.0
*/
public function addWishlistLink()
{
Expand All @@ -113,7 +113,7 @@ public function addWishlistLink()
*/
public function getCacheTags()
{
/** @var $wishlist Mage_Wishlist_Model_Wishlist */
/** @var Mage_Wishlist_Model_Wishlist $wishlist */
$wishlist = $this->helper('wishlist')->getWishlist();
$this->addModelTags($wishlist);
foreach ($wishlist->getItemCollection() as $item) {
Expand Down
4 changes: 4 additions & 0 deletions app/code/core/Mage/Wishlist/Block/Render/Item/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
* @category Mage
* @package Mage_Wishlist
* @author Magento Core Team <core@magentocommerce.com>
*
* @method Mage_Catalog_Model_Product getProduct()
* @method string getDisplayMinimalPrice()
* @method string getIdSuffix()
*/
class Mage_Wishlist_Block_Render_Item_Price extends Mage_Core_Block_Template
{
Expand Down
3 changes: 2 additions & 1 deletion app/code/core/Mage/Wishlist/Block/Share/Email/Rss.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/


/**
* Wishlist RSS URL to Email Block
*
* @category Mage
* @package Mage_Wishlist
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setWishlistId(int $value)
*/
class Mage_Wishlist_Block_Share_Email_Rss extends Mage_Core_Block_Template
{
Expand Down
10 changes: 4 additions & 6 deletions app/code/core/Mage/Wishlist/Controller/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public function allcartAction()
$qtys = array_filter(json_decode($qtysString), 'strlen');
}

/** @var Mage_Wishlist_Model_Item $item */
foreach ($collection as $item) {
/** @var Mage_Wishlist_Model_Item */
try {
$disableAddToCart = $item->getProduct()->getDisableAddToCart();
$item->unsProduct();
Expand All @@ -123,11 +123,10 @@ public function allcartAction()
if ($item->addToCart($cart, $isOwner)) {
$addedItems[] = $item->getProduct();
}

} catch (Mage_Core_Exception $e) {
if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {
$notSalable[] = $item;
} else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {
} elseif ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {
$hasOptions[] = $item;
} else {
$messages[] = $this->__('%s for "%s".', trim($e->getMessage(), '.'), $item->getProduct()->getName());
Expand All @@ -150,7 +149,7 @@ public function allcartAction()
}
if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {
$redirectUrl = Mage::helper('checkout/cart')->getCartUrl();
} else if ($this->_getRefererUrl()) {
} elseif ($this->_getRefererUrl()) {
$redirectUrl = $this->_getRefererUrl();
} else {
$redirectUrl = $indexUrl;
Expand Down Expand Up @@ -193,8 +192,7 @@ public function allcartAction()
// save wishlist model for setting date of last update
try {
$wishlist->save();
}
catch (Exception $e) {
} catch (Exception $e) {
Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));
$redirectUrl = $indexUrl;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Wishlist/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ protected function _getUrlStore($item)
if ($product) {
if ($product->isVisibleInSiteVisibility()) {
$storeId = $product->getStoreId();
} else if ($product->hasUrlDataObject()) {
} elseif ($product->hasUrlDataObject()) {
$storeId = $product->getUrlDataObject()->getStoreId();
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Wishlist/Model/Config/Source/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
class Mage_Wishlist_Model_Config_Source_Summary
{
/**
* @return array
*/
public function toOptionArray()
{
return array(
Expand Down
Loading