Friday 27 December 2013

Joomla Administration; How to add a custom dropdown list to a form

The aim here was to make some customisations to the Messaging component.  I wanted to change the user dropdown to only select from our shoppers.


Here's how I fixed this.

I added this file administrator/com_message/models/fields/ourshoppers.php

getQuery(true);
 
                $query->select('user_id As value, username As text');
                $query->from('#__users AS a');   
    $query->join('LEFT', '#__mijoshop_user AS m ON m.userid = a.id');
                $query->order('a.username');
                $query->where('m.status = 1');
 
                // Get the options.
                $db->setQuery($query);
 
                $options = $db->loadObjectList();
 
                // Check for a database error.
                if ($db->getErrorNum()) {
                        JError::raiseWarning(500, $db->getErrorMsg());
                }
 
                return $options;
        }
}


defined('JPATH_BASE') or die;

jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');

/**
 * Custom Field class for the Joomla Framework.
 *
 * @package             Joomla.Administrator
 * @subpackage          com_my
 * @since               1.6
 */
class JFormFieldOurShoppers extends JFormFieldList
{
        /**
         * The form field type.
         *
         * @var         string
         * @since       1.6
         */
        protected $type = 'OurShoppers';

        /**
         * Method to get the field options.
         *
         * @return      array   The field option objects.
         * @since       1.6
         */
        public function getOptions()
        {
                // Initialize variables.
                $options = array();

                $db     = JFactory::getDbo();
                $query  = $db->getQuery(true);

                $query->select('user_id As value, username As text');
                $query->from('#__users AS a');  
                $query->join('LEFT', '#__mijoshop_user AS m ON m.userid = a.id');
                $query->order('a.username');
                $query->where('m.status = 1');

                // Get the options.
                $db->setQuery($query);

                $options = $db->loadObjectList();

                // Check for a database error.
                if ($db->getErrorNum()) {
                        JError::raiseWarning(500, $db->getErrorMsg());
                }

                return $options;
        }
}




and then in administrator/com_messages/models/forms/message.xml
FIND
name="user_id_to"



And underneath change the type to 'our shoppers'

type="OurShoppers"

type="OurShoppers"






###########################

Here's what I searched for on Google


joomla com_messages model how to effect the recipient dropdown

joomla messages components how to effect the recipient dropdown

joomla changing a input-append in administrator


how to make your own customised forms .  Heres a great article.

http://docs.joomla.org/J2.5:How_to_add_custom_filters_to_components


index.php?

option=com_users&view=users&layout=modal&tmpl=component&field=jform_us

er_id_to&groups=WyI3IiwiOCJd&excluded=WyI4MjIiXQ==

joomla 3 administrator models/fields custom dropdown


I NEED TO LINK UP TO MIJOSHOP CUSTOMER AND NOT MIJOSHOP USER.  !! match on email !!


Here's the answer on this page ->

http://docs.joomla.org/Creating_a_custom_form_field_type

joomla RD Ticketmaster - Change checkout so that the Returning Customer box isn't dropped down

OPEN

components/com_ticketmaster/views/checkout/tmpl/default.php


and comment out the line


JQ('.acc_trigger:first').addClass('active').next().show();

around line 109

Wednesday 11 December 2013

Joomla Ticketmaster Mailchimp not working

In configuration after I save my Mailchimp API returns as a single value and the List ID does the same.

To fix this you need to make this change in MySql

in the table __ticketmaster_config

you need to change both tables  mailchimp_listid  & mailchimp_api from INT to VARCHAR

Monday 9 December 2013

Wordpress Wealthz theme weird behavior of Portfolios

I'd been having a few weird issues when loading Portfolios on to our Wealthz theme. 

What was happing is after a certain amount when I was adding a new item then the oldest Portfolio would not show.   After changing the category layout I was still getting some weird behavior in that the last 2 categories had all the same images. 

The fix here is in the Wealthz theme options - go to

Theme Options, On portfolio options tab, number of portfolios will be a default of 12 . Change this to a much higher number.

Wednesday 4 December 2013

Jigoshop how to add product code to products

what you need to search for is SKU.  and this is set in > Jigoshop > Settings.

the go to 'Products & Inventory'    and tick 'enable SKU field'




Monday 2 December 2013

Joomla RD Media Ticketmaster change Rolling Stones text

on the background of the PDF's of the tickets we're sending out we have a message like 'you're tickets for the Rolling Stones'
To get rid of this you need to change the PDF background .  You can find this at
admin > components > com_ticketmaster > assets > etickets

And you can also upload this on each individual ticket.