Jump to content

Mfg Brand


Claudia M

Recommended Posts

Please make these edits.

In the admin /sources/products.index.inc.php:

Near line 70, find:

if (!empty($_POST['product_id']) && is_numeric($_POST['product_id'])) {

On a new blank line ABOVE that, add:


if (isset($record['manufacturer']) && $record['manufacturer'] == "new" && isset($record['newmanufacturer']['name'])) {
	if(($existing_manufacturer = $GLOBALS['db']->select('CubeCart_manufacturers', array('id'), array('name' => $record['newmanufacturer']['name']))) === false) {
		if (($record['manufacturer'] = $GLOBALS['db']->insert('CubeCart_manufacturers', $record['newmanufacturer'])) !== false) {
			$GLOBALS['main']->setACPNotify($lang['catalogue']['notify_manufacturer_create']);
		} else {
			$GLOBALS['main']->setACPWarning($lang['catalogue']['error_manufacturer_create'].' - no insert');
		}
	} else {
		$record['manufacturer'] = $existing_manufacturer[0]['id'];
		$GLOBALS['main']->setACPWarning($lang['catalogue']['error_manufacturer_create'].' - name');
	}
}

In the admin template products.inc.php:

Near line 152, find:

<option value="">{$LANG.form.none}</option>

On a new blank line AFTER that, add:

<option value="new">-- {$LANG.catalogue.title_manufacturer_add} --</option>

Just a few lines further, find:

</select>

Change to:

</select> &nbsp;If select '{$LANG.catalogue.title_manufacturer_add}', enter data below.

About 20 lines further, find:

<fieldset>
   <legend>{$LANG.catalogue.title_stock_control}</legend>

On a new blank line ABOVE that, add:

<fieldset><legend>{$LANG.catalogue.title_manufacturer_add}</legend>
   <div><label for="manu_name">{$LANG.catalogue.manufacturer}</label><span><input type="text" class="textbox required" id="manu_name" name="newmanufacturer[name]" value=""></span></div>
   <div><label for="manu_site">{$LANG.common.url}</label><span><input type="text" class="textbox" id="manu_site" name="newmanufacturer[URL]" value=""></span></div>
</fieldset>

 

Edited by bsmither
Link to comment
Share on other sites

I got it to work.  I copied the instructions from the email I received about  the post, not the actual forum post.  The email read and I couldn't find that complete line:

Near line 70, find:

 

if (!empty($_POST['product_id']) &&

is_numeric($_POST['product_id'])) { dbgClue('We are updating a

product.',array(),false);

 

FORUM READ:  On a new blank line ABOVE that, add:

Near line 70, find:

if (!empty($_POST['product_id']) && is_numeric($_POST['product_id'])) {
Link to comment
Share on other sites

Doh! Didn't test for that.

<fieldset><legend>{$LANG.catalogue.title_manufacturer_add}</legend>
   <div><label for="manu_name">{$LANG.catalogue.manufacturer}</label><span><input type="text" class="textbox" id="manu_name" name="newmanufacturer[name]" value=""></span></div>
   <div><label for="manu_site">{$LANG.common.url}</label><span><input type="text" class="textbox" id="manu_site" name="newmanufacturer[URL]" value=""></span></div>
</fieldset>

I removed the 'required' attribute from the text entry field.

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...