X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Navbar on Checkout page (https://forum.x-cart.com/showthread.php?t=71914)

Phil Richman 04-27-2015 12:07 PM

Navbar on Checkout page
 
Does anybody know how to turn the navbar and minicart on the checkout page? I'm sure this is easily accomplished, just not sure which file to find it in. I've been looking, but haven't found what controls it yet.

tony_sologubov 05-04-2015 03:13 AM

Re: Navbar on Checkout page
 
Hello Phil,

If you want to display all standard navbars on checkout page, then you can decorate the isCheckoutLayout() method of the \XLite\Controller\Customer\ACustomer class and define it as false.

It should do the trick.

Tony

Phil Richman 05-05-2015 10:10 AM

Re: Navbar on Checkout page
 
Quote:

Originally Posted by tony_sologubov
Hello Phil,

If you want to display all standard navbars on checkout page, then you can decorate the isCheckoutLayout() method of the \XLite\Controller\Customer\ACustomer class and define it as false.

It should do the trick.

Tony

Please forgive me for my ignorance here, but how do I define it as false. I've tried decorating this as you suggested, but I must be doing something wrong. Can you give a little more specific information on how to achieve this.

totaltec 05-05-2015 04:51 PM

Re: Navbar on Checkout page
 
Phil,
Do you know how to decorate a class in your own module? If not watch some of my tutorials on the subject. (Link in sig)

That should get you warmed up. After you have your module setup and going you want to decorate the class that Tony referenced above.

Then include this in the code of your decorated class. This should be the only method that you have to define in your class, otherwise the file will be empty except for opening tag, namespace and opening class defintion:

Code:

    /**
    * Return true if checkout layout is used
    *
    * @return boolean
    */
    public function isCheckoutLayout()
    {
        return false;
    }


tony_sologubov 05-06-2015 02:40 AM

Re: Navbar on Checkout page
 
@Phil,

You may also want to check the KB guide about decoration here:
http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes

If you still have questions after reading and watching, do not be confused and just ask us here. I will be glad to explain the concept in more details if needed.

Tony

Phil Richman 05-06-2015 03:39 AM

Re: Navbar on Checkout page
 
Quote:

Originally Posted by totaltec
Phil,
Do you know how to decorate a class in your own module? If not watch some of my tutorials on the subject. (Link in sig)

That should get you warmed up. After you have your module setup and going you want to decorate the class that Tony referenced above.

Then include this in the code of your decorated class. This should be the only method that you have to define in your class, otherwise the file will be empty except for opening tag, namespace and opening class defintion:

Code:

    /**
    * Return true if checkout layout is used
    *
    * @return boolean
    */
    public function isCheckoutLayout()
    {
        return false;
    }


That is basically the code I was trying. Is there something wrong with my namespace maybe?


<?php

namespace XLite\Module\Pmall\PmallSkin\Controller\Customer;

abstract class ACustomer extends \XLite\Controller\AController implements \XLite\Base\IDecorator
{
public function isCheckoutLayout()
{
return false;
}
}

totaltec 05-06-2015 04:49 AM

Re: Navbar on Checkout page
 
What is the name of the file? Is it ACustomer.php? Is it saved in the directory XLite/Module/Pmall/PmallSkin/Controller/Customer/? Does it show up in the var/run after rebuild?

totaltec 05-06-2015 05:24 AM

Re: Navbar on Checkout page
 
Oh, I see what is wrong. Your are not extending the right class. You are extending the class that the original ACustomer class extended. You want to extend ACustomer

totaltec 05-06-2015 06:27 AM

Re: Navbar on Checkout page
 
Here is my functioning code:
Code:

<?php

namespace XLite\Module\Guru\GoUnmanned\Controller\Customer;

abstract class ACustomer extends \XLite\Controller\Customer\ACustomer implements \XLite\Base\IDecorator
{
        public function isCheckoutLayout()
        {
                return true;
        }
}

The file is saved as: XLite/Module/Guru/GoUnmanned/Controller/Customer/ACustomer.php

I hope it helps.

Phil Richman 05-06-2015 07:49 AM

Re: Navbar on Checkout page
 
Thank you mike


All times are GMT -8. The time now is 12:13 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.