jcbflorida Posted June 7, 2009 Share Posted June 7, 2009 Just getting started with PHP! I'm using a shopping cart software and I hate the way it picks the page title. The PHP code looks like this: <title><?php echo $myPage->getConfig('shopname'); ?></title> It causes every page title to be equal to the shopname: $config['shopname'] = 'Our Shop'; I want change the code to reflect the product name not the shop name. The same file while $config['shopname'] = 'Our Shop'; is located has arrays for the products that look like this: $products['14']['428'] = array( 'productid' => '428', 'groupid' => '14', 'pagehref' => 'viewitem.php?groupid=14&productid=428', 'name' => 'BIG GREEN TOY CAR', I've played with the php code using a get before after the <head> and before the <title> and changed the echo, but I just can't get it right. I want the title to be equal to the 'name'. I hope someone who knows php better than me can advise on the correct code. HELP!?!? Quote Link to comment https://forums.phpfreaks.com/topic/161271-echo-part-of-array-for-page-title-newbie-question/ Share on other sites More sharing options...
gevans Posted June 7, 2009 Share Posted June 7, 2009 I'd need to look at the myPage object before I could find a method that would allow you to find that information. WHat cart system are you using, perhaps their documentation will help. Quote Link to comment https://forums.phpfreaks.com/topic/161271-echo-part-of-array-for-page-title-newbie-question/#findComment-851051 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.