Post by milok » Mon Apr 23, 2018 2:46 pm

Hello,

I've been using opencart 3.0.2 for about 2 weeks now, but i do have a decent amount of experience in other programs/code.

So I've got a problem with adding a link to my dropdown menu in the header ("dropdown-menu pull-right") the class(line of code) is located in:
E:\Apache24\htdocs\opencart\catalog\view\theme\default\template\common\cart.twig
I've added an image of how the inspector sees the dropdown in the frontend.
Feel free to tell me if there is any other information you would need,
Milo

Attachments

frontend.PNG

frontend.PNG (48.98 KiB) Viewed 615 times


Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm

Post by xxvirusxx » Mon Apr 23, 2018 4:00 pm

So you want to have a drop down menu( like My account) after Checkout?

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by milok » Mon Apr 23, 2018 4:17 pm

xxvirusxx wrote:
Mon Apr 23, 2018 4:00 pm
So you want to have a drop down menu( like My account) after Checkout?
I'd like to add a checkout link to the cart dropdown, by that I mean under the product you can see in the upper right corner of the image i attached.

Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm

Post by xxvirusxx » Mon Apr 23, 2018 4:40 pm

Try to add

Code: Select all

<li><div class="header_cart">{{ cart }}</div></li>
After

Code: Select all

<li><a href="<?php echo $checkout; ?>.......
And you can add css for header_cart

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by milok » Mon Apr 23, 2018 5:48 pm

xxvirusxx wrote:
Mon Apr 23, 2018 4:40 pm
Try to add

Code: Select all

<li><div class="header_cart">{{ cart }}</div></li>
After

Code: Select all

<li><a href="<?php echo $checkout; ?>.......
And you can add css for header_cart
hmm, tried to add the code into header.twig and some others. Did you think of any specific file i should add this into?

Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by milok » Mon Apr 23, 2018 6:14 pm

xxvirusxx wrote:
Mon Apr 23, 2018 6:05 pm
So not show?
Yeah nothing came up when i put that code into the header.twig

Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm

Post by xxvirusxx » Mon Apr 23, 2018 6:27 pm

Refresh ocmod, clear cache

Also you can use div

Code: Select all

	 <div class="nav pull-right">
		<div class="header_cart">{{ cart }}</div>
         </div>
Or just one div

Code: Select all

<div class="header_cart">{{ cart }}</div>
And add to css:

Code: Select all

.header_cart {
    max-width:200px;
    float: right!important;
}
More css tune for mobile...

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by milok » Mon Apr 23, 2018 6:51 pm

xxvirusxx wrote:
Mon Apr 23, 2018 6:27 pm
Refresh ocmod, clear cache

Also you can use div

Code: Select all

	 <div class="nav pull-right">
		<div class="header_cart">{{ cart }}</div>
         </div>
Or just one div

Code: Select all

<div class="header_cart">{{ cart }}</div>
And add to css:

Code: Select all

.header_cart {
    max-width:200px;
    float: right!important;
}
More css tune for mobile...
Alright haven't added any text yet to the link but should i just change the div to "header_checkout" so that it redirects the user to checkout?

Attachments

frontendv.2.PNG

frontendv.2.PNG (11.07 KiB) Viewed 552 times


Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm

Post by xxvirusxx » Mon Apr 23, 2018 7:52 pm

Class header_cart is to be used in CSS....to make changes only for that div..

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by milok » Thu Apr 26, 2018 1:47 pm

xxvirusxx wrote:
Mon Apr 23, 2018 7:52 pm
Class header_cart is to be used in CSS....to make changes only for that div..
I've gotten the link for checkout to work, but when i hover over the checkout link a weird red line shows up. I attached a screenshot of this. It says in the inspector that it is the <a href=".." line that is the redline.
Sorry for this late answer.

Attachments

redline.PNG

redline.PNG (9.45 KiB) Viewed 495 times


Newbie

Posts

Joined
Tue Apr 17, 2018 2:36 pm
Who is online

Users browsing this forum: moreduff and 269 guests