I have modified the bundled product view template so that the "checkboxed" product options are displayed with links back to their component products using $_product = Mage::getModel
, etc.
The problem I'm having is, I need to not show a link if the item is not visible in the website/catalog, and include the link only if the item is visible in the catlog.
Here's a recent version of the code:
<?php $_option = $this->getOption() ?>
<?php $_selections = $_option->getSelections() ?>
....
$_product = Mage::getModel('catalog/product');
$_product->load($_selection->getProductId());
....
<?php if($_selection->getVisibleInSiteVisibilities()) echo '<a href="'.$_selection->getProductUrl().'" target="_blank">'; ?>
<?php echo $this->getSelectionQtyTitlePrice($_selection) ?>
<?php if ($_selection->getVisibleInSiteVisibilities()) echo '</a>'; ?>
</label></span>
I've tried $_selection->getVisibleIn SiteVisibilities()
and that provides me with a boolean "false" regardless of how the visibility is set.
I tried $_selection->isVisibleInSiteVisibility() and that returns an array which seems to be the same for all products regardless of how the visibility is set as well.
Is there a simple way to find out if a product is set to be visible (or rather not set to "Not Visible Individually"?)