Page 1 of 1
Error Logs: PHP Notice: Undefined variable: action
Posted: Sun Dec 13, 2009 11:22 am
by montanaflynn
I am getting this error in my error log. Any ideas on how to troubleshoot and fix this?
2009-12-12 21:17:14 - PHP Notice: Undefined variable: action in /home/expressp/public_html/admin/view/template/catalog/product_form.tpl on line 10
Re: Error Logs: PHP Notice: Undefined variable: action
Posted: Sun Dec 13, 2009 12:08 pm
by Qphoria
what did you change?
Re: Error Logs: PHP Notice: Undefined variable: action
Posted: Sun Dec 13, 2009 12:56 pm
by montanaflynn
I added another input with the SEO keyword variable echo'ing in PHP. This is because I added a jQuery plugin to hyphenate the SEO phrase so it is easier to enter for staff. This could be avoided if OpenCart did this internally after the form was submitted with a
script like this, but I have no idea how to implement it. I also added the import / export contribution, and changed other files in the view, but css, images and inline styles only.
My Changes to /admin/view/template/catalog/product_form.tpl
Code: Select all
<tr>
<td><?php echo $entry_keyword; ?></td>
<td> <input name="SEOword" id="SEOword" value="<?php echo $keyword; ?>" />
<input type="text" class="slug" name="keyword" value="<?php echo $keyword; ?>" /></td>
</tr>
Slug PHP function
Code: Select all
function slug($str)
{
$str = strtolower(trim($str));
$str = preg_replace('/[^a-z0-9-]/', '-', $str);
$str = preg_replace('/-+/', "-", $str);
return $str;
}