Hi ukfish1,
You sure can. There are however a few steps you need to take to make it all work.
Firstly you need to setup a new CUSTOM FIELD with the following options
- Custom Field Type : Integer
- Title : PhoneOrderOnly
- Published : Yes
- Parent : 0
- Cart Attribute : NO
- Description : NULL
- Default : NULL
- Tooltip : NULL
- Layout position : NULL
- Admin only : NO
- Is a list? : NO
- Hidden : YES
Save it and then take note of it's ID (/administrator/index.php?option=com_virtuemart&view=custom&task=edit&virtuemart_custom_id[]=
26)
Then in your product detail page find the add to cart block and insert this code:
$testphoneorder = array();
foreach ($this->product->customfieldsSorted['normal'] as $phoneorder) :
$testphoneorder[] = $phoneorder->virtuemart_custom_id;
endforeach;
if ( ! in_array( 26, $testphoneorder) ) : // <-- insert your ID in place of the 26
// Add To Cart Button
if (!VmConfig::get('use_as_catalog', 0) and !empty($this->product->prices)) {
echo $this->loadTemplate('addtocart');
};
// Add To Cart Button END
else :
echo JText::_('COM_VIRTUEMART_CART_NOTIFY');
endif;
See how you go with that.