Quickly before I do this...
My dofe and pnew are varchars, is this ok?
Paul
@ paul
It should be fine that they are varchars. I set mine up as Bool in my MySQL database, but defaulted them to 0.
Regardless, the conditional in the Template file is only using the == and not the === operator. So you should be fine.
It should be fine that they are varchars. I set mine up as Bool in my MySQL database, but defaulted them to 0.
Regardless, the conditional in the Template file is only using the == and not the === operator. So you should be fine.
Hi,
Uploaded these files... Got this error when trying to take a product OFF being dofe or pnew... however it did still remove it even if the error appeared...
And also this error when inserting a new product by the checkboxes...
Uploaded these files... Got this error when trying to take a product OFF being dofe or pnew... however it did still remove it even if the error appeared...
Code: Select all
Notice: Undefined index: dofe in /home/theadv11/public_html/admin/model/catalog/product.php on line 132Warning: Cannot modify header information - headers already sent by (output started at /home/theadv11/public_html/admin/index.php:83) in /home/theadv11/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/theadv11/public_html/admin/index.php:83) in /home/theadv11/public_html/vqmod/vqcache/vq2-system_engine_controller.php on line 29
Code: Select all
Notice: Undefined index: 1 in /home/theadv11/public_html/admin/view/template/catalog/product_form.tpl on line 37 />DOFE Award Notice: Undefined index: 1 in /home/theadv11/public_html/admin/view/template/catalog/product_form.tpl on line 38 />New Item!
@ paul
Are you running any additional modules with OpenCart at this time? It could be that something else is causing a conflict somewhere in there. But by the error it really looks like the problem is in your Template file, and perhaps the checkbox elements aren't being named correctly? For that matter, did I name your variables correctly? dofe and pnew rather than Dofe, or DoFe, or DOFE or anything like that. You may want to double check your database column names and make sure that they exactly match the name of the checkbox element.
As for the undefined index: 1, that might just require you to remove the "== 1" part of the template file and just check to see if the variable is true.
Something else to look at is try re-configuring your database table structure so that rather than varchar they are bool. This shouldn't be the issue, but we may as well try everything.
Additionally, and this is my fault for forgetting to ask, but what version of OpenCart are you running. I'm currently using 1.5.1.3.
Are you running any additional modules with OpenCart at this time? It could be that something else is causing a conflict somewhere in there. But by the error it really looks like the problem is in your Template file, and perhaps the checkbox elements aren't being named correctly? For that matter, did I name your variables correctly? dofe and pnew rather than Dofe, or DoFe, or DOFE or anything like that. You may want to double check your database column names and make sure that they exactly match the name of the checkbox element.
As for the undefined index: 1, that might just require you to remove the "== 1" part of the template file and just check to see if the variable is true.
Something else to look at is try re-configuring your database table structure so that rather than varchar they are bool. This shouldn't be the issue, but we may as well try everything.
Additionally, and this is my fault for forgetting to ask, but what version of OpenCart are you running. I'm currently using 1.5.1.3.
I added this before the check boxes and it fixed the big error...
So it would have something to submit if the check box was not ticked, this seemed to do the trick...
I'm still getting the undefined 1 error when I create a new product even with removing ==1...
Also I have found another issue... on the catergories display page, when you switch between grid and list, it stacks up lots of (null)'s every time you switch where Dofe or New would be displayed... Thanks
Code: Select all
<input type="hidden" name="product_description[<?php echo $language['language_id']; ?>][dofe]" value="">
<input type="hidden" name="product_description[<?php echo $language['language_id']; ?>][pnew]" value="">
I'm still getting the undefined 1 error when I create a new product even with removing ==1...
Also I have found another issue... on the catergories display page, when you switch between grid and list, it stacks up lots of (null)'s every time you switch where Dofe or New would be displayed... Thanks
@ paul
Okay. I figured out what was causing the undefined 1 error.
When you are checking to see if the item == 1 you currently have this:
you need to change them to this:
All I did there was to add to the conditional statement so that way if you are creating a new item it looks to see if $product_description[language_id][dofe] exists. This gets rid of that annoying error when creating new products.
You may need to be a bit more specific about the grid view. If I place:
Somewhere in the product display, it just display the 'stuff here' whether I'm in grid or list view. If I switch back and forth it doesn't stack. Are you by chance telling it to show up via the Javascript function display(view) on the template page? If so, just put it straight in your html where it loops through each product in the foreach() loop.
Otherwise you may need to take a screen cap of these nulls stacking up.
Okay. I figured out what was causing the undefined 1 error.
When you are checking to see if the item == 1 you currently have this:
Code: Select all
<input type="checkbox" name="product_description[<?php echo $language['language_id']; ?>][pnew]" value="1" <?php if ($product_description[$language['language_id']]['pnew'] == 1) { echo 'checked="checked"'; } ?> />
Code: Select all
<input type="checkbox" name="product_description[<?php echo $language['language_id']; ?>][pnew]" value="1" <?php if (isset($product_description[$language['language_id']]['pnew']) && $product_description[$language['language_id']]['pnew'] == 1) { echo 'checked="checked"'; } ?> />
You may need to be a bit more specific about the grid view. If I place:
Code: Select all
<?php if($product['dofe']){ ?>
stuff here
<?php } ?>
Otherwise you may need to take a screen cap of these nulls stacking up.
Ok, the admin bit is now working, but I don't quite understand the view page for products...
I'll upload my category.tpl file so you can see what I'm doing wrong... At the moment, it does not display anything on the pages...
Thanks, Paul
I'll upload my category.tpl file so you can see what I'm doing wrong... At the moment, it does not display anything on the pages...
Thanks, Paul
Attachments
@ paul
Okay. I'm not sure, but it wasn't showing up for me at all in my file. I moved it to within the <div class="price"> and it shows up fine, and no stacking issues.
Occasionally when messing around with it I got some crazy results where it would show up everywhere, but then I realized it was just because a <div> tag didn't get closed out. Take a look at this file, and see if it works for you.
Okay. I'm not sure, but it wasn't showing up for me at all in my file. I moved it to within the <div class="price"> and it shows up fine, and no stacking issues.
Occasionally when messing around with it I got some crazy results where it would show up everywhere, but then I realized it was just because a <div> tag didn't get closed out. Take a look at this file, and see if it works for you.
Attachments
Who is online
Users browsing this forum: No registered users and 98 guests