Read More
Read More
Menu Close

    PrestaShop Combination Activate / Deactivate {User Guide}

    PrestaShop Combination Activate / Deactivate: PrestaShop has given its users a very convenient and handy functionality to add Combinations to its products. In PrestaShop, Combinations generate 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 –

    LNN73xYP4nQ

    Features of PrestaShop Combination Activate / Deactivate

    • Admin can deactivate combinations he does not want to show and activate them later when required.
    • Helps Admin to manage the product combinations in a better and judicious way.
    • Buyers can view only those product combinations whose status is active and not the ones which have been deactivated by admin.
    • Admin can easily reactivate the combinations by clicking on the “activate” icon again.
    • The module is multi-shop compatible.

    An Important Note

    • This module is also compatible with the PrestaShop Advanced Multi-Vendor Marketplace module.
    • Also, The module will be multi-shop compatible with PrestaShop Advanced Multi-Vendor Marketplace version 5.4.0/3.4.0 and above.

    Installation

    • Firstly, go to the module manager in back office and click on ‘upload a module’.
    • After that, drag and drop the module file or select the file from the system.
    • In this way, the module installation will be successful.
    Click to upload a module
    Drop or select module file
    1-10

    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

    Searching for an experienced
    Prestashop Company ?
    Read More

    Add this hook

    <meta http-equiv="content-type" content="text/html; charset=utf-8"><code>{{ renderhook('displayWkCombinationStatus', { 'id_product_attribute':form.vars.value.id_product_attribute }) }}</code>

    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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"><code>'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)) ) ),</code>

    in generateCombinationFormAction() of CombinationController.php

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

    Add this hook

    <meta http-equiv="content-type" content="text/html; charset=utf-8"><code>{{ displayWkCombinationStatus|raw }}</code>

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

    Workflow

    After the successful installation of the module, a new column for status will be added to the Product Combination list.

    So, 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

    Also, an admin can activate/deactivate the status for the existing combinations.

    Combination is disabled

    Frontend View

    Therefore, only active combinations will be displayed on the product page.

    Disabled combination hidden from product page

    REMEMBER: It is mandatory for at least one combination to be active at any particular time.

    If the admin tries to deactivate ALL combinations of the product, an error message will display as shown in the screenshot below.

    1-11

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

    So, this was all about the PrestaShop Combination Activate/Deactivate Module. I hope this document will help you in checking the functionality of the module in a better way.

    Also, do let us know about your views in the comments.

    Support

    For any kind of technical assistance or query, please raise a ticket at http://webkul.uvdesk.com or send us a mail at [email protected]

    Also, please explore our PrestaShop development services & vast range of featureful PrestaShop Addons.

    Current Product Version - 5.0.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