<a href="https://console.cloud.google.com/apis/credentials">Get Your Api Credentials Here</a> <a href="https://calendar.google.com/calendar">Get your Calender ID</a> <?php include_once("wp-load.php"); function get_calender_events() { $params = array(); /*Get current date*/ $current_date = date('Y-m-d H:i:s'); /*Convert it to google calendar's rfc_format */ $rfc_format = date("c", strtotime($current_date)); $params[] = 'orderBy=startTime'; $params[] ='maxResults=100'; $params[] = 'timeMin='.urlencode($rfc_format); $url_param = ''; foreach($params as $param) { $url_param.= '&'.$param; } $calender_id = "calender_id"; $client_key = "client_key"; $url = "https://www.googleapis.com/calendar/v3/calendars/".$calender_id."/events?key=".$client_key."&singleEvents=true".$url_param; $list_events = wp_remote_post($url, ...
<div id="samrat">
<?php
//Releted product show in table format in magento
$related_prods = $_product->getRelatedProductIds();
if (count($related_prods) > 0) {
?>
<div class="featureproduct">
<h3 class="title"><?php echo $this->__('Related') ?></h3>
<table class="data-table sortable" id="super-product-table">
<colgroup><col><col><col> <col width="1">
<col width="1">
</colgroup><thead>
<tr>
<th colspan="2" class="sortcol"><strong>Product</strong></th>
<th class="a-center nosort"><strong>Price</strong></th>
<?php
//for price +
foreach ($related_prods as $related) {
$_rel = Mage::getModel('catalog/product')->load($related);
?>
<?php
$qtys = array();
$tprices = array();
$_rel->setData('tier_price', null);
$_tierPrices = $this->getTierPrices($_rel);
?>
<?php foreach ($_tierPrices as $key => $value): ?>
<?php
$qtys[] = $value['price_qty'];
$tprices[] = $value['formated_price'];
?>
<?php endforeach; ?>
<?php
array_unique($qtys);
array_unique($tprices);
$_SESSION['count'] = count($qtys);
?>
<?php for ($i = 0; $i < count($qtys); $i++): ?>
<?php if ($qtys[$i] < 1000) { ?>
<th class="a-center nosort"><strong>
<?php
$session = Mage::getSingleton('customer/session');
$group_id = $session->getCustomerGroupId();
//min and max values are du
$min = 10;
$max = 19;
$incr = 500;
if ($group_id >= $min && $group_id <= $max && $qtys[$i] == $incr) {
?>
<?php echo "Uw Prijs"; ?>
<?php
} else {
?>
<?php echo $qtys[$i]; ?>+
<?php
}
?>
</strong></th>
<?php } ?>
<?php
endfor;
}
//end +
?>
<th class="a-center nosort"><strong>Availability</strong></th>
<th class="a-center nosort"><strong>Add To Cart</strong></th>
</tr>
</thead>
<tbody>
<?php
foreach ($related_prods as $related) {
$_rel = Mage::getModel('catalog/product')->load($related);
//print_r($_rel);
if ($_rel->isSaleable()) {
?>
<?php
$_coreHelper = $this->helper('core');
$regularprice = $_coreHelper->currency($_rel->getPrice(),true,false);
$specialprice = $_coreHelper->currency($_rel->getSpecialPrice(),true,false);
$test = $_rel->getSpecialPrice();
?>
<tr class=" odd">
<td colspan="2" id="super-product-table-cell-1">
<a href="<?php echo $_rel->getProductUrl(); ?>"><?php echo $_rel->getName(); ?></a>
</td>
<td class="a-center" width="120">
<div class="price-box">
<?php if($test == '') { ?>
<div class="regular-price">
<div class="price"><?php echo $regularprice;?></div>
</div>
<?php } else { ?>
<div class="old-price">
<div class="price"><?php echo $regularprice;?></div>
</div>
<div class="special-price">
<div class="price"><?php echo $specialprice;?></div>
</div>
<?php } ?>
<div class="cls"></div>
</div>
</td>
<?php
// for tire price
$qtys = array();
$tprices = array();
$_rel->setData('tier_price', null);
$_tierPrices = $this->getTierPrices($_rel);
?>
<?php foreach ($_tierPrices as $key => $value): ?>
<?php
$qtys[] = $value['price_qty'];
$tprices[] = $value['formated_price'];
?>
<?php endforeach; ?>
<?php
array_unique($qtys);
array_unique($tprices);
?>
<?php for ($i = 0; $i < $_SESSION['count']; $i++): ?>
<?php if ($qtys[$i] == "") { ?>
<td class="a-center" width="120"></td>
<?php } ?>
<?php endfor; ?>
<?php for ($i = 0; $i < count($qtys); $i++): ?>
<?php if ($qtys[$i] < 1000) { ?>
<td class="a-center" width="120"><?php echo $tprices[$i]; ?></td>
<?php } ?>
<?php
endfor;
//end tire
?>
<td class="a-center" width="120">
<?php echo (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_rel)->getQty(); ?>
</td>
<td class="a-center" width="120">
<form action="<?php echo $this->getAddToCartUrl($_rel) ?>" method="post" id="product_addtocart_form_<?php echo $_rel->getId(); ?>">
<input type="text" name="qty" maxlength="12" value="<?php echo $_rel->getQty() * 1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
<button class="button btn-cart" type="button" onclick="productAddToCartForms_<?php echo $_rel->getId(); ?>.submit()" title="<?php echo $this->__('Add to Cart') ?>"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
</form>
</td>
<script type="text/javascript">
var productAddToCartForms_<?php echo $_rel->getId(); ?> = new VarienForm('product_addtocart_form_<?php echo $_rel->getId(); ?>');
productAddToCartForms_<?php echo $_rel->getId(); ?>.submit = function() {
if (this.validator.validate()) {
this.form.submit();
}
}.bind(productAddToCartForms_<?php echo $_rel->getId(); ?>);
</script>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
<?php
}
?>
</div>
Comments
Post a Comment