Menu Close
    Searching for an experienced Prestashop Development Company ?

    Prestashop Combination Activate / Deactivate

    Prestashop Combination Activate / Deactivate : Prestashop has given its users a very convenient and handy functionality to add Combinations to its products. In Prestashop, Combinations can be generated in two simple ways : Manual and Automatic. But to add little additional functionality to this we have built this Prestashop Combination Activate/Deactivate module with the help of which admin can change the status of the existing combinations.

    Check the overview of the plugin in the video mentioned-below –

    Features

    • Admin can activate / deactivate the status of existing product combinations
    • Helps Admin to manage the product combinations in a better and judicious way
    • Buyer can view the only those product combinations whose status is active

    Installation

    • Go to back office ->module
    • Upload the module zip file
    • Search “Combination Activate / Deactivate” in module search box then go to module and click on install.
    Click to upload a module
    Drop or select module file
    The module has been successfully installed

    This is how the module will be installed successfully

    Note

    1. For Module version 4.2.0 and above versions compatible with Prestashop version V1.7.3.1 and above

    In file: /src/PrestaShopBundle/Resources/views/Admin/Product/ProductPage/Forms/form_combination.html.twig

    Add this hook

    {{ renderhook('displayWkCombinationStatus', { 'id_product_attribute':form.vars.value.id_product_attribute }) }}

    after quantity section close ‘{% endif %}’ and before ‘<td class=”attribute-actions”>’
    in prestashop core file – form_combination.html.twig

    2.  For Module version 4.1.1 and below versions compatible with Prestashop version V1.7.3.0 and below

    (A.) Add hook in return array and after form->createview()

    In file: /src/PrestaShopBundle/Controller/Admin/CombinationController.php

    'displayWkCombinationStatus' => \Hook::exec('displayWkCombinationStatus', array( 'id_product_attribute' => $combinationId, 'edit_product_link' => $this->generateUrl('admin_product_form', array('id' => (new \Product((new \Combination($combinationId))->id_product))->id)) ) ),

    in generateCombinationFormAction() of CombinationController.php

    (B.) In File: /src/PrestaShopBundle/Resources/views/Admin/Product/Include/form_combination.html.twig

    Add this hook

    {{ displayWkCombinationStatus|raw }}

    after attribute-quantity section and before attribute-actions class in form_combination.html.twig file

    Workflow

    Once the module is installed, A new column for Status will be added to the Product Combination list. The default status of the existing combinations will be “Active”

    Go to Catalog -> Edit Product -> Combinations to view the existing combinations of a particular product

    Option to activate/deactivate is enabled

    Admin can activate/deactivate the status for the existing combinations

    Combination is disabled

    Frontend View (Only active combinations will be displayed on product page)

    Disabled combination hidden from product page

    REMEMBER : It is mandatory for atleast one combination to be active at any particular time. If admin tries to deactivate ALL combinations of the product, an error message will be displayed as shown in the screenshot below

    Message on deactivating all combination of product

    Suppose the default combination is deactivate. And admin tries to deactivate all the other combinations as well. In this case, the default combination will become active automatically.

    This is how admin will get additional functionality to activate/deactivate its product combinations

    Support

    For any kind of technical assistance, just raise a ticket at: http://webkul.uvdesk.com/ and for any doubt contact us at [email protected]

    Current Product Version - 4.2.1

    Supported Framework Version - 1.7.x.x

    Blog Version - 1.7.x.x
    • Version 1.7.x.x
    • Version 1.6.x.x
    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top

    Table of Content

    Hide Index