Jump to content

How to Add New Product Fields


Dirty Butter

Recommended Posts

I've been using a free mod based on Homar's How To Add New Product Fields since v3, and would like to be able to add a tab in Products on Admin to use that information in my v5 upgrade. Can someone spell out how to create that extra tab in the Product Fields and populate it with the table in my inventory file?

Link to comment
Share on other sites

  • 2 weeks later...

I've just realized there is already a Notes tab on the Order Summary screen.

This code in admin/sources/orders.index.inc.php looks like the place that could be copied and modified to create a Notes tab on each product:

// Add a new note, if there's any content

	if (!empty($_POST['note'])) {

		$note	= array(

			'admin_id'		=> Admin::getInstance()->get('admin_id'),

			'cart_order_id'	=> $order_id,

			'content'		=> strip_tags($_POST['note']),

		);

		$GLOBALS['db']->insert('CubeCart_order_notes', $note);

	}

	// Hook

	foreach ($GLOBALS['hooks']->load('admin.order.index.post_process') as $hook) include $hook;



	if (isset($_POST['submit_cont'])) {

		httpredir(currentPage(null, array('action' => 'edit', 'order_id' => $order_id)));

	} else {

		httpredir(currentPage(array('action', 'order_id')));

	}

}



if (isset($_GET['delete-note']) && isset($_GET['order_id'])) {

	$GLOBALS['db']->delete('CubeCart_order_notes', array('cart_order_id' => $_GET['order_id'], 'note_id' => $_GET['delete-note']));

	httpredir(currentPage(array('delete-note','print_hash')), 'notes');

}

I'm still hoping someone can help me accomplish this. Any takers??

Link to comment
Share on other sites

  • 1 month later...

the above post is really useful and i am also looking for this here i found ...thanks

I ended up buying Goober's Product Description Tab plugin. It works beautifully. I left the Notes tab disabled, so it shows in Admin but not on the customer screen. It's also great for showing additional images without getting a long strip of thumbnails down the product listing.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...