Add link "to checkout" in mini basket

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
heural
Posts: 58
Joined: 09 Jun 2022, 07:55

Add link "to checkout" in mini basket

Post by heural » 04 Apr 2023, 12:27

Hi Aimeos-Team,

how can I add a link in mini-basket "to checkout" to go directly to the checkout pages.

I overwrite the template for the mini basket:

Code: Select all

 <div class="to-checkout">
                <a class="btn btn-primary" href="<?= $enc->attr( $this->link( 'client/html/checkout/standard/url' ) ) ?>">
                    <?= $enc->html( $this->translate( 'client', 'Checkout' ), $enc::TRUST ) ?>
                </a>
            </div>
but the link in href is "relative" to the page instead of "/checkout?ai%5Baction%5D=standard&ai%5Bcontroller%5D=Checkout"
It seems that "client/html/checkout/standard/url" only return "?ai%5Baction%5D=standard&ai%5Bcontroller%5D=Checkout"

Thank you!
Ralf

User avatar
aimeos
Administrator
Posts: 7858
Joined: 01 Jan 1970, 00:00

Re: Add link "to checkout" in mini basket

Post by aimeos » 07 Apr 2023, 08:15

Add "absoluteUri" as third parameter to the link view helper call:

Code: Select all

$this->link( 'client/html/checkout/standard/url', [], ['absoluteUri' => 1] )
Documentation: https://aimeos.org/docs/latest/infrastr ... view/#link
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

heural
Posts: 58
Joined: 09 Jun 2022, 07:55

Re: Add link "to checkout" in mini basket

Post by heural » 17 Apr 2023, 07:21

Documentation...it could be so easy
Thank you!

Post Reply