Beispiel #1
0
if ($hasBeenPurchased) {
    echo "<p class='noticeMessage'>";
    echo "This product has been purchased so some properties have been locked to avoid accidental editing. ";
    echo "If you want to edit these properties, <a href=\"javascript:unlockProduct()\">click here to unlock them</a>.";
    echo "</p>";
}
?>
	<input type='hidden' id='mm-id' value='<?php 
echo $p->id;
?>
' />
	<table style="width:100%" cellpadding="2">
	<tr>
		<td width="140">Name*</td>
		<td><input type='text' id='mm-name' value='<?php 
echo $product->getName();
?>
' class="long-text"/></td>
	</tr>
	
	<tr>
		<td>Status<?php 
echo MM_Utils::getInfoIcon("Inactive products cannot be purchased. Changing the status of a product has no impact on members who have already purchased the product.");
?>
</td>
		<td>
			<div id="mm-status-container">
				<input type="radio" name="status" value="active" onclick="mmjs.processForm()" <?php 
echo $product->getStatus() == "1" ? "checked" : "";
?>
 /> Active &nbsp;
Beispiel #2
0
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "product";
$rows = array();
foreach ($data as $key => $item) {
    $product = new MM_Product($item->id);
    // Actions
    $editActionUrl = 'onclick="mmjs.edit(\'mm-products-dialog\', \'' . $product->getId() . '\', 580, 600)"';
    $deleteActionUrl = 'onclick="mmjs.remove(\'' . $product->getId() . '\')"';
    $actions = MM_Utils::getEditIcon("Edit Product", '', $editActionUrl);
    if (!MM_Product::isBeingUsed($product->getId()) && !MM_Product::hasBeenPurchased($product->getId())) {
        $actions .= MM_Utils::getDeleteIcon("Delete Product", 'margin-left:5px;', $deleteActionUrl);
    } else {
        $actions .= MM_Utils::getDeleteIcon("This product is currently being used and cannot be deleted", 'margin-left:5px;', '', true);
    }
    $purchaseLinks = '<a title="Get purchase links" onclick="mmjs.showPurchaseLinks(' . $product->getId() . ',\'' . htmlentities(addslashes($product->getName()), ENT_QUOTES) . '\')" class="mm-ui-button" style="margin:0px;">' . MM_Utils::getIcon('money', '', '1.3em', '1px', '', 'margin-right:0px;') . '</a>';
    // Associated Access
    $accessGranted = "";
    $membership = $product->getAssociatedMembership();
    if ($membership->isValid()) {
        $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_MEMBERSHIP);
        $accessGranted .= " <a href='" . MM_ModuleUtils::getUrl(MM_MODULE_PRODUCT_SETTINGS, MM_MODULE_MEMBERSHIP_LEVELS) . "&autoload=" . $membership->getId() . "'>" . $membership->getName() . "</a>";
    }
    if (empty($accessGranted)) {
        $bundle = $product->getAssociatedBundle();
        if ($bundle->isValid()) {
            $accessGranted .= MM_Utils::getAccessIcon(MM_OrderItemAccess::$ACCESS_TYPE_BUNDLE);
            $accessGranted .= " <a href='" . MM_ModuleUtils::getUrl(MM_MODULE_PRODUCT_SETTINGS, MM_MODULE_BUNDLES) . "&autoload=" . $bundle->getId() . "'>" . $bundle->getName() . "</a>";
        }
    }
    if (empty($accessGranted)) {
Beispiel #3
0
 * 
 * MemberMouse(TM) (http://www.membermouse.com)
 * (c) MemberMouse, LLC. All rights reserved.
 */
$view = new MM_LimeLightProductsView();
$dataGrid = new MM_DataGrid($_REQUEST, "limelight_campaign_name", "asc", 10);
$data = $view->getViewData($dataGrid);
$dataGrid->setTotalRecords($data);
$dataGrid->recordName = "product mapping";
$rows = array();
foreach ($data as $key => $item) {
    $mmProductName = MM_NO_DATA;
    $mmProductDescription = MM_NO_DATA;
    $product = new MM_Product($item->membermouse_product_id);
    if ($product->isValid()) {
        $mmProductName = $product->getName();
        $mmProductDescription = $product->getBillingDescription() . " ";
        if ($product->hasTrial()) {
            $mmProductDescription .= MM_Utils::getIcon('clock-o', 'beige', '1.3em', '2px', 'Has Trial', 'margin-right:5px;');
        }
        if ($product->isRecurring()) {
            if ($product->doLimitPayments()) {
                $mmProductDescription .= MM_Utils::getIcon('calendar-o', 'beige', '1.3em', '2px', 'Payment Plan', 'margin-right:5px;');
            } else {
                $mmProductDescription .= MM_Utils::getIcon('refresh', 'beige', '1.3em', '2px', 'Subscription', 'margin-right:5px;');
            }
        }
        if ($product->isShippable()) {
            $mmProductDescription .= MM_Utils::getIcon('truck', 'beige', '1.3em', '2px', 'Requires Shipping', 'margin-right:5px;');
        }
        if ($product->getSku() != "") {
					<span style="font-size:11px;">
					Default Product<?php 
    echo MM_Utils::getInfoIcon("Customers can purchase any of the products above to sign up for this membership level. It's also possible for customers to sign up for the membership directly in which case they'll end up purchasing the default product. You can specify the default product below.");
    ?>
 
					</span>
					<br/>
						<select id='mm-default-product-id'  >
							<?php 
    if ($product->isValid() && $product->getId() > 0) {
        $products = $membership->getProductIds();
        $productsArr = array();
        if (is_array($products)) {
            foreach ($products as $pid) {
                $p = new MM_Product($pid);
                $productsArr[$pid] = $p->getName();
            }
            $selections = MM_HtmlUtils::generateSelectionsList($productsArr, $product->getId());
            if (empty($selections)) {
                echo "<option value=''>Select a product</option>";
            } else {
                echo $selections;
            }
        } else {
            echo "<option value=''>Select a product</option>";
        }
        ?>
									<?php 
    } else {
        echo "<option value=''>Select a product</option>";
    }
$limeLightProduct = new MM_LimeLightProduct($p->id);
$limeLightService = MM_PaymentServiceFactory::getPaymentService(MM_PaymentService::$LIMELIGHT_SERVICE_TOKEN);
?>
<div id="mm-form-container">
	<table cellspacing="10">
		<tr>
			<td width="150">MemberMouse Product</td>
			<td>
				<select name='mm_product_id' id='mm_product_id' onchange="mmjs.getMMProductDescription();">
				<?php 
$unmappedProducts = MM_LimeLightProduct::getUnmappedProducts();
// add currently selected product
if ($limeLightProduct->isValid()) {
    $product = new MM_Product($limeLightProduct->getMMProductId());
    if ($product->isValid()) {
        $unmappedProducts[$limeLightProduct->getMMProductId()] = $product->getName();
    }
}
echo MM_HtmlUtils::generateSelectionsList($unmappedProducts, $limeLightProduct->getMMProductId());
?>
				</select>
				
				<div id="mm_product_description" style="margin-top:10px;"></div>
			</td>
		</tr>
		
		<tr>
			<td colspan="2">
			<div style="width: 98%; margin-top: 8px;" class="mm-divider"></div>
			</td>
		</tr>
    ?>
		<p>MemberMouse offers two methods for creating purchase links. First, select the product you want to create
		a purchase link for and then use one of the links below to allow customers to purchase access to the 
		'<?php 
    echo $p->accessTypeName;
    ?>
' bundle.</p>
		
		<input id="mm-last-selected-product-id" type="hidden" value="0" /> 
		<select id="mm-product-selector" onchange="mmjs.productChangeHandler();">
		<option value='0'>Select a product</option>
		<?php 
    foreach ($p->productIds as $id) {
        $product = new MM_Product($id);
        if ($product->isValid()) {
            echo "<option value='{$product->getId()}'>{$product->getName()}</option>";
        }
    }
    ?>
		</select>
		
	<?php 
    foreach ($p->productIds as $id) {
        generatePurchaseSection($id);
    }
} else {
    ?>
		<p>Cannot create purchase links for free bundles.</p>
	<?php 
}
?>