Post by mesm » Mon May 30, 2016 10:17 am

Hello! I want to do such a menu and instead categories in the menu to display the products.
demo.abantecart.com
I managed to get some products on the menu so:

Code: Select all

 "catalog/controller/common/header.php"
before
$children = $this->model_catalog_category->getCategories($category['category_id']);
add
if ($this->model_catalog_category->getCategories($category['category_id'])) {

before
// Level 1
add
} else {
                $dataProduct = array(
                  'filter_category_id'  => $category['category_id'],
                  'filter_sub_category' => true
               );
               $children = $this->model_catalog_product->getProducts($dataProduct);
            foreach ($children as $child ) {
               $children_data [] = array(
                     'name'  =>  $child['name'],
                     'href'  => $this->url->link('product/product', 'product_id=' . $child['product_id']),
                  );

                }
            }


... And my options are here...

Please help me...
Last edited by mesm on Tue May 31, 2016 7:59 am, edited 1 time in total.

Newbie

Posts

Joined
Wed Jul 01, 2015 4:02 pm

Post by IP_CAM » Mon May 30, 2016 11:42 pm

you possibly better remove your LINKS in your Post, this could be misunderstud... :-\
And you can find such in the Extension Section:
---
Top Menu Category with Image on hover
http://www.opencart.com/index.php?route ... n_id=19980
---
TOP menu - images 2
http://www.opencart.com/index.php?route ... n_id=23715
---
found here:
http://www.opencart.com/index.php?route ... u%20images
---
Ernie

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
3'030+ FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by mesm » Tue May 31, 2016 8:03 am

Sorry, I knew it was not customary to put links ..

And I came to these decisions, but I do not know how to do it to show products on the menu ...

Newbie

Posts

Joined
Wed Jul 01, 2015 4:02 pm

Post by IP_CAM » Tue May 31, 2016 8:38 am

it's not a Problem usually, and not my Problem in specific terms, still, better not that one. ;)

But I linked you two Mod's on this, and such Mod's usually have a read_me file,
explaining how to get the Mod on the server, and use it, in the ADMIN Section, to
add corresponding category images. Possibly, the default optional Cat Images will
be used for this, but I really don't know.

Ernie
Last edited by IP_CAM on Tue May 31, 2016 10:01 pm, edited 1 time in total.

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
3'030+ FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by mesm » Tue May 31, 2016 12:58 pm

I paid for this mod
http://www.opencart.com/index.php?route ... bor&page=4
and has yet to find a solution how to spend the products.
But now came a new problem: Parse error: syntax error, unexpected '}' in .... common_header.tpl on line 228
Where is the error in this code ...

Code: Select all

<li class="dropdown-level"> 
						  <?php $levels_2 = $this->model_catalog_category->getCategories($category['children'][$i]['category_id']); ?>
						  <?php if($levels_2) {  ?>
							<a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?><span class="parent"></span></a>
							<div class="dropdown-block-level">
							  <ul>
								<?php foreach ($levels_2 as $level_2) { ?>
								  <li><a href="<?php echo $this->url->link('product/category', 'path='.$category['category_id'].'_' . $category['children'][$i]['category_id'] . '_' . $level_2['category_id']); ?>"><?php echo $level_2['name']; ?></a></li>	
								<?php } ?>
							  </ul>
							</div>
						  <?php } else { ?>
							<a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a>
						  <?php } ?>
						</li>
					  <?php } ?>
					<?php } ?>
				  </ul>
				<?php } ?>
			  </div>
			<?php } ?>
		    </li>

Newbie

Posts

Joined
Wed Jul 01, 2015 4:02 pm

Post by IP_CAM » Wed Jun 01, 2016 7:28 am

what OC Version and extensions do you use, anyway ?

I am no longer active at the Forum. Please do NOT send me Personal Mails,
they will no longer be replied to.
My Github OC Site: https://github.com/IP-CAM
3'030+ FREE OC Extensions, on the World's largest Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by mesm » Wed Jun 01, 2016 4:23 pm

I fixed is.. :dance:
Thanks for your attention IP_CAM
Smiling day! :good:

Newbie

Posts

Joined
Wed Jul 01, 2015 4:02 pm
Who is online

Users browsing this forum: No registered users and 9 guests