blog.calebnance.com

It's So Loud, Inside My Head...

Sunday, 15 January 2012 19:08

My E-commerce for Joomla 1.5?

Written by Caleb Nance

I have been toying around with an E-commerce Component for Joomla for a while now. I have used Virtuemart for one site, and that is the last time I will be using that component. It is too bulky, yes it is free, and comes with a huge options library, but what about the smaller stores? Do you honestly think that a regular user could use Virtuemart with ease? I want to put something out there (Commercial or free, undecided) that will be easy to use and straight to the point. That is what I try to do with all the extensions I have made so far. I think that is where everything is going, I want to help someone that is a regular user on the internet to be able to download my component, and have a store set up within 30 minutes. I have a lot of code for the E-commerce already created, but what about Joomla 1.7 and 2.5? I honestly think people jumped the gun with creating live websites with Joomla 1.7. It is great, but no where near the stable version Joomla 1.5.25. I still think it will be a good year before 2.5 is where Joomla 1.5.25 is.

| View Comments
Friday, 30 December 2011 10:37

How To Add A Content Editor In Your Component

Written by Caleb Nance

Today I wanted to show you how easy it is to add a content editor in your Joomla component form.

| View Comments
Thursday, 20 October 2011 10:20

How To Create A United States Select Box In Joomla

Written by Caleb Nance

First we want to have the array of States in our code. See Below.

$states = array("AK","AL","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID",
"IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH",
"NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA",
"WI","WV","WY");

Then you want to create the list (select list options). Above is the simplest way of creating a state array, but right now the key of each array is 0, 1, 2. This is not what we want, we want the key and value of the array to be the same. So this next line fixes just that.

| View Comments
Wednesday, 19 October 2011 14:10

How To Set The Page Title In A Joomla Component

Written by Caleb Nance

Below is how you set the page title for a Joomla 1.5 component.

With MVC, the standard place to put this code is going to be the view.html.php file inside your view folder.

$document = JFactory::getDocument();
$document->setTitle('Title of Page');

And that is it. Leave the comments below, hope this helped!

| View Comments

This is a way to insert data into a Joomla Database. I use this mostly whenever I am using an Ajax call to a function that needs to be added quickly and neatly. This is what I use inside of that function.

$data              = new stdClass();
$data->item = $post['item'];
$data->published = 1;
$db->insertObject('#__MYTABLE', $data, id);

Remember the key field of the database table. Mine being id, is included in the insertObject() function. Remember it is not supposed to be in the listing, it is supposed to be inside the function. This will need to be a specific variable value IF you do not have AUTO INCREMENT set for this field in the database.

| View Comments
Tuesday, 18 October 2011 20:27

How To Add A Redirect In Joomla 1.5 MVC Component

Written by Caleb Nance

Today I want to show you how easy it is to set a redirect in your Joomla Component. Below is the easiest way to go about this.

$app = JFactory::getApplication();
$app->redirect($link, $msg);

You will want to make sure that there are variables set for $link and $msg. Also this is best used with an IF statement. Here is a full example on how to use the redirect.

if($user->guest):
$link = 'index.php';
$msg = 'You are not logged in.';

$app = JFactory::getApplication();
$app->redirect($link, $msg);
endif;
| View Comments

So you want to add a CSS or JS file to your component? Here is how you would do that, the easiest and best practice way.

| View Comments