Package Gadgets

MVC Enhancement

Implementing Packages

The Package Gadgets utilise the functionality of The Region Gadget and Item Details and Cart Gadgets. So you should start off by creating them the same way. There are a few differences in the parameters that you will need to apply to these gadgets in order for them to pull through packages product correctly.

To set The Region Gadget to display Packages, you will need to:

Use the Disabled Types parameter to exclude all other product types except for packages.
eg. disabledTypes: ["accom","tours","carhire","events"];

Set the Packages Only Mode to true.
eg. packagesOnlyMode: true;

Set Show All Packages to true to ensure that your packages products display regardless of whether they have availability or not.
eg. showAllPackages: true;

Set the Item Detail Page URL so the user will land on the product ID that they've clicked on. This will be determined by the pathname that the Region Gadget exists on eg. /packages
eg. itemDetailPageURL: "/packages?pid={id}"; 

<script type="text/javascript">
    $w(function () {
        BE.gadget.region(".bookitRegionWidget",{
            vcID:239,
showLegend:false,
disabledTypes:["accom","tours","carhire","events"],
packagesOnlyMode:true,
showAllPackages:true,
showRefineTools:false,
itemDetailPageURL:"/packages?pid={id}",
        });
    });
</script>

 

To set the Item Details and Cart Gadget to display Packages, you will need to:

Ensure that the product type is set to packages.
eg. type: "packages";

Set the Product ID to the ID indicated in the client's BookIt console.
eg. productID: "310";

Set Show All Packages to true to ensure that your package products display regardless of whether they have availability or not.
eg. showAllPackages: true; 

<script type="text/javascript">
    $w(function () { 
BE.gadget.details("#itemGadget",{
            vcID:239,
type:"packages",
productID:"310",
showAllPackages:true,
        });
    });
</script>