Hello All This is a solution for Load more posts by wordpress ajax.
First of all suppose you have section like this.
<section class="hightech-news-content" >
<div class="container">
<?php
$page_number = (get_query_var('paged')) ? get_query_var('paged') : 1;
$page_link = get_pagenum_link(9999999999);
$args = array('post_type' => 'post','posts_per_page' => 3,'paged'=>$page_number);
$the_query = new WP_Query( $args );
$max_page = $the_query->max_num_pages;
?>
<div class="row news-list-row">
<?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div class="col-lg-4 col-md-4 col-sm-6 hightech-news-list">
<div class="row hightech-news-list-row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-4 hightech-news-list-img">
<?php if(has_post_thumbnail()){ ?>
<img class="img-responsive" src="<?php echo get_the_post_thumbnail_url();?>">
<?php }else{ ?>
<img class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/images/Img-1.png">
<?php } ?>
<img class="hi_img" src="<?php echo get_template_directory_uri(); ?>/images/Hi.png">
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-8 hightech-news-list-content">
<h3><?php the_title(); ?></h3>
<p><?php echo substr(strip_tags($post->post_content), 0, 80)."...";?></p>
<br>
<h4>> Lee verder</h4>
</div>
</div>
</div>
<?php endwhile; ?>
<?php endif ;?>
<div class="clear"></div>
</div>
<div class="text-center loading-img">
<img id="loading-img" src="<?php echo get_template_directory_uri(); ?>/images/loading.gif" >
</div>
<div class="event-more">
<a href="javascript:void(0)" id="load-more" onclick="loadMoreFun();" data-pagenumber="<?php echo $page_number; ?>" data-maxpage="<?php echo $max_page; ?>" data-pagelink="<?php echo $page_link; ?>">
<h4><img src="<?php echo get_template_directory_uri(); ?>/images/next.png" >Bekijk de agenda</h4>
</a>
</div>
</div>
</section>
Now for loadMoreFun() we can add a script like this.
<script type="text/javascript">
function loadMoreFun() {
var next_page = jQuery('#load-more').data("pagenumber");
var max_page = jQuery('#load-more').data("maxpage");
var next_page_url = jQuery('#load-more').data("pagelink");
var $load_more_btn = jQuery(this);
var request_data = jQuery(this).attr('pagenumber');
next_page++;
jQuery('#load-more').data('pagenumber',next_page);
var next_link = next_page_url.replace(/\d+(\/)?$/, next_page + '$1');
if(next_page <= max_page) {
var post_type = 'post';
$.ajax({
type : 'POST',
url : next_link,
cache: false,
beforeSend: function(){
jQuery('.loading-img').show();
},
complete: function(){
jQuery('.loading-img').hide();
},
success: function(response) {
if (jQuery(response).find('.hightech-news-list')){
var newElems = jQuery(response).find('.news-list-row').html();
jQuery('.news-list-row').append(newElems);
if(next_page == max_page){
jQuery('#load-more').text('No More News Available');
}
} else{
}
}
});
}
}
</script>
Hope it will be helpful for everyone.Please let me know it another help required.
I have a url like this
localhost/codeIgniter/Depan?lang=id
and I want to make it like this
localhost/codeIgniter/id/Depan
where localhost/codeIgniter is the base_url, /id is parameter for language, and /Depan is the controller name. But since I change the url as the second one. The base_url is changed to localhost/codeIgniter/id. So everytime I pass images location like assets/image/pic1.jpg from javascript. The link in html become localhost/codeIgniter/id/assets/image/pic1.jpg. And the file that actually stored in codeIgniter/assets/images folder is can't accessed. Ive already set the
$config['base_url'] = 'localhost/codeIgniter'
I wish I could use the second url without changing the base url
HTML
<div class="picture container">
<img id="slide" src="">
<div class="desc">
<div id="text">
<p></p>
</div>
<div id="text">
</div>
</div>
<div onclick="prev()" class="prev">
<img src="<?php echo base_url();?>assets/button/prev.png">
</div>
<div onclick="next()" class="next">
<img src="<?php echo base_url();?>assets/button/next.png">
</div>
<div class="pics">
</div>
<script> var sldrpic = <?php echo json_encode($sldrpic); ?>;</script>
<script src="<?php echo base_url();?>javascript/sldr_home.js"></script>
</div>
Javascript
function firstslide() {
if (!document.images)
return
document.getElementById('slide').src = slideimages[step].src;
document.getElementById('slide').alt = sldrpic[step].nama;
document.getElementById('text').childNodes[1].innerHTML = sldrpic[step].nama;
}
with the javascript I want to pass the slideimages[] array that contain folder path assets/image/pic.jpg to the
<img id="slide" src="">
I have put base url variable in html as shown below.
<div class="picture container">
<img id="slide" src="">
<div class="desc">
<div id="text">
<p></p>
</div>
<div id="text">
</div>
</div>
<div onclick="prev()" class="prev">
<img src="<?php echo base_url();?>assets/button/prev.png">
</div>
<div onclick="next()" class="next">
<img src="<?php echo base_url();?>assets/button/next.png">
</div>
<div class="pics">
</div>
<script> var sldrpic = <?php echo json_encode($sldrpic); ?>;</script>
// echo base url from php
<script> var base_url ="<?php echo base_url();?>"; </script>
<script src="<?php echo base_url();?>javascript/sldr_home.js"></script>
</div>
javascript
function firstslide() {
if (!document.images)
return
// note: base_url is variable. not function.
document.getElementById('slide').src = base_url + slideimages[step].src;
document.getElementById('slide').alt = sldrpic[step].nama;
document.getElementById('text').childNodes[1].innerHTML = sldrpic[step].nama;
}
http://ajobis.brainiacstech.com/404_override error when i pass url
when i click on apply button to send action url this message shown is 404 page not found i think it is because of use of () brakets with test work, other url which has no any special charachter is being passed successfully, my code is as under
<div id="content-wrapper" class="container">
<div class="row">
<div class="col-lg-9">
<div>
<div class="content-wrapper">
<!-- <div class="content-header">
<script>
function goBack() {
window.history.back()
}
</script>
<div class="title"><h1><a onclick="goBack()"><img src="<?php echo base_url("resources/images/back-icon.jpg"); ?>" alt="">Back to Results</a></h1></div>
</div>-->
<div class="content">
<div id="search-result-wrapper">
<div class="title" style="color: #005580;"><h1><?php echo $job->job_title; ?></h1></div>
<div>
<p><?php echo $job->job_description; ?></p>
</div>
<?php if (!empty($job->question)) { ?>
<div class="title text-blue"><h2>Application Questions</h2></div>
<div class="question-awnser">
<ul>
<?php $counter = 0; ?>
<?php foreach ($job->question as $question) { ?>
<li><?php echo $question->question;
$counter++; ?>
<span class="answers">
<input type="radio" name="answers" id="yes" value="yes">
<label id="answer_<?php echo $counter; ?>" for="yes">Yes</label>
/
<input type="radio" name="answers" id="no" value="No">
<label for="no">No</label>
</span>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<div class="section-row">
<div class="pull-right">
<div class="pull-left">
<img src="<?php echo base_url("resources/images/apply-icon.jpg"); ?>"> Apply
</div>
<div class="pull-left" id="<?php echo $job->id; ?>">
<button onclick="save_job('<?php echo $job->id; ?>')" class="btn btn-blue"><span class="glyphicon glyphicon-save"></span> Save</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php $this->load->view('front/common/job_detail_widget'); ?>
</div>
<div class="row">
<div class="col-lg-11">
<div class="title"><h3 style="color: #0a0;">Suggested Jobs</h3></div>
</div>
</div>
<div class="suggestion-jobs"><div class="row">
<!--suggestedJobs-->
<?php if (!empty($suggestedJobs)) { ?>
<?php foreach ($suggestedJobs as $suggestedJob) { ?>
<div class="col-lg-3 suggestions">
<input type="text" id="jobid" value="<?php echo $suggestedJob->job_url; ?>" style="display: none;">
<input type="text" id="jobid" value="<?php echo $suggestedJob->id; ?>" style="display: none;">
<div class="suggestions-info"><h4><?php echo $suggestedJob->job_title; ?></h4></div>
<div class="suggestions-info"><span>Salary: </span><?php echo $suggestedJob->min_salary; ?> - to - <?php echo $suggestedJob->max_salary; ?></div>
<div class="suggestions-info"><span>Location: </span><?php echo $suggestedJob->location; ?></div>
<div class="suggestions-info"><span>Posted on: </span><?php echo $suggestedJob->start_date; ?></div>
</div>
<?php } ?>
<?php } else { ?>
No Job Found
<?php } ?>
</div>
</div>
</div><!--
<!--</div>-->
<script src="<?php echo base_url("resources/js/icheck.js"); ?>"></script>
<script type="text/javascript">
function save_job(id) {
$.ajax({
dataType: 'json',
type: 'POST',
url: base_url + 'employee/add-to-favorite',
data: {
jobId: id
},
success: function(RESP) {
if (RESP.status == 200) {
$('#' + id).html("<button class='btn btn-green' disabled='disabled'><span class='glyphicon glyphicon-save'></span> Saved</button>");
displayUIMessage(RESP.message);
}
}
});
}
function check_killer_answers() {
var count = '<?php echo $counter; ?>';
var error = 0;
for (var i = 1; i <= count; i++) {
if ($('#answer_' + i).hasClass('active')) {
} else {
error++;
}
}
if (error == 0) {
window.location.href = '<?php echo base_url('employee/confirm-apply/' . #$job->job_url); ?>';
} else {
alert('Please answer all questions to apply.');
}
}
function report(id) {
$.ajax({
dataType: 'json',
type: 'POST',
url: base_url + 'employee/report-to-admin',
data: {
jobId: id
},
success: function(RESP) {
if (RESP.status == 200) {
displayUIMessage(RESP.message);
}
}
});
}
</script>
I have followed different solution here in stacj overflow with regards to coinslider not moving. So here's mine. It seems that I dont know how to make it move.
here's my code.
Thanks.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="LeavemanagementFinal.Index" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CrossXTrain - Home</title>
<link href="css/master.css" rel="stylesheet" />
<link href="css/coin-slider-styles.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/coin-slider.min.js"></script>
<%--<style type="text/css">
.frame
{
font:12px arial;
width:200px;
height:200px;
border:none;
overflow:hidden;
border:1px solid black;
padding:5;
}
</style>
<script language="javascript">
i = 0
var speed = 1
function scroll() {
i = i + speed
var div = document.getElementById("news")
div.scrollTop = i
if (i > div.scrollHeight - 160) { i = 0 }
t1 = setTimeout("scroll()", 10)
}
</script>--%>
</head>
<body onload="scroll()">
<div class="divpage">
<img src="images/header2.png">
<div class="divmenu">
<a class="FontStaticMenuItemStyle" href="index.aspx"> Home</a>
<a class="FontStaticMenuItemStyle" href="leavemanagementlogin.aspx"> Leave Management</a>
<a class="FontStaticMenuItemStyle" href="news.aspx"> News</a>
<a class="FontStaticMenuItemStyle" href=""> Articles</a>
<a class="FontStaticMenuItemStyle" href="aboutus.aspx"> About Us</a>
<a class="FontStaticMenuItemStyle" href="contactus.aspx"> Contact Us</a>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#news').news();
});
</script>
<div class="mainbanner" id="news" >
<img src="images/BUBLES.jpg" />
<img src="images/CrossXtrain.jpg"/>
<img src="images/CrossXtrain3.jpg"/>
<img src="images/CrossXtrain4.jpg"/>
<img src="images/CrossXtrain5.jpg"/>
<img src="images/CrossXtrain6.jpg"/>
<img src="images/CrossXtrain7.jpg"/>
<img src="images/CrossXtrain8.jpg"/>
<img src="images/CrossXtrain9.jpg"/>
</div>
<div class="clear"> </div>
<div class="mainadfooter">
<input type="image" class="secondinput" src="images/BUBLES.jpg"/>
<input type="image" class="thirdinput" src="images/HCS.jpg" onclick="javascript: window.location.href = 'http://www.healthcaresynergy.com/'"/>
<input type="image" class="thirdinput" src="images/fusionplus.png" onclick="javascript: window.location.href = 'http://sync.fusionpl.us//'"/>
<input type="image" class="thirdinput" src="images/DoubleRule_Logo#2x.png" onclick="javascript: window.location.href = 'http://www.doublerule.com/'"/>
</div>
<div class="clear"> </div>
</div>
<div class="clear"> </div>
<div class="footer"><p>Copyright © 2014. CrossXTrain Company Inc. All rights reserved. | Leave Management System - ISD (Php)</p></div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function () {
$('#news').news();
});
</script>
Thank you so much all.
Your script needs to be inside the html tags.
I have a mystery question: in my magento shop there is a specific page (part of /customer/account but from an extension) where inline translation is not working at all.
To be more specific: If inline translation is enabled for the entire shop, then it does usually work fine. Menus, Sub-Menus, Titles, everything can be translated.
But as soon I navigate to said page, I can't translate anything on the whole site. Not even the Menus and Sub-Menus, that do not even belong to the requested page.
As soon as I navigate to another page, translation works fine again.
I'm really lost and I hope that you guys can point me to places where this might be configurated?
for full disclousure: the extension mentioned is Webkul_Marketplacepartner and the page mentioned is marketplacepartner/partnerproducts/mydashboard/
the source code of the phtml looks like this:
<?php
$customerid=Mage::getSingleton('customer/session')->getCustomerId();
$isPartner= Mage::getModel('marketplaceprofile/marketplaceprofile')->isPartner($customerid);
$partner=Mage::getModel('marketplaceprofile/marketplaceprofile')->getPartnerProfileById($customerid);
if($isPartner==1){?>
<link href="<?php echo $this->getSkinUrl('Customerpartner/css/global.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->getSkinUrl('Customerpartner/css/jquery.jqplot.min.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->getSkinUrl('Customerpartner/css/webkul-image-slider.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->getSkinUrl('Customerpartner/css/shCoreDefault.min.css'); ?>" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->getSkinUrl('Customerpartner/css/shThemejqPlot.min.css'); ?>" rel="stylesheet" type="text/css" />
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jquery.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jquery.jqplot.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/shCore.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/shBrushJScript.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/shBrushXml.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.logAxisRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.canvasTextRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.canvasAxisLabelRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.canvasAxisTickRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.dateAxisRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.categoryAxisRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.barRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.canvasTextRenderer.min.js'); ?>" type="text/javascript"></script>
<script src="<?php echo $this->getSkinUrl('Customerpartner/js/jqplot.canvasAxisLabelRenderer.min.js'); ?>" type="text/javascript"></script>
<style>
div.example-plot { height: 400px;width: 650px;}
</style>
<?php
$mysqlprefix = Mage::getConfig()->getTablePrefix();
$write = Mage::getSingleton('core/resource')->getConnection('core_write');
$k="";
$i=0;
$Optioncreated=0;
// prefix checking and execute code
$j=0;$op=0;
$weeklytotal=0;
$todaytotal=0.0;
$yeartotal=0.0;
$sk=array();
$allskulist=array();
$allmageprolist=array();
$$allorderids=array();
$s1=0;
$s2=0;
$s5=0;
$today=date("Y-m-d");
$sqlQuery = "select * from ".$mysqlprefix."marketplacepartner_entity_saleslist where mageproownerid =".$customerid." order by autoid desc";
$querydata=$write->query($sqlQuery);
$grandTotal = array();
$dataArr= array();
$currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();
$baseCurrencyCode = Mage::app()->getBaseCurrencyCode();
foreach($write->fetchAll($sqlQuery) as $row){
$l=explode('-',$row['cleared_at']);
$day=substr($row['cleared_at'],0,10);
$row['actualparterprocost'] = round(Mage::helper('directory')->currencyConvert($row['actualparterprocost'], $baseCurrencyCode, $currentCurrencyCode),2);
$order = Mage::getModel('sales/order')->loadByIncrementId($row['magerealorderid']);
if($order->getStatus()!='pending'){
if($day==$today){
$todaytotal+=$row['actualparterprocost'];
}
$week_number = date('W');
$year = date('Y');
for($days=1; $days<=7; $days++)
{
$m=date('Y-m-d', strtotime($year."W".$week_number.$days));
if($day==trim($m))
{
$row['magerealorderid'].$weeklytotal=$row['actualparterprocost']+$weeklytotal;
}
}
$grandTotal[$l[1]]=$row['actualparterprocost']+$grandTotal[$l[1]];
$dataArr[]= $row;
}
}
?>
<div class="prdouctbackground">
<div class="maindash">
<h4 class="textcolor"><span><?php echo $this->__('My Vendor Dashboard') ?></span></h4>
<div class="salesmonth">
<div class="todaydash"><?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); if($todaytotal<=0) {echo 0;} else {echo $todaytotal;}?> <span class="textcolordash"> <?php echo $this->__('Today') ?></span>
</div>
<div class="weekdash"><?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); if($weeklytotal<=0){ echo 0;} else {echo $weeklytotal;}?> <span class="textcolordash"> <?php echo $this->__('Week') ?></span>
</div>
<div class="monthdash"><?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
$d=date('m');
echo $grandTotal[$d];
?>
<span class="textcolordash"><?php echo $this->__('Month') ?></span>
</div>
</div>
<div class="salesemail"></div>
<div class="orderdproduct">
<table class="tablepostioneditdash">
<thead><tr>
<th class="headingbg"><span><?php echo $this->__('Latest Order') ; ?> </span></th>
</tr></thead>
<tbody id="tbodyingeditdash">
<?php
$m=0;
foreach($dataArr as $key=>$val){
$order = Mage::getModel('sales/order')->loadByIncrementId($val['magerealorderid']);
if($order->getStatus()!= 'pending'){ ?>
<tr>
<th class="tdpadfirsteditheadingdash">
<label for="name" class="rightgapeditheadedit">
<?php if($order->getStatus()=='pending') {?>
<div class="status" style="background-color:orange"><?php echo $this->__(strtoupper($order->getStatus())); ?> </div>
<?php }?>
<?php if($order->getStatus()=='canceled') {?>
<div class="status" style="background-color:red"><?php echo $this->__(strtoupper($order->getStatus())); ?> </div>
<?php }?>
<?php if($order->getStatus()=='complete') {?>
<div class="status" style="background-color:green"><?php echo $this->__(strtoupper($order->getStatus())); ?> </div>
<?php }?>
<?php if($order->getStatus()=='delivered') {?>
<div class="status" style="background-color:green"><?php echo $this->__(strtoupper($order->getStatus())); ?> </div>
<?php }?>
<?php if($order->getStatus()=='processing') {?>
<div class="status" style="background-color:blue"><?php echo $this->__(strtoupper($order->getStatus())); ?> </div>
<?php }?>
<p style="margin: 0 0 10px 6px;"><?php echo "<br>".$val['cleared_at']; ?></p> </label>
</th>
<th class="tdpadfirsteditheadingdash">
<label for="name" class="rightgapeditheadedit">
<div class="textcolordashdiv"><?php echo $this->__('Order'); ?> #<?php echo $val['magerealorderid']; ?></div>
<?php $shipping_address = $order->getShippingAddress();
if ( $shipping_address != null) {
?>
<div class="dd">
<?php echo "By: " . $shipping_address->getCustomerId(); ?>
<br>
<?php
$orddataing="SELECT * FROM ".$mysqlprefix."sales_flat_order_item where order_id='".$val['mageorderid']."' ORDER BY order_id DESC";
//$sqlProductQuery = "select * from ".$mysqlprefix."marketplacepartner_entity_saleslist where mageproownerid =".$customerid." AND magerealorderid='".$val['magerealorderid']."'";
$ordconnectioning = Mage::getSingleton('core/resource')->getConnection('core_read');
//$order = Mage::getModel('sales/order')->load($orderidenitity[$x]);
//$priceTwo = Mage::helper('directory')->currencyConvert($aa, $baseCurrencyCode, $currentCurrencyCode);
$shipammount=(int)$order->getShippingAmount();
$count=0;
$product;
foreach($ordconnectioning->fetchAll($orddataing) as $ordername){
$product=Mage::getModel('catalog/product')->load($ordername['product_id']);
if($ordername['product_id'] == $val['mageproid']){
if($count==0){
echo "<p style='color:silver;float:left;'>" . (int)$ordername['qty_ordered']." x ".$ordername['name']." (" . $product->getSku() .")</p>"; $proid[$m]=$ordername['product_id'];
}else{
echo "<p style='color:silver;float:left;'>, ". (int)$ordername['qty_ordered']." x ".$ordername['name']." (" . $product->getSku() .")</p>"; $proid[$m]=$ordername['product_id'];
}
$count++;
$m++;
}
}?>
</div>
<?php } ?>
</label>
</th>
<th class="tdpadfirsteditheadingdash">
<?php
/* (2014-01-07 AM) disabled till further notice */
?>
<label for="name" class="rightgapeditheadprice"><?php echo $this->__('Net margin') . ': '; echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); echo " ".$val['actualparterprocost']?> </label>
<?php
/**/
?>
</th>
<th>
<?php if($order->getStatus()=='processing') {?> <label for="name" class="rightgapeditheadedit">
<div class="status" style="background-color:blue"><?php echo $this->__('Ready To Shipped'); ?></div>
<p style='color:silver;text-align:center;'><?php echo $this->__('Click To Ship Item'); ?></p>
<p style='color:silver;text-align:center;'><?php
if ($order->hasInvoices()) {
$invoice = $order->prepareInvoice();
$invoice->register();
//$invoice->setEmailSent(true);
$invoice->save();
//$invoice->sendEmail();
$invoiceID = $invoice->getId(); ?>
<?php
/*
(2014-01-07 AM) disable till further notice
<?php echo $this->__('Print Invoice'); ?>
*/
?>
<?php } ?></p>
</label>
<?php }?>
<?php $updatedDate = $order->getUpdatedAt();
$terminationDays = $partner['terminationperiod'];
$TotalTime = strtotime($updatedDate) + $terminationDays * 86400;
$currentTime = time();
?>
<?php if($order->getStatus()=='delivered') {?>
<label for="name" class="rightgapeditheadedit">
<div class="status" style="background-color:green"><?php echo $this->__('Item Delivered'); ?></div></label>
<p style='color:silver;text-align:center;'><?php
if ($order->hasInvoices()) {
$invoice = $order->prepareInvoice();
$invoice->register();
//$invoice->setEmailSent(true);
$invoice->save();
//$invoice->sendEmail();
$invoiceID = $invoice->getId(); ?>
<?php
/*
(2014-01-07 AM) disable till further notice
Print Invoice
*/
?>
<?php
if($currentTime <= $TotalTime){
?>
<p style='color:silver;text-align:center;'><?php echo $this->__('Click After Item Received'); ?></p>
<?php } ?>
</p>
<?php } ?>
<?php } ?>
<?php if($order->getStatus()=='complete') {?>
<label for="name" class="rightgapeditheadedit">
<div class="status" style="background-color:green"><?php echo $this->__('Item Delivered'); ?></div></label>
<p style='color:silver;text-align:center;'><?php
if ($order->hasInvoices()) {
$invoice = $order->prepareInvoice();
$invoice->register();
//$invoice->setEmailSent(true);
$invoice->save();
//$invoice->sendEmail();
$invoiceID = $invoice->getId();
?>
<?php
/*
(2014-01-07 AM) disable till further notice
Print Invoice
*/
?>
<?php if($currentTime <= $TotalTime){
?>
<p style='color:silver;text-align:center;'><?php echo $this->__('Click After Item Received'); ?></p>
<?php } ?>
<?php } ?></p>
<?php } ?>
</p>
<?php //} ?>
</th>
</tr>
<?php
}else { }
}
?>
</tbody>
</table>
</div>
<div class="review">
<h4 colspan="2" class="headingbg"><?php echo $this->__('Latest Comments & Reviews'); ?></h4>
<table class="reviewtable">
<?php
$c=0;$cc=0;$r=0;
// prefix checking and execute code
$productget="select entity_pk_value from ".$mysqlprefix."review ORDER BY created_at DESC";
$ownerread = Mage::getSingleton('core/resource')->getConnection('core_read');
$q5=0;
foreach($ownerread->fetchAll($productget) as $value){
$storepro[$q5]=$value['entity_pk_value'];
$q5++;
}
$listingpro = array_unique($storepro);
foreach($listingpro as $q2){
$allpro=Mage::getModel('catalog/product')->load($q2);
$owner=Mage::getSingleton('customer/session')->getCustomer()->getEntityid();
$ownerconnection = Mage::getSingleton('core/resource')->getConnection('core_read');
// prefix checking and execute code
$cusresult=$ownerconnection->query("SELECT * FROM ".$mysqlprefix."marketplacepartner_entity_data where userid='".Mage::getSingleton('customer/session')->getCustomer()->getEntityid()."' and sku='".$allpro['sku']."'");
$ownerkey=$cusresult->fetch();
if($allpro['sku']==$ownerkey['sku']){
$ownerread = Mage::getSingleton('core/resource')->getConnection('core_read');
// mysql prefix checking and execute code
$ownerreadresulting=$ownerread->query("select * from ".$mysqlprefix."review where entity_pk_value ='".$allpro['entity_id']."' ORDER BY created_at DESC");
$ownerget=$ownerreadresulting->fetch();
// prefix checking and execute code
$ownerreviewresulting=$ownerread->query("select * from ".$mysqlprefix."review_detail where review_id ='".$ownerget['review_id']."' ORDER BY review_id DESC");
$ownerreviewget=$ownerreviewresulting->fetch();
// here i code for mysql prefix checking and execute code
$ratdatasql="select rating_summary from ".$mysqlprefix."review_entity_summary where entity_pk_value='".$allpro['entity_id']."' ORDER BY primary_id DESC";
$ownerrateresult=$ownerread->query($ratdatasql);
$ownerrateresulting=$ownerrateresult->fetch();
if((gettype($ownerreviewget)=='array')&& (gettype($ownerrateresulting)=='array')){
if(($c==0)||($c==1)){?>
<tr class="ex2">
<th class="reviewtablethleft">
<?php
$detail=$ownerreviewget['title'];
$nickname=$ownerreviewget['nickname'];
$status_id=$ownerget['status_id'];
$created_at=$ownerget['created_at'];
$rating_summary=$ownerrateresulting['rating_summary'];
?>
<div class="ratingslider-box"><div class="rating" style="width:<?php echo ceil($rating_summary);?>%;"></div></div>
<?php $productcity=Mage::getModel('catalog/product')->load($allpro['entity_id']); ?>
<p class="rightgapeditheadedit" style="margin: 5px 0 10px 6px;float: left;"><?php echo $this->__('Product') ?> : </p>
<p class="textcolorproalter"><?php echo $productcity['name']; ?></p>
<p class="rightgapeditheadedit" style="margin: 0 0 10px 6px;float: left;"><?php echo $this->__('Comment By') ?>: </p>
<p class="textcolorproalter"><?php echo $nickname; ?></p>
<p class="rightgapeditheadedit" style="margin: 0 0 10px 6px;float: left;"> </p>
<p class="textcolorproalter1"><?php echo $detail; ?></p>
</th>
<th class="reviewtablethright">
<br><br>
<?php if($status_id==1){?>
<p class="statusapp"><?php echo $this->__('Approved'); ?></p>
<?php } else{ ?>
<p class="statussunapp"><?php echo $this->__('Unapproved'); ?></p>
<?php }?>
<br>
<p class="rightgapeditheadedit" style="margin:0 0 10px 37%;float: left;"><?php echo $this->__('Review On') ?> : </p>
<p class="textcolorpro"> <?php echo trim($created_at); ?></p>
<?php $c++;?>
</th>
</tr>
<?php }
}
$r++;
}
}?>
</table>
</div>
<br>
<?php
/*(2014-01-07 AM) disabled till further notice
<div class="example-plot" id="chart2"></div>
*/
?>
</div>
<div class="button-set buttonarea">
<p class="headingbackindex">
« <?php echo $this->__('Back') ?>
</p>
</div>
</div>
<?php
/*(2014-01-07 AM) disabled till further notice
<script class="code" type="text/javascript" language="javascript">
jQuery.noConflict();
jQuery(document).ready(function(){
var line2 = [['1/1/<?php echo date('Y');?>', <?php if($aa<=0){ echo 0; } else { echo $aa; }?>], ['2/1/<?php echo date('Y');?>', <?php if($bb<=0){ echo 0; } else { echo $bb; }?>], ['3/1/<?php echo date('Y');?>',<?php if($cc<=0){ echo 0; } else { echo $cc; }?>], ['4/1/<?php echo date('Y');?>',<?php if($dd<=0){ echo 0; } else { echo $dd; }?>], ['5/1/<?php echo date('Y');?>',<?php if($ee<=0){ echo 0; } else { echo $ee; }?>], ['6/1/<?php echo date('Y');?>', <?php if($ff<=0){ echo 0; } else { echo $ff; }?>], ['7/1/<?php echo date('Y');?>', <?php if($gg<=0){ echo 0; } else { echo $gg; }?>], ['8/1/<?php echo date('Y');?>', <?php if($hh<=0){ echo 0; } else { echo $hh; }?>], ['9/1/<?php echo date('Y');?>', <?php if($ii<=0){ echo 0; } else { echo $ii; }?>], ['10/1/<?php echo date('Y');?>', <?php if($jj<=0){ echo 0; } else { echo $jj; }?>], ['11/1/<?php echo date('Y');?>', <?php if($kk<=0){ echo 0; } else { echo $kk; }?>], ['12/1/<?php echo date('Y');?>', <?php if($ll<=0){ echo 0; } else { echo $ll; }?>]];
var plot2 = jQuery.jqplot('chart2', [line2], {
axes: {
xaxis: {
renderer: jQuery.jqplot.DateAxisRenderer,
label: '<?php echo $this->__("Month"); ?>',
labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
tickOptions: {angle: 30}
},
yaxis: {
label: '<?php echo $this->__("Money") ?>',
labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
}
}
});
});
</script>
*/
?>
<?php }else{
echo "<h2 style='color:#ff0000;font-weight:600'>".$this->__('FOR BECOME SELLER CONTACT TO ADMIN..')."</h2>";
}?>
please note that this code is not mine. I just have to deal with it.. -.-
The question has been answered by the support team of the modules developers. the reason for the not working inline translation was an error in a java script.
the fix looks like this:
<script class="code" type="text/javascript" language="javascript">
$wk_jq=jQuery.noConflict();
(function($wk_jq){
jQuery(document).ready(function(){
var line2 = [['1/1/<?php echo date('Y');?>', <?php if($aa<=0){ echo 0; } else { echo $aa; }?>], ['2/1/<?php echo date('Y');?>', <?php if($bb<=0){ echo 0; } else { echo $bb; }?>], ['3/1/<?php echo date('Y');?>',<?php if($cc<=0){ echo 0; } else { echo $cc; }?>], ['4/1/<?php echo date('Y');?>',<?php if($dd<=0){ echo 0; } else { echo $dd; }?>], ['5/1/<?php echo date('Y');?>',<?php if($ee<=0){ echo 0; } else { echo $ee; }?>], ['6/1/<?php echo date('Y');?>', <?php if($ff<=0){ echo 0; } else { echo $ff; }?>], ['7/1/<?php echo date('Y');?>', <?php if($gg<=0){ echo 0; } else { echo $gg; }?>], ['8/1/<?php echo date('Y');?>', <?php if($hh<=0){ echo 0; } else { echo $hh; }?>], ['9/1/<?php echo date('Y');?>', <?php if($ii<=0){ echo 0; } else { echo $ii; }?>], ['10/1/<?php echo date('Y');?>', <?php if($jj<=0){ echo 0; } else { echo $jj; }?>], ['11/1/<?php echo date('Y');?>', <?php if($kk<=0){ echo 0; } else { echo $kk; }?>], ['12/1/<?php echo date('Y');?>', <?php if($ll<=0){ echo 0; } else { echo $ll; }?>]];
var plot2 = jQuery.jqplot('chart2', [line2], {
axes: {
xaxis: {
renderer: jQuery.jqplot.DateAxisRenderer,
label: '<?php echo $this->__("Month"); ?>',
labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer,
tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer,
tickOptions: {angle: 30}
},
yaxis: {
label: '<?php echo $this->__("Money") ?>',
labelRenderer: jQuery.jqplot.CanvasAxisLabelRenderer
}
}
});
});
})($wk_jq);
</script>