Post by ArabianMaiden » Fri Aug 05, 2022 9:28 pm

OC Version: 3.0.3.8
Website: shop.candybird.co.za

Hi there, I've been tinkering with this for a while, but I can't find the right placement in the OC twig files to add an extra menu. How can I add the "specials" as a category on my top menu bar and side bar (images attached)? I attempted a couple days ago by following this post viewtopic.php?t=41744 but it's for an older version , and the category kept sitting inside the children categories, and there isn't any further up I can place it. This is the code I'd like to add:

Code: Select all

<a href="index.php?route=product/special">Specials</a>
Image

Newbie

Posts

Joined
Thu Oct 01, 2020 12:23 am

Post by by mona » Fri Aug 05, 2022 10:37 pm

As a quick hack way
catalog/view/theme/default/template/common/menu.twig

change

Code: Select all

      {% endfor %}
      </ul>
for

Code: Select all

        {% endfor %}
	<li class="dropdown"><a href="https://www.shop.candybird.co.za/index.php?route=product/special" class="dropdown-toggle" data-toggle="dropdown">Specials</a>
      </ul>
and the side menu you follow the same principle in catalog/view/theme/default/template/extension/module/category.twig
with

Code: Select all

<a href="https://www.shop.candybird.co.za/index.php?route=product/special" class="list-group-item">Specials</a>
It should be done using OCMOD and in the controllers using the language files, but as a free quick option the above will suffice.
and remember to clear your cache, including your server.

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


Spinning Social : Links : Menus : Payments : Socials : Ads : Screen Backgrounds : Galleries : Headers : Banners : Promos


Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by ArabianMaiden » Fri Aug 05, 2022 11:37 pm

by mona wrote:
Fri Aug 05, 2022 10:37 pm
As a quick hack way
catalog/view/theme/default/template/common/menu.twig

change

Code: Select all

      {% endfor %}
      </ul>
for

Code: Select all

        {% endfor %}
	<li class="dropdown"><a href="https://www.shop.candybird.co.za/index.php?route=product/special" class="dropdown-toggle" data-toggle="dropdown">Specials</a>
      </ul>
and the side menu you follow the same principle in catalog/view/theme/default/template/extension/module/category.twig
with

Code: Select all

<a href="https://www.shop.candybird.co.za/index.php?route=product/special" class="list-group-item">Specials</a>
It should be done using OCMOD and in the controllers using the language files, but as a free quick option the above will suffice.
and remember to clear your cache, including your server.
Thank you! Something that finally works :)
May I ask, why is this a hacky solution? In a real-life application would this not be acceptable or do you actually mean the way to do this properly is to edit the source files?

Newbie

Posts

Joined
Thu Oct 01, 2020 12:23 am
Who is online

Users browsing this forum: No registered users and 16 guests