public function urlCollections()
{
if ($this->isLicense() === true) {
[color="#FF0000"]$attribute = Mage::getmodel("eav/config")->getAttribute("catalog_product", "562");[/color]
$cityValue = array();
[color="#FF0000"]foreach ($attribute->getSource()->getAllOptions(true, true) as $option) {[/color]
$cityValue[$option['label']] = $option['value'];
$storeId = Mage::app()->getStore()->getStoreId();
$city = $option['value'];
if ($city != "") {
$cityName = $option['label'];
$cityName = ereg_replace("[^A-Za-z0-9^-]", "", $cityName);
$cityName = str_replace(" ", "-", $cityName);
$cityName = strtolower($cityName);
$requestPath = "deal/" . $cityName . ".html";
$realPath = "deal/index/index/city/" . $city;
$resource = Mage::getsingleton("core/resource");
$read = $resource->getConnection("read");
$tPrefix = ( boolean ) Mage::getconfig()->getTablePrefix();
$rewriteTable = "magentocore_url_rewrite";
$idPath = "deal/index/index/city/" . $city;
$urlRewrite = $read->select()->from(array(
"ur" => $rewriteTable
), array(
"ur.request_path"
))->where("ur.id_path =? ", $idPath)->where("ur.store_id =? ", $storeId)->where("ur.is_system =?", 0);
$cityUrl = $read->fetchRow($urlRewrite);
if (empty($cityUrl)) {
$urlCheck = $read->select()->from(array(
"ur" => $rewriteTable
), array(
"ur.request_path"
))->where("ur.request_path =? ", $requestPath)->where("ur.store_id =? ", $storeId)->where("ur.is_system =?", 0);
$cityUrlCheck = $read->fetchRow($urlCheck);
if (!empty($cityUrlCheck)) {
$requestPath = "deal/" . $cityName . "-" . $city . ".html";
}
$executeQuery = $read->query("INSERT INTO {$rewriteTable} (`store_id`, `category_id`, `product_id`, `id_path`, `request_path`, `target_path`, `is_system`, `options`, `description`) VALUES ({$storeId}, NULL, NULL, '{$realPath}', '{$requestPath}', '{$realPath}', '0', '', NULL)");
}
}
}
return $cityValue;
}
}
1 Replies - 225 Views - Last Post: 13 September 2012 - 02:10 AM
#1
Fatal error: Call to a member function getSource() on a non-object in
Posted 12 September 2012 - 11:08 PM
i am new at php & i have downloaded Contus groupclone nulled code. i made its connection to mysql database but when i want to run it i got this error. my local sever is wamp 2.2 and uses apache 2.2.21 , php 5.3.8 and mysql 5.5.16 on windows vista. i 'd be appreciate if someone could help me.
Replies To: Fatal error: Call to a member function getSource() on a non-object in
#2
Re: Fatal error: Call to a member function getSource() on a non-object in
Posted 13 September 2012 - 02:10 AM
Nulled code? This apparently means you're trying to steal something. We don't help people with that.
Closed.
Closed.
Page 1 of 1
|
|

New Topic/Question
This topic is locked



MultiQuote




|