Created
June 28, 2011 17:53
-
-
Save enminc/1051715 to your computer and use it in GitHub Desktop.
Temporary Fix for VisionCart "vcGetProductCustomField" Snippet. The changes to this snippet have been logged in big tracker
This file contains 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 | |
/** | |
* @package visioncart | |
*/ | |
$vc =& $modx->visioncart; | |
# !!! FIXED: Fixed statement to be !isset rather then isset | |
##################################################### | |
if (!isset($scriptProperties['id']) || !is_numeric($scriptProperties['id'])) { | |
return ''; | |
} | |
$product = $vc->getProduct($scriptProperties['id']); | |
if ($product == null) { | |
return ''; | |
} | |
$link = $product->getOne('ProductCategory'); | |
$product = $product->toArray(); | |
# !!! FIXED: Without this $link will never resolve bellow | |
######################################################### | |
$link = $link->toArray(); | |
if ($product['customfields'] != '' && is_array($product['customfields'])) { | |
if (isset($product['customfields'][$link['categoryid']][$field])) { | |
return $product['customfields'][$link['categoryid']][$field]; | |
} | |
} | |
return ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment