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)
-   -   disable drag and drop for some products (https://forum.x-cart.com/showthread.php?t=70006)

juancho 09-16-2014 08:40 PM

disable drag and drop for some products
 
Hi

Is there any way to disable "drag and drop me to the cart" for just some products? It seems to me that only the products that don't have options to configure by the customer should be turned on for drag and drop.

In case this is not possible, how can I disable drag and drop for all products?

Thanks

qualiteam 09-18-2014 11:18 PM

Re: disable drag and drop for some products
 
There is a setting that does what you are looking for - the "Force customer to choose product options before adding a product to cart" checkbox on the "Store setup" -> "Cart and Checkout" back-end page.

juancho 09-20-2014 08:34 AM

Re: disable drag and drop for some products
 
thanks, that works pretty well.

Thanks again
Juan

totaltec 09-20-2014 09:49 AM

Re: disable drag and drop for some products
 
Juan,
If you want to prevent all products from being draggable, decorate the class XLite\Controller\AController

This method:
Code:

    /**
    * Currently the drag and drop cart feature is disabled for the mobile devices
    *
    * @return boolean
    */
    protected function getDragDropCartFlag()
    {
        return !\XLite\Core\Request::isMobileDevice();
    }


Just change it to return false.


All times are GMT -8. The time now is 04:04 AM.

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