<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, ...
<?php
//Get the view of configurable product with option by product id
$_helper = $this->helper('catalog/output');
$productId = 1112;
$_product = Mage::getModel('catalog/product')->load($productId); //
$_coreHelper = $this->helper('core');
$regularprice = $_coreHelper->currency(number_format($_product->getPrice(),2),true,false);
$specialprice = $_coreHelper->currency(number_format($_product->getSpecialPrice(),2),true,false);
$test=$_product->getSpecialPrice();
?>
<div class="quickViewSec" id="sectionOne">
<form action="<?php echo Mage::helper('checkout/cart')->getAddUrl($_product); ?>" method="post" id="product_addtocart_form" >
<?php echo $this->getBlockHtml('formkey') ?>
<div class="no-display">
<input type="hidden" name="product" value="<?php echo $_product->getId() ?>" />
<input id="related-products-field" type="hidden" value="" name="related_product">
</div>
<a href="javascript:void(0)" class="close">CLOSE</a><div class="clearfix"></div>
<div class="quickViewSecLeft"><img src="<?php echo Mage::helper('catalog/image')->init($_product, 'image')->resize(350,350); ?>"></div>
<div class="quickViewSecRight">
<p><?php echo $_product->getName(); ?></p>
<p><div class="price-box">
<div class="special-price">
<div class="price"><?php echo $regularprice; ?></div>
</div>
</div></p>
<p><?php echo nl2br($_product->getShortDescription()) ?> </p>
<?php
if ($_product->getData('type_id') == "configurable")
{
$config = $_product->getTypeInstance(true);
foreach($config->getConfigurableAttributesAsArray($_product) as $attributes)
{
?>
<div id="product-options-wrapper" class="product-options">
<ul>
<li><span class="optionsLabel"> <label class="required"><em>*</em>Size:</span>
<ul class="optionsGroupul last">
<div>
<?php foreach($attributes["values"] as $values) { ?>
<label onclick="fun1('<?php echo $values["value_index"]; ?>')"><?php echo $values["label"]; ?></label>
<?php } ?>
</div>
</ul>
<div style="clear:both;"><!-- product clear --></div>
</li>
</ul>
</div>
<div class="input-box" style="display:none;">
<label class="required"><em>*</em><?php echo $attributes["label"]; ?></label>
<select class="required-entry testtpp super-attribute-select" name="super_attribute[<?php echo $attributes['attribute_id'] ?>]" id="attribute<?php echo $attributes['attribute_id'] ?>">
<option value="">-- Please Select --</option>
<?php
foreach($attributes["values"] as $values)
{
//print_r($values);
$testcc= $values["value_index"];
echo "<option value='$testcc' price='0'>".$testcc."</option>";
}
?>
</select>
</div>
<?php
}
}?>
<input id="qty" class="input-text qty" type="hidden" title="Qty" value="1" maxlength="12" name="qty" pattern="\d*">
<script>
function fun1(theText){
//alert(theText)
jQuery(".testtpp option:contains(" + theText + ")").attr('selected', 'selected');
}
</script>
<p>
<div class="add-to-cart-buttons">
<button onclick="productAddToCartForm.submit(this)" class="button btn-cart" title="Add to Cart" type="button"><span><span>Add to Cart</span></span></button>
</div>
</p>
</div>
</form>
<script type="text/javascript">
//<![CDATA[
var productAddToCartForm = new VarienForm('product_addtocart_form');
productAddToCartForm.submit = function(button, url) {
if (this.validator.validate()) {
var form = this.form;
var oldUrl = form.action;
if (url) {
form.action = url;
}
var e = null;
try {
this.form.submit();
} catch (e) {
}
this.form.action = oldUrl;
if (e) {
throw e;
}
if (button && button != 'undefined') {
button.disabled = true;
}
}
}.bind(productAddToCartForm);
productAddToCartForm.submitLight = function(button, url){
if(this.validator) {
var nv = Validation.methods;
delete Validation.methods['required-entry'];
delete Validation.methods['validate-one-required'];
delete Validation.methods['validate-one-required-by-name'];
// Remove custom datetime validators
for (var methodName in Validation.methods) {
if (methodName.match(/^validate-datetime-.*/i)) {
delete Validation.methods[methodName];
}
}
if (this.validator.validate()) {
if (url) {
this.form.action = url;
}
this.form.submit();
}
Object.extend(Validation.methods, nv);
}
}.bind(productAddToCartForm);
//]]>
</script>
</div>
Comments
Post a Comment