Jump to content

Array to a single variable?

- - - - -

  • Please log in to reply
No replies to this topic

#1
MortalMan

MortalMan

    Newbie

  • Members
  • Pip
  • 1 posts
So I'm trying to make the bulk upload on my site simpler to use by removing a lot of the options. Lets face it. Most sellers just won't bother learning how to use the bulk uploader if it takes more then 5 minutes of there time.

I find that I can remove a lot of the options just by changing 'mandatory' => true to false. I can then remove an entire column in the sample bulk file. Not all the columns in the bulk uploader are necessary for my site. The smaller the sample file the less scary it looks to sellers.

I can't just change all 'mandatory' => true to false and expect the bulk uploader to work after I remove a few unnecessary columns. Some columns NEED to be filled in, but to make it easier for the sellers I would like to be able to automatically set one value and completely remove the column.

For instance to keep it simple on my site I have a few minor mods that makes all auctions buyitnow so it's not necessary for users to have stores. This means I can possibly remove the 3rd column (ListIn) in the bulk uploader completely and just program my site to automatically set the ListIn value to "auction" for all bulk uploads.

Here's the the stock bulk.php looks like when addressing ListIn.

function setListIn()

	{

		//$this->list_in = null;

		

		if (!$this->setts['enable_store_only_mode'])

		{

			$this->list_in[] = 'auction';

		}

		

		if ($this->user_details['shop_active'])

		{

			$shop = new shop();

			$shop->setts = &$this->setts;

			

			$shop_status = $shop->shop_status($this->user_details, true);


			if ($shop_status['remaining_items'] > 0)

			{

				$this->list_in[] = 'both';

				

				$this->list_in[] = 'store';

			}

		}

		

		return array(

			'id' => 'list_in', 

			'name' => MSG_LIST_IN, 

			'description' => 'enum',

			'sample' => 'auction', 

			'formchecker' => array(array('in_array', $this->list_in)),

			'max_length' => 50, 'type' => 'enum', 'mandatory' => true, 'accepted_values' => $this->list_in

		);		

	}

How can I modify this code so that the user can leave the ListIn value empty in the bulk upload file, but have the listin value automatically set to auction?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users